web3-eth 0.2.47 → 0.2.48

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
  SHA256:
3
- metadata.gz: 8be6fa4b04cd58538038dbe11ccd90c2f197f5be205e5d204b7cdbc58f7cef45
4
- data.tar.gz: a7b08dd6af5a133cf38f5c286da8dfe7eda81d5eeb65b1c68f0a99c18f050236
3
+ metadata.gz: 337174dd38a29930910926ec514a3147aaf5656a5ae602ff80bd9e3d82dea2a1
4
+ data.tar.gz: 7940b9dd70ca348518e66fef6a7894c5e7877f42b119bc7b76a833e3dcc674ad
5
5
  SHA512:
6
- metadata.gz: f976abfae663d97f06f4b61ac441ef8c1178517f8791ffb0e8930fbd7d933f8f6f01b6d49c10e3f900f703422a27697de5e6562df975198f1a8e1e03cd115d13
7
- data.tar.gz: 2897cb1de0fc173593bc9bb5ba82622d603727e6d30210da103455c474aa62fdeae491220aebdeccec468faaa0d397befed6ae12d41b8cc285240f546e245752
6
+ metadata.gz: 6aa2ef6edae9e986e05232a6e6ddd62d20bce5d0a1db1f5b1f8401c68703fd92ffe1cc1b76d6763dd07ce716082c4a67bd8ac161ddb08cc1f85ba7e9ed2b30ff
7
+ data.tar.gz: 795dd7071b2254b4bae126f945016ef464f49b7906d85eaeb73c2074a619f444459b082b48313515b95f2bbb9a170ab33d5f7ee865ec4d542851a35deb3f0bcb
@@ -290,6 +290,19 @@ module Web3::Eth::Abi
290
290
  l = Utils.big_endian_to_int arg[0,32]
291
291
  data = arg[32..-1]
292
292
  data[0, l]
293
+ elsif !type.dims.empty? && (l = type.dims.last)>0 # static-sized arrays
294
+ subtype = type.subtype
295
+ if subtype.dynamic?
296
+ start_positions = (0...l).map {|i| Utils.big_endian_to_int(arg[32*i, 32]) }
297
+ start_positions.push arg.size
298
+
299
+ outputs = (0...l).map {|i| arg[start_positions[i]...start_positions[i+1]] }
300
+
301
+ outputs.map {|out| decode_type(subtype, out) }
302
+ else
303
+ (0...l).map {|i| decode_type(subtype, arg[subtype.size*i, subtype.size]) }
304
+ end
305
+
293
306
  elsif type.dynamic?
294
307
  l = Utils.big_endian_to_int arg[0,32]
295
308
  raise DecodingError, "Too long length: #{l}" if l>100000
@@ -307,11 +320,7 @@ module Web3::Eth::Abi
307
320
  else
308
321
  (0...l).map {|i| decode_type(subtype, arg[32 + subtype.size*i, subtype.size]) }
309
322
  end
310
- elsif !type.dims.empty? # static-sized arrays
311
- l = type.dims.last
312
- subtype = type.subtype
313
323
 
314
- (0...l).map {|i| decode_type(subtype, arg[subtype.size*i, subtype.size]) }
315
324
  else
316
325
  decode_primitive_type type, arg
317
326
  end
@@ -1,5 +1,5 @@
1
1
  module Web3
2
2
  module Eth
3
- VERSION = "0.2.47"
3
+ VERSION = "0.2.48"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web3-eth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.47
4
+ version: 0.2.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - studnev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-27 00:00:00.000000000 Z
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rlp