aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/contract.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-01-21 05:18:19 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-01-21 05:18:19 +0800
commit78f196409552466ff878a030e4069495a923c73e (patch)
tree0e1038f8bced35fdbdb44ac3dca2cf029d7824e5 /core/vm/contract.go
parent7b11e9444195cc728437d568bb61e1e86034ba39 (diff)
parent752c75fb21ad151204f2aadeee1fff597e013aa2 (diff)
downloadgo-tangerine-78f196409552466ff878a030e4069495a923c73e.tar.gz
go-tangerine-78f196409552466ff878a030e4069495a923c73e.tar.zst
go-tangerine-78f196409552466ff878a030e4069495a923c73e.zip
Merge pull request #2115 from karalabe/vm-debug-storage
core/vm: resolve circular dependency to debug vm storage
Diffstat (limited to 'core/vm/contract.go')
-rw-r--r--core/vm/contract.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/vm/contract.go b/core/vm/contract.go
index 95417e747..5981dcca0 100644
--- a/core/vm/contract.go
+++ b/core/vm/contract.go
@@ -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)
+}