diff --git a/opcode_test.go b/opcode_test.go index 298292c5..4615019a 100644 --- a/opcode_test.go +++ b/opcode_test.go @@ -542,8 +542,8 @@ type detailedTest struct { altafter [][]byte disassembly string disassemblyerr error - nSigOps int // should have same return as disassembly error - nPreciseSigOps int // should have same return as disassembly error + nSigOps int // should have same return as disassembly error + nPreciseSigOps int // should have same return as disassembly error } var detailedTests = []detailedTest{ @@ -2117,7 +2117,7 @@ var detailedTests = []detailedTest{ script: []byte{btcscript.OP_1, btcscript.OP_CHECKSIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 OP_CHECKSIG", - nSigOps: 1, + nSigOps: 1, nPreciseSigOps: 1, }, { @@ -2125,7 +2125,7 @@ var detailedTests = []detailedTest{ script: []byte{btcscript.OP_CHECKSIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_CHECKSIG", - nSigOps: 1, + nSigOps: 1, nPreciseSigOps: 1, }, { @@ -2134,7 +2134,7 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKSIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 OP_CHECKSIGVERIFY", - nSigOps: 1, + nSigOps: 1, nPreciseSigOps: 1, }, { @@ -2142,7 +2142,7 @@ var detailedTests = []detailedTest{ script: []byte{btcscript.OP_CHECKSIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_CHECKSIGVERIFY", - nSigOps: 1, + nSigOps: 1, nPreciseSigOps: 1, }, { @@ -2150,7 +2150,7 @@ var detailedTests = []detailedTest{ script: []byte{btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_CHECK_MULTISIG", - nSigOps: 20, + nSigOps: 20, nPreciseSigOps: 20, }, { @@ -2160,8 +2160,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrNumberTooBig, disassembly: "010203040506070809 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 20, + nSigOps: 20, + nPreciseSigOps: 20, }, { name: "OP_CHECK_MULTISIG too many keys", @@ -2169,8 +2169,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrTooManyPubkeys, disassembly: "15 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 20, + nSigOps: 20, + nPreciseSigOps: 20, }, { name: "OP_CHECK_MULTISIG lying about pubkeys", @@ -2178,8 +2178,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // pubkey comes from blockchain @@ -2198,8 +2198,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // pubkey comes from blockchain @@ -2220,8 +2220,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrNumberTooBig, disassembly: "010203040506070809 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { name: "OP_CHECK_MULTISIG too few sigs", @@ -2239,8 +2239,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECK_MULTISIG}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // pubkey and sig comes from blockchain, are unrelated @@ -2267,10 +2267,10 @@ var detailedTests = []detailedTest{ 0xd8, 0x4c, btcscript.OP_1, btcscript.OP_CHECK_MULTISIG}, - after: [][]byte{{0}}, - disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + after: [][]byte{{0}}, + disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECK_MULTISIG", + nSigOps: 20, + nPreciseSigOps: 1, }, { // invalid pubkey means that it fails to validate, not an @@ -2290,10 +2290,10 @@ var detailedTests = []detailedTest{ btcscript.OP_1, btcscript.OP_1, btcscript.OP_1, btcscript.OP_CHECK_MULTISIG}, - after: [][]byte{{0}}, - disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 OP_1 OP_1 OP_CHECK_MULTISIG", - nSigOps: 20, - nPreciseSigOps: 1, + after: [][]byte{{0}}, + disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 OP_1 OP_1 OP_CHECK_MULTISIG", + nSigOps: 20, + nPreciseSigOps: 1, }, // XXX(oga) Test multisig when extra arg is missing. needs valid sig. // disabled opcodes @@ -2302,8 +2302,8 @@ var detailedTests = []detailedTest{ script: []byte{btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 20, + nSigOps: 20, + nPreciseSigOps: 20, }, { name: "OP_CHECKMULTISIGVERIFY huge number", @@ -2312,8 +2312,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrNumberTooBig, disassembly: "010203040506070809 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 20, + nSigOps: 20, + nPreciseSigOps: 20, }, { name: "OP_CHECKMULTISIGVERIFY too many keys", @@ -2321,8 +2321,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrTooManyPubkeys, disassembly: "15 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 20, + nSigOps: 20, + nPreciseSigOps: 20, }, { name: "OP_CHECKMULTISIGVERIFY lying about pubkeys", @@ -2330,8 +2330,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // pubkey comes from blockchain @@ -2350,8 +2350,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { name: "OP_CHECKMULTISIGVERIFY sigs huge no", @@ -2371,8 +2371,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrNumberTooBig, disassembly: "010203040506070809 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { name: "OP_CHECKMULTISIGVERIFY too few sigs", @@ -2390,8 +2390,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrUnderflow, disassembly: "OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // pubkey and sig comes from blockchain, are unrelated @@ -2420,8 +2420,8 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrVerifyFailed, disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 04ae1a62fe09c5f51b13905f07f06b99a2f7159b2225f374cd378d71302fa28414e7aab37397f554a7df5f142c21c1b7303b8a0626f1baded5c72a704f7e6cd84c OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // invalid pubkey means that it fails to validate, not an @@ -2443,643 +2443,643 @@ var detailedTests = []detailedTest{ btcscript.OP_CHECKMULTISIGVERIFY}, expectedReturn: btcscript.StackErrVerifyFailed, disassembly: "OP_1 304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901 OP_1 OP_1 OP_1 OP_CHECKMULTISIGVERIFY", - nSigOps: 20, - nPreciseSigOps: 1, + nSigOps: 20, + nPreciseSigOps: 1, }, { // 201 operations + one push, should just fit limits name: "max operations", 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_DUP, + 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_DUP, }, - after: [][]byte{{1}, {1}}, - 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", + after: [][]byte{{1}, {1}}, + 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", }, { // 202 operations + one push name: "too many operations", 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_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_DUP, + btcscript.OP_DROP, + btcscript.OP_DUP, + btcscript.OP_DROP, }, 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", + 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, + 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", - nSigOps: 20, - nPreciseSigOps: 2, + 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", + nSigOps: 20, + nPreciseSigOps: 2, }, { name: "OP_CAT disabled", @@ -3802,14 +3802,14 @@ func TestSigOps(t *testing.T) { continue } if test.disassemblyerr != nil { - t.Errorf("%s: no error when expected \"%v\"", + t.Errorf("%s: no error when expected \"%v\"", test.name, test.disassemblyerr) continue } if count != test.nSigOps { t.Errorf("%s: expected count of %d, got %d", test.name, test.nSigOps, count) - + } } } @@ -3834,14 +3834,14 @@ func TestPreciseSigOps(t *testing.T) { continue } if test.disassemblyerr != nil { - t.Errorf("%s: no error when expected \"%v\"", + t.Errorf("%s: no error when expected \"%v\"", test.name, test.disassemblyerr) continue } if count != test.nPreciseSigOps { t.Errorf("%s: expected count of %d, got %d", test.name, test.nPreciseSigOps, count) - + } } } diff --git a/script.go b/script.go index 8fc9e3dc..7cbef226 100644 --- a/script.go +++ b/script.go @@ -718,7 +718,7 @@ func (s *Script) SetAltStack(data [][]byte) { // GetSigOpCount provides a quick count of the number of signature operations // in a script. a CHECKSIG operations counts for 1, and a CHECK_MULTISIG for 20. -func GetSigOpCount(script [] byte) (int, error) { +func GetSigOpCount(script []byte) (int, error) { pops, err := parseScript(script) if err != nil { return 0, err @@ -751,7 +751,7 @@ func GetPreciseSigOpCount(scriptSig, scriptPubKey []byte, bip16 bool) (int, erro return 0, nil } - shScript := sigPops[len(sigPops) - 1].data + shScript := sigPops[len(sigPops)-1].data // Means that sigPops is jus OP_1 - OP_16, no sigops there. if shScript == nil { return 0, nil @@ -774,20 +774,20 @@ func getSigOpCount(pops []parsedOpcode, precise bool) int { for i, pop := range pops { switch pop.opcode.value { case OP_CHECKSIG: - fallthrough; + fallthrough case OP_CHECKSIGVERIFY: nSigs++ case OP_CHECK_MULTISIG: - fallthrough; + fallthrough case OP_CHECKMULTISIGVERIFY: // If we are being precise then look for familiar // patterns for multisig, for now all we recognise is - // OP_1 - OP_16 to signify the number of pubkeys. + // OP_1 - OP_16 to signify the number of pubkeys. // Otherwise, we use the max of 20. if precise && i > 0 && - pops[i - 1].opcode.value >= OP_1 && - pops[i - 1].opcode.value <= OP_16 { - nSigs += int(pops[i-1].opcode.value - + pops[i-1].opcode.value >= OP_1 && + pops[i-1].opcode.value <= OP_16 { + nSigs += int(pops[i-1].opcode.value - (OP_1 - 1)) } else { nSigs += MaxPubKeysPerMultiSig diff --git a/script_test.go b/script_test.go index 69642531..0a4a69f9 100644 --- a/script_test.go +++ b/script_test.go @@ -121,7 +121,7 @@ var txTests = []txTest{ 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, btcscript.OP_CHECKSIG, }, - idx: 0, + idx: 0, nSigOps: 1, }, // Previous test with the value of one output changed. @@ -221,8 +221,8 @@ var txTests = []txTest{ 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, btcscript.OP_CHECKSIG, }, - idx: 0, - err: btcscript.StackErrScriptFailed, + idx: 0, + err: btcscript.StackErrScriptFailed, nSigOps: 1, }, txTest{ @@ -325,7 +325,7 @@ var txTests = []txTest{ }, idx: 0, shouldFail: true, - nSigOps: 1, + nSigOps: 1, }, txTest{ name: "CheckSig invalid pubkey", @@ -426,7 +426,7 @@ var txTests = []txTest{ }, idx: 0, shouldFail: true, - nSigOps: 1, + nSigOps: 1, }, // tx 599e47a8114fe098103663029548811d2651991b62397e057f0c863c2bc9f9ea // uses checksig with SigHashNone. @@ -526,8 +526,8 @@ var txTests = []txTest{ btcscript.OP_EQUALVERIFY, btcscript.OP_CHECKSIG, }, - idx: 0, - bip16: true, // after threshold + idx: 0, + bip16: true, // after threshold nSigOps: 1, }, // tx 51bf528ecf3c161e7c021224197dbe84f9a8564212f6207baa014c01a1668e1e @@ -650,8 +650,8 @@ var txTests = []txTest{ btcscript.OP_EQUALVERIFY, btcscript.OP_CHECKSIG, }, - idx: 0, - bip16: true, // after threshold + idx: 0, + bip16: true, // after threshold nSigOps: 1, }, // tx 6d36bc17e947ce00bb6f12f8e7a56a1585c5a36188ffa2b05e10b4743273a74b @@ -773,8 +773,8 @@ var txTests = []txTest{ 0x4f, 0x13, btcscript.OP_NOP2, btcscript.OP_DROP, }, - idx: 1, - bip16: false, + idx: 1, + bip16: false, nSigOps: 0, // multisig is in the pkScript! }, // same as previous but with one byte changed to make signature fail @@ -895,9 +895,9 @@ var txTests = []txTest{ 0x4f, 0x13, btcscript.OP_NOP2, btcscript.OP_DROP, }, - idx: 1, - bip16: false, - err: btcscript.StackErrScriptFailed, + idx: 1, + bip16: false, + err: btcscript.StackErrScriptFailed, nSigOps: 0, // multisig is in the pkScript! }, // tx e5779b9e78f9650debc2893fd9636d827b26b4ddfa6a8172fe8708c924f5c39d @@ -955,8 +955,8 @@ var txTests = []txTest{ 0xae, 0x88, btcscript.OP_EQUAL, }, - idx: 0, - bip16: true, + idx: 0, + bip16: true, nSigOps: 0, // no signature ops in the pushed script. }, } @@ -1014,7 +1014,7 @@ func TestGetPreciseSignOps(t *testing.T) { if count != test.nSigOps { t.Errorf("%s: expected count of %d, got %d", test.name, test.nSigOps, count) - + } } } @@ -1302,12 +1302,12 @@ func TestBadPC(t *testing.T) { } pcTests := []pcTest{ pcTest{ - script:2, - off:0, + script: 2, + off: 0, }, pcTest{ script: 0, - off: 2, + off: 2, }, } // tx with almost empty scripts. @@ -1329,12 +1329,12 @@ func TestBadPC(t *testing.T) { Index: 0, }, SignatureScript: []uint8{btcscript.OP_NOP}, - Sequence: 4294967295, + Sequence: 4294967295, }, }, TxOut: []*btcwire.TxOut{ &btcwire.TxOut{ - Value: 1000000000, + Value: 1000000000, PkScript: []byte{}, }, }, @@ -1343,7 +1343,7 @@ func TestBadPC(t *testing.T) { pkScript := []byte{btcscript.OP_NOP} for _, test := range pcTests { - engine, err := btcscript.NewScript(tx.TxIn[0].SignatureScript, + engine, err := btcscript.NewScript(tx.TxIn[0].SignatureScript, pkScript, 0, tx, 70001, false) if err != nil { t.Errorf("Failed to create script: %v", err) @@ -1388,12 +1388,12 @@ func TestCheckErrorCondition(t *testing.T) { Index: 0, }, SignatureScript: []uint8{}, - Sequence: 4294967295, + Sequence: 4294967295, }, }, TxOut: []*btcwire.TxOut{ &btcwire.TxOut{ - Value: 1000000000, + Value: 1000000000, PkScript: []byte{}, }, }, @@ -1419,7 +1419,7 @@ func TestCheckErrorCondition(t *testing.T) { t.Errorf("failed to create script: %v", err) } - for i := 0; i < len(pkScript) - 1; i++ { + for i := 0; i < len(pkScript)-1; i++ { done, err := engine.Step() if err != nil { t.Errorf("failed to step %dth time: %v", i, err) @@ -1452,4 +1452,3 @@ func TestCheckErrorCondition(t *testing.T) { t.Errorf("unexpected error %v on final check", err) } } - diff --git a/stack_test.go b/stack_test.go index 942a227d..f6c6e77c 100644 --- a/stack_test.go +++ b/stack_test.go @@ -235,7 +235,7 @@ var stackTests = []stackTest{ [][]byte{}, }, { - "PushInt 0", + "PushInt 0", [][]byte{}, func(stack *btcscript.Stack) error { stack.PushInt(big.NewInt(0)) @@ -245,7 +245,7 @@ var stackTests = []stackTest{ [][]byte{{}}, }, { - "PushInt 1", + "PushInt 1", [][]byte{}, func(stack *btcscript.Stack) error { stack.PushInt(big.NewInt(1)) @@ -255,7 +255,7 @@ var stackTests = []stackTest{ [][]byte{{0x1}}, }, { - "PushInt -1", + "PushInt -1", [][]byte{}, func(stack *btcscript.Stack) error { stack.PushInt(big.NewInt(-1)) @@ -265,7 +265,7 @@ var stackTests = []stackTest{ [][]byte{{0x81}}, }, { - "PushInt two bytes", + "PushInt two bytes", [][]byte{}, func(stack *btcscript.Stack) error { stack.PushInt(big.NewInt(256)) @@ -276,7 +276,7 @@ var stackTests = []stackTest{ [][]byte{{0x00, 0x01}}, }, { - "PushInt leading zeros", + "PushInt leading zeros", [][]byte{}, func(stack *btcscript.Stack) error { // this will have the highbit set @@ -284,7 +284,7 @@ var stackTests = []stackTest{ return nil }, nil, - [][]byte{{0x80, 0x00 }}, + [][]byte{{0x80, 0x00}}, }, { "dup",