openassets-ruby 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openassets/protocol/marker_output.rb +0 -2
- data/lib/openassets/util.rb +3 -1
- data/lib/openassets/version.rb +1 -1
- 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: bd0918ad4bb75cb8cbc1a3cd13fcedffde7d97a9
|
4
|
+
data.tar.gz: ca7fc189f43ea44adf304ab3a2f3e4df831a936f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 927f9c392e633ff2ce0f621b792283c5c6e3705dd9e8d83a561a4b946e0b575ec342e4512e72ceb8de1726963de72817ef924e5b481913e983cfdb0862578e5f
|
7
|
+
data.tar.gz: 0662166b353f3e54a6514d49440ff4c2fbaf82ee61d899e46107f4f3f325f6ae3ad10d7b8ae242e2e02f268cfbe0809bcff5dcb5737bd35cf66ec27dcc83816c
|
@@ -73,8 +73,6 @@ module OpenAssets
|
|
73
73
|
# check metadata
|
74
74
|
length, offset = read_var_integer(data, offset)
|
75
75
|
return nil unless length
|
76
|
-
puts [data].pack('H*').bytes.length
|
77
|
-
puts length + offset
|
78
76
|
return nil if [data].pack('H*').bytes.length < length + offset
|
79
77
|
data
|
80
78
|
end
|
data/lib/openassets/util.rb
CHANGED
@@ -127,7 +127,9 @@ module OpenAssets
|
|
127
127
|
# https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer
|
128
128
|
def read_var_integer(data, offset = 0)
|
129
129
|
raise ArgumentError, "data is nil." unless data
|
130
|
-
|
130
|
+
packed = [data].pack('H*')
|
131
|
+
return [nil, 0] if packed.bytesize < 1+offset
|
132
|
+
bytes = packed.bytes[offset..(offset + 9)] # 9 is variable integer max storage length.
|
131
133
|
first_byte = bytes[0]
|
132
134
|
if first_byte < 0xfd
|
133
135
|
[first_byte, offset + 1]
|
data/lib/openassets/version.rb
CHANGED
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.1
|
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
|
+
date: 2016-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|