aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/dump.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-04-15 17:16:56 +0800
committerFelix Lange <fjl@twurst.com>2016-04-15 17:16:56 +0800
commit68c755a238f1a204087c2843f01d48fc6039716f (patch)
tree6c8f4c3450f958a7a6f4370c57730f222445add9 /core/state/dump.go
parentebf3cf8f7dca0f2885a2215510715a06a8ee69c8 (diff)
downloadgo-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar.gz
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar.bz2
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar.lz
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar.xz
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.tar.zst
go-tangerine-68c755a238f1a204087c2843f01d48fc6039716f.zip
core/state: fix TestDump
Lazy "I'll just put return here instead of fixing the test" found by go vet.
Diffstat (limited to 'core/state/dump.go')
-rw-r--r--core/state/dump.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/state/dump.go b/core/state/dump.go
index 8eb03e8e4..a328b0537 100644
--- a/core/state/dump.go
+++ b/core/state/dump.go
@@ -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)