mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
add debug in OnEnter
This commit is contained in:
parent
1358a5e60c
commit
548f7ea474
1 changed files with 3 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ package native
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
|
|
@ -152,6 +153,7 @@ func newCallTracerObject(ctx *tracers.Context, cfg json.RawMessage) (*callTracer
|
||||||
|
|
||||||
// OnEnter is called when EVM enters a new scope (via call, create or selfdestruct).
|
// OnEnter is called when EVM enters a new scope (via call, create or selfdestruct).
|
||||||
func (t *callTracer) OnEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
func (t *callTracer) OnEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
||||||
|
fmt.Println("[JEREMYDEBUG] OnEnter: depth %d, from %s, to %s, input %s, gas %d, value %s", depth, from, to, input, gas, value)
|
||||||
t.depth = depth
|
t.depth = depth
|
||||||
if t.config.OnlyTopCall && depth > 0 {
|
if t.config.OnlyTopCall && depth > 0 {
|
||||||
return
|
return
|
||||||
|
|
@ -174,6 +176,7 @@ func (t *callTracer) OnEnter(depth int, typ byte, from common.Address, to common
|
||||||
call.Gas = t.gasLimit
|
call.Gas = t.gasLimit
|
||||||
}
|
}
|
||||||
t.callstack = append(t.callstack, call)
|
t.callstack = append(t.callstack, call)
|
||||||
|
fmt.Println("[JEREMYDEBUG] callstack length: %d", len(t.callstack))
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnExit is called when EVM exits a scope, even if the scope didn't
|
// OnExit is called when EVM exits a scope, even if the scope didn't
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue