From 31511e55d02ffde0400a08aea98d3cae3389d0b6 Mon Sep 17 00:00:00 2001 From: BlockChainDev Date: Sat, 16 Mar 2019 22:06:32 +0000 Subject: [PATCH] Add Equal Opcode --- pkg/vm/vm_ops_bitwise.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pkg/vm/vm_ops_bitwise.go diff --git a/pkg/vm/vm_ops_bitwise.go b/pkg/vm/vm_ops_bitwise.go new file mode 100644 index 000000000..8c73ce25e --- /dev/null +++ b/pkg/vm/vm_ops_bitwise.go @@ -0,0 +1,17 @@ +package vm + +import "github.com/CityOfZion/neo-go/pkg/vm/stack" + +// Bitwise logic + +// EQUAL pushes true to the stack +// If the two top items on the stack are equal +func EQUAL(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation) (Vmstate, error) { + + itemA, itemB, err := popTwoByteArrays(ctx) + if err != nil { + return FAULT, err + } + ctx.Estack.Push(itemA.Equals(itemB)) + return NONE, nil +}