diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-19 21:41:57 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-19 21:41:57 +0800 |
commit | f8d98f7fcd08bd2eff36d5366ac2a14b52255d57 (patch) | |
tree | 99111d4f80ee4c436c99813ef8ffe7a7b16ee8ce /core/state | |
parent | c305005d831eccf9d65c7b55f817390d2334e666 (diff) | |
parent | 5b283663b40dbc06c56cc481ef90f4365ab85724 (diff) | |
download | go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar.gz go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar.bz2 go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar.lz go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar.xz go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.tar.zst go-tangerine-f8d98f7fcd08bd2eff36d5366ac2a14b52255d57.zip |
Merge pull request #2116 from obscuren/homestead
core, core/vm: consensus changes necessary for the homestead release
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 cff9c50aa..8eb03e8e4 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, _ := 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)} + 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 47546112f..6095fc96a 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -238,6 +238,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 { |