From 0309cff5a2b246723159816c3da216608d43037f Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 20 Aug 2019 19:46:52 +0300 Subject: [PATCH] vm: implement EQUAL via reflection Fixes failing tests. --- pkg/vm/vm.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 420becec2..d4493d5fc 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -9,6 +9,7 @@ import ( "math/big" "os" "text/tabwriter" + "reflect" "github.com/CityOfZion/neo-go/pkg/util" "golang.org/x/crypto/ripemd160" @@ -349,7 +350,9 @@ func (v *VM) execute(ctx *Context, op Instruction) { v.estack.Pop() case EQUAL: - panic("TODO EQUAL") + b := v.estack.Pop() + a := v.estack.Pop() + v.estack.PushVal(reflect.DeepEqual(a,b)) // Bit operations. case AND: