aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-07-21 20:31:26 +0800
committerzelig <viktor.tron@gmail.com>2014-07-21 20:31:26 +0800
commit13cc220c0d7f9b31478b49a1109d44aeab66b372 (patch)
tree7f103997d746e2b5da20eed3ce20cb2521b12852 /ethchain/state.go
parent1e4af85a380977233a3bceaf5e2a020a281aa19a (diff)
parent8f91d47bf3c26b850f0f40f79856141087e6ef82 (diff)
downloaddexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar.gz
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar.bz2
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar.lz
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar.xz
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.tar.zst
dexon-13cc220c0d7f9b31478b49a1109d44aeab66b372.zip
Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor
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()
}
}