mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-05 23:55:11 +00:00
Merge pull request #1346 from nspcc-dev/string-tryboolean
Fail converting long strings to boolean
This commit is contained in:
commit
e5813ae8cd
9 changed files with 77 additions and 46 deletions
|
@ -401,6 +401,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