rlp 0.6.0 → 0.6.1

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: 3a7e6cfb6c2ff329ee45d38680304abe966afa38
4
- data.tar.gz: 9a9c72a1be75da655162c63dbc351c10e621aadc
3
+ metadata.gz: bb1c99e46dd34a67fd5fa9643202a3a90629a461
4
+ data.tar.gz: 7831231076cd749b0a9f5b4f4ac46264316366c3
5
5
  SHA512:
6
- metadata.gz: 5ae8922fc6fd5b0b641d03103218ebc2368562156cf1220469ab15dbcbde92436dd8a543473339c036d70e59af227c9f44614df75bc5b36f9bf188b0be20dd5a
7
- data.tar.gz: 54c60053ea2ccbb85efa95d0ce310a1415854cf4873f478cc0c163118fceef6b130e005d361b71cf09308f80c3bf757362820249e7fc4cfcff2287ce8a4078a9
6
+ metadata.gz: db4e9932905f0b8227da5fe2d92451a85339e4a520499c24d80fb7fb5a4d17e4649be51923e9a9a08e1edc60d21344bf38e06d3973e82cdbbfd15a32dd408567
7
+ data.tar.gz: bebd6210c1d5d9410b3816919dd1e8c848c8151055a30e9f62d57b4d871af04b8bcfbe4cf889a3f1cfb8c6b3344a520b3a69054ff1840b6339b89bb08d2e9581
@@ -61,6 +61,27 @@ module RLP
61
61
  end
62
62
  end
63
63
 
64
+ def descend(rlp, *path)
65
+ rlp = str_to_bytes(rlp)
66
+
67
+ path.each do |pa|
68
+ pos = 0
69
+
70
+ type, len, pos = consume_length_prefix rlp, pos
71
+ raise DecodingError.new("Trying to descend through a non-list!", rlp) if type != :list
72
+
73
+ pa.times do |i|
74
+ t, l, s = consume_length_prefix(rlp, pos)
75
+ pos = l + s
76
+ end
77
+
78
+ t, l, s = consume_length_prefix rlp, pos
79
+ rlp = rlp[pos...(l+s)]
80
+ end
81
+
82
+ rlp
83
+ end
84
+
64
85
  private
65
86
 
66
87
  ##
@@ -34,9 +34,6 @@ module RLP
34
34
  begin
35
35
  result.push sedes.serialize(element)
36
36
  rescue SerializationError => e
37
- puts "List.serialize"
38
- puts e
39
- puts e.backtrace[0,20].join("\n")
40
37
  raise ListSerializationError.new(obj: obj, element_exception: e, index: i)
41
38
  end
42
39
  end
@@ -56,9 +56,6 @@ module RLP
56
56
  begin
57
57
  serializable_sedes.serialize(field_values)
58
58
  rescue ListSerializationError => e
59
- puts "Serializable.serialize"
60
- puts e
61
- puts e.backtrace[0,20].join("\n")
62
59
  raise ObjectSerializationError.new(obj: obj, sedes: self, list_exception: e)
63
60
  end
64
61
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : ascii-8bit -*-
2
2
 
3
3
  module RLP
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Xie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake