diff options
author | Martin Holst Swende <martin@swende.se> | 2017-08-23 19:37:18 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-23 19:37:18 +0800 |
commit | 286ec5df40d3707a7a2c98d49c8d324372ed29c2 (patch) | |
tree | 1cb14e2519516edde4beba39d8524f5cab5b34ee /core | |
parent | f7e39a772497f96253071da873d7d9923a3ed719 (diff) | |
download | dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar.gz dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar.bz2 dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar.lz dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar.xz dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.tar.zst dexon-286ec5df40d3707a7a2c98d49c8d324372ed29c2.zip |
cmd/evm, core/vm, internal/ethapi: Show error when exiting (#14985)
* cmd/evm, core/vm, internal/ethapi: Add 'err' to tracer interface CaptureEnd
* cmd/evm: fix nullpointer when there is no error
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/logger.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/vm/logger.go b/core/vm/logger.go index b73b13bd9..5ada310f0 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -86,7 +86,7 @@ func (s *StructLog) OpName() string { // if you need to retain them beyond the current call. type Tracer interface { CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, contract *Contract, depth int, err error) error - CaptureEnd(output []byte, gasUsed uint64, t time.Duration) error + CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error } // StructLogger is an EVM state logger and implements Tracer. @@ -183,8 +183,11 @@ func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost ui return nil } -func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration) error { +func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error { fmt.Printf("0x%x", output) + if err != nil { + fmt.Printf(" error: %v\n", err) + } return nil } |