aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethchain/state.go')
-rw-r--r--ethchain/state.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/ethchain/state.go b/ethchain/state.go
index 684b81102..3a9929ecc 100644
--- a/ethchain/state.go
+++ b/ethchain/state.go
@@ -1,7 +1,6 @@
package ethchain
import (
- "fmt"
"github.com/ethereum/eth-go/ethcrypto"
"github.com/ethereum/eth-go/ethtrie"
"github.com/ethereum/eth-go/ethutil"
@@ -27,12 +26,6 @@ func NewState(trie *ethtrie.Trie) *State {
return &State{trie: trie, stateObjects: make(map[string]*StateObject), manifest: NewManifest()}
}
-// Iterate over each storage address and yield callback
-func (s *State) EachStorage(cb ethtrie.EachCallback) {
- it := s.trie.NewIterator()
- it.Each(cb)
-}
-
// Retrieve the balance from the given address or 0 if object not found
func (self *State) GetBalance(addr []byte) *big.Int {
stateObject := self.GetStateObject(addr)
@@ -214,11 +207,8 @@ func (self *State) Update() {
// Debug stuff
func (self *State) CreateOutputForDiff() {
- for addr, stateObject := range self.stateObjects {
- fmt.Printf("%x %x %x %x\n", addr, stateObject.state.Root(), stateObject.Amount.Bytes(), stateObject.Nonce)
- stateObject.state.EachStorage(func(addr string, value *ethutil.Value) {
- fmt.Printf("%x %x\n", addr, value.Bytes())
- })
+ for _, stateObject := range self.stateObjects {
+ stateObject.CreateOutputForDiff()
}
}