Cleaned up some of that util
This commit is contained in:
@ -38,13 +38,13 @@ func NewContext(caller ContextRef, object ContextRef, code []byte, gas, price *b
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) GetOp(x uint64) OpCode {
|
||||
return OpCode(c.GetByte(x))
|
||||
func (c *Context) GetOp(n uint64) OpCode {
|
||||
return OpCode(c.GetByte(n))
|
||||
}
|
||||
|
||||
func (c *Context) GetByte(x uint64) byte {
|
||||
if x < uint64(len(c.Code)) {
|
||||
return c.Code[x]
|
||||
func (c *Context) GetByte(n uint64) byte {
|
||||
if n < uint64(len(c.Code)) {
|
||||
return c.Code[n]
|
||||
}
|
||||
|
||||
return 0
|
||||
|
@ -83,7 +83,7 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
|
||||
jump = func(from uint64, to *big.Int) {
|
||||
p := to.Uint64()
|
||||
|
||||
nop := OpCode(context.GetOp(p))
|
||||
nop := context.GetOp(p)
|
||||
if !destinations.Has(p) {
|
||||
panic(fmt.Sprintf("invalid jump destination (%v) %v", nop, p))
|
||||
}
|
||||
|
Reference in New Issue
Block a user