Skip to content

Commit

Permalink
fix: OnTxEnd check for Children()
Browse files Browse the repository at this point in the history
  • Loading branch information
mortimr committed Oct 29, 2024
1 parent deb7010 commit e55be4c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions plugins/pgeth-monitoring/pkg/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ func (m *MonitoringTracer) OnTxStart(vm *tracing.VMContext, tx *types.Transactio
}

func (m *MonitoringTracer) OnTxEnd(receipt *types.Receipt, err error) {
output := m.Cursor.(*Call).Children()[0].(*Call).Out
copyOutput := make([]byte, len(output))
copy(copyOutput, output)
m.Cursor.(*Call).Out = copyOutput
m.Cursor.(*Call).OutHex = "0x" + hex.EncodeToString(copyOutput)
if len(m.Cursor.(*Call).Children()) == 1 {
output := m.Cursor.(*Call).Children()[0].(*Call).Out
copyOutput := make([]byte, len(output))
copy(copyOutput, output)
m.Cursor.(*Call).Out = copyOutput
m.Cursor.(*Call).OutHex = "0x" + hex.EncodeToString(copyOutput)
}
}

func (m *MonitoringTracer) OnEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
Expand Down

0 comments on commit e55be4c

Please sign in to comment.