aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/closure.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-22 01:22:47 +0800
committerobscuren <geffobscura@gmail.com>2014-03-22 01:22:47 +0800
commit01c1bce9c5dfa2b2bcdf934afec3f206823f895f (patch)
tree03c6e06ced15c61e2997b3d7d42fa11b2426d7c5 /ethchain/closure.go
parent9a9e252cabdc6283d7f4e523860f0e4addf62152 (diff)
downloaddexon-01c1bce9c5dfa2b2bcdf934afec3f206823f895f.tar.gz
dexon-01c1bce9c5dfa2b2bcdf934afec3f206823f895f.tar.zst
dexon-01c1bce9c5dfa2b2bcdf934afec3f206823f895f.zip
Removed regular ints from the virtual machine and closures
Diffstat (limited to 'ethchain/closure.go')
-rw-r--r--ethchain/closure.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/ethchain/closure.go b/ethchain/closure.go
index f8e692f61..2e809aa9d 100644
--- a/ethchain/closure.go
+++ b/ethchain/closure.go
@@ -15,7 +15,8 @@ type Callee interface {
type ClosureBody interface {
Callee
ethutil.RlpEncodable
- GetMem(int64) *ethutil.Value
+ GetMem(*big.Int) *ethutil.Value
+ SetMem(*big.Int, *ethutil.Value)
}
// Basic inline closure object which implement the 'closure' interface
@@ -36,7 +37,7 @@ func NewClosure(callee Callee, object ClosureBody, state *State, gas, val *big.I
}
// Retuns the x element in data slice
-func (c *Closure) GetMem(x int64) *ethutil.Value {
+func (c *Closure) GetMem(x *big.Int) *ethutil.Value {
m := c.object.GetMem(x)
if m == nil {
return ethutil.EmptyValue()
@@ -45,6 +46,10 @@ func (c *Closure) GetMem(x int64) *ethutil.Value {
return m
}
+func (c *Closure) SetMem(x *big.Int, val *ethutil.Value) {
+ c.object.SetMem(x, val)
+}
+
func (c *Closure) Address() []byte {
return c.object.Address()
}