mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
logger/json: implement OnFaultV2 and wire into hooks to include rData on faults
This commit is contained in:
parent
182e08af32
commit
cdc1133880
1 changed files with 6 additions and 1 deletions
|
|
@ -74,6 +74,7 @@ func NewJSONLogger(cfg *Config, writer io.Writer) *tracing.Hooks {
|
||||||
OnExit: l.OnExit,
|
OnExit: l.OnExit,
|
||||||
OnOpcode: l.OnOpcode,
|
OnOpcode: l.OnOpcode,
|
||||||
OnFault: l.OnFault,
|
OnFault: l.OnFault,
|
||||||
|
OnFaultV2: l.OnFaultV2,
|
||||||
}
|
}
|
||||||
return l.hooks
|
return l.hooks
|
||||||
}
|
}
|
||||||
|
|
@ -92,15 +93,19 @@ func NewJSONLoggerWithCallFrames(cfg *Config, writer io.Writer) *tracing.Hooks {
|
||||||
OnExit: l.OnExit,
|
OnExit: l.OnExit,
|
||||||
OnOpcode: l.OnOpcode,
|
OnOpcode: l.OnOpcode,
|
||||||
OnFault: l.OnFault,
|
OnFault: l.OnFault,
|
||||||
|
OnFaultV2: l.OnFaultV2,
|
||||||
}
|
}
|
||||||
return l.hooks
|
return l.hooks
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *jsonLogger) OnFault(pc uint64, op byte, gas uint64, cost uint64, scope tracing.OpContext, depth int, err error) {
|
func (l *jsonLogger) OnFault(pc uint64, op byte, gas uint64, cost uint64, scope tracing.OpContext, depth int, err error) {
|
||||||
// TODO: Add rData to this interface as well
|
|
||||||
l.OnOpcode(pc, op, gas, cost, scope, nil, depth, err)
|
l.OnOpcode(pc, op, gas, cost, scope, nil, depth, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *jsonLogger) OnFaultV2(pc uint64, op byte, gas uint64, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
|
||||||
|
l.OnOpcode(pc, op, gas, cost, scope, rData, depth, err)
|
||||||
|
}
|
||||||
|
|
||||||
func (l *jsonLogger) OnOpcode(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
|
func (l *jsonLogger) OnOpcode(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
|
||||||
memory := scope.MemoryData()
|
memory := scope.MemoryData()
|
||||||
stack := scope.StackData()
|
stack := scope.StackData()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue