web3-eth 0.2.34 → 0.2.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/web3/eth/debug/transaction_call_trace.rb +9 -4
- data/lib/web3/eth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3f1f3b034625e2da1a0553ab2943f3140c86547e7667a2671c8fdd2252ef19
|
4
|
+
data.tar.gz: 6d9108ec98ae3b3e4a715c6ba136706ee062eb5e7cb036272a6ef81fb228701e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f3c3598e84b3ddc6eb4cedadf434feb7f44dacaacabde27f0c044fe9e7c36213b7473f83b90b6a9e6fc6b994d68d22578d498240c6c19c3711a90465520d90
|
7
|
+
data.tar.gz: a05ff6d9dd49db8323efc84d3dfac07234bc42bac24eb46a054411da52c7c35d3e846dd1330f49a4f9dcc66a9964cea56e5be6f7862a9103224e3c985a74f25b
|
@@ -4,11 +4,12 @@ module Web3::Eth::Debug
|
|
4
4
|
|
5
5
|
include Web3::Eth::Utility
|
6
6
|
|
7
|
-
attr_reader :raw_data, :calls, :traceAddress
|
8
|
-
def initialize raw, traceAddress = []
|
7
|
+
attr_reader :raw_data, :calls, :traceAddress, :parent
|
8
|
+
def initialize raw, traceAddress = [], parent = nil
|
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]), parent } : []
|
12
13
|
end
|
13
14
|
|
14
15
|
# CALL STATICCALL DELEGATECALL CREATE SELFDESTRUCT
|
@@ -19,10 +20,14 @@ module Web3::Eth::Debug
|
|
19
20
|
def action
|
20
21
|
{
|
21
22
|
'callType' => type.downcase,
|
22
|
-
'address' => raw_data['to']
|
23
|
+
'address' => ( suicide? ? parent.smart_contract : raw_data['to'])
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
27
|
+
def smart_contract
|
28
|
+
['DELEGATECALL','CALL'].include?(type) ? to : from
|
29
|
+
end
|
30
|
+
|
26
31
|
def creates
|
27
32
|
(type=='CREATE' || type=='CREATE2') ? to : nil
|
28
33
|
end
|
data/lib/web3/eth/version.rb
CHANGED