Special diff output for execution

This commit is contained in:
obscuren
2014-07-11 16:04:09 +02:00
parent ff151f9fbc
commit 9010857677
6 changed files with 57 additions and 8 deletions

View File

@ -1,6 +1,7 @@
package ethchain
import (
"fmt"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethtrie"
"github.com/ethereum/eth-go/ethutil"
@ -208,6 +209,16 @@ func (self *State) Update() {
}
}
// Debug stuff
func (self *State) CreateOutputForDiff() {
for addr, stateObject := range self.stateObjects {
fmt.Printf("0x%x 0x%x 0x%x 0x%x\n", addr, stateObject.state.Root(), stateObject.Amount.Bytes(), stateObject.Nonce)
stateObject.state.EachStorage(func(addr string, value *ethutil.Value) {
fmt.Printf("0x%x 0x%x\n", addr, value.Bytes())
})
}
}
// Object manifest
//
// The object manifest is used to keep changes to the state so we can keep track of the changes