core/state: fix TestDump

Lazy "I'll just put return here instead of fixing the test" found by go vet.
This commit is contained in:
Felix Lange
2016-04-15 11:16:56 +02:00
parent ebf3cf8f7d
commit 68c755a238
3 changed files with 27 additions and 9 deletions

View File

@ -46,11 +46,19 @@ func (self *StateDB) RawDump() World {
it := self.trie.Iterator()
for it.Next() {
addr := self.trie.GetKey(it.Key)
stateObject, _ := DecodeObject(common.BytesToAddress(addr), self.db, it.Value)
account := Account{Balance: stateObject.balance.String(), Nonce: stateObject.nonce, Root: common.Bytes2Hex(stateObject.Root()), CodeHash: common.Bytes2Hex(stateObject.codeHash), Code: common.Bytes2Hex(stateObject.Code())}
account.Storage = make(map[string]string)
stateObject, err := DecodeObject(common.BytesToAddress(addr), self.db, it.Value)
if err != nil {
panic(err)
}
account := Account{
Balance: stateObject.balance.String(),
Nonce: stateObject.nonce,
Root: common.Bytes2Hex(stateObject.Root()),
CodeHash: common.Bytes2Hex(stateObject.codeHash),
Code: common.Bytes2Hex(stateObject.Code()),
Storage: make(map[string]string),
}
storageIt := stateObject.trie.Iterator()
for storageIt.Next() {
account.Storage[common.Bytes2Hex(self.trie.GetKey(storageIt.Key))] = common.Bytes2Hex(storageIt.Value)