mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 03:36:44 +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
|
|
@ -79,6 +79,8 @@ func NewMuxTracer(names []string, objects []*tracers.Tracer) (*tracers.Tracer, e
|
|||
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