From 5dba30a49d51359d30e617e4d23862e78d1f93b6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 15 Apr 2020 16:19:42 +0300 Subject: [PATCH] vm: update bool -> []byte conversion to NEO 3 This reverts commit 4c688355bcaa8a239d5a3ba9245273c4df7ef4d9. --- pkg/vm/stack_item.go | 4 +--- pkg/vm/vm_test.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/vm/stack_item.go b/pkg/vm/stack_item.go index 19c5ea6e3..b6ed046a4 100644 --- a/pkg/vm/stack_item.go +++ b/pkg/vm/stack_item.go @@ -341,9 +341,7 @@ func (i *BoolItem) Bytes() []byte { if i.value { return []byte{1} } - // return []byte{0} - // FIXME revert when NEO 3.0 https://github.com/nspcc-dev/neo-go/issues/477 - return []byte{} + return []byte{0} } // TryBytes implements StackItem interface. diff --git a/pkg/vm/vm_test.go b/pkg/vm/vm_test.go index 7b911d5d8..4f655870c 100644 --- a/pkg/vm/vm_test.go +++ b/pkg/vm/vm_test.go @@ -1505,9 +1505,7 @@ func TestSIZEBool(t *testing.T) { vm.estack.PushVal(false) runVM(t, vm) assert.Equal(t, 1, vm.estack.Len()) - // assert.Equal(t, makeStackItem(1), vm.estack.Pop().value) - // FIXME revert when NEO 3.0 https://github.com/nspcc-dev/neo-go/issues/477 - assert.Equal(t, makeStackItem(0), vm.estack.Pop().value) + assert.Equal(t, makeStackItem(1), vm.estack.Pop().value) } func TestARRAYSIZEArray(t *testing.T) {