diff options
Diffstat (limited to 'core/state')
-rw-r--r-- | core/state/dump.go | 3 | ||||
-rw-r--r-- | core/state/state_object.go | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/state/dump.go b/core/state/dump.go index 9acb8a024..dbb9e72cb 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -28,6 +28,7 @@ type Account struct { Nonce uint64 `json:"nonce"` Root string `json:"root"` CodeHash string `json:"codeHash"` + Code string `json:"code"` Storage map[string]string `json:"storage"` } @@ -47,7 +48,7 @@ func (self *StateDB) RawDump() World { addr := self.trie.GetKey(it.Key) stateObject := NewStateObjectFromBytes(common.BytesToAddress(addr), it.Value, self.db) - account := Account{Balance: stateObject.balance.String(), Nonce: stateObject.nonce, Root: common.Bytes2Hex(stateObject.Root()), CodeHash: common.Bytes2Hex(stateObject.codeHash)} + 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) storageIt := stateObject.trie.Iterator() diff --git a/core/state/state_object.go b/core/state/state_object.go index c06e3d227..ad6a91cdb 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -260,6 +260,13 @@ func (self *StateObject) Nonce() uint64 { return self.nonce } +// Never called, but must be present to allow StateObject to be used +// as a vm.Account interface that also satisfies the vm.ContractRef +// interface. Interfaces are awesome. +func (self *StateObject) Value() *big.Int { + panic("Value on StateObject should never be called") +} + func (self *StateObject) EachStorage(cb func(key, value []byte)) { // When iterating over the storage check the cache first for h, v := range self.storage { |