Call fixed

This commit is contained in:
obscuren
2014-04-10 14:40:12 -04:00
parent 0fccbeabcc
commit 6a530ea371
5 changed files with 52 additions and 37 deletions

View File

@ -52,6 +52,10 @@ func (c *Closure) Get(x *big.Int) *ethutil.Value {
}
func (c *Closure) Gets(x, y *big.Int) *ethutil.Value {
if x.Int64() > int64(len(c.Script)) || y.Int64() > int64(len(c.Script)) {
return ethutil.NewValue(0)
}
partial := c.Script[x.Int64() : x.Int64()+y.Int64()]
return ethutil.NewValue(partial)