mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
eth/tracers: forward system-call hooks in muxTracer
This commit is contained in:
parent
68646229a0
commit
441bf004b0
1 changed files with 32 additions and 12 deletions
|
|
@ -67,18 +67,20 @@ func NewMuxTracer(names []string, objects []*tracers.Tracer) (*tracers.Tracer, e
|
|||
t := &muxTracer{names: names, tracers: objects}
|
||||
return &tracers.Tracer{
|
||||
Hooks: &tracing.Hooks{
|
||||
OnTxStart: t.OnTxStart,
|
||||
OnTxEnd: t.OnTxEnd,
|
||||
OnEnter: t.OnEnter,
|
||||
OnExit: t.OnExit,
|
||||
OnOpcode: t.OnOpcode,
|
||||
OnFault: t.OnFault,
|
||||
OnGasChange: t.OnGasChange,
|
||||
OnBalanceChange: t.OnBalanceChange,
|
||||
OnNonceChange: t.OnNonceChange,
|
||||
OnCodeChange: t.OnCodeChange,
|
||||
OnStorageChange: t.OnStorageChange,
|
||||
OnLog: t.OnLog,
|
||||
OnTxStart: t.OnTxStart,
|
||||
OnTxEnd: t.OnTxEnd,
|
||||
OnEnter: t.OnEnter,
|
||||
OnExit: t.OnExit,
|
||||
OnOpcode: t.OnOpcode,
|
||||
OnFault: t.OnFault,
|
||||
OnGasChange: t.OnGasChange,
|
||||
OnBalanceChange: t.OnBalanceChange,
|
||||
OnNonceChange: t.OnNonceChange,
|
||||
OnCodeChange: t.OnCodeChange,
|
||||
OnStorageChange: t.OnStorageChange,
|
||||
OnLog: t.OnLog,
|
||||
OnSystemCallStartV2: t.OnSystemCallStart,
|
||||
OnSystemCallEnd: t.OnSystemCallEnd,
|
||||
},
|
||||
GetResult: t.GetResult,
|
||||
Stop: t.Stop,
|
||||
|
|
@ -189,6 +191,24 @@ func (t *muxTracer) OnLog(log *types.Log) {
|
|||
}
|
||||
}
|
||||
|
||||
func (t *muxTracer) OnSystemCallStart(vm *tracing.VMContext) {
|
||||
for _, t := range t.tracers {
|
||||
if t.OnSystemCallStartV2 != nil {
|
||||
t.OnSystemCallStartV2(vm)
|
||||
} else if t.OnSystemCallStart != nil {
|
||||
t.OnSystemCallStart()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *muxTracer) OnSystemCallEnd() {
|
||||
for _, t := range t.tracers {
|
||||
if t.OnSystemCallEnd != nil {
|
||||
t.OnSystemCallEnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetResult returns an empty json object.
|
||||
func (t *muxTracer) GetResult() (json.RawMessage, error) {
|
||||
resObject := make(map[string]json.RawMessage)
|
||||
|
|
|
|||
Loading…
Reference in a new issue