diff options
Diffstat (limited to 'cmd/evm/main.go')
-rw-r--r-- | cmd/evm/main.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 561f1a943..7c9d27fac 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -59,6 +59,7 @@ func main() { logger.AddLogSystem(logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.LogLevel(*loglevel))) + vm.Debug = true db, _ := ethdb.NewMemDatabase() statedb := state.New(common.Hash{}, db) sender := statedb.CreateAccount(common.StringToAddress("sender")) @@ -80,6 +81,8 @@ func main() { fmt.Println(string(statedb.Dump())) } + vm.StdErrFormat(vmenv.StructLogs()) + var mem runtime.MemStats runtime.ReadMemStats(&mem) fmt.Printf("vm took %v\n", time.Since(tstart)) @@ -104,6 +107,7 @@ type VMEnv struct { depth int Gas *big.Int time int64 + logs []vm.StructLog } func NewEnv(state *state.StateDB, transactor common.Address, value *big.Int) *VMEnv { @@ -133,6 +137,12 @@ func (self *VMEnv) GetHash(n uint64) common.Hash { } return common.Hash{} } +func (self *VMEnv) AddStructLog(log vm.StructLog) { + self.logs = append(self.logs, log) +} +func (self *VMEnv) StructLogs() []vm.StructLog { + return self.logs +} func (self *VMEnv) AddLog(log *state.Log) { self.state.AddLog(log) } |