2019-03-15 22:36:16 +00:00
|
|
|
package vm
|
|
|
|
|
|
|
|
import "github.com/CityOfZion/neo-go/pkg/vm/stack"
|
|
|
|
|
2019-03-16 22:15:08 +00:00
|
|
|
var opFunc = map[stack.Instruction]func(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation) (Vmstate, error){
|
2019-03-15 23:37:54 +00:00
|
|
|
stack.ADD: Add,
|
|
|
|
stack.SUB: Sub,
|
|
|
|
stack.PUSHBYTES1: PushNBytes,
|
|
|
|
stack.PUSHBYTES75: PushNBytes,
|
2019-03-16 22:15:08 +00:00
|
|
|
stack.RET: RET,
|
|
|
|
stack.EQUAL: EQUAL,
|
|
|
|
stack.THROWIFNOT: THROWIFNOT,
|
2019-03-15 23:37:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
for i := int(stack.PUSHBYTES1); i <= int(stack.PUSHBYTES75); i++ {
|
|
|
|
opFunc[stack.Instruction(i)] = PushNBytes
|
|
|
|
}
|
2019-03-15 22:36:16 +00:00
|
|
|
}
|