diff --git a/pkg/core/blockchain_test.go b/pkg/core/blockchain_test.go index 1b9ba1af4..75b696b17 100644 --- a/pkg/core/blockchain_test.go +++ b/pkg/core/blockchain_test.go @@ -354,6 +354,17 @@ func TestVerifyHashAgainstScript(t *testing.T) { err := bc.verifyHashAgainstScript(hash.Hash160(verif), w, ic, false, gas) require.True(t, errors.Is(err, ErrVerificationFailed)) }) + t.Run("BadResult", func(t *testing.T) { + verif := make([]byte, 66) + verif[0] = byte(opcode.PUSHDATA1) + verif[1] = 64 + w := &transaction.Witness{ + InvocationScript: []byte{byte(opcode.NOP)}, + VerificationScript: verif, + } + err := bc.verifyHashAgainstScript(hash.Hash160(verif), w, ic, false, gas) + require.True(t, errors.Is(err, ErrVerificationFailed)) + }) t.Run("TooManyResults", func(t *testing.T) { verif := []byte{byte(opcode.NOP)} w := &transaction.Witness{ diff --git a/pkg/vm/stackitem/item.go b/pkg/vm/stackitem/item.go index 54d485bfd..c20701b50 100644 --- a/pkg/vm/stackitem/item.go +++ b/pkg/vm/stackitem/item.go @@ -507,7 +507,7 @@ func (i *ByteArray) String() string { // TryBool implements Item interface. func (i *ByteArray) TryBool() (bool, error) { if len(i.value) > MaxBigIntegerSizeBits/8 { - return true, nil + return false, errors.New("too big byte string") } for _, b := range i.value { if b != 0 { diff --git a/pkg/vm/testdata/neo-vm b/pkg/vm/testdata/neo-vm index 359e8631e..377464ed4 160000 --- a/pkg/vm/testdata/neo-vm +++ b/pkg/vm/testdata/neo-vm @@ -1 +1 @@ -Subproject commit 359e8631ee2ddfefe8261afcec1a5bab9d9bddf9 +Subproject commit 377464ed475a3de108e1bf9c834bd2279b72624e