openassets-ruby 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76264bfa708badea9cd4797851dbf74c8d96e869
4
- data.tar.gz: 1bf65b91f46e0e81b6a4b5b7ee580dc4b131cb3c
3
+ metadata.gz: 42f90d72e17b972a1339a04511c2f8df17a0f90d
4
+ data.tar.gz: 4b9d6b5a3133cb1602ebcf866a67dd202817410a
5
5
  SHA512:
6
- metadata.gz: 9f4b49c84af17ef43f9e0b961d65b4320566c2174ebaa9dd036295448ecbd5b5769ab118bf01f14283862a7c02dcbb0d61ffa9e3a04a6195a2d7ee83c1c4fa93
7
- data.tar.gz: c5da7028a8bed46e6488544972bec5e129b6b3f6aa7bea56f09ea977b2c9f1257c74302fe28ee69ac14415a85b88614c0e7c227c9ca8d220cff2f7c47bb8ad0c
6
+ metadata.gz: 863eeb3a760be7d9705d81d31cbfa18829e6b66557f05f1b750950b6c112bcaa1b1bfdbdbd63cc93abe7944724db545e2bb8fcb33e19330a0a7ed81e3279681b
7
+ data.tar.gz: 614c5bc59d24ca6322d44219e80330e2edeb74b47459c8d4877543e307e29d3955a0477adc5083f7eb29b7b6a8eb8cfc099ef62e9c0bcb9450f2239dfa789928
@@ -405,7 +405,7 @@ module OpenAssets
405
405
  script = Bitcoin::Script.new(script_sig).chunks.last
406
406
  redeem_script = Bitcoin::Script.new(script)
407
407
  return nil unless redeem_script.chunks[1] == Bitcoin::Script::OP_DROP
408
- asset_def = to_bytes(redeem_script.chunks[0].bth)[0..-1].map{|x|x.to_i(16).chr}.join
408
+ asset_def = to_bytes(redeem_script.chunks[0].to_s.bth)[0..-1].map{|x|x.to_i(16).chr}.join
409
409
  asset_def && asset_def.start_with?('u=') ? asset_def : nil
410
410
  end
411
411
 
@@ -1,3 +1,3 @@
1
1
  module OpenAssets
2
- VERSION = '0.5.7'
2
+ VERSION = '0.5.8'
3
3
  end
data/lib/segwit/tx.rb CHANGED
@@ -8,10 +8,10 @@ class Bitcoin::Protocol::Tx
8
8
  @ver, @lock_time, @in, @out, @scripts, @witness = 1, 0, [], [], [], Bitcoin::Protocol::TxWitness.new
9
9
  @enable_bitcoinconsensus = !!ENV['USE_BITCOINCONSENSUS']
10
10
  if data
11
- if witness_tx?(data)
12
- parse_witness_data_from_io(data) # parse witness data
13
- else
14
- parse_data_from_io(data) # parse no witness data
11
+ begin
12
+ parse_witness_data_from_io(data) unless parse_data_from_io(data).is_a?(TrueClass)
13
+ rescue Exception
14
+ parse_witness_data_from_io(data)
15
15
  end
16
16
  end
17
17
  end
@@ -73,14 +73,4 @@ class Bitcoin::Protocol::Tx
73
73
  payload
74
74
  end
75
75
 
76
- # Checks witness transaction data.
77
- # see https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki
78
- def witness_tx?(data)
79
- buf = data.is_a?(String) ? StringIO.new(data) : data
80
- buf.read(4) # read nVersion
81
- marker = buf.read(1).unpack("c").first
82
- flag = buf.read(1).unpack("c").first
83
- marker == 0 && flag == 1
84
- end
85
-
86
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openassets-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby