web3-eth 0.2.35 → 0.2.40
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.rb +1 -0
- data/lib/web3/eth/debug/debug_module.rb +4 -1
- data/lib/web3/eth/debug/transaction_call_trace.rb +2 -2
- data/lib/web3/eth/parity_module.rb +26 -0
- data/lib/web3/eth/rpc.rb +9 -4
- data/lib/web3/eth/trace_module.rb +6 -0
- data/lib/web3/eth/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aacea6822d6743a8cecd1620d10c39fe1552cb3ec3f98891527c93bbf20c66e
|
4
|
+
data.tar.gz: a70a11f63c761b1923dce7c4e9cf66ddd93c4e0914a03e539fd94d5f638b9c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0d38f4875da54624615267a9502b022efd7f2e780c3e07a7fe9b66f0e5479a365b63afca17da62f76385fbf30fb9fc1100eb690a56a04340c842ab0110cd74
|
7
|
+
data.tar.gz: 4cbf7ccd1ab947b86591343d5177ebc2f617388549a62fe0c916d8beee3b87910598c075b92c5e6977a566064a81b6a317a1c8e1c64e0c34846135890f7ae0a0
|
data/lib/web3/eth.rb
CHANGED
@@ -16,7 +16,10 @@ module Web3::Eth::Debug
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def traceBlockByNumber number, tracer = 'callTracer', convert_to_object = true
|
19
|
-
|
19
|
+
timeout = @web3_rpc.connect_options[:read_timeout] || 120
|
20
|
+
raw = @web3_rpc.request("#{PREFIX}#{__method__}", [hex(number), {tracer: tracer,
|
21
|
+
timeout: "#{timeout}s"}])
|
22
|
+
raise raw.first['error'] if (raw.first && raw.first['error'])
|
20
23
|
convert_to_object ? raw.map{|r| TransactionCallTrace.new(r['result'])} : raw
|
21
24
|
end
|
22
25
|
|
@@ -9,7 +9,7 @@ module Web3::Eth::Debug
|
|
9
9
|
@raw_data = raw
|
10
10
|
@traceAddress = traceAddress
|
11
11
|
@parent = parent
|
12
|
-
@calls = raw['calls'] ? raw['calls'].each_with_index.map{|c,i| TransactionCallTrace.new c, (traceAddress + [i]),
|
12
|
+
@calls = raw['calls'] ? raw['calls'].each_with_index.map{|c,i| TransactionCallTrace.new c, (traceAddress + [i]), self } : []
|
13
13
|
end
|
14
14
|
|
15
15
|
# CALL STATICCALL DELEGATECALL CREATE SELFDESTRUCT
|
@@ -25,7 +25,7 @@ module Web3::Eth::Debug
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def smart_contract
|
28
|
-
['
|
28
|
+
['STATICCALL','CALL'].include?(type) ? to : from
|
29
29
|
end
|
30
30
|
|
31
31
|
def creates
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Web3
|
2
|
+
module Eth
|
3
|
+
|
4
|
+
class ParityModule
|
5
|
+
|
6
|
+
include Web3::Eth::Utility
|
7
|
+
|
8
|
+
PREFIX = 'parity_'
|
9
|
+
|
10
|
+
def initialize web3_rpc
|
11
|
+
@web3_rpc = web3_rpc
|
12
|
+
end
|
13
|
+
|
14
|
+
def method_missing m, *args
|
15
|
+
@web3_rpc.request "#{PREFIX}#{m}", args[0]
|
16
|
+
end
|
17
|
+
|
18
|
+
def getBlockReceiptsByBlockNumber block
|
19
|
+
@web3_rpc.request("#{PREFIX}getBlockReceipts", [hex(block)]).collect{|tr|
|
20
|
+
TransactionReceipt.new tr
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/web3/eth/rpc.rb
CHANGED
@@ -17,7 +17,7 @@ module Web3
|
|
17
17
|
DEFAULT_HOST = 'localhost'
|
18
18
|
DEFAULT_PORT = 8545
|
19
19
|
|
20
|
-
attr_reader :eth, :
|
20
|
+
attr_reader :eth, :connect_options
|
21
21
|
|
22
22
|
def initialize host: DEFAULT_HOST, port: DEFAULT_PORT, connect_options: DEFAULT_CONNECT_OPTIONS
|
23
23
|
|
@@ -27,15 +27,20 @@ module Web3
|
|
27
27
|
@connect_options = connect_options
|
28
28
|
|
29
29
|
@eth = EthModule.new self
|
30
|
-
@trace = TraceModule.new self
|
31
30
|
|
32
31
|
end
|
33
32
|
|
33
|
+
def trace
|
34
|
+
@trace ||= TraceModule.new(self)
|
35
|
+
end
|
34
36
|
|
35
|
-
def
|
36
|
-
|
37
|
+
def parity
|
38
|
+
@parity ||= ParityModule.new(self)
|
37
39
|
end
|
38
40
|
|
41
|
+
def debug
|
42
|
+
@debug ||= Debug::DebugModule.new(self)
|
43
|
+
end
|
39
44
|
|
40
45
|
def request method, params = nil
|
41
46
|
|
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.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- studnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rlp
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/web3/eth/eth_module.rb
|
111
111
|
- lib/web3/eth/etherscan.rb
|
112
112
|
- lib/web3/eth/log.rb
|
113
|
+
- lib/web3/eth/parity_module.rb
|
113
114
|
- lib/web3/eth/rpc.rb
|
114
115
|
- lib/web3/eth/trace_module.rb
|
115
116
|
- lib/web3/eth/transaction.rb
|