diff --git a/opcode_test.go b/opcode_test.go index dbbecd30..b3ce43d2 100644 --- a/opcode_test.go +++ b/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}, diff --git a/test_coverage.txt b/test_coverage.txt index cd1b94d6..34e69f39 100644 --- a/test_coverage.txt +++ b/test_coverage.txt @@ -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)