mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +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,
|
OnCodeChange: t.OnCodeChange,
|
||||||
OnStorageChange: t.OnStorageChange,
|
OnStorageChange: t.OnStorageChange,
|
||||||
OnLog: t.OnLog,
|
OnLog: t.OnLog,
|
||||||
|
OnSystemCallStartV2: t.OnSystemCallStart,
|
||||||
|
OnSystemCallEnd: t.OnSystemCallEnd,
|
||||||
},
|
},
|
||||||
GetResult: t.GetResult,
|
GetResult: t.GetResult,
|
||||||
Stop: t.Stop,
|
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.
|
// GetResult returns an empty json object.
|
||||||
func (t *muxTracer) GetResult() (json.RawMessage, error) {
|
func (t *muxTracer) GetResult() (json.RawMessage, error) {
|
||||||
resObject := make(map[string]json.RawMessage)
|
resObject := make(map[string]json.RawMessage)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue