mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 23:55:11 +00:00
stackitem: return error in TryBytes() for big byte strings
Follow neo-project/neo-vm#349.
This commit is contained in:
parent
a7670303e8
commit
93f51f922a
3 changed files with 13 additions and 2 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue