core/vm: resolve circular dependency to debug vm storage

This commit is contained in:
Péter Szilágyi
2016-01-11 18:20:31 +02:00
parent 1b8566a7b1
commit 752c75fb21
4 changed files with 20 additions and 14 deletions

View File

@ -27,6 +27,7 @@ type ContractRef interface {
ReturnGas(*big.Int, *big.Int)
Address() common.Address
SetCode([]byte)
EachStorage(cb func(key, value []byte))
}
// Contract represents an ethereum contract in the state database. It contains
@ -124,3 +125,9 @@ func (self *Contract) SetCallCode(addr *common.Address, code []byte) {
self.Code = code
self.CodeAddr = addr
}
// EachStorage iterates the contract's storage and calls a method for every key
// value pair.
func (self *Contract) EachStorage(cb func(key, value []byte)) {
self.caller.EachStorage(cb)
}