diff --git a/pkg/compiler/convert_test.go b/pkg/compiler/convert_test.go index 787af553f..0bcd8eace 100644 --- a/pkg/compiler/convert_test.go +++ b/pkg/compiler/convert_test.go @@ -46,7 +46,7 @@ func TestConvert(t *testing.T) { {"int64", "[]byte{0, 1, 0}", big.NewInt(256)}, {"int64", "[]byte{0}", big.NewInt(0)}, {"[]byte", "true", []byte{1}}, - {"[]byte", "false", []byte{}}, + {"[]byte", "false", []byte{0}}, {"[]byte", "12", []byte{0x0C}}, {"[]byte", "0", []byte{}}, {"[]byte", "[]byte{0, 1, 0}", []byte{0, 1, 0}}, diff --git a/pkg/compiler/struct_test.go b/pkg/compiler/struct_test.go index 3cca26fd7..aa0da998e 100644 --- a/pkg/compiler/struct_test.go +++ b/pkg/compiler/struct_test.go @@ -274,7 +274,7 @@ var structTestCases = []testCase{ vm.NewBigIntegerItem(big.NewInt(1)), vm.NewBigIntegerItem(big.NewInt(2)), vm.NewByteArrayItem([]byte("hello")), - vm.NewByteArrayItem([]byte{}), + vm.NewBoolItem(false), }, }, { diff --git a/pkg/vm/emit/emit.go b/pkg/vm/emit/emit.go index 1401d4364..f510efb7d 100644 --- a/pkg/vm/emit/emit.go +++ b/pkg/vm/emit/emit.go @@ -31,6 +31,7 @@ func Bool(w *io.BinWriter, ok bool) { return } Opcode(w, opcode.PUSHF) + Instruction(w, opcode.CONVERT, []byte{0x20}) // 0x20 for Boolean type } func padRight(s int, buf []byte) []byte {