aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-11 22:04:09 +0800
committerobscuren <geffobscura@gmail.com>2014-07-11 22:04:09 +0800
commit9010857677ac374e09bab62a89f2fb52c11ed6d3 (patch)
tree41c047472589f281fe83b333b24d96988dbc46f8 /ethchain/state.go
parentff151f9fbcfea2d21139ec778fc7c1ac32282d71 (diff)
downloaddexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar.gz
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar.bz2
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar.lz
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar.xz
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.tar.zst
dexon-9010857677ac374e09bab62a89f2fb52c11ed6d3.zip
Special diff output for execution
Diffstat (limited to 'ethchain/state.go')
-rw-r--r--ethchain/state.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/ethchain/state.go b/ethchain/state.go
index 6d45c9e32..8df79dcef 100644
--- a/ethchain/state.go
+++ b/ethchain/state.go
@@ -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