vm: revert bool -> []byte conversion to NEO 2.x

This commit is contained in:
Evgenii Stratonikov 2019-11-06 12:15:48 +03:00
parent 5544ff1768
commit 4c688355bc
2 changed files with 6 additions and 2 deletions

View file

@ -127,7 +127,9 @@ func (e *Element) Bytes() []byte {
if t.value {
return []byte{1}
}
return []byte{0}
// return []byte{0}
// FIXME revert when NEO 3.0 https://github.com/nspcc-dev/neo-go/issues/477
return []byte{}
default:
panic("can't convert to []byte: " + t.String())
}

View file

@ -1033,7 +1033,9 @@ 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)
// 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)
}
func TestARRAYSIZEArray(t *testing.T) {