check that OP_CHECK_MULTISIG also triggers on too many ops
This commit is contained in:
parent
bac455cdd2
commit
25624bc6a7
2 changed files with 216 additions and 2 deletions
214
opcode_test.go
214
opcode_test.go
|
@ -2819,6 +2819,220 @@ var detailedTests = []detailedTest{
|
|||
expectedReturn: btcscript.StackErrTooManyOperations,
|
||||
disassembly: "OP_1 OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP",
|
||||
},
|
||||
{
|
||||
// 202 operations + one push
|
||||
name: "too many operations multisig",
|
||||
script: []byte{btcscript.OP_1,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_DUP,
|
||||
btcscript.OP_DROP,
|
||||
btcscript.OP_1,
|
||||
btcscript.OP_1,
|
||||
btcscript.OP_1,
|
||||
btcscript.OP_1,
|
||||
btcscript.OP_2,
|
||||
btcscript.OP_CHECK_MULTISIG,
|
||||
},
|
||||
expectedReturn: btcscript.StackErrTooManyOperations,
|
||||
disassembly: "OP_1 OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_DUP OP_DROP OP_1 OP_1 OP_1 OP_1 OP_2 OP_CHECK_MULTISIG",
|
||||
},
|
||||
{
|
||||
name: "OP_CAT disabled",
|
||||
script: []byte{btcscript.OP_CAT},
|
||||
|
|
|
@ -118,7 +118,7 @@ github.com/conformal/btcscript/script.go isPubkey 100.00% (1/1)
|
|||
github.com/conformal/btcscript/stack.go Stack.PushBool 100.00% (1/1)
|
||||
github.com/conformal/btcscript/script.go Script.subScript 100.00% (1/1)
|
||||
github.com/conformal/btcscript/log.go UseLogger 100.00% (1/1)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSig 96.43% (54/56)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCheckMultiSig 98.21% (55/56)
|
||||
github.com/conformal/btcscript/opcode.go opcodeCheckSig 96.15% (25/26)
|
||||
github.com/conformal/btcscript/script.go NewScript 95.24% (20/21)
|
||||
github.com/conformal/btcscript/address.go ScriptToAddress 94.92% (56/59)
|
||||
|
@ -135,5 +135,5 @@ github.com/conformal/btcscript/opcode.go opcodeSha1 60.00% (3/5)
|
|||
github.com/conformal/btcscript/script.go Script.Execute 44.44% (8/18)
|
||||
github.com/conformal/btcscript/log.go SetLogWriter 0.00% (0/7)
|
||||
github.com/conformal/btcscript/log.go logClosure.String 0.00% (0/1)
|
||||
github.com/conformal/btcscript -------------------------- 93.87% (842/897)
|
||||
github.com/conformal/btcscript -------------------------- 93.98% (843/897)
|
||||
|
||||
|
|
Loading…
Reference in a new issue