diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2018-01-04 20:18:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-04 20:18:30 +0800 |
commit | 1c2378b926b4ae96ae42a4e802058a2fcd42c87b (patch) | |
tree | 07c3f0e70e514625e5770d5f922b878b84a3b59a /core | |
parent | ae71da1b03c6eee82b714ef81b4fc59bcc130bb2 (diff) | |
download | go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar.gz go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar.bz2 go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar.lz go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar.xz go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.tar.zst go-tangerine-1c2378b926b4ae96ae42a4e802058a2fcd42c87b.zip |
tests: update to upstream commit 2bb0c3da3b (#15806)
Also raise traceLimit once again and print the VM
error and output on failure.
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/logger.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/core/vm/logger.go b/core/vm/logger.go index 1a6e43ee3..119181433 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -100,6 +100,8 @@ type StructLogger struct { logs []StructLog changedValues map[common.Address]Storage + output []byte + err error } // NewStructLogger returns a new logger @@ -172,17 +174,19 @@ func (l *StructLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost ui } 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) - } + l.output = output + l.err = err return nil } -// StructLogs returns a list of captured log entries -func (l *StructLogger) StructLogs() []StructLog { - return l.logs -} +// StructLogs returns the captured log entries. +func (l *StructLogger) StructLogs() []StructLog { return l.logs } + +// Error returns the VM error captured by the trace. +func (l *StructLogger) Error() error { return l.err } + +// Output returns the VM return value captured by the trace. +func (l *StructLogger) Output() []byte { return l.output } // WriteTrace writes a formatted trace to the given writer func WriteTrace(writer io.Writer, logs []StructLog) { |