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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf357f674167afab29db9933b6242cf21f2cc321ca81162fc042f480b3a82e49
4
- data.tar.gz: 88307dbee12f2a8f275139d76458c6f3a1023aa5a64c668ae2d7a46bf6dbf357
3
+ metadata.gz: db3f1f3b034625e2da1a0553ab2943f3140c86547e7667a2671c8fdd2252ef19
4
+ data.tar.gz: 6d9108ec98ae3b3e4a715c6ba136706ee062eb5e7cb036272a6ef81fb228701e
5
5
  SHA512:
6
- metadata.gz: 98e8475451c7517f6dfadc3daa4142b989863a816dfeb4c0f874a4785ddaf7919f17df94be4f3575cfe8b1c4d31c9f6c85a4934e98759fc7643fa8b140770ac5
7
- data.tar.gz: 04d198919d8787c19765fea2c194fcdcb9af1188efee42e564c42b17c25b517607c5015c583b6cba410d2fa3915aa9ac63bbb39bf4310c186757966913473a3b
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
- @calls = raw['calls'] ? raw['calls'].each_with_index.map{|c,i| TransactionCallTrace.new c, (traceAddress + [i]) } : []
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
@@ -1,5 +1,5 @@
1
1
  module Web3
2
2
  module Eth
3
- VERSION = "0.2.34"
3
+ VERSION = "0.2.35"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web3-eth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.34
4
+ version: 0.2.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - studnev