aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/logger.go')
-rw-r--r--core/vm/logger.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/vm/logger.go b/core/vm/logger.go
index c32a7b404..85acb8d6d 100644
--- a/core/vm/logger.go
+++ b/core/vm/logger.go
@@ -29,8 +29,10 @@ import (
"github.com/ethereum/go-ethereum/core/types"
)
+// Storage represents a contract's storage.
type Storage map[common.Hash]common.Hash
+// Copy duplicates the current storage.
func (s Storage) Copy() Storage {
cpy := make(Storage)
for key, value := range s {
@@ -76,10 +78,12 @@ type structLogMarshaling struct {
ErrorString string `json:"error"` // adds call to ErrorString() in MarshalJSON
}
+// OpName formats the operand name in a human-readable format.
func (s *StructLog) OpName() string {
return s.Op.String()
}
+// ErrorString formats the log's error as a string.
func (s *StructLog) ErrorString() string {
if s.Err != nil {
return s.Err.Error()
@@ -124,6 +128,7 @@ func NewStructLogger(cfg *LogConfig) *StructLogger {
return logger
}
+// CaptureStart implements the Tracer interface to initialize the tracing operation.
func (l *StructLogger) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error {
return nil
}
@@ -178,10 +183,13 @@ func (l *StructLogger) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost ui
return nil
}
+// CaptureFault implements the Tracer interface to trace an execution fault
+// while running an opcode.
func (l *StructLogger) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, memory *Memory, stack *Stack, contract *Contract, depth int, err error) error {
return nil
}
+// CaptureEnd is called after the call finishes to finalize the tracing.
func (l *StructLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error {
l.output = output
l.err = err