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 +4 -4
- data/lib/openassets/api.rb +1 -1
- data/lib/openassets/version.rb +1 -1
- data/lib/segwit/tx.rb +4 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42f90d72e17b972a1339a04511c2f8df17a0f90d
|
4
|
+
data.tar.gz: 4b9d6b5a3133cb1602ebcf866a67dd202817410a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 863eeb3a760be7d9705d81d31cbfa18829e6b66557f05f1b750950b6c112bcaa1b1bfdbdbd63cc93abe7944724db545e2bb8fcb33e19330a0a7ed81e3279681b
|
7
|
+
data.tar.gz: 614c5bc59d24ca6322d44219e80330e2edeb74b47459c8d4877543e307e29d3955a0477adc5083f7eb29b7b6a8eb8cfc099ef62e9c0bcb9450f2239dfa789928
|
data/lib/openassets/api.rb
CHANGED
@@ -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
|
|
data/lib/openassets/version.rb
CHANGED
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
|
-
|
12
|
-
parse_witness_data_from_io(data)
|
13
|
-
|
14
|
-
|
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.
|
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-
|
11
|
+
date: 2016-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|