Commit 8b4605c3 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke

Merge pull request #1186 from obscuren/log_fixes

tests: log coalescing fixes
parents 45152dea 246db425
...@@ -67,7 +67,7 @@ func (self *Env) GetHash(n uint64) common.Hash { ...@@ -67,7 +67,7 @@ func (self *Env) GetHash(n uint64) common.Hash {
return common.BytesToHash(crypto.Sha3([]byte(big.NewInt(int64(n)).String()))) return common.BytesToHash(crypto.Sha3([]byte(big.NewInt(int64(n)).String())))
} }
func (self *Env) AddLog(log *state.Log) { func (self *Env) AddLog(log *state.Log) {
self.logs = append(self.logs, log) self.state.AddLog(log)
} }
func (self *Env) Depth() int { return self.depth } func (self *Env) Depth() int { return self.depth }
func (self *Env) SetDepth(i int) { self.depth = i } func (self *Env) SetDepth(i int) { self.depth = i }
...@@ -153,7 +153,7 @@ func RunVm(state *state.StateDB, env, exec map[string]string) ([]byte, state.Log ...@@ -153,7 +153,7 @@ func RunVm(state *state.StateDB, env, exec map[string]string) ([]byte, state.Log
vmenv.initial = true vmenv.initial = true
ret, err := vmenv.Call(caller, to, data, gas, price, value) ret, err := vmenv.Call(caller, to, data, gas, price, value)
return ret, vmenv.logs, vmenv.Gas, err return ret, vmenv.state.Logs(), vmenv.Gas, err
} }
func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) { func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state.Logs, *big.Int, error) {
...@@ -188,7 +188,7 @@ func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state. ...@@ -188,7 +188,7 @@ func RunState(statedb *state.StateDB, env, tx map[string]string) ([]byte, state.
} }
statedb.Update() statedb.Update()
return ret, vmenv.logs, vmenv.Gas, err return ret, vmenv.state.Logs(), vmenv.Gas, err
} }
type Message struct { type Message struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment