web3-eth 0.2.43 → 0.2.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/web3/eth/abi/abi_coder.rb +13 -4
- data/lib/web3/eth/abi/type.rb +2 -2
- data/lib/web3/eth/contract.rb +1 -1
- data/lib/web3/eth/debug/debug_module.rb +3 -1
- data/lib/web3/eth/utility.rb +1 -1
- data/lib/web3/eth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 337174dd38a29930910926ec514a3147aaf5656a5ae602ff80bd9e3d82dea2a1
|
4
|
+
data.tar.gz: 7940b9dd70ca348518e66fef6a7894c5e7877f42b119bc7b76a833e3dcc674ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/web3/eth/abi/type.rb
CHANGED
@@ -152,13 +152,13 @@ module Web3::Eth::Abi
|
|
152
152
|
end
|
153
153
|
collected << current unless current.empty?
|
154
154
|
|
155
|
-
Tuple.new collected, dims
|
155
|
+
Tuple.new collected, dims.map {|x| x[1...-1].to_i}
|
156
156
|
|
157
157
|
end
|
158
158
|
|
159
159
|
attr_reader :types, :parsed_types
|
160
160
|
def initialize types, dims
|
161
|
-
super('tuple', '', dims
|
161
|
+
super('tuple', '', dims)
|
162
162
|
@types = types
|
163
163
|
@parsed_types = types.map{|t| Type.parse t}
|
164
164
|
end
|
data/lib/web3/eth/contract.rb
CHANGED
@@ -34,7 +34,7 @@ module Web3
|
|
34
34
|
def initialize abi
|
35
35
|
@abi = abi
|
36
36
|
@name = abi['name']
|
37
|
-
@constant = !!abi['constant']
|
37
|
+
@constant = !!abi['constant'] || abi['stateMutability']=='view'
|
38
38
|
@input_types = abi['inputs'] ? abi['inputs'].map{|a| parse_component_type a } : []
|
39
39
|
@output_types = abi['outputs'].map{|a| parse_component_type a } if abi['outputs']
|
40
40
|
@signature = Abi::Utils.function_signature @name, @input_types
|
@@ -11,7 +11,9 @@ module Web3::Eth::Debug
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def traceTransaction hash, tracer = 'callTracer', convert_to_object = true
|
14
|
-
|
14
|
+
timeout = @web3_rpc.connect_options[:read_timeout] || 120
|
15
|
+
raw = @web3_rpc.request("#{PREFIX}#{__method__}", [hash, {tracer: tracer,
|
16
|
+
timeout: "#{timeout}s"}])
|
15
17
|
convert_to_object ? TransactionCallTrace.new(raw) : raw
|
16
18
|
end
|
17
19
|
|
data/lib/web3/eth/utility.rb
CHANGED
data/lib/web3/eth/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rlp
|