diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-16 01:28:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-16 01:28:48 +0800 |
commit | 5daf8729be88eca87b302ebf7a46fc69cad0f6d0 (patch) | |
tree | 0053cb5b84978645b3c83895a651c512e081a183 /core/vm/context.go | |
parent | bac9a94ddf20dc530966cbf6cd384aaf94aedc77 (diff) | |
parent | 4673b04503742de9b1622557b44135d6a4934ad6 (diff) | |
download | go-tangerine-0.9.30.tar.gz go-tangerine-0.9.30.tar.zst go-tangerine-0.9.30.zip |
Merge branch 'release/0.9.30'v0.9.30
Diffstat (limited to 'core/vm/context.go')
-rw-r--r-- | core/vm/context.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/context.go b/core/vm/context.go index de03f84f0..e33324b53 100644 --- a/core/vm/context.go +++ b/core/vm/context.go @@ -49,13 +49,13 @@ func NewContext(caller ContextRef, object ContextRef, value, gas, price *big.Int return c } -func (c *Context) GetOp(n *big.Int) OpCode { +func (c *Context) GetOp(n uint64) OpCode { return OpCode(c.GetByte(n)) } -func (c *Context) GetByte(n *big.Int) byte { - if n.Cmp(big.NewInt(int64(len(c.Code)))) < 0 { - return c.Code[n.Int64()] +func (c *Context) GetByte(n uint64) byte { + if n < uint64(len(c.Code)) { + return c.Code[n] } return 0 |