From fca8da0b15f503c714d7947dfde252a21ce48a3a Mon Sep 17 00:00:00 2001 From: Mike Zak Date: Sun, 1 Jul 2018 11:38:40 +0300 Subject: [PATCH 1/2] [DEV-47] Removed legacy doUpgrades contents, and only left it as a placeholder for future generations --- upgrade.go | 168 +---------------------------------------------------- 1 file changed, 2 insertions(+), 166 deletions(-) diff --git a/upgrade.go b/upgrade.go index 5dec8d4c6..ca6b74641 100644 --- a/upgrade.go +++ b/upgrade.go @@ -4,172 +4,8 @@ package main -import ( - "io" - "os" - "path/filepath" -) - -// dirEmpty returns whether or not the specified directory path is empty. -func dirEmpty(dirPath string) (bool, error) { - f, err := os.Open(dirPath) - if err != nil { - return false, err - } - defer f.Close() - - // Read the names of a max of one entry from the directory. When the - // directory is empty, an io.EOF error will be returned, so allow it. - names, err := f.Readdirnames(1) - if err != nil && err != io.EOF { - return false, err - } - - return len(names) == 0, nil -} - -// oldBtcdHomeDir returns the OS specific home directory btcd used prior to -// version 0.3.3. This has since been replaced with btcutil.AppDataDir, but -// this function is still provided for the automatic upgrade path. -func oldBtcdHomeDir() string { - // Search for Windows APPDATA first. This won't exist on POSIX OSes. - appData := os.Getenv("APPDATA") - if appData != "" { - return filepath.Join(appData, "btcd") - } - - // Fall back to standard HOME directory that works for most POSIX OSes. - home := os.Getenv("HOME") - if home != "" { - return filepath.Join(home, ".btcd") - } - - // In the worst case, use the current directory. - return "." -} - -// upgradeDBPathNet moves the database for a specific network from its -// location prior to btcd version 0.2.0 and uses heuristics to ascertain the old -// database type to rename to the new format. -func upgradeDBPathNet(oldDbPath, netName string) error { - // Prior to version 0.2.0, the database was named the same thing for - // both sqlite and leveldb. Use heuristics to figure out the type - // of the database and move it to the new path and name introduced with - // version 0.2.0 accordingly. - fi, err := os.Stat(oldDbPath) - if err == nil { - oldDbType := "sqlite" - if fi.IsDir() { - oldDbType = "leveldb" - } - - // The new database name is based on the database type and - // resides in a directory named after the network type. - newDbRoot := filepath.Join(filepath.Dir(cfg.DataDir), netName) - newDbName := blockDbNamePrefix + "_" + oldDbType - if oldDbType == "sqlite" { - newDbName = newDbName + ".db" - } - newDbPath := filepath.Join(newDbRoot, newDbName) - - // Create the new path if needed. - err = os.MkdirAll(newDbRoot, 0700) - if err != nil { - return err - } - - // Move and rename the old database. - err := os.Rename(oldDbPath, newDbPath) - if err != nil { - return err - } - } - - return nil -} - -// upgradeDBPaths moves the databases from their locations prior to btcd -// version 0.2.0 to their new locations. -func upgradeDBPaths() error { - // Prior to version 0.2.0, the databases were in the "db" directory and - // their names were suffixed by "testnet" and "regtest" for their - // respective networks. Check for the old database and update it to the - // new path introduced with version 0.2.0 accordingly. - oldDbRoot := filepath.Join(oldBtcdHomeDir(), "db") - upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd.db"), "mainnet") - upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_testnet.db"), "testnet") - upgradeDBPathNet(filepath.Join(oldDbRoot, "btcd_regtest.db"), "regtest") - - // Remove the old db directory. - return os.RemoveAll(oldDbRoot) -} - -// upgradeDataPaths moves the application data from its location prior to btcd -// version 0.3.3 to its new location. -func upgradeDataPaths() error { - // No need to migrate if the old and new home paths are the same. - oldHomePath := oldBtcdHomeDir() - newHomePath := defaultHomeDir - if oldHomePath == newHomePath { - return nil - } - - // Only migrate if the old path exists and the new one doesn't. - if fileExists(oldHomePath) && !fileExists(newHomePath) { - // Create the new path. - btcdLog.Infof("Migrating application home path from '%s' to '%s'", - oldHomePath, newHomePath) - err := os.MkdirAll(newHomePath, 0700) - if err != nil { - return err - } - - // Move old btcd.conf into new location if needed. - oldConfPath := filepath.Join(oldHomePath, defaultConfigFilename) - newConfPath := filepath.Join(newHomePath, defaultConfigFilename) - if fileExists(oldConfPath) && !fileExists(newConfPath) { - err := os.Rename(oldConfPath, newConfPath) - if err != nil { - return err - } - } - - // Move old data directory into new location if needed. - oldDataPath := filepath.Join(oldHomePath, defaultDataDirname) - newDataPath := filepath.Join(newHomePath, defaultDataDirname) - if fileExists(oldDataPath) && !fileExists(newDataPath) { - err := os.Rename(oldDataPath, newDataPath) - if err != nil { - return err - } - } - - // Remove the old home if it is empty or show a warning if not. - ohpEmpty, err := dirEmpty(oldHomePath) - if err != nil { - return err - } - if ohpEmpty { - err := os.Remove(oldHomePath) - if err != nil { - return err - } - } else { - btcdLog.Warnf("Not removing '%s' since it contains files "+ - "not created by this application. You may "+ - "want to manually move them or delete them.", - oldHomePath) - } - } - - return nil -} - // doUpgrades performs upgrades to btcd as new versions require it. +// currently it's a placeholder we got from btcd upstream, that does nothing func doUpgrades() error { - err := upgradeDBPaths() - if err != nil { - return err - } - return upgradeDataPaths() + return nil } From 8195acd0bba46e3fffb0304bac4ccc24755723f5 Mon Sep 17 00:00:00 2001 From: Svarog Date: Sun, 1 Jul 2018 15:52:05 +0300 Subject: [PATCH 2/2] [DEV-49] Renamed all opcodes consts to be CamelCase (#16) --- blockchain/compress.go | 48 +- blockchain/fullblocktests/generate.go | 62 +- blockchain/validate.go | 6 +- mempool/policy_test.go | 48 +- mining/mining.go | 2 +- txscript/engine.go | 4 +- txscript/engine_test.go | 4 +- txscript/example_test.go | 2 +- txscript/opcode.go | 1100 ++++++++++++------------- txscript/opcode_test.go | 6 +- txscript/reference_test.go | 6 +- txscript/script.go | 40 +- txscript/script_test.go | 972 +++++++++++----------- txscript/scriptbuilder.go | 22 +- txscript/scriptbuilder_test.go | 154 ++-- txscript/sign.go | 6 +- txscript/sign_test.go | 2 +- txscript/standard.go | 72 +- txscript/standard_test.go | 22 +- 19 files changed, 1289 insertions(+), 1289 deletions(-) diff --git a/blockchain/compress.go b/blockchain/compress.go index c7f48a5ad..2804e1a8c 100644 --- a/blockchain/compress.go +++ b/blockchain/compress.go @@ -175,11 +175,11 @@ const ( // standard pay-to-pubkey-hash script along with the pubkey hash it is paying to // if it is. func isPubKeyHash(script []byte) (bool, []byte) { - if len(script) == 25 && script[0] == txscript.OP_DUP && - script[1] == txscript.OP_HASH160 && - script[2] == txscript.OP_DATA_20 && - script[23] == txscript.OP_EQUALVERIFY && - script[24] == txscript.OP_CHECKSIG { + if len(script) == 25 && script[0] == txscript.OpDup && + script[1] == txscript.OpHash160 && + script[2] == txscript.OpData20 && + script[23] == txscript.OpEqualVerify && + script[24] == txscript.OpCheckSig { return true, script[3:23] } @@ -191,9 +191,9 @@ func isPubKeyHash(script []byte) (bool, []byte) { // standard pay-to-script-hash script along with the script hash it is paying to // if it is. func isScriptHash(script []byte) (bool, []byte) { - if len(script) == 23 && script[0] == txscript.OP_HASH160 && - script[1] == txscript.OP_DATA_20 && - script[22] == txscript.OP_EQUAL { + if len(script) == 23 && script[0] == txscript.OpHash160 && + script[1] == txscript.OpData20 && + script[22] == txscript.OpEqual { return true, script[2:22] } @@ -212,8 +212,8 @@ func isScriptHash(script []byte) (bool, []byte) { // to a valid compressed or uncompressed pubkey. func isPubKey(script []byte) (bool, []byte) { // Pay-to-compressed-pubkey script. - if len(script) == 35 && script[0] == txscript.OP_DATA_33 && - script[34] == txscript.OP_CHECKSIG && (script[1] == 0x02 || + if len(script) == 35 && script[0] == txscript.OpData33 && + script[34] == txscript.OpCheckSig && (script[1] == 0x02 || script[1] == 0x03) { // Ensure the public key is valid. @@ -225,8 +225,8 @@ func isPubKey(script []byte) (bool, []byte) { } // Pay-to-uncompressed-pubkey script. - if len(script) == 67 && script[0] == txscript.OP_DATA_65 && - script[66] == txscript.OP_CHECKSIG && script[1] == 0x04 { + if len(script) == 67 && script[0] == txscript.OpData65 && + script[66] == txscript.OpCheckSig && script[1] == 0x04 { // Ensure the public key is valid. serializedPubKey := script[1:66] @@ -361,32 +361,32 @@ func decompressScript(compressedPkScript []byte) []byte { // <20 byte hash> case cstPayToPubKeyHash: pkScript := make([]byte, 25) - pkScript[0] = txscript.OP_DUP - pkScript[1] = txscript.OP_HASH160 - pkScript[2] = txscript.OP_DATA_20 + pkScript[0] = txscript.OpDup + pkScript[1] = txscript.OpHash160 + pkScript[2] = txscript.OpData20 copy(pkScript[3:], compressedPkScript[bytesRead:bytesRead+20]) - pkScript[23] = txscript.OP_EQUALVERIFY - pkScript[24] = txscript.OP_CHECKSIG + pkScript[23] = txscript.OpEqualVerify + pkScript[24] = txscript.OpCheckSig return pkScript // Pay-to-script-hash script. The resulting script is: // <20 byte script hash> case cstPayToScriptHash: pkScript := make([]byte, 23) - pkScript[0] = txscript.OP_HASH160 - pkScript[1] = txscript.OP_DATA_20 + pkScript[0] = txscript.OpHash160 + pkScript[1] = txscript.OpData20 copy(pkScript[2:], compressedPkScript[bytesRead:bytesRead+20]) - pkScript[22] = txscript.OP_EQUAL + pkScript[22] = txscript.OpEqual return pkScript // Pay-to-compressed-pubkey script. The resulting script is: // <33 byte compressed pubkey> case cstPayToPubKeyComp2, cstPayToPubKeyComp3: pkScript := make([]byte, 35) - pkScript[0] = txscript.OP_DATA_33 + pkScript[0] = txscript.OpData33 pkScript[1] = byte(encodedScriptSize) copy(pkScript[2:], compressedPkScript[bytesRead:bytesRead+32]) - pkScript[34] = txscript.OP_CHECKSIG + pkScript[34] = txscript.OpCheckSig return pkScript // Pay-to-uncompressed-pubkey script. The resulting script is: @@ -405,9 +405,9 @@ func decompressScript(compressedPkScript []byte) []byte { } pkScript := make([]byte, 67) - pkScript[0] = txscript.OP_DATA_65 + pkScript[0] = txscript.OpData65 copy(pkScript[1:], key.SerializeUncompressed()) - pkScript[66] = txscript.OP_CHECKSIG + pkScript[66] = txscript.OpCheckSig return pkScript } diff --git a/blockchain/fullblocktests/generate.go b/blockchain/fullblocktests/generate.go index ae44edd6f..39b92b5d6 100644 --- a/blockchain/fullblocktests/generate.go +++ b/blockchain/fullblocktests/generate.go @@ -46,7 +46,7 @@ const ( var ( // opTrueScript is simply a public key script that contains the OP_TRUE // opcode. It is defined here to reduce garbage creation. - opTrueScript = []byte{txscript.OP_TRUE} + opTrueScript = []byte{txscript.OpTrue} // lowFee is a single satoshi and exists to make the test code more // readable. @@ -218,8 +218,8 @@ func makeTestGenerator(params *chaincfg.Params) (testGenerator, error) { func payToScriptHashScript(redeemScript []byte) []byte { redeemScriptHash := btcutil.Hash160(redeemScript) script, err := txscript.NewScriptBuilder(). - AddOp(txscript.OP_HASH160).AddData(redeemScriptHash). - AddOp(txscript.OP_EQUAL).Script() + AddOp(txscript.OpHash160).AddData(redeemScriptHash). + AddOp(txscript.OpEqual).Script() if err != nil { panic(err) } @@ -252,7 +252,7 @@ func standardCoinbaseScript(blockHeight int32, extraNonce uint64) ([]byte, error // provided data. func opReturnScript(data []byte) []byte { builder := txscript.NewScriptBuilder() - script, err := builder.AddOp(txscript.OP_RETURN).AddData(data).Script() + script, err := builder.AddOp(txscript.OpReturn).AddData(data).Script() if err != nil { panic(err) } @@ -774,7 +774,7 @@ func (g *testGenerator) assertTipBlockTxOutOpReturn(txIndex, txOutIndex uint32) } txOut := tx.TxOut[txOutIndex] - if txOut.PkScript[0] != txscript.OP_RETURN { + if txOut.PkScript[0] != txscript.OpReturn { panic(fmt.Sprintf("transaction index %d output %d in block %q "+ "(height %d) is not an OP_RETURN", txIndex, txOutIndex, g.tipName, g.tipHeight)) @@ -1051,7 +1051,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b5(2) -> b12(3) -> b13(4) -> b15(5) // \-> b3(1) -> b4(2) g.setTip("b13") - manySigOps := repeatOpcode(txscript.OP_CHECKSIG, maxBlockSigOps) + manySigOps := repeatOpcode(txscript.OpCheckSig, maxBlockSigOps) g.nextBlock("b15", outs[5], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) accepted() @@ -1062,7 +1062,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b5(2) -> b12(3) -> b13(4) -> b15(5) // \ \-> b16(7) // \-> b3(1) -> b4(2) - tooManySigOps := repeatOpcode(txscript.OP_CHECKSIG, maxBlockSigOps+1) + tooManySigOps := repeatOpcode(txscript.OpCheckSig, maxBlockSigOps+1) g.nextBlock("b16", outs[6], replaceSpendScript(tooManySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps + 1) rejected(blockchain.ErrTooManySigOps) @@ -1203,7 +1203,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b30(7) -> b31(8) // // OP_CHECKMULTISIG counts for 20 sigops. - manySigOps = repeatOpcode(txscript.OP_CHECKMULTISIG, maxBlockSigOps/20) + manySigOps = repeatOpcode(txscript.OpCheckMultiSig, maxBlockSigOps/20) g.nextBlock("b31", outs[8], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) accepted() @@ -1215,8 +1215,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // \-> b32(9) // // OP_CHECKMULTISIG counts for 20 sigops. - tooManySigOps = repeatOpcode(txscript.OP_CHECKMULTISIG, maxBlockSigOps/20) - tooManySigOps = append(manySigOps, txscript.OP_CHECKSIG) + tooManySigOps = repeatOpcode(txscript.OpCheckMultiSig, maxBlockSigOps/20) + tooManySigOps = append(manySigOps, txscript.OpCheckSig) g.nextBlock("b32", outs[9], replaceSpendScript(tooManySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps + 1) rejected(blockchain.ErrTooManySigOps) @@ -1225,7 +1225,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // // ... -> b31(8) -> b33(9) g.setTip("b31") - manySigOps = repeatOpcode(txscript.OP_CHECKMULTISIGVERIFY, maxBlockSigOps/20) + manySigOps = repeatOpcode(txscript.OpCheckMultiSigVerify, maxBlockSigOps/20) g.nextBlock("b33", outs[9], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) accepted() @@ -1236,8 +1236,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b33(9) // \-> b34(10) // - tooManySigOps = repeatOpcode(txscript.OP_CHECKMULTISIGVERIFY, maxBlockSigOps/20) - tooManySigOps = append(manySigOps, txscript.OP_CHECKSIG) + tooManySigOps = repeatOpcode(txscript.OpCheckMultiSigVerify, maxBlockSigOps/20) + tooManySigOps = append(manySigOps, txscript.OpCheckSig) g.nextBlock("b34", outs[10], replaceSpendScript(tooManySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps + 1) rejected(blockchain.ErrTooManySigOps) @@ -1247,7 +1247,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b33(9) -> b35(10) // g.setTip("b33") - manySigOps = repeatOpcode(txscript.OP_CHECKSIGVERIFY, maxBlockSigOps) + manySigOps = repeatOpcode(txscript.OpCheckSigVerify, maxBlockSigOps) g.nextBlock("b35", outs[10], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) accepted() @@ -1258,7 +1258,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b35(10) // \-> b36(11) // - tooManySigOps = repeatOpcode(txscript.OP_CHECKSIGVERIFY, maxBlockSigOps+1) + tooManySigOps = repeatOpcode(txscript.OpCheckSigVerify, maxBlockSigOps+1) g.nextBlock("b36", outs[11], replaceSpendScript(tooManySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps + 1) rejected(blockchain.ErrTooManySigOps) @@ -1292,9 +1292,9 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // signature operations to be used in the next three blocks. const redeemScriptSigOps = 9 redeemScript := pushDataScript(g.privKey.PubKey().SerializeCompressed()) - redeemScript = append(redeemScript, bytes.Repeat([]byte{txscript.OP_2DUP, - txscript.OP_CHECKSIGVERIFY}, redeemScriptSigOps-1)...) - redeemScript = append(redeemScript, txscript.OP_CHECKSIG) + redeemScript = append(redeemScript, bytes.Repeat([]byte{txscript.Op2Dup, + txscript.OpCheckSigVerify}, redeemScriptSigOps-1)...) + redeemScript = append(redeemScript, txscript.OpCheckSig) assertScriptSigOpsCount(redeemScript, redeemScriptSigOps) // Create a block that has enough pay-to-script-hash outputs such that @@ -1351,7 +1351,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { fill := maxBlockSigOps - (txnsNeeded * redeemScriptSigOps) + 1 finalTx := b.Transactions[len(b.Transactions)-1] tx := createSpendTxForTx(finalTx, lowFee) - tx.TxOut[0].PkScript = repeatOpcode(txscript.OP_CHECKSIG, fill) + tx.TxOut[0].PkScript = repeatOpcode(txscript.OpCheckSig, fill) b.AddTransaction(tx) }) rejected(blockchain.ErrTooManySigOps) @@ -1385,7 +1385,7 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { } finalTx := b.Transactions[len(b.Transactions)-1] tx := createSpendTxForTx(finalTx, lowFee) - tx.TxOut[0].PkScript = repeatOpcode(txscript.OP_CHECKSIG, fill) + tx.TxOut[0].PkScript = repeatOpcode(txscript.OpCheckSig, fill) b.AddTransaction(tx) }) accepted() @@ -1886,8 +1886,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b69(20) // \-> b70(21) scriptSize := maxBlockSigOps + 5 + (maxScriptElementSize + 1) + 1 - tooManySigOps = repeatOpcode(txscript.OP_CHECKSIG, scriptSize) - tooManySigOps[maxBlockSigOps] = txscript.OP_PUSHDATA4 + tooManySigOps = repeatOpcode(txscript.OpCheckSig, scriptSize) + tooManySigOps[maxBlockSigOps] = txscript.OpPushData4 binary.LittleEndian.PutUint32(tooManySigOps[maxBlockSigOps+1:], maxScriptElementSize+1) g.nextBlock("b70", outs[21], replaceSpendScript(tooManySigOps)) @@ -1903,8 +1903,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // \-> b71(21) g.setTip("b69") scriptSize = maxBlockSigOps + 5 + maxScriptElementSize + 1 - tooManySigOps = repeatOpcode(txscript.OP_CHECKSIG, scriptSize) - tooManySigOps[maxBlockSigOps+1] = txscript.OP_PUSHDATA4 + tooManySigOps = repeatOpcode(txscript.OpCheckSig, scriptSize) + tooManySigOps[maxBlockSigOps+1] = txscript.OpPushData4 binary.LittleEndian.PutUint32(tooManySigOps[maxBlockSigOps+2:], 0xffffffff) g.nextBlock("b71", outs[21], replaceSpendScript(tooManySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps + 1) @@ -1919,8 +1919,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // ... -> b69(20) -> b72(21) g.setTip("b69") scriptSize = maxBlockSigOps + 5 + maxScriptElementSize - manySigOps = repeatOpcode(txscript.OP_CHECKSIG, scriptSize) - manySigOps[maxBlockSigOps] = txscript.OP_PUSHDATA4 + manySigOps = repeatOpcode(txscript.OpCheckSig, scriptSize) + manySigOps[maxBlockSigOps] = txscript.OpPushData4 binary.LittleEndian.PutUint32(manySigOps[maxBlockSigOps+1:], 0xffffffff) g.nextBlock("b72", outs[21], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) @@ -1933,8 +1933,8 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // // ... -> b72(21) -> b73(22) scriptSize = maxBlockSigOps + 5 + (maxScriptElementSize + 1) - manySigOps = repeatOpcode(txscript.OP_CHECKSIG, scriptSize) - manySigOps[maxBlockSigOps] = txscript.OP_PUSHDATA4 + manySigOps = repeatOpcode(txscript.OpCheckSig, scriptSize) + manySigOps[maxBlockSigOps] = txscript.OpPushData4 g.nextBlock("b73", outs[22], replaceSpendScript(manySigOps)) g.assertTipBlockSigOpsCount(maxBlockSigOps) accepted() @@ -1946,12 +1946,12 @@ func Generate(includeLargeReorg bool) (tests [][]TestInstance, err error) { // Create block with an invalid opcode in a dead execution path. // // ... -> b73(22) -> b74(23) - script := []byte{txscript.OP_IF, txscript.OP_INVALIDOPCODE, - txscript.OP_ELSE, txscript.OP_TRUE, txscript.OP_ENDIF} + script := []byte{txscript.OpIf, txscript.OpInvalidOpCode, + txscript.OpElse, txscript.OpTrue, txscript.OpEndIf} g.nextBlock("b74", outs[23], replaceSpendScript(script), func(b *wire.MsgBlock) { tx2 := b.Transactions[1] tx3 := createSpendTxForTx(tx2, lowFee) - tx3.TxIn[0].SignatureScript = []byte{txscript.OP_FALSE} + tx3.TxIn[0].SignatureScript = []byte{txscript.OpFalse} b.AddTransaction(tx3) }) accepted() diff --git a/blockchain/validate.go b/blockchain/validate.go index 98e3e0a8e..03d3ea51f 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -599,11 +599,11 @@ func ExtractCoinbaseHeight(coinbaseTx *btcutil.Tx) (int32, error) { // Detect the case when the block height is a small integer encoded with // as single byte. opcode := int(sigScript[0]) - if opcode == txscript.OP_0 { + if opcode == txscript.Op0 { return 0, nil } - if opcode >= txscript.OP_1 && opcode <= txscript.OP_16 { - return int32(opcode - (txscript.OP_1 - 1)), nil + if opcode >= txscript.Op1 && opcode <= txscript.Op16 { + return int32(opcode - (txscript.Op1 - 1)), nil } // Otherwise, the opcode is the length of the following bytes which diff --git a/mempool/policy_test.go b/mempool/policy_test.go index ae787d798..85ef1a25f 100644 --- a/mempool/policy_test.go +++ b/mempool/policy_test.go @@ -114,72 +114,72 @@ func TestCheckPkScriptStandard(t *testing.T) { }{ { "key1 and key2", - txscript.NewScriptBuilder().AddOp(txscript.OP_2). + txscript.NewScriptBuilder().AddOp(txscript.Op2). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_2).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op2).AddOp(txscript.OpCheckMultiSig), true, }, { "key1 or key2", - txscript.NewScriptBuilder().AddOp(txscript.OP_1). + txscript.NewScriptBuilder().AddOp(txscript.Op1). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_2).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op2).AddOp(txscript.OpCheckMultiSig), true, }, { "escrow", - txscript.NewScriptBuilder().AddOp(txscript.OP_2). + txscript.NewScriptBuilder().AddOp(txscript.Op2). AddData(pubKeys[0]).AddData(pubKeys[1]). AddData(pubKeys[2]). - AddOp(txscript.OP_3).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op3).AddOp(txscript.OpCheckMultiSig), true, }, { "one of four", - txscript.NewScriptBuilder().AddOp(txscript.OP_1). + txscript.NewScriptBuilder().AddOp(txscript.Op1). AddData(pubKeys[0]).AddData(pubKeys[1]). AddData(pubKeys[2]).AddData(pubKeys[3]). - AddOp(txscript.OP_4).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op4).AddOp(txscript.OpCheckMultiSig), false, }, { "malformed1", - txscript.NewScriptBuilder().AddOp(txscript.OP_3). + txscript.NewScriptBuilder().AddOp(txscript.Op3). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_2).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op2).AddOp(txscript.OpCheckMultiSig), false, }, { "malformed2", - txscript.NewScriptBuilder().AddOp(txscript.OP_2). + txscript.NewScriptBuilder().AddOp(txscript.Op2). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_3).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op3).AddOp(txscript.OpCheckMultiSig), false, }, { "malformed3", - txscript.NewScriptBuilder().AddOp(txscript.OP_0). + txscript.NewScriptBuilder().AddOp(txscript.Op0). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_2).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op2).AddOp(txscript.OpCheckMultiSig), false, }, { "malformed4", - txscript.NewScriptBuilder().AddOp(txscript.OP_1). + txscript.NewScriptBuilder().AddOp(txscript.Op1). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_0).AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.Op0).AddOp(txscript.OpCheckMultiSig), false, }, { "malformed5", - txscript.NewScriptBuilder().AddOp(txscript.OP_1). + txscript.NewScriptBuilder().AddOp(txscript.Op1). AddData(pubKeys[0]).AddData(pubKeys[1]). - AddOp(txscript.OP_CHECKMULTISIG), + AddOp(txscript.OpCheckMultiSig), false, }, { "malformed6", - txscript.NewScriptBuilder().AddOp(txscript.OP_1). + txscript.NewScriptBuilder().AddOp(txscript.Op1). AddData(pubKeys[0]).AddData(pubKeys[1]), false, }, @@ -392,7 +392,7 @@ func TestCheckTransactionStandard(t *testing.T) { TxIn: []*wire.TxIn{{ PreviousOutPoint: dummyPrevOut, SignatureScript: []byte{ - txscript.OP_CHECKSIGVERIFY}, + txscript.OpCheckSigVerify}, Sequence: wire.MaxTxInSequenceNum, }}, TxOut: []*wire.TxOut{&dummyTxOut}, @@ -409,7 +409,7 @@ func TestCheckTransactionStandard(t *testing.T) { TxIn: []*wire.TxIn{&dummyTxIn}, TxOut: []*wire.TxOut{{ Value: 100000000, - PkScript: []byte{txscript.OP_TRUE}, + PkScript: []byte{txscript.OpTrue}, }}, LockTime: 0, }, @@ -424,10 +424,10 @@ func TestCheckTransactionStandard(t *testing.T) { TxIn: []*wire.TxIn{&dummyTxIn}, TxOut: []*wire.TxOut{{ Value: 0, - PkScript: []byte{txscript.OP_RETURN}, + PkScript: []byte{txscript.OpReturn}, }, { Value: 0, - PkScript: []byte{txscript.OP_RETURN}, + PkScript: []byte{txscript.OpReturn}, }}, LockTime: 0, }, @@ -457,7 +457,7 @@ func TestCheckTransactionStandard(t *testing.T) { TxIn: []*wire.TxIn{&dummyTxIn}, TxOut: []*wire.TxOut{{ Value: 0, - PkScript: []byte{txscript.OP_RETURN}, + PkScript: []byte{txscript.OpReturn}, }}, LockTime: 0, }, diff --git a/mining/mining.go b/mining/mining.go index b84ec3836..ef1e98d2f 100644 --- a/mining/mining.go +++ b/mining/mining.go @@ -257,7 +257,7 @@ func createCoinbaseTx(params *chaincfg.Params, coinbaseScript []byte, nextBlockH } else { var err error scriptBuilder := txscript.NewScriptBuilder() - pkScript, err = scriptBuilder.AddOp(txscript.OP_TRUE).Script() + pkScript, err = scriptBuilder.AddOp(txscript.OpTrue).Script() if err != nil { return nil, err } diff --git a/txscript/engine.go b/txscript/engine.go index cc5add85f..585d8ee0f 100644 --- a/txscript/engine.go +++ b/txscript/engine.go @@ -140,7 +140,7 @@ func (vm *Engine) executeOpcode(pop *parsedOpcode) error { } // Note that this includes OP_RESERVED which counts as a push operation. - if pop.opcode.value > OP_16 { + if pop.opcode.value > Op16 { vm.numOps++ if vm.numOps > MaxOpsPerScript { str := fmt.Sprintf("exceeded max operation limit of %d", @@ -163,7 +163,7 @@ func (vm *Engine) executeOpcode(pop *parsedOpcode) error { // Ensure all executed data push opcodes use the minimal encoding when // the minimal data verification flag is set. if vm.dstack.verifyMinimalData && vm.isBranchExecuting() && - pop.opcode.value >= 0 && pop.opcode.value <= OP_PUSHDATA4 { + pop.opcode.value >= 0 && pop.opcode.value <= OpPushData4 { if err := pop.checkMinimalDataPush(); err != nil { return err diff --git a/txscript/engine_test.go b/txscript/engine_test.go index 3b866e58f..3d5179cb2 100644 --- a/txscript/engine_test.go +++ b/txscript/engine_test.go @@ -172,7 +172,7 @@ func TestInvalidFlagCombinations(t *testing.T) { }), Index: 0, }, - SignatureScript: []uint8{OP_NOP}, + SignatureScript: []uint8{OpNop}, Sequence: 4294967295, }, }, @@ -184,7 +184,7 @@ func TestInvalidFlagCombinations(t *testing.T) { }, LockTime: 0, } - pkScript := []byte{OP_NOP} + pkScript := []byte{OpNop} for i, test := range tests { _, err := NewEngine(pkScript, tx, 0, test, nil) diff --git a/txscript/example_test.go b/txscript/example_test.go index c9421ebe6..eaa96a5c1 100644 --- a/txscript/example_test.go +++ b/txscript/example_test.go @@ -103,7 +103,7 @@ func ExampleSignTxOutput() { // contains a single output that pays to address in the amount of 1 BTC. originTx := wire.NewMsgTx(wire.TxVersion) prevOut := wire.NewOutPoint(&chainhash.Hash{}, ^uint32(0)) - txIn := wire.NewTxIn(prevOut, []byte{txscript.OP_0, txscript.OP_0}) + txIn := wire.NewTxIn(prevOut, []byte{txscript.Op0, txscript.Op0}) originTx.AddTxIn(txIn) pkScript, err := txscript.PayToAddrScript(addr) if err != nil { diff --git a/txscript/opcode.go b/txscript/opcode.go index b38a49a4c..0b65c9749 100644 --- a/txscript/opcode.go +++ b/txscript/opcode.go @@ -34,266 +34,266 @@ type opcode struct { // in bitcoin core and in most if not all other references and software related // to handling BTC scripts. const ( - OP_0 = 0x00 // 0 - OP_FALSE = 0x00 // 0 - AKA OP_0 - OP_DATA_1 = 0x01 // 1 - OP_DATA_2 = 0x02 // 2 - OP_DATA_3 = 0x03 // 3 - OP_DATA_4 = 0x04 // 4 - OP_DATA_5 = 0x05 // 5 - OP_DATA_6 = 0x06 // 6 - OP_DATA_7 = 0x07 // 7 - OP_DATA_8 = 0x08 // 8 - OP_DATA_9 = 0x09 // 9 - OP_DATA_10 = 0x0a // 10 - OP_DATA_11 = 0x0b // 11 - OP_DATA_12 = 0x0c // 12 - OP_DATA_13 = 0x0d // 13 - OP_DATA_14 = 0x0e // 14 - OP_DATA_15 = 0x0f // 15 - OP_DATA_16 = 0x10 // 16 - OP_DATA_17 = 0x11 // 17 - OP_DATA_18 = 0x12 // 18 - OP_DATA_19 = 0x13 // 19 - OP_DATA_20 = 0x14 // 20 - OP_DATA_21 = 0x15 // 21 - OP_DATA_22 = 0x16 // 22 - OP_DATA_23 = 0x17 // 23 - OP_DATA_24 = 0x18 // 24 - OP_DATA_25 = 0x19 // 25 - OP_DATA_26 = 0x1a // 26 - OP_DATA_27 = 0x1b // 27 - OP_DATA_28 = 0x1c // 28 - OP_DATA_29 = 0x1d // 29 - OP_DATA_30 = 0x1e // 30 - OP_DATA_31 = 0x1f // 31 - OP_DATA_32 = 0x20 // 32 - OP_DATA_33 = 0x21 // 33 - OP_DATA_34 = 0x22 // 34 - OP_DATA_35 = 0x23 // 35 - OP_DATA_36 = 0x24 // 36 - OP_DATA_37 = 0x25 // 37 - OP_DATA_38 = 0x26 // 38 - OP_DATA_39 = 0x27 // 39 - OP_DATA_40 = 0x28 // 40 - OP_DATA_41 = 0x29 // 41 - OP_DATA_42 = 0x2a // 42 - OP_DATA_43 = 0x2b // 43 - OP_DATA_44 = 0x2c // 44 - OP_DATA_45 = 0x2d // 45 - OP_DATA_46 = 0x2e // 46 - OP_DATA_47 = 0x2f // 47 - OP_DATA_48 = 0x30 // 48 - OP_DATA_49 = 0x31 // 49 - OP_DATA_50 = 0x32 // 50 - OP_DATA_51 = 0x33 // 51 - OP_DATA_52 = 0x34 // 52 - OP_DATA_53 = 0x35 // 53 - OP_DATA_54 = 0x36 // 54 - OP_DATA_55 = 0x37 // 55 - OP_DATA_56 = 0x38 // 56 - OP_DATA_57 = 0x39 // 57 - OP_DATA_58 = 0x3a // 58 - OP_DATA_59 = 0x3b // 59 - OP_DATA_60 = 0x3c // 60 - OP_DATA_61 = 0x3d // 61 - OP_DATA_62 = 0x3e // 62 - OP_DATA_63 = 0x3f // 63 - OP_DATA_64 = 0x40 // 64 - OP_DATA_65 = 0x41 // 65 - OP_DATA_66 = 0x42 // 66 - OP_DATA_67 = 0x43 // 67 - OP_DATA_68 = 0x44 // 68 - OP_DATA_69 = 0x45 // 69 - OP_DATA_70 = 0x46 // 70 - OP_DATA_71 = 0x47 // 71 - OP_DATA_72 = 0x48 // 72 - OP_DATA_73 = 0x49 // 73 - OP_DATA_74 = 0x4a // 74 - OP_DATA_75 = 0x4b // 75 - OP_PUSHDATA1 = 0x4c // 76 - OP_PUSHDATA2 = 0x4d // 77 - OP_PUSHDATA4 = 0x4e // 78 - OP_1NEGATE = 0x4f // 79 - OP_RESERVED = 0x50 // 80 - OP_1 = 0x51 // 81 - AKA OP_TRUE - OP_TRUE = 0x51 // 81 - OP_2 = 0x52 // 82 - OP_3 = 0x53 // 83 - OP_4 = 0x54 // 84 - OP_5 = 0x55 // 85 - OP_6 = 0x56 // 86 - OP_7 = 0x57 // 87 - OP_8 = 0x58 // 88 - OP_9 = 0x59 // 89 - OP_10 = 0x5a // 90 - OP_11 = 0x5b // 91 - OP_12 = 0x5c // 92 - OP_13 = 0x5d // 93 - OP_14 = 0x5e // 94 - OP_15 = 0x5f // 95 - OP_16 = 0x60 // 96 - OP_NOP = 0x61 // 97 - OP_VER = 0x62 // 98 - OP_IF = 0x63 // 99 - OP_NOTIF = 0x64 // 100 - OP_VERIF = 0x65 // 101 - OP_VERNOTIF = 0x66 // 102 - OP_ELSE = 0x67 // 103 - OP_ENDIF = 0x68 // 104 - OP_VERIFY = 0x69 // 105 - OP_RETURN = 0x6a // 106 - OP_TOALTSTACK = 0x6b // 107 - OP_FROMALTSTACK = 0x6c // 108 - OP_2DROP = 0x6d // 109 - OP_2DUP = 0x6e // 110 - OP_3DUP = 0x6f // 111 - OP_2OVER = 0x70 // 112 - OP_2ROT = 0x71 // 113 - OP_2SWAP = 0x72 // 114 - OP_IFDUP = 0x73 // 115 - OP_DEPTH = 0x74 // 116 - OP_DROP = 0x75 // 117 - OP_DUP = 0x76 // 118 - OP_NIP = 0x77 // 119 - OP_OVER = 0x78 // 120 - OP_PICK = 0x79 // 121 - OP_ROLL = 0x7a // 122 - OP_ROT = 0x7b // 123 - OP_SWAP = 0x7c // 124 - OP_TUCK = 0x7d // 125 - OP_CAT = 0x7e // 126 - OP_SUBSTR = 0x7f // 127 - OP_LEFT = 0x80 // 128 - OP_RIGHT = 0x81 // 129 - OP_SIZE = 0x82 // 130 - OP_INVERT = 0x83 // 131 - OP_AND = 0x84 // 132 - OP_OR = 0x85 // 133 - OP_XOR = 0x86 // 134 - OP_EQUAL = 0x87 // 135 - OP_EQUALVERIFY = 0x88 // 136 - OP_RESERVED1 = 0x89 // 137 - OP_RESERVED2 = 0x8a // 138 - OP_1ADD = 0x8b // 139 - OP_1SUB = 0x8c // 140 - OP_2MUL = 0x8d // 141 - OP_2DIV = 0x8e // 142 - OP_NEGATE = 0x8f // 143 - OP_ABS = 0x90 // 144 - OP_NOT = 0x91 // 145 - OP_0NOTEQUAL = 0x92 // 146 - OP_ADD = 0x93 // 147 - OP_SUB = 0x94 // 148 - OP_MUL = 0x95 // 149 - OP_DIV = 0x96 // 150 - OP_MOD = 0x97 // 151 - OP_LSHIFT = 0x98 // 152 - OP_RSHIFT = 0x99 // 153 - OP_BOOLAND = 0x9a // 154 - OP_BOOLOR = 0x9b // 155 - OP_NUMEQUAL = 0x9c // 156 - OP_NUMEQUALVERIFY = 0x9d // 157 - OP_NUMNOTEQUAL = 0x9e // 158 - OP_LESSTHAN = 0x9f // 159 - OP_GREATERTHAN = 0xa0 // 160 - OP_LESSTHANOREQUAL = 0xa1 // 161 - OP_GREATERTHANOREQUAL = 0xa2 // 162 - OP_MIN = 0xa3 // 163 - OP_MAX = 0xa4 // 164 - OP_WITHIN = 0xa5 // 165 - OP_RIPEMD160 = 0xa6 // 166 - OP_SHA1 = 0xa7 // 167 - OP_SHA256 = 0xa8 // 168 - OP_HASH160 = 0xa9 // 169 - OP_HASH256 = 0xaa // 170 - OP_CODESEPARATOR = 0xab // 171 - OP_CHECKSIG = 0xac // 172 - OP_CHECKSIGVERIFY = 0xad // 173 - OP_CHECKMULTISIG = 0xae // 174 - OP_CHECKMULTISIGVERIFY = 0xaf // 175 - OP_NOP1 = 0xb0 // 176 - OP_NOP2 = 0xb1 // 177 - OP_CHECKLOCKTIMEVERIFY = 0xb1 // 177 - AKA OP_NOP2 - OP_NOP3 = 0xb2 // 178 - OP_CHECKSEQUENCEVERIFY = 0xb2 // 178 - AKA OP_NOP3 - OP_NOP4 = 0xb3 // 179 - OP_NOP5 = 0xb4 // 180 - OP_NOP6 = 0xb5 // 181 - OP_NOP7 = 0xb6 // 182 - OP_NOP8 = 0xb7 // 183 - OP_NOP9 = 0xb8 // 184 - OP_NOP10 = 0xb9 // 185 - OP_UNKNOWN186 = 0xba // 186 - OP_UNKNOWN187 = 0xbb // 187 - OP_UNKNOWN188 = 0xbc // 188 - OP_UNKNOWN189 = 0xbd // 189 - OP_UNKNOWN190 = 0xbe // 190 - OP_UNKNOWN191 = 0xbf // 191 - OP_UNKNOWN192 = 0xc0 // 192 - OP_UNKNOWN193 = 0xc1 // 193 - OP_UNKNOWN194 = 0xc2 // 194 - OP_UNKNOWN195 = 0xc3 // 195 - OP_UNKNOWN196 = 0xc4 // 196 - OP_UNKNOWN197 = 0xc5 // 197 - OP_UNKNOWN198 = 0xc6 // 198 - OP_UNKNOWN199 = 0xc7 // 199 - OP_UNKNOWN200 = 0xc8 // 200 - OP_UNKNOWN201 = 0xc9 // 201 - OP_UNKNOWN202 = 0xca // 202 - OP_UNKNOWN203 = 0xcb // 203 - OP_UNKNOWN204 = 0xcc // 204 - OP_UNKNOWN205 = 0xcd // 205 - OP_UNKNOWN206 = 0xce // 206 - OP_UNKNOWN207 = 0xcf // 207 - OP_UNKNOWN208 = 0xd0 // 208 - OP_UNKNOWN209 = 0xd1 // 209 - OP_UNKNOWN210 = 0xd2 // 210 - OP_UNKNOWN211 = 0xd3 // 211 - OP_UNKNOWN212 = 0xd4 // 212 - OP_UNKNOWN213 = 0xd5 // 213 - OP_UNKNOWN214 = 0xd6 // 214 - OP_UNKNOWN215 = 0xd7 // 215 - OP_UNKNOWN216 = 0xd8 // 216 - OP_UNKNOWN217 = 0xd9 // 217 - OP_UNKNOWN218 = 0xda // 218 - OP_UNKNOWN219 = 0xdb // 219 - OP_UNKNOWN220 = 0xdc // 220 - OP_UNKNOWN221 = 0xdd // 221 - OP_UNKNOWN222 = 0xde // 222 - OP_UNKNOWN223 = 0xdf // 223 - OP_UNKNOWN224 = 0xe0 // 224 - OP_UNKNOWN225 = 0xe1 // 225 - OP_UNKNOWN226 = 0xe2 // 226 - OP_UNKNOWN227 = 0xe3 // 227 - OP_UNKNOWN228 = 0xe4 // 228 - OP_UNKNOWN229 = 0xe5 // 229 - OP_UNKNOWN230 = 0xe6 // 230 - OP_UNKNOWN231 = 0xe7 // 231 - OP_UNKNOWN232 = 0xe8 // 232 - OP_UNKNOWN233 = 0xe9 // 233 - OP_UNKNOWN234 = 0xea // 234 - OP_UNKNOWN235 = 0xeb // 235 - OP_UNKNOWN236 = 0xec // 236 - OP_UNKNOWN237 = 0xed // 237 - OP_UNKNOWN238 = 0xee // 238 - OP_UNKNOWN239 = 0xef // 239 - OP_UNKNOWN240 = 0xf0 // 240 - OP_UNKNOWN241 = 0xf1 // 241 - OP_UNKNOWN242 = 0xf2 // 242 - OP_UNKNOWN243 = 0xf3 // 243 - OP_UNKNOWN244 = 0xf4 // 244 - OP_UNKNOWN245 = 0xf5 // 245 - OP_UNKNOWN246 = 0xf6 // 246 - OP_UNKNOWN247 = 0xf7 // 247 - OP_UNKNOWN248 = 0xf8 // 248 - OP_UNKNOWN249 = 0xf9 // 249 - OP_SMALLINTEGER = 0xfa // 250 - bitcoin core internal - OP_PUBKEYS = 0xfb // 251 - bitcoin core internal - OP_UNKNOWN252 = 0xfc // 252 - OP_PUBKEYHASH = 0xfd // 253 - bitcoin core internal - OP_PUBKEY = 0xfe // 254 - bitcoin core internal - OP_INVALIDOPCODE = 0xff // 255 - bitcoin core internal + Op0 = 0x00 // 0 + OpFalse = 0x00 // 0 - AKA Op0 + OpData1 = 0x01 // 1 + OpData2 = 0x02 // 2 + OpData3 = 0x03 // 3 + OpData4 = 0x04 // 4 + OpData5 = 0x05 // 5 + OpData6 = 0x06 // 6 + OpData7 = 0x07 // 7 + OpData8 = 0x08 // 8 + OpData9 = 0x09 // 9 + OpData10 = 0x0a // 10 + OpData11 = 0x0b // 11 + OpData12 = 0x0c // 12 + OpData13 = 0x0d // 13 + OpData14 = 0x0e // 14 + OpData15 = 0x0f // 15 + OpData16 = 0x10 // 16 + OpData17 = 0x11 // 17 + OpData18 = 0x12 // 18 + OpData19 = 0x13 // 19 + OpData20 = 0x14 // 20 + OpData21 = 0x15 // 21 + OpData22 = 0x16 // 22 + OpData23 = 0x17 // 23 + OpData24 = 0x18 // 24 + OpData25 = 0x19 // 25 + OpData26 = 0x1a // 26 + OpData27 = 0x1b // 27 + OpData28 = 0x1c // 28 + OpData29 = 0x1d // 29 + OpData30 = 0x1e // 30 + OpData31 = 0x1f // 31 + OpData32 = 0x20 // 32 + OpData33 = 0x21 // 33 + OpData34 = 0x22 // 34 + OpData35 = 0x23 // 35 + OpData36 = 0x24 // 36 + OpData37 = 0x25 // 37 + OpData38 = 0x26 // 38 + OpData39 = 0x27 // 39 + OpData40 = 0x28 // 40 + OpData41 = 0x29 // 41 + OpData42 = 0x2a // 42 + OpData43 = 0x2b // 43 + OpData44 = 0x2c // 44 + OpData45 = 0x2d // 45 + OpData46 = 0x2e // 46 + OpData47 = 0x2f // 47 + OpData48 = 0x30 // 48 + OpData49 = 0x31 // 49 + OpData50 = 0x32 // 50 + OpData51 = 0x33 // 51 + OpData52 = 0x34 // 52 + OpData53 = 0x35 // 53 + OpData54 = 0x36 // 54 + OpData55 = 0x37 // 55 + OpData56 = 0x38 // 56 + OpData57 = 0x39 // 57 + OpData58 = 0x3a // 58 + OpData59 = 0x3b // 59 + OpData60 = 0x3c // 60 + OpData61 = 0x3d // 61 + OpData62 = 0x3e // 62 + OpData63 = 0x3f // 63 + OpData64 = 0x40 // 64 + OpData65 = 0x41 // 65 + OpData66 = 0x42 // 66 + OpData67 = 0x43 // 67 + OpData68 = 0x44 // 68 + OpData69 = 0x45 // 69 + OpData70 = 0x46 // 70 + OpData71 = 0x47 // 71 + OpData72 = 0x48 // 72 + OpData73 = 0x49 // 73 + OpData74 = 0x4a // 74 + OpData75 = 0x4b // 75 + OpPushData1 = 0x4c // 76 + OpPushData2 = 0x4d // 77 + OpPushData4 = 0x4e // 78 + Op1Negate = 0x4f // 79 + OpReserved = 0x50 // 80 + Op1 = 0x51 // 81 - AKA OpTrue + OpTrue = 0x51 // 81 + Op2 = 0x52 // 82 + Op3 = 0x53 // 83 + Op4 = 0x54 // 84 + Op5 = 0x55 // 85 + Op6 = 0x56 // 86 + Op7 = 0x57 // 87 + Op8 = 0x58 // 88 + Op9 = 0x59 // 89 + Op10 = 0x5a // 90 + Op11 = 0x5b // 91 + Op12 = 0x5c // 92 + Op13 = 0x5d // 93 + Op14 = 0x5e // 94 + Op15 = 0x5f // 95 + Op16 = 0x60 // 96 + OpNop = 0x61 // 97 + OpVer = 0x62 // 98 + OpIf = 0x63 // 99 + OpNotIf = 0x64 // 100 + OpVerIf = 0x65 // 101 + OpVerNotIf = 0x66 // 102 + OpElse = 0x67 // 103 + OpEndIf = 0x68 // 104 + OpVerify = 0x69 // 105 + OpReturn = 0x6a // 106 + OpToAltStack = 0x6b // 107 + OpFromAltStack = 0x6c // 108 + Op2Drop = 0x6d // 109 + Op2Dup = 0x6e // 110 + Op3Dup = 0x6f // 111 + Op2Over = 0x70 // 112 + Op2Rot = 0x71 // 113 + Op2Swap = 0x72 // 114 + OpIfDup = 0x73 // 115 + OpDepth = 0x74 // 116 + OpDrop = 0x75 // 117 + OpDup = 0x76 // 118 + OpNip = 0x77 // 119 + OpOver = 0x78 // 120 + OpPick = 0x79 // 121 + OpRoll = 0x7a // 122 + OpRot = 0x7b // 123 + OpSwap = 0x7c // 124 + OpTuck = 0x7d // 125 + OpCat = 0x7e // 126 + OpSubStr = 0x7f // 127 + OpLeft = 0x80 // 128 + OpRight = 0x81 // 129 + OpSize = 0x82 // 130 + OpInvert = 0x83 // 131 + OpAnd = 0x84 // 132 + OpOr = 0x85 // 133 + OpXor = 0x86 // 134 + OpEqual = 0x87 // 135 + OpEqualVerify = 0x88 // 136 + OpReserved1 = 0x89 // 137 + OpReserved2 = 0x8a // 138 + Op1Add = 0x8b // 139 + Op1Sub = 0x8c // 140 + Op2Mul = 0x8d // 141 + Op2Div = 0x8e // 142 + OpNegate = 0x8f // 143 + OpAbs = 0x90 // 144 + OpNot = 0x91 // 145 + Op0NotEqual = 0x92 // 146 + OpAdd = 0x93 // 147 + OpSub = 0x94 // 148 + OpMul = 0x95 // 149 + OpDiv = 0x96 // 150 + OpMod = 0x97 // 151 + OpLShift = 0x98 // 152 + OpRShift = 0x99 // 153 + OpBoolAnd = 0x9a // 154 + OpBoolOr = 0x9b // 155 + OpNumEqual = 0x9c // 156 + OpNumEqualVerify = 0x9d // 157 + OpNumNotEqual = 0x9e // 158 + OpLessThan = 0x9f // 159 + OpGreaterThan = 0xa0 // 160 + OpLessThanOrEqual = 0xa1 // 161 + OpGreaterThanOrEqual = 0xa2 // 162 + OpMin = 0xa3 // 163 + OpMax = 0xa4 // 164 + OpWithin = 0xa5 // 165 + OpRipeMD160 = 0xa6 // 166 + OpSHA1 = 0xa7 // 167 + OpSHA256 = 0xa8 // 168 + OpHash160 = 0xa9 // 169 + OpHash256 = 0xaa // 170 + OpCodeSeparator = 0xab // 171 + OpCheckSig = 0xac // 172 + OpCheckSigVerify = 0xad // 173 + OpCheckMultiSig = 0xae // 174 + OpCheckMultiSigVerify = 0xaf // 175 + OpNop1 = 0xb0 // 176 + OpNop2 = 0xb1 // 177 + OpCheckLockTimeVerify = 0xb1 // 177 - AKA OPNop2 + OpNop3 = 0xb2 // 178 + OpCheckSequenceVerify = 0xb2 // 178 - AKA OpNop3 + OpNop4 = 0xb3 // 179 + OpNop5 = 0xb4 // 180 + OpNop6 = 0xb5 // 181 + OpNop7 = 0xb6 // 182 + OpNop8 = 0xb7 // 183 + OpNop9 = 0xb8 // 184 + OpNop10 = 0xb9 // 185 + OpUnknown186 = 0xba // 186 + OpUnknown187 = 0xbb // 187 + OpUnknown188 = 0xbc // 188 + OpUnknown189 = 0xbd // 189 + OpUnknown190 = 0xbe // 190 + OpUnknown191 = 0xbf // 191 + OpUnknown192 = 0xc0 // 192 + OpUnknown193 = 0xc1 // 193 + OpUnknown194 = 0xc2 // 194 + OpUnknown195 = 0xc3 // 195 + OpUnknown196 = 0xc4 // 196 + OpUnknown197 = 0xc5 // 197 + OpUnknown198 = 0xc6 // 198 + OpUnknown199 = 0xc7 // 199 + OpUnknown200 = 0xc8 // 200 + OpUnknown201 = 0xc9 // 201 + OpUnknown202 = 0xca // 202 + OpUnknown203 = 0xcb // 203 + OpUnknown204 = 0xcc // 204 + OpUnknown205 = 0xcd // 205 + OpUnknown206 = 0xce // 206 + OpUnknown207 = 0xcf // 207 + OpUnknown208 = 0xd0 // 208 + OpUnknown209 = 0xd1 // 209 + OpUnknown210 = 0xd2 // 210 + OpUnknown211 = 0xd3 // 211 + OpUnknown212 = 0xd4 // 212 + OpUnknown213 = 0xd5 // 213 + OpUnknown214 = 0xd6 // 214 + OpUnknown215 = 0xd7 // 215 + OpUnknown216 = 0xd8 // 216 + OpUnknown217 = 0xd9 // 217 + OpUnknown218 = 0xda // 218 + OpUnknown219 = 0xdb // 219 + OpUnknown220 = 0xdc // 220 + OpUnknown221 = 0xdd // 221 + OpUnknown222 = 0xde // 222 + OpUnknown223 = 0xdf // 223 + OpUnknown224 = 0xe0 // 224 + OpUnknown225 = 0xe1 // 225 + OpUnknown226 = 0xe2 // 226 + OpUnknown227 = 0xe3 // 227 + OpUnknown228 = 0xe4 // 228 + OpUnknown229 = 0xe5 // 229 + OpUnknown230 = 0xe6 // 230 + OpUnknown231 = 0xe7 // 231 + OpUnknown232 = 0xe8 // 232 + OpUnknown233 = 0xe9 // 233 + OpUnknown234 = 0xea // 234 + OpUnknown235 = 0xeb // 235 + OpUnknown236 = 0xec // 236 + OpUnknown237 = 0xed // 237 + OpUnknown238 = 0xee // 238 + OpUnknown239 = 0xef // 239 + OpUnknown240 = 0xf0 // 240 + OpUnknown241 = 0xf1 // 241 + OpUnknown242 = 0xf2 // 242 + OpUnknown243 = 0xf3 // 243 + OpUnknown244 = 0xf4 // 244 + OpUnknown245 = 0xf5 // 245 + OpUnknown246 = 0xf6 // 246 + OpUnknown247 = 0xf7 // 247 + OpUnknown248 = 0xf8 // 248 + OpUnknown249 = 0xf9 // 249 + OpSmallInteger = 0xfa // 250 - bitcoin core internal + OpPubKeys = 0xfb // 251 - bitcoin core internal + OpUnknown252 = 0xfc // 252 + OpPubKeyHash = 0xfd // 253 - bitcoin core internal + OpPubKey = 0xfe // 254 - bitcoin core internal + OpInvalidOpCode = 0xff // 255 - bitcoin core internal ) // Conditional execution constants. @@ -308,281 +308,281 @@ const ( // the handler function. var opcodeArray = [256]opcode{ // Data push opcodes. - OP_FALSE: {OP_FALSE, "OP_0", 1, opcodeFalse}, - OP_DATA_1: {OP_DATA_1, "OP_DATA_1", 2, opcodePushData}, - OP_DATA_2: {OP_DATA_2, "OP_DATA_2", 3, opcodePushData}, - OP_DATA_3: {OP_DATA_3, "OP_DATA_3", 4, opcodePushData}, - OP_DATA_4: {OP_DATA_4, "OP_DATA_4", 5, opcodePushData}, - OP_DATA_5: {OP_DATA_5, "OP_DATA_5", 6, opcodePushData}, - OP_DATA_6: {OP_DATA_6, "OP_DATA_6", 7, opcodePushData}, - OP_DATA_7: {OP_DATA_7, "OP_DATA_7", 8, opcodePushData}, - OP_DATA_8: {OP_DATA_8, "OP_DATA_8", 9, opcodePushData}, - OP_DATA_9: {OP_DATA_9, "OP_DATA_9", 10, opcodePushData}, - OP_DATA_10: {OP_DATA_10, "OP_DATA_10", 11, opcodePushData}, - OP_DATA_11: {OP_DATA_11, "OP_DATA_11", 12, opcodePushData}, - OP_DATA_12: {OP_DATA_12, "OP_DATA_12", 13, opcodePushData}, - OP_DATA_13: {OP_DATA_13, "OP_DATA_13", 14, opcodePushData}, - OP_DATA_14: {OP_DATA_14, "OP_DATA_14", 15, opcodePushData}, - OP_DATA_15: {OP_DATA_15, "OP_DATA_15", 16, opcodePushData}, - OP_DATA_16: {OP_DATA_16, "OP_DATA_16", 17, opcodePushData}, - OP_DATA_17: {OP_DATA_17, "OP_DATA_17", 18, opcodePushData}, - OP_DATA_18: {OP_DATA_18, "OP_DATA_18", 19, opcodePushData}, - OP_DATA_19: {OP_DATA_19, "OP_DATA_19", 20, opcodePushData}, - OP_DATA_20: {OP_DATA_20, "OP_DATA_20", 21, opcodePushData}, - OP_DATA_21: {OP_DATA_21, "OP_DATA_21", 22, opcodePushData}, - OP_DATA_22: {OP_DATA_22, "OP_DATA_22", 23, opcodePushData}, - OP_DATA_23: {OP_DATA_23, "OP_DATA_23", 24, opcodePushData}, - OP_DATA_24: {OP_DATA_24, "OP_DATA_24", 25, opcodePushData}, - OP_DATA_25: {OP_DATA_25, "OP_DATA_25", 26, opcodePushData}, - OP_DATA_26: {OP_DATA_26, "OP_DATA_26", 27, opcodePushData}, - OP_DATA_27: {OP_DATA_27, "OP_DATA_27", 28, opcodePushData}, - OP_DATA_28: {OP_DATA_28, "OP_DATA_28", 29, opcodePushData}, - OP_DATA_29: {OP_DATA_29, "OP_DATA_29", 30, opcodePushData}, - OP_DATA_30: {OP_DATA_30, "OP_DATA_30", 31, opcodePushData}, - OP_DATA_31: {OP_DATA_31, "OP_DATA_31", 32, opcodePushData}, - OP_DATA_32: {OP_DATA_32, "OP_DATA_32", 33, opcodePushData}, - OP_DATA_33: {OP_DATA_33, "OP_DATA_33", 34, opcodePushData}, - OP_DATA_34: {OP_DATA_34, "OP_DATA_34", 35, opcodePushData}, - OP_DATA_35: {OP_DATA_35, "OP_DATA_35", 36, opcodePushData}, - OP_DATA_36: {OP_DATA_36, "OP_DATA_36", 37, opcodePushData}, - OP_DATA_37: {OP_DATA_37, "OP_DATA_37", 38, opcodePushData}, - OP_DATA_38: {OP_DATA_38, "OP_DATA_38", 39, opcodePushData}, - OP_DATA_39: {OP_DATA_39, "OP_DATA_39", 40, opcodePushData}, - OP_DATA_40: {OP_DATA_40, "OP_DATA_40", 41, opcodePushData}, - OP_DATA_41: {OP_DATA_41, "OP_DATA_41", 42, opcodePushData}, - OP_DATA_42: {OP_DATA_42, "OP_DATA_42", 43, opcodePushData}, - OP_DATA_43: {OP_DATA_43, "OP_DATA_43", 44, opcodePushData}, - OP_DATA_44: {OP_DATA_44, "OP_DATA_44", 45, opcodePushData}, - OP_DATA_45: {OP_DATA_45, "OP_DATA_45", 46, opcodePushData}, - OP_DATA_46: {OP_DATA_46, "OP_DATA_46", 47, opcodePushData}, - OP_DATA_47: {OP_DATA_47, "OP_DATA_47", 48, opcodePushData}, - OP_DATA_48: {OP_DATA_48, "OP_DATA_48", 49, opcodePushData}, - OP_DATA_49: {OP_DATA_49, "OP_DATA_49", 50, opcodePushData}, - OP_DATA_50: {OP_DATA_50, "OP_DATA_50", 51, opcodePushData}, - OP_DATA_51: {OP_DATA_51, "OP_DATA_51", 52, opcodePushData}, - OP_DATA_52: {OP_DATA_52, "OP_DATA_52", 53, opcodePushData}, - OP_DATA_53: {OP_DATA_53, "OP_DATA_53", 54, opcodePushData}, - OP_DATA_54: {OP_DATA_54, "OP_DATA_54", 55, opcodePushData}, - OP_DATA_55: {OP_DATA_55, "OP_DATA_55", 56, opcodePushData}, - OP_DATA_56: {OP_DATA_56, "OP_DATA_56", 57, opcodePushData}, - OP_DATA_57: {OP_DATA_57, "OP_DATA_57", 58, opcodePushData}, - OP_DATA_58: {OP_DATA_58, "OP_DATA_58", 59, opcodePushData}, - OP_DATA_59: {OP_DATA_59, "OP_DATA_59", 60, opcodePushData}, - OP_DATA_60: {OP_DATA_60, "OP_DATA_60", 61, opcodePushData}, - OP_DATA_61: {OP_DATA_61, "OP_DATA_61", 62, opcodePushData}, - OP_DATA_62: {OP_DATA_62, "OP_DATA_62", 63, opcodePushData}, - OP_DATA_63: {OP_DATA_63, "OP_DATA_63", 64, opcodePushData}, - OP_DATA_64: {OP_DATA_64, "OP_DATA_64", 65, opcodePushData}, - OP_DATA_65: {OP_DATA_65, "OP_DATA_65", 66, opcodePushData}, - OP_DATA_66: {OP_DATA_66, "OP_DATA_66", 67, opcodePushData}, - OP_DATA_67: {OP_DATA_67, "OP_DATA_67", 68, opcodePushData}, - OP_DATA_68: {OP_DATA_68, "OP_DATA_68", 69, opcodePushData}, - OP_DATA_69: {OP_DATA_69, "OP_DATA_69", 70, opcodePushData}, - OP_DATA_70: {OP_DATA_70, "OP_DATA_70", 71, opcodePushData}, - OP_DATA_71: {OP_DATA_71, "OP_DATA_71", 72, opcodePushData}, - OP_DATA_72: {OP_DATA_72, "OP_DATA_72", 73, opcodePushData}, - OP_DATA_73: {OP_DATA_73, "OP_DATA_73", 74, opcodePushData}, - OP_DATA_74: {OP_DATA_74, "OP_DATA_74", 75, opcodePushData}, - OP_DATA_75: {OP_DATA_75, "OP_DATA_75", 76, opcodePushData}, - OP_PUSHDATA1: {OP_PUSHDATA1, "OP_PUSHDATA1", -1, opcodePushData}, - OP_PUSHDATA2: {OP_PUSHDATA2, "OP_PUSHDATA2", -2, opcodePushData}, - OP_PUSHDATA4: {OP_PUSHDATA4, "OP_PUSHDATA4", -4, opcodePushData}, - OP_1NEGATE: {OP_1NEGATE, "OP_1NEGATE", 1, opcode1Negate}, - OP_RESERVED: {OP_RESERVED, "OP_RESERVED", 1, opcodeReserved}, - OP_TRUE: {OP_TRUE, "OP_1", 1, opcodeN}, - OP_2: {OP_2, "OP_2", 1, opcodeN}, - OP_3: {OP_3, "OP_3", 1, opcodeN}, - OP_4: {OP_4, "OP_4", 1, opcodeN}, - OP_5: {OP_5, "OP_5", 1, opcodeN}, - OP_6: {OP_6, "OP_6", 1, opcodeN}, - OP_7: {OP_7, "OP_7", 1, opcodeN}, - OP_8: {OP_8, "OP_8", 1, opcodeN}, - OP_9: {OP_9, "OP_9", 1, opcodeN}, - OP_10: {OP_10, "OP_10", 1, opcodeN}, - OP_11: {OP_11, "OP_11", 1, opcodeN}, - OP_12: {OP_12, "OP_12", 1, opcodeN}, - OP_13: {OP_13, "OP_13", 1, opcodeN}, - OP_14: {OP_14, "OP_14", 1, opcodeN}, - OP_15: {OP_15, "OP_15", 1, opcodeN}, - OP_16: {OP_16, "OP_16", 1, opcodeN}, + OpFalse: {OpFalse, "OP_0", 1, opcodeFalse}, + OpData1: {OpData1, "OP_DATA_1", 2, opcodePushData}, + OpData2: {OpData2, "OP_DATA_2", 3, opcodePushData}, + OpData3: {OpData3, "OP_DATA_3", 4, opcodePushData}, + OpData4: {OpData4, "OP_DATA_4", 5, opcodePushData}, + OpData5: {OpData5, "OP_DATA_5", 6, opcodePushData}, + OpData6: {OpData6, "OP_DATA_6", 7, opcodePushData}, + OpData7: {OpData7, "OP_DATA_7", 8, opcodePushData}, + OpData8: {OpData8, "OP_DATA_8", 9, opcodePushData}, + OpData9: {OpData9, "OP_DATA_9", 10, opcodePushData}, + OpData10: {OpData10, "OP_DATA_10", 11, opcodePushData}, + OpData11: {OpData11, "OP_DATA_11", 12, opcodePushData}, + OpData12: {OpData12, "OP_DATA_12", 13, opcodePushData}, + OpData13: {OpData13, "OP_DATA_13", 14, opcodePushData}, + OpData14: {OpData14, "OP_DATA_14", 15, opcodePushData}, + OpData15: {OpData15, "OP_DATA_15", 16, opcodePushData}, + OpData16: {OpData16, "OP_DATA_16", 17, opcodePushData}, + OpData17: {OpData17, "OP_DATA_17", 18, opcodePushData}, + OpData18: {OpData18, "OP_DATA_18", 19, opcodePushData}, + OpData19: {OpData19, "OP_DATA_19", 20, opcodePushData}, + OpData20: {OpData20, "OP_DATA_20", 21, opcodePushData}, + OpData21: {OpData21, "OP_DATA_21", 22, opcodePushData}, + OpData22: {OpData22, "OP_DATA_22", 23, opcodePushData}, + OpData23: {OpData23, "OP_DATA_23", 24, opcodePushData}, + OpData24: {OpData24, "OP_DATA_24", 25, opcodePushData}, + OpData25: {OpData25, "OP_DATA_25", 26, opcodePushData}, + OpData26: {OpData26, "OP_DATA_26", 27, opcodePushData}, + OpData27: {OpData27, "OP_DATA_27", 28, opcodePushData}, + OpData28: {OpData28, "OP_DATA_28", 29, opcodePushData}, + OpData29: {OpData29, "OP_DATA_29", 30, opcodePushData}, + OpData30: {OpData30, "OP_DATA_30", 31, opcodePushData}, + OpData31: {OpData31, "OP_DATA_31", 32, opcodePushData}, + OpData32: {OpData32, "OP_DATA_32", 33, opcodePushData}, + OpData33: {OpData33, "OP_DATA_33", 34, opcodePushData}, + OpData34: {OpData34, "OP_DATA_34", 35, opcodePushData}, + OpData35: {OpData35, "OP_DATA_35", 36, opcodePushData}, + OpData36: {OpData36, "OP_DATA_36", 37, opcodePushData}, + OpData37: {OpData37, "OP_DATA_37", 38, opcodePushData}, + OpData38: {OpData38, "OP_DATA_38", 39, opcodePushData}, + OpData39: {OpData39, "OP_DATA_39", 40, opcodePushData}, + OpData40: {OpData40, "OP_DATA_40", 41, opcodePushData}, + OpData41: {OpData41, "OP_DATA_41", 42, opcodePushData}, + OpData42: {OpData42, "OP_DATA_42", 43, opcodePushData}, + OpData43: {OpData43, "OP_DATA_43", 44, opcodePushData}, + OpData44: {OpData44, "OP_DATA_44", 45, opcodePushData}, + OpData45: {OpData45, "OP_DATA_45", 46, opcodePushData}, + OpData46: {OpData46, "OP_DATA_46", 47, opcodePushData}, + OpData47: {OpData47, "OP_DATA_47", 48, opcodePushData}, + OpData48: {OpData48, "OP_DATA_48", 49, opcodePushData}, + OpData49: {OpData49, "OP_DATA_49", 50, opcodePushData}, + OpData50: {OpData50, "OP_DATA_50", 51, opcodePushData}, + OpData51: {OpData51, "OP_DATA_51", 52, opcodePushData}, + OpData52: {OpData52, "OP_DATA_52", 53, opcodePushData}, + OpData53: {OpData53, "OP_DATA_53", 54, opcodePushData}, + OpData54: {OpData54, "OP_DATA_54", 55, opcodePushData}, + OpData55: {OpData55, "OP_DATA_55", 56, opcodePushData}, + OpData56: {OpData56, "OP_DATA_56", 57, opcodePushData}, + OpData57: {OpData57, "OP_DATA_57", 58, opcodePushData}, + OpData58: {OpData58, "OP_DATA_58", 59, opcodePushData}, + OpData59: {OpData59, "OP_DATA_59", 60, opcodePushData}, + OpData60: {OpData60, "OP_DATA_60", 61, opcodePushData}, + OpData61: {OpData61, "OP_DATA_61", 62, opcodePushData}, + OpData62: {OpData62, "OP_DATA_62", 63, opcodePushData}, + OpData63: {OpData63, "OP_DATA_63", 64, opcodePushData}, + OpData64: {OpData64, "OP_DATA_64", 65, opcodePushData}, + OpData65: {OpData65, "OP_DATA_65", 66, opcodePushData}, + OpData66: {OpData66, "OP_DATA_66", 67, opcodePushData}, + OpData67: {OpData67, "OP_DATA_67", 68, opcodePushData}, + OpData68: {OpData68, "OP_DATA_68", 69, opcodePushData}, + OpData69: {OpData69, "OP_DATA_69", 70, opcodePushData}, + OpData70: {OpData70, "OP_DATA_70", 71, opcodePushData}, + OpData71: {OpData71, "OP_DATA_71", 72, opcodePushData}, + OpData72: {OpData72, "OP_DATA_72", 73, opcodePushData}, + OpData73: {OpData73, "OP_DATA_73", 74, opcodePushData}, + OpData74: {OpData74, "OP_DATA_74", 75, opcodePushData}, + OpData75: {OpData75, "OP_DATA_75", 76, opcodePushData}, + OpPushData1: {OpPushData1, "OP_PUSHDATA1", -1, opcodePushData}, + OpPushData2: {OpPushData2, "OP_PUSHDATA2", -2, opcodePushData}, + OpPushData4: {OpPushData4, "OP_PUSHDATA4", -4, opcodePushData}, + Op1Negate: {Op1Negate, "OP_1NEGATE", 1, opcode1Negate}, + OpReserved: {OpReserved, "OP_RESERVED", 1, opcodeReserved}, + OpTrue: {OpTrue, "OP_1", 1, opcodeN}, + Op2: {Op2, "OP_2", 1, opcodeN}, + Op3: {Op3, "OP_3", 1, opcodeN}, + Op4: {Op4, "OP_4", 1, opcodeN}, + Op5: {Op5, "OP_5", 1, opcodeN}, + Op6: {Op6, "OP_6", 1, opcodeN}, + Op7: {Op7, "OP_7", 1, opcodeN}, + Op8: {Op8, "OP_8", 1, opcodeN}, + Op9: {Op9, "OP_9", 1, opcodeN}, + Op10: {Op10, "OP_10", 1, opcodeN}, + Op11: {Op11, "OP_11", 1, opcodeN}, + Op12: {Op12, "OP_12", 1, opcodeN}, + Op13: {Op13, "OP_13", 1, opcodeN}, + Op14: {Op14, "OP_14", 1, opcodeN}, + Op15: {Op15, "OP_15", 1, opcodeN}, + Op16: {Op16, "OP_16", 1, opcodeN}, // Control opcodes. - OP_NOP: {OP_NOP, "OP_NOP", 1, opcodeNop}, - OP_VER: {OP_VER, "OP_VER", 1, opcodeReserved}, - OP_IF: {OP_IF, "OP_IF", 1, opcodeIf}, - OP_NOTIF: {OP_NOTIF, "OP_NOTIF", 1, opcodeNotIf}, - OP_VERIF: {OP_VERIF, "OP_VERIF", 1, opcodeReserved}, - OP_VERNOTIF: {OP_VERNOTIF, "OP_VERNOTIF", 1, opcodeReserved}, - OP_ELSE: {OP_ELSE, "OP_ELSE", 1, opcodeElse}, - OP_ENDIF: {OP_ENDIF, "OP_ENDIF", 1, opcodeEndif}, - OP_VERIFY: {OP_VERIFY, "OP_VERIFY", 1, opcodeVerify}, - OP_RETURN: {OP_RETURN, "OP_RETURN", 1, opcodeReturn}, - OP_CHECKLOCKTIMEVERIFY: {OP_CHECKLOCKTIMEVERIFY, "OP_CHECKLOCKTIMEVERIFY", 1, opcodeCheckLockTimeVerify}, - OP_CHECKSEQUENCEVERIFY: {OP_CHECKSEQUENCEVERIFY, "OP_CHECKSEQUENCEVERIFY", 1, opcodeCheckSequenceVerify}, + OpNop: {OpNop, "OP_NOP", 1, opcodeNop}, + OpVer: {OpVer, "OP_VER", 1, opcodeReserved}, + OpIf: {OpIf, "OP_IF", 1, opcodeIf}, + OpNotIf: {OpNotIf, "OP_NOTIF", 1, opcodeNotIf}, + OpVerIf: {OpVerIf, "OP_VERIF", 1, opcodeReserved}, + OpVerNotIf: {OpVerNotIf, "OP_VERNOTIF", 1, opcodeReserved}, + OpElse: {OpElse, "OP_ELSE", 1, opcodeElse}, + OpEndIf: {OpEndIf, "OP_ENDIF", 1, opcodeEndif}, + OpVerify: {OpVerify, "OP_VERIFY", 1, opcodeVerify}, + OpReturn: {OpReturn, "OP_RETURN", 1, opcodeReturn}, + OpCheckLockTimeVerify: {OpCheckLockTimeVerify, "OP_CHECKLOCKTIMEVERIFY", 1, opcodeCheckLockTimeVerify}, + OpCheckSequenceVerify: {OpCheckSequenceVerify, "OP_CHECKSEQUENCEVERIFY", 1, opcodeCheckSequenceVerify}, // Stack opcodes. - OP_TOALTSTACK: {OP_TOALTSTACK, "OP_TOALTSTACK", 1, opcodeToAltStack}, - OP_FROMALTSTACK: {OP_FROMALTSTACK, "OP_FROMALTSTACK", 1, opcodeFromAltStack}, - OP_2DROP: {OP_2DROP, "OP_2DROP", 1, opcode2Drop}, - OP_2DUP: {OP_2DUP, "OP_2DUP", 1, opcode2Dup}, - OP_3DUP: {OP_3DUP, "OP_3DUP", 1, opcode3Dup}, - OP_2OVER: {OP_2OVER, "OP_2OVER", 1, opcode2Over}, - OP_2ROT: {OP_2ROT, "OP_2ROT", 1, opcode2Rot}, - OP_2SWAP: {OP_2SWAP, "OP_2SWAP", 1, opcode2Swap}, - OP_IFDUP: {OP_IFDUP, "OP_IFDUP", 1, opcodeIfDup}, - OP_DEPTH: {OP_DEPTH, "OP_DEPTH", 1, opcodeDepth}, - OP_DROP: {OP_DROP, "OP_DROP", 1, opcodeDrop}, - OP_DUP: {OP_DUP, "OP_DUP", 1, opcodeDup}, - OP_NIP: {OP_NIP, "OP_NIP", 1, opcodeNip}, - OP_OVER: {OP_OVER, "OP_OVER", 1, opcodeOver}, - OP_PICK: {OP_PICK, "OP_PICK", 1, opcodePick}, - OP_ROLL: {OP_ROLL, "OP_ROLL", 1, opcodeRoll}, - OP_ROT: {OP_ROT, "OP_ROT", 1, opcodeRot}, - OP_SWAP: {OP_SWAP, "OP_SWAP", 1, opcodeSwap}, - OP_TUCK: {OP_TUCK, "OP_TUCK", 1, opcodeTuck}, + OpToAltStack: {OpToAltStack, "OP_TOALTSTACK", 1, opcodeToAltStack}, + OpFromAltStack: {OpFromAltStack, "OP_FROMALTSTACK", 1, opcodeFromAltStack}, + Op2Drop: {Op2Drop, "OP_2DROP", 1, opcode2Drop}, + Op2Dup: {Op2Dup, "OP_2DUP", 1, opcode2Dup}, + Op3Dup: {Op3Dup, "OP_3DUP", 1, opcode3Dup}, + Op2Over: {Op2Over, "OP_2OVER", 1, opcode2Over}, + Op2Rot: {Op2Rot, "OP_2ROT", 1, opcode2Rot}, + Op2Swap: {Op2Swap, "OP_2SWAP", 1, opcode2Swap}, + OpIfDup: {OpIfDup, "OP_IFDUP", 1, opcodeIfDup}, + OpDepth: {OpDepth, "OP_DEPTH", 1, opcodeDepth}, + OpDrop: {OpDrop, "OP_DROP", 1, opcodeDrop}, + OpDup: {OpDup, "OP_DUP", 1, opcodeDup}, + OpNip: {OpNip, "OP_NIP", 1, opcodeNip}, + OpOver: {OpOver, "OP_OVER", 1, opcodeOver}, + OpPick: {OpPick, "OP_PICK", 1, opcodePick}, + OpRoll: {OpRoll, "OP_ROLL", 1, opcodeRoll}, + OpRot: {OpRot, "OP_ROT", 1, opcodeRot}, + OpSwap: {OpSwap, "OP_SWAP", 1, opcodeSwap}, + OpTuck: {OpTuck, "OP_TUCK", 1, opcodeTuck}, // Splice opcodes. - OP_CAT: {OP_CAT, "OP_CAT", 1, opcodeDisabled}, - OP_SUBSTR: {OP_SUBSTR, "OP_SUBSTR", 1, opcodeDisabled}, - OP_LEFT: {OP_LEFT, "OP_LEFT", 1, opcodeDisabled}, - OP_RIGHT: {OP_RIGHT, "OP_RIGHT", 1, opcodeDisabled}, - OP_SIZE: {OP_SIZE, "OP_SIZE", 1, opcodeSize}, + OpCat: {OpCat, "OP_CAT", 1, opcodeDisabled}, + OpSubStr: {OpSubStr, "OP_SUBSTR", 1, opcodeDisabled}, + OpLeft: {OpLeft, "OP_LEFT", 1, opcodeDisabled}, + OpRight: {OpRight, "OP_RIGHT", 1, opcodeDisabled}, + OpSize: {OpSize, "OP_SIZE", 1, opcodeSize}, // Bitwise logic opcodes. - OP_INVERT: {OP_INVERT, "OP_INVERT", 1, opcodeDisabled}, - OP_AND: {OP_AND, "OP_AND", 1, opcodeDisabled}, - OP_OR: {OP_OR, "OP_OR", 1, opcodeDisabled}, - OP_XOR: {OP_XOR, "OP_XOR", 1, opcodeDisabled}, - OP_EQUAL: {OP_EQUAL, "OP_EQUAL", 1, opcodeEqual}, - OP_EQUALVERIFY: {OP_EQUALVERIFY, "OP_EQUALVERIFY", 1, opcodeEqualVerify}, - OP_RESERVED1: {OP_RESERVED1, "OP_RESERVED1", 1, opcodeReserved}, - OP_RESERVED2: {OP_RESERVED2, "OP_RESERVED2", 1, opcodeReserved}, + OpInvert: {OpInvert, "OP_INVERT", 1, opcodeDisabled}, + OpAnd: {OpAnd, "OP_AND", 1, opcodeDisabled}, + OpOr: {OpOr, "OP_OR", 1, opcodeDisabled}, + OpXor: {OpXor, "OP_XOR", 1, opcodeDisabled}, + OpEqual: {OpEqual, "OP_EQUAL", 1, opcodeEqual}, + OpEqualVerify: {OpEqualVerify, "OP_EQUALVERIFY", 1, opcodeEqualVerify}, + OpReserved1: {OpReserved1, "OP_RESERVED1", 1, opcodeReserved}, + OpReserved2: {OpReserved2, "OP_RESERVED2", 1, opcodeReserved}, // Numeric related opcodes. - OP_1ADD: {OP_1ADD, "OP_1ADD", 1, opcode1Add}, - OP_1SUB: {OP_1SUB, "OP_1SUB", 1, opcode1Sub}, - OP_2MUL: {OP_2MUL, "OP_2MUL", 1, opcodeDisabled}, - OP_2DIV: {OP_2DIV, "OP_2DIV", 1, opcodeDisabled}, - OP_NEGATE: {OP_NEGATE, "OP_NEGATE", 1, opcodeNegate}, - OP_ABS: {OP_ABS, "OP_ABS", 1, opcodeAbs}, - OP_NOT: {OP_NOT, "OP_NOT", 1, opcodeNot}, - OP_0NOTEQUAL: {OP_0NOTEQUAL, "OP_0NOTEQUAL", 1, opcode0NotEqual}, - OP_ADD: {OP_ADD, "OP_ADD", 1, opcodeAdd}, - OP_SUB: {OP_SUB, "OP_SUB", 1, opcodeSub}, - OP_MUL: {OP_MUL, "OP_MUL", 1, opcodeDisabled}, - OP_DIV: {OP_DIV, "OP_DIV", 1, opcodeDisabled}, - OP_MOD: {OP_MOD, "OP_MOD", 1, opcodeDisabled}, - OP_LSHIFT: {OP_LSHIFT, "OP_LSHIFT", 1, opcodeDisabled}, - OP_RSHIFT: {OP_RSHIFT, "OP_RSHIFT", 1, opcodeDisabled}, - OP_BOOLAND: {OP_BOOLAND, "OP_BOOLAND", 1, opcodeBoolAnd}, - OP_BOOLOR: {OP_BOOLOR, "OP_BOOLOR", 1, opcodeBoolOr}, - OP_NUMEQUAL: {OP_NUMEQUAL, "OP_NUMEQUAL", 1, opcodeNumEqual}, - OP_NUMEQUALVERIFY: {OP_NUMEQUALVERIFY, "OP_NUMEQUALVERIFY", 1, opcodeNumEqualVerify}, - OP_NUMNOTEQUAL: {OP_NUMNOTEQUAL, "OP_NUMNOTEQUAL", 1, opcodeNumNotEqual}, - OP_LESSTHAN: {OP_LESSTHAN, "OP_LESSTHAN", 1, opcodeLessThan}, - OP_GREATERTHAN: {OP_GREATERTHAN, "OP_GREATERTHAN", 1, opcodeGreaterThan}, - OP_LESSTHANOREQUAL: {OP_LESSTHANOREQUAL, "OP_LESSTHANOREQUAL", 1, opcodeLessThanOrEqual}, - OP_GREATERTHANOREQUAL: {OP_GREATERTHANOREQUAL, "OP_GREATERTHANOREQUAL", 1, opcodeGreaterThanOrEqual}, - OP_MIN: {OP_MIN, "OP_MIN", 1, opcodeMin}, - OP_MAX: {OP_MAX, "OP_MAX", 1, opcodeMax}, - OP_WITHIN: {OP_WITHIN, "OP_WITHIN", 1, opcodeWithin}, + Op1Add: {Op1Add, "OP_1ADD", 1, opcode1Add}, + Op1Sub: {Op1Sub, "OP_1SUB", 1, opcode1Sub}, + Op2Mul: {Op2Mul, "OP_2MUL", 1, opcodeDisabled}, + Op2Div: {Op2Div, "OP_2DIV", 1, opcodeDisabled}, + OpNegate: {OpNegate, "OP_NEGATE", 1, opcodeNegate}, + OpAbs: {OpAbs, "OP_ABS", 1, opcodeAbs}, + OpNot: {OpNot, "OP_NOT", 1, opcodeNot}, + Op0NotEqual: {Op0NotEqual, "OP_0NOTEQUAL", 1, opcode0NotEqual}, + OpAdd: {OpAdd, "OP_ADD", 1, opcodeAdd}, + OpSub: {OpSub, "OP_SUB", 1, opcodeSub}, + OpMul: {OpMul, "OP_MUL", 1, opcodeDisabled}, + OpDiv: {OpDiv, "OP_DIV", 1, opcodeDisabled}, + OpMod: {OpMod, "OP_MOD", 1, opcodeDisabled}, + OpLShift: {OpLShift, "OP_LSHIFT", 1, opcodeDisabled}, + OpRShift: {OpRShift, "OP_RSHIFT", 1, opcodeDisabled}, + OpBoolAnd: {OpBoolAnd, "OP_BOOLAND", 1, opcodeBoolAnd}, + OpBoolOr: {OpBoolOr, "OP_BOOLOR", 1, opcodeBoolOr}, + OpNumEqual: {OpNumEqual, "OP_NUMEQUAL", 1, opcodeNumEqual}, + OpNumEqualVerify: {OpNumEqualVerify, "OP_NUMEQUALVERIFY", 1, opcodeNumEqualVerify}, + OpNumNotEqual: {OpNumNotEqual, "OP_NUMNOTEQUAL", 1, opcodeNumNotEqual}, + OpLessThan: {OpLessThan, "OP_LESSTHAN", 1, opcodeLessThan}, + OpGreaterThan: {OpGreaterThan, "OP_GREATERTHAN", 1, opcodeGreaterThan}, + OpLessThanOrEqual: {OpLessThanOrEqual, "OP_LESSTHANOREQUAL", 1, opcodeLessThanOrEqual}, + OpGreaterThanOrEqual: {OpGreaterThanOrEqual, "OP_GREATERTHANOREQUAL", 1, opcodeGreaterThanOrEqual}, + OpMin: {OpMin, "OP_MIN", 1, opcodeMin}, + OpMax: {OpMax, "OP_MAX", 1, opcodeMax}, + OpWithin: {OpWithin, "OP_WITHIN", 1, opcodeWithin}, // Crypto opcodes. - OP_RIPEMD160: {OP_RIPEMD160, "OP_RIPEMD160", 1, opcodeRipemd160}, - OP_SHA1: {OP_SHA1, "OP_SHA1", 1, opcodeSha1}, - OP_SHA256: {OP_SHA256, "OP_SHA256", 1, opcodeSha256}, - OP_HASH160: {OP_HASH160, "OP_HASH160", 1, opcodeHash160}, - OP_HASH256: {OP_HASH256, "OP_HASH256", 1, opcodeHash256}, - OP_CODESEPARATOR: {OP_CODESEPARATOR, "OP_CODESEPARATOR", 1, opcodeCodeSeparator}, - OP_CHECKSIG: {OP_CHECKSIG, "OP_CHECKSIG", 1, opcodeCheckSig}, - OP_CHECKSIGVERIFY: {OP_CHECKSIGVERIFY, "OP_CHECKSIGVERIFY", 1, opcodeCheckSigVerify}, - OP_CHECKMULTISIG: {OP_CHECKMULTISIG, "OP_CHECKMULTISIG", 1, opcodeCheckMultiSig}, - OP_CHECKMULTISIGVERIFY: {OP_CHECKMULTISIGVERIFY, "OP_CHECKMULTISIGVERIFY", 1, opcodeCheckMultiSigVerify}, + OpRipeMD160: {OpRipeMD160, "OP_RIPEMD160", 1, opcodeRipemd160}, + OpSHA1: {OpSHA1, "OP_SHA1", 1, opcodeSha1}, + OpSHA256: {OpSHA256, "OP_SHA256", 1, opcodeSha256}, + OpHash160: {OpHash160, "OP_HASH160", 1, opcodeHash160}, + OpHash256: {OpHash256, "OP_HASH256", 1, opcodeHash256}, + OpCodeSeparator: {OpCodeSeparator, "OP_CODESEPARATOR", 1, opcodeCodeSeparator}, + OpCheckSig: {OpCheckSig, "OP_CHECKSIG", 1, opcodeCheckSig}, + OpCheckSigVerify: {OpCheckSigVerify, "OP_CHECKSIGVERIFY", 1, opcodeCheckSigVerify}, + OpCheckMultiSig: {OpCheckMultiSig, "OP_CHECKMULTISIG", 1, opcodeCheckMultiSig}, + OpCheckMultiSigVerify: {OpCheckMultiSigVerify, "OP_CHECKMULTISIGVERIFY", 1, opcodeCheckMultiSigVerify}, // Reserved opcodes. - OP_NOP1: {OP_NOP1, "OP_NOP1", 1, opcodeNop}, - OP_NOP4: {OP_NOP4, "OP_NOP4", 1, opcodeNop}, - OP_NOP5: {OP_NOP5, "OP_NOP5", 1, opcodeNop}, - OP_NOP6: {OP_NOP6, "OP_NOP6", 1, opcodeNop}, - OP_NOP7: {OP_NOP7, "OP_NOP7", 1, opcodeNop}, - OP_NOP8: {OP_NOP8, "OP_NOP8", 1, opcodeNop}, - OP_NOP9: {OP_NOP9, "OP_NOP9", 1, opcodeNop}, - OP_NOP10: {OP_NOP10, "OP_NOP10", 1, opcodeNop}, + OpNop1: {OpNop1, "OP_NOP1", 1, opcodeNop}, + OpNop4: {OpNop4, "OP_NOP4", 1, opcodeNop}, + OpNop5: {OpNop5, "OP_NOP5", 1, opcodeNop}, + OpNop6: {OpNop6, "OP_NOP6", 1, opcodeNop}, + OpNop7: {OpNop7, "OP_NOP7", 1, opcodeNop}, + OpNop8: {OpNop8, "OP_NOP8", 1, opcodeNop}, + OpNop9: {OpNop9, "OP_NOP9", 1, opcodeNop}, + OpNop10: {OpNop10, "OP_NOP10", 1, opcodeNop}, // Undefined opcodes. - OP_UNKNOWN186: {OP_UNKNOWN186, "OP_UNKNOWN186", 1, opcodeInvalid}, - OP_UNKNOWN187: {OP_UNKNOWN187, "OP_UNKNOWN187", 1, opcodeInvalid}, - OP_UNKNOWN188: {OP_UNKNOWN188, "OP_UNKNOWN188", 1, opcodeInvalid}, - OP_UNKNOWN189: {OP_UNKNOWN189, "OP_UNKNOWN189", 1, opcodeInvalid}, - OP_UNKNOWN190: {OP_UNKNOWN190, "OP_UNKNOWN190", 1, opcodeInvalid}, - OP_UNKNOWN191: {OP_UNKNOWN191, "OP_UNKNOWN191", 1, opcodeInvalid}, - OP_UNKNOWN192: {OP_UNKNOWN192, "OP_UNKNOWN192", 1, opcodeInvalid}, - OP_UNKNOWN193: {OP_UNKNOWN193, "OP_UNKNOWN193", 1, opcodeInvalid}, - OP_UNKNOWN194: {OP_UNKNOWN194, "OP_UNKNOWN194", 1, opcodeInvalid}, - OP_UNKNOWN195: {OP_UNKNOWN195, "OP_UNKNOWN195", 1, opcodeInvalid}, - OP_UNKNOWN196: {OP_UNKNOWN196, "OP_UNKNOWN196", 1, opcodeInvalid}, - OP_UNKNOWN197: {OP_UNKNOWN197, "OP_UNKNOWN197", 1, opcodeInvalid}, - OP_UNKNOWN198: {OP_UNKNOWN198, "OP_UNKNOWN198", 1, opcodeInvalid}, - OP_UNKNOWN199: {OP_UNKNOWN199, "OP_UNKNOWN199", 1, opcodeInvalid}, - OP_UNKNOWN200: {OP_UNKNOWN200, "OP_UNKNOWN200", 1, opcodeInvalid}, - OP_UNKNOWN201: {OP_UNKNOWN201, "OP_UNKNOWN201", 1, opcodeInvalid}, - OP_UNKNOWN202: {OP_UNKNOWN202, "OP_UNKNOWN202", 1, opcodeInvalid}, - OP_UNKNOWN203: {OP_UNKNOWN203, "OP_UNKNOWN203", 1, opcodeInvalid}, - OP_UNKNOWN204: {OP_UNKNOWN204, "OP_UNKNOWN204", 1, opcodeInvalid}, - OP_UNKNOWN205: {OP_UNKNOWN205, "OP_UNKNOWN205", 1, opcodeInvalid}, - OP_UNKNOWN206: {OP_UNKNOWN206, "OP_UNKNOWN206", 1, opcodeInvalid}, - OP_UNKNOWN207: {OP_UNKNOWN207, "OP_UNKNOWN207", 1, opcodeInvalid}, - OP_UNKNOWN208: {OP_UNKNOWN208, "OP_UNKNOWN208", 1, opcodeInvalid}, - OP_UNKNOWN209: {OP_UNKNOWN209, "OP_UNKNOWN209", 1, opcodeInvalid}, - OP_UNKNOWN210: {OP_UNKNOWN210, "OP_UNKNOWN210", 1, opcodeInvalid}, - OP_UNKNOWN211: {OP_UNKNOWN211, "OP_UNKNOWN211", 1, opcodeInvalid}, - OP_UNKNOWN212: {OP_UNKNOWN212, "OP_UNKNOWN212", 1, opcodeInvalid}, - OP_UNKNOWN213: {OP_UNKNOWN213, "OP_UNKNOWN213", 1, opcodeInvalid}, - OP_UNKNOWN214: {OP_UNKNOWN214, "OP_UNKNOWN214", 1, opcodeInvalid}, - OP_UNKNOWN215: {OP_UNKNOWN215, "OP_UNKNOWN215", 1, opcodeInvalid}, - OP_UNKNOWN216: {OP_UNKNOWN216, "OP_UNKNOWN216", 1, opcodeInvalid}, - OP_UNKNOWN217: {OP_UNKNOWN217, "OP_UNKNOWN217", 1, opcodeInvalid}, - OP_UNKNOWN218: {OP_UNKNOWN218, "OP_UNKNOWN218", 1, opcodeInvalid}, - OP_UNKNOWN219: {OP_UNKNOWN219, "OP_UNKNOWN219", 1, opcodeInvalid}, - OP_UNKNOWN220: {OP_UNKNOWN220, "OP_UNKNOWN220", 1, opcodeInvalid}, - OP_UNKNOWN221: {OP_UNKNOWN221, "OP_UNKNOWN221", 1, opcodeInvalid}, - OP_UNKNOWN222: {OP_UNKNOWN222, "OP_UNKNOWN222", 1, opcodeInvalid}, - OP_UNKNOWN223: {OP_UNKNOWN223, "OP_UNKNOWN223", 1, opcodeInvalid}, - OP_UNKNOWN224: {OP_UNKNOWN224, "OP_UNKNOWN224", 1, opcodeInvalid}, - OP_UNKNOWN225: {OP_UNKNOWN225, "OP_UNKNOWN225", 1, opcodeInvalid}, - OP_UNKNOWN226: {OP_UNKNOWN226, "OP_UNKNOWN226", 1, opcodeInvalid}, - OP_UNKNOWN227: {OP_UNKNOWN227, "OP_UNKNOWN227", 1, opcodeInvalid}, - OP_UNKNOWN228: {OP_UNKNOWN228, "OP_UNKNOWN228", 1, opcodeInvalid}, - OP_UNKNOWN229: {OP_UNKNOWN229, "OP_UNKNOWN229", 1, opcodeInvalid}, - OP_UNKNOWN230: {OP_UNKNOWN230, "OP_UNKNOWN230", 1, opcodeInvalid}, - OP_UNKNOWN231: {OP_UNKNOWN231, "OP_UNKNOWN231", 1, opcodeInvalid}, - OP_UNKNOWN232: {OP_UNKNOWN232, "OP_UNKNOWN232", 1, opcodeInvalid}, - OP_UNKNOWN233: {OP_UNKNOWN233, "OP_UNKNOWN233", 1, opcodeInvalid}, - OP_UNKNOWN234: {OP_UNKNOWN234, "OP_UNKNOWN234", 1, opcodeInvalid}, - OP_UNKNOWN235: {OP_UNKNOWN235, "OP_UNKNOWN235", 1, opcodeInvalid}, - OP_UNKNOWN236: {OP_UNKNOWN236, "OP_UNKNOWN236", 1, opcodeInvalid}, - OP_UNKNOWN237: {OP_UNKNOWN237, "OP_UNKNOWN237", 1, opcodeInvalid}, - OP_UNKNOWN238: {OP_UNKNOWN238, "OP_UNKNOWN238", 1, opcodeInvalid}, - OP_UNKNOWN239: {OP_UNKNOWN239, "OP_UNKNOWN239", 1, opcodeInvalid}, - OP_UNKNOWN240: {OP_UNKNOWN240, "OP_UNKNOWN240", 1, opcodeInvalid}, - OP_UNKNOWN241: {OP_UNKNOWN241, "OP_UNKNOWN241", 1, opcodeInvalid}, - OP_UNKNOWN242: {OP_UNKNOWN242, "OP_UNKNOWN242", 1, opcodeInvalid}, - OP_UNKNOWN243: {OP_UNKNOWN243, "OP_UNKNOWN243", 1, opcodeInvalid}, - OP_UNKNOWN244: {OP_UNKNOWN244, "OP_UNKNOWN244", 1, opcodeInvalid}, - OP_UNKNOWN245: {OP_UNKNOWN245, "OP_UNKNOWN245", 1, opcodeInvalid}, - OP_UNKNOWN246: {OP_UNKNOWN246, "OP_UNKNOWN246", 1, opcodeInvalid}, - OP_UNKNOWN247: {OP_UNKNOWN247, "OP_UNKNOWN247", 1, opcodeInvalid}, - OP_UNKNOWN248: {OP_UNKNOWN248, "OP_UNKNOWN248", 1, opcodeInvalid}, - OP_UNKNOWN249: {OP_UNKNOWN249, "OP_UNKNOWN249", 1, opcodeInvalid}, + OpUnknown186: {OpUnknown186, "OP_UNKNOWN186", 1, opcodeInvalid}, + OpUnknown187: {OpUnknown187, "OP_UNKNOWN187", 1, opcodeInvalid}, + OpUnknown188: {OpUnknown188, "OP_UNKNOWN188", 1, opcodeInvalid}, + OpUnknown189: {OpUnknown189, "OP_UNKNOWN189", 1, opcodeInvalid}, + OpUnknown190: {OpUnknown190, "OP_UNKNOWN190", 1, opcodeInvalid}, + OpUnknown191: {OpUnknown191, "OP_UNKNOWN191", 1, opcodeInvalid}, + OpUnknown192: {OpUnknown192, "OP_UNKNOWN192", 1, opcodeInvalid}, + OpUnknown193: {OpUnknown193, "OP_UNKNOWN193", 1, opcodeInvalid}, + OpUnknown194: {OpUnknown194, "OP_UNKNOWN194", 1, opcodeInvalid}, + OpUnknown195: {OpUnknown195, "OP_UNKNOWN195", 1, opcodeInvalid}, + OpUnknown196: {OpUnknown196, "OP_UNKNOWN196", 1, opcodeInvalid}, + OpUnknown197: {OpUnknown197, "OP_UNKNOWN197", 1, opcodeInvalid}, + OpUnknown198: {OpUnknown198, "OP_UNKNOWN198", 1, opcodeInvalid}, + OpUnknown199: {OpUnknown199, "OP_UNKNOWN199", 1, opcodeInvalid}, + OpUnknown200: {OpUnknown200, "OP_UNKNOWN200", 1, opcodeInvalid}, + OpUnknown201: {OpUnknown201, "OP_UNKNOWN201", 1, opcodeInvalid}, + OpUnknown202: {OpUnknown202, "OP_UNKNOWN202", 1, opcodeInvalid}, + OpUnknown203: {OpUnknown203, "OP_UNKNOWN203", 1, opcodeInvalid}, + OpUnknown204: {OpUnknown204, "OP_UNKNOWN204", 1, opcodeInvalid}, + OpUnknown205: {OpUnknown205, "OP_UNKNOWN205", 1, opcodeInvalid}, + OpUnknown206: {OpUnknown206, "OP_UNKNOWN206", 1, opcodeInvalid}, + OpUnknown207: {OpUnknown207, "OP_UNKNOWN207", 1, opcodeInvalid}, + OpUnknown208: {OpUnknown208, "OP_UNKNOWN208", 1, opcodeInvalid}, + OpUnknown209: {OpUnknown209, "OP_UNKNOWN209", 1, opcodeInvalid}, + OpUnknown210: {OpUnknown210, "OP_UNKNOWN210", 1, opcodeInvalid}, + OpUnknown211: {OpUnknown211, "OP_UNKNOWN211", 1, opcodeInvalid}, + OpUnknown212: {OpUnknown212, "OP_UNKNOWN212", 1, opcodeInvalid}, + OpUnknown213: {OpUnknown213, "OP_UNKNOWN213", 1, opcodeInvalid}, + OpUnknown214: {OpUnknown214, "OP_UNKNOWN214", 1, opcodeInvalid}, + OpUnknown215: {OpUnknown215, "OP_UNKNOWN215", 1, opcodeInvalid}, + OpUnknown216: {OpUnknown216, "OP_UNKNOWN216", 1, opcodeInvalid}, + OpUnknown217: {OpUnknown217, "OP_UNKNOWN217", 1, opcodeInvalid}, + OpUnknown218: {OpUnknown218, "OP_UNKNOWN218", 1, opcodeInvalid}, + OpUnknown219: {OpUnknown219, "OP_UNKNOWN219", 1, opcodeInvalid}, + OpUnknown220: {OpUnknown220, "OP_UNKNOWN220", 1, opcodeInvalid}, + OpUnknown221: {OpUnknown221, "OP_UNKNOWN221", 1, opcodeInvalid}, + OpUnknown222: {OpUnknown222, "OP_UNKNOWN222", 1, opcodeInvalid}, + OpUnknown223: {OpUnknown223, "OP_UNKNOWN223", 1, opcodeInvalid}, + OpUnknown224: {OpUnknown224, "OP_UNKNOWN224", 1, opcodeInvalid}, + OpUnknown225: {OpUnknown225, "OP_UNKNOWN225", 1, opcodeInvalid}, + OpUnknown226: {OpUnknown226, "OP_UNKNOWN226", 1, opcodeInvalid}, + OpUnknown227: {OpUnknown227, "OP_UNKNOWN227", 1, opcodeInvalid}, + OpUnknown228: {OpUnknown228, "OP_UNKNOWN228", 1, opcodeInvalid}, + OpUnknown229: {OpUnknown229, "OP_UNKNOWN229", 1, opcodeInvalid}, + OpUnknown230: {OpUnknown230, "OP_UNKNOWN230", 1, opcodeInvalid}, + OpUnknown231: {OpUnknown231, "OP_UNKNOWN231", 1, opcodeInvalid}, + OpUnknown232: {OpUnknown232, "OP_UNKNOWN232", 1, opcodeInvalid}, + OpUnknown233: {OpUnknown233, "OP_UNKNOWN233", 1, opcodeInvalid}, + OpUnknown234: {OpUnknown234, "OP_UNKNOWN234", 1, opcodeInvalid}, + OpUnknown235: {OpUnknown235, "OP_UNKNOWN235", 1, opcodeInvalid}, + OpUnknown236: {OpUnknown236, "OP_UNKNOWN236", 1, opcodeInvalid}, + OpUnknown237: {OpUnknown237, "OP_UNKNOWN237", 1, opcodeInvalid}, + OpUnknown238: {OpUnknown238, "OP_UNKNOWN238", 1, opcodeInvalid}, + OpUnknown239: {OpUnknown239, "OP_UNKNOWN239", 1, opcodeInvalid}, + OpUnknown240: {OpUnknown240, "OP_UNKNOWN240", 1, opcodeInvalid}, + OpUnknown241: {OpUnknown241, "OP_UNKNOWN241", 1, opcodeInvalid}, + OpUnknown242: {OpUnknown242, "OP_UNKNOWN242", 1, opcodeInvalid}, + OpUnknown243: {OpUnknown243, "OP_UNKNOWN243", 1, opcodeInvalid}, + OpUnknown244: {OpUnknown244, "OP_UNKNOWN244", 1, opcodeInvalid}, + OpUnknown245: {OpUnknown245, "OP_UNKNOWN245", 1, opcodeInvalid}, + OpUnknown246: {OpUnknown246, "OP_UNKNOWN246", 1, opcodeInvalid}, + OpUnknown247: {OpUnknown247, "OP_UNKNOWN247", 1, opcodeInvalid}, + OpUnknown248: {OpUnknown248, "OP_UNKNOWN248", 1, opcodeInvalid}, + OpUnknown249: {OpUnknown249, "OP_UNKNOWN249", 1, opcodeInvalid}, // Bitcoin Core internal use opcode. Defined here for completeness. - OP_SMALLINTEGER: {OP_SMALLINTEGER, "OP_SMALLINTEGER", 1, opcodeInvalid}, - OP_PUBKEYS: {OP_PUBKEYS, "OP_PUBKEYS", 1, opcodeInvalid}, - OP_UNKNOWN252: {OP_UNKNOWN252, "OP_UNKNOWN252", 1, opcodeInvalid}, - OP_PUBKEYHASH: {OP_PUBKEYHASH, "OP_PUBKEYHASH", 1, opcodeInvalid}, - OP_PUBKEY: {OP_PUBKEY, "OP_PUBKEY", 1, opcodeInvalid}, + OpSmallInteger: {OpSmallInteger, "OP_SMALLINTEGER", 1, opcodeInvalid}, + OpPubKeys: {OpPubKeys, "OP_PUBKEYS", 1, opcodeInvalid}, + OpUnknown252: {OpUnknown252, "OP_UNKNOWN252", 1, opcodeInvalid}, + OpPubKeyHash: {OpPubKeyHash, "OP_PUBKEYHASH", 1, opcodeInvalid}, + OpPubKey: {OpPubKey, "OP_PUBKEY", 1, opcodeInvalid}, - OP_INVALIDOPCODE: {OP_INVALIDOPCODE, "OP_INVALIDOPCODE", 1, opcodeInvalid}, + OpInvalidOpCode: {OpInvalidOpCode, "OP_INVALIDOPCODE", 1, opcodeInvalid}, } // opcodeOnelineRepls defines opcode names which are replaced when doing a @@ -621,35 +621,35 @@ type parsedOpcode struct { // bad to see in the instruction stream (even if turned off by a conditional). func (pop *parsedOpcode) isDisabled() bool { switch pop.opcode.value { - case OP_CAT: + case OpCat: return true - case OP_SUBSTR: + case OpSubStr: return true - case OP_LEFT: + case OpLeft: return true - case OP_RIGHT: + case OpRight: return true - case OP_INVERT: + case OpInvert: return true - case OP_AND: + case OpAnd: return true - case OP_OR: + case OpOr: return true - case OP_XOR: + case OpXor: return true - case OP_2MUL: + case Op2Mul: return true - case OP_2DIV: + case Op2Div: return true - case OP_MUL: + case OpMul: return true - case OP_DIV: + case OpDiv: return true - case OP_MOD: + case OpMod: return true - case OP_LSHIFT: + case OpLShift: return true - case OP_RSHIFT: + case OpRShift: return true default: return false @@ -661,9 +661,9 @@ func (pop *parsedOpcode) isDisabled() bool { // coincidence that they are conditionals). func (pop *parsedOpcode) alwaysIllegal() bool { switch pop.opcode.value { - case OP_VERIF: + case OpVerIf: return true - case OP_VERNOTIF: + case OpVerNotIf: return true default: return false @@ -674,13 +674,13 @@ func (pop *parsedOpcode) alwaysIllegal() bool { // changes the conditional execution stack when executed. func (pop *parsedOpcode) isConditional() bool { switch pop.opcode.value { - case OP_IF: + case OpIf: return true - case OP_NOTIF: + case OpNotIf: return true - case OP_ELSE: + case OpElse: return true - case OP_ENDIF: + case OpEndIf: return true default: return false @@ -697,12 +697,12 @@ func (pop *parsedOpcode) checkMinimalDataPush() error { dataLen := len(data) opcode := pop.opcode.value - if dataLen == 0 && opcode != OP_0 { + if dataLen == 0 && opcode != Op0 { str := fmt.Sprintf("zero length data push is encoded with "+ "opcode %s instead of OP_0", pop.opcode.name) return scriptError(ErrMinimalData, str) } else if dataLen == 1 && data[0] >= 1 && data[0] <= 16 { - if opcode != OP_1+data[0]-1 { + if opcode != Op1+data[0]-1 { // Should have used OP_1 .. OP_16 str := fmt.Sprintf("data push of the value %d encoded "+ "with opcode %s instead of OP_%d", data[0], @@ -710,7 +710,7 @@ func (pop *parsedOpcode) checkMinimalDataPush() error { return scriptError(ErrMinimalData, str) } } else if dataLen == 1 && data[0] == 0x81 { - if opcode != OP_1NEGATE { + if opcode != Op1Negate { str := fmt.Sprintf("data push of the value -1 encoded "+ "with opcode %s instead of OP_1NEGATE", pop.opcode.name) @@ -725,14 +725,14 @@ func (pop *parsedOpcode) checkMinimalDataPush() error { return scriptError(ErrMinimalData, str) } } else if dataLen <= 255 { - if opcode != OP_PUSHDATA1 { + if opcode != OpPushData1 { str := fmt.Sprintf("data push of %d bytes encoded "+ "with opcode %s instead of OP_PUSHDATA1", dataLen, pop.opcode.name) return scriptError(ErrMinimalData, str) } } else if dataLen <= 65535 { - if opcode != OP_PUSHDATA2 { + if opcode != OpPushData2 { str := fmt.Sprintf("data push of %d bytes encoded "+ "with opcode %s instead of OP_PUSHDATA2", dataLen, pop.opcode.name) @@ -898,7 +898,7 @@ func opcode1Negate(op *parsedOpcode, vm *Engine) error { func opcodeN(op *parsedOpcode, vm *Engine) error { // The opcodes are all defined consecutively, so the numeric value is // the difference. - vm.dstack.PushInt(scriptNum((op.opcode.value - (OP_1 - 1)))) + vm.dstack.PushInt(scriptNum((op.opcode.value - (Op1 - 1)))) return nil } @@ -907,11 +907,11 @@ func opcodeN(op *parsedOpcode, vm *Engine) error { // the flag to discourage use of NOPs is set for select opcodes. func opcodeNop(op *parsedOpcode, vm *Engine) error { switch op.opcode.value { - case OP_NOP1, OP_NOP4, OP_NOP5, - OP_NOP6, OP_NOP7, OP_NOP8, OP_NOP9, OP_NOP10: + case OpNop1, OpNop4, OpNop5, + OpNop6, OpNop7, OpNop8, OpNop9, OpNop10: if vm.hasFlag(ScriptDiscourageUpgradableNops) { str := fmt.Sprintf("OP_NOP%d reserved for soft-fork "+ - "upgrades", op.opcode.value-(OP_NOP1-1)) + "upgrades", op.opcode.value-(OpNop1-1)) return scriptError(ErrDiscourageUpgradableNOPs, str) } } @@ -2365,8 +2365,8 @@ func init() { for _, op := range opcodeArray { OpcodeByName[op.name] = op.value } - OpcodeByName["OP_FALSE"] = OP_FALSE - OpcodeByName["OP_TRUE"] = OP_TRUE - OpcodeByName["OP_NOP2"] = OP_CHECKLOCKTIMEVERIFY - OpcodeByName["OP_NOP3"] = OP_CHECKSEQUENCEVERIFY + OpcodeByName["OP_FALSE"] = OpFalse + OpcodeByName["OP_TRUE"] = OpTrue + OpcodeByName["OP_NOP2"] = OpCheckLockTimeVerify + OpcodeByName["OP_NOP3"] = OpCheckSequenceVerify } diff --git a/txscript/opcode_test.go b/txscript/opcode_test.go index 6e3205a20..5eef9b8f5 100644 --- a/txscript/opcode_test.go +++ b/txscript/opcode_test.go @@ -18,9 +18,9 @@ import ( func TestOpcodeDisabled(t *testing.T) { t.Parallel() - tests := []byte{OP_CAT, OP_SUBSTR, OP_LEFT, OP_RIGHT, OP_INVERT, - OP_AND, OP_OR, OP_2MUL, OP_2DIV, OP_MUL, OP_DIV, OP_MOD, - OP_LSHIFT, OP_RSHIFT, + tests := []byte{OpCat, OpSubStr, OpLeft, OpRight, OpInvert, + OpAnd, OpOr, Op2Mul, Op2Div, OpMul, OpDiv, OpMod, + OpLShift, OpRShift, } for _, opcodeVal := range tests { pop := parsedOpcode{opcode: &opcodeArray[opcodeVal], data: nil} diff --git a/txscript/reference_test.go b/txscript/reference_test.go index 8768132ba..1f465e1f7 100644 --- a/txscript/reference_test.go +++ b/txscript/reference_test.go @@ -82,8 +82,8 @@ func parseShortForm(script string) ([]byte, error) { // have the same value, so detect those by name and // allow them. if (opcodeName == "OP_FALSE" || opcodeName == "OP_TRUE") || - (opcodeValue != OP_0 && (opcodeValue < OP_1 || - opcodeValue > OP_16)) { + (opcodeValue != Op0 && (opcodeValue < Op1 || + opcodeValue > Op16)) { ops[strings.TrimPrefix(opcodeName, "OP_")] = opcodeValue } @@ -242,7 +242,7 @@ func createSpendingTx(sigScript, pkScript []byte) *wire.MsgTx { coinbaseTx := wire.NewMsgTx(wire.TxVersion) outPoint := wire.NewOutPoint(&chainhash.Hash{}, ^uint32(0)) - txIn := wire.NewTxIn(outPoint, []byte{OP_0, OP_0}) + txIn := wire.NewTxIn(outPoint, []byte{Op0, Op0}) txOut := wire.NewTxOut(0, pkScript) coinbaseTx.AddTxIn(txIn) coinbaseTx.AddTxOut(txOut) diff --git a/txscript/script.go b/txscript/script.go index 362c79b35..5f4798875 100644 --- a/txscript/script.go +++ b/txscript/script.go @@ -45,7 +45,7 @@ const ( // isSmallInt returns whether or not the opcode is considered a small integer, // which is an OP_0, or OP_1 through OP_16. func isSmallInt(op *opcode) bool { - if op.value == OP_0 || (op.value >= OP_1 && op.value <= OP_16) { + if op.value == Op0 || (op.value >= Op1 && op.value <= Op16) { return true } return false @@ -55,9 +55,9 @@ func isSmallInt(op *opcode) bool { // transaction, false otherwise. func isScriptHash(pops []parsedOpcode) bool { return len(pops) == 3 && - pops[0].opcode.value == OP_HASH160 && - pops[1].opcode.value == OP_DATA_20 && - pops[2].opcode.value == OP_EQUAL + pops[0].opcode.value == OpHash160 && + pops[1].opcode.value == OpData20 && + pops[2].opcode.value == OpEqual } // IsPayToScriptHash returns true if the script is in the standard @@ -81,7 +81,7 @@ func isPushOnly(pops []parsedOpcode) bool { // NOTE: This does consider OP_RESERVED to be a data push // instruction, but execution of OP_RESERVED will fail anyways // and matches the behavior required by consensus. - if pop.opcode.value > OP_16 { + if pop.opcode.value > Op16 { return false } } @@ -246,20 +246,20 @@ func canonicalPush(pop parsedOpcode) bool { opcode := pop.opcode.value data := pop.data dataLen := len(pop.data) - if opcode > OP_16 { + if opcode > Op16 { return true } - if opcode < OP_PUSHDATA1 && opcode > OP_0 && (dataLen == 1 && data[0] <= 16) { + if opcode < OpPushData1 && opcode > Op0 && (dataLen == 1 && data[0] <= 16) { return false } - if opcode == OP_PUSHDATA1 && dataLen < OP_PUSHDATA1 { + if opcode == OpPushData1 && dataLen < OpPushData1 { return false } - if opcode == OP_PUSHDATA2 && dataLen <= 0xff { + if opcode == OpPushData2 && dataLen <= 0xff { return false } - if opcode == OP_PUSHDATA4 && dataLen <= 0xffff { + if opcode == OpPushData4 && dataLen <= 0xffff { return false } return true @@ -348,7 +348,7 @@ func calcSignatureHash(script []parsedOpcode, hashType SigHashType, tx *wire.Msg } // Remove all instances of OP_CODESEPARATOR from the script. - script = removeOpcode(script, OP_CODESEPARATOR) + script = removeOpcode(script, OpCodeSeparator) // Make a shallow copy of the transaction, zeroing out the script for // all inputs that are not currently being processed. @@ -415,11 +415,11 @@ func calcSignatureHash(script []parsedOpcode, hashType SigHashType, tx *wire.Msg // asSmallInt returns the passed opcode, which must be true according to // isSmallInt(), as an integer. func asSmallInt(op *opcode) int { - if op.value == OP_0 { + if op.value == Op0 { return 0 } - return int(op.value - (OP_1 - 1)) + return int(op.value - (Op1 - 1)) } // getSigOpCount is the implementation function for counting the number of @@ -430,20 +430,20 @@ func getSigOpCount(pops []parsedOpcode, precise bool) int { nSigs := 0 for i, pop := range pops { switch pop.opcode.value { - case OP_CHECKSIG: + case OpCheckSig: fallthrough - case OP_CHECKSIGVERIFY: + case OpCheckSigVerify: nSigs++ - case OP_CHECKMULTISIG: + case OpCheckMultiSig: fallthrough - case OP_CHECKMULTISIGVERIFY: + case OpCheckMultiSigVerify: // If we are being precise then look for familiar // patterns for multisig, for now all we recognize is // 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 { + pops[i-1].opcode.value >= Op1 && + pops[i-1].opcode.value <= Op16 { nSigs += asSmallInt(pops[i-1].opcode) } else { nSigs += MaxPubKeysPerMultiSig @@ -521,5 +521,5 @@ func IsUnspendable(pkScript []byte) bool { return true } - return len(pops) > 0 && pops[0].opcode.value == OP_RETURN + return len(pops) > 0 && pops[0].opcode.value == OpReturn } diff --git a/txscript/script_test.go b/txscript/script_test.go index a35c39e99..fb6674af8 100644 --- a/txscript/script_test.go +++ b/txscript/script_test.go @@ -15,11 +15,11 @@ func TestParseOpcode(t *testing.T) { // Deep copy the array and make one of the opcodes invalid by setting it // to the wrong length. fakeArray := opcodeArray - fakeArray[OP_PUSHDATA4] = opcode{value: OP_PUSHDATA4, + fakeArray[OpPushData4] = opcode{value: OpPushData4, name: "OP_PUSHDATA4", length: -8, opfunc: opcodePushData} // This script would be fine if -8 was a valid length. - _, err := parseScriptTemplate([]byte{OP_PUSHDATA4, 0x1, 0x00, 0x00, + _, err := parseScriptTemplate([]byte{OpPushData4, 0x1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, &fakeArray) if err == nil { t.Errorf("no error with dodgy opcode array!") @@ -37,7 +37,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_FALSE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_FALSE], + opcode: &opcodeArray[OpFalse], data: nil, }, expectedErr: nil, @@ -45,7 +45,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_FALSE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_FALSE], + opcode: &opcodeArray[OpFalse], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -53,7 +53,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_1 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_1], + opcode: &opcodeArray[OpData1], data: nil, }, expectedErr: scriptError(ErrInternal, ""), @@ -61,7 +61,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_1", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_1], + opcode: &opcodeArray[OpData1], data: make([]byte, 1), }, expectedErr: nil, @@ -69,7 +69,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_1 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_1], + opcode: &opcodeArray[OpData1], data: make([]byte, 2), }, expectedErr: scriptError(ErrInternal, ""), @@ -77,7 +77,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_2 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_2], + opcode: &opcodeArray[OpData2], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -85,7 +85,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_2], + opcode: &opcodeArray[OpData2], data: make([]byte, 2), }, expectedErr: nil, @@ -93,7 +93,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_2 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_2], + opcode: &opcodeArray[OpData2], data: make([]byte, 3), }, expectedErr: scriptError(ErrInternal, ""), @@ -101,7 +101,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_3 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_3], + opcode: &opcodeArray[OpData3], data: make([]byte, 2), }, expectedErr: scriptError(ErrInternal, ""), @@ -109,7 +109,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_3", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_3], + opcode: &opcodeArray[OpData3], data: make([]byte, 3), }, expectedErr: nil, @@ -117,7 +117,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_3 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_3], + opcode: &opcodeArray[OpData3], data: make([]byte, 4), }, expectedErr: scriptError(ErrInternal, ""), @@ -125,7 +125,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_4 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_4], + opcode: &opcodeArray[OpData4], data: make([]byte, 3), }, expectedErr: scriptError(ErrInternal, ""), @@ -133,7 +133,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_4", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_4], + opcode: &opcodeArray[OpData4], data: make([]byte, 4), }, expectedErr: nil, @@ -141,7 +141,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_4 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_4], + opcode: &opcodeArray[OpData4], data: make([]byte, 5), }, expectedErr: scriptError(ErrInternal, ""), @@ -149,7 +149,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_5 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_5], + opcode: &opcodeArray[OpData5], data: make([]byte, 4), }, expectedErr: scriptError(ErrInternal, ""), @@ -157,7 +157,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_5", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_5], + opcode: &opcodeArray[OpData5], data: make([]byte, 5), }, expectedErr: nil, @@ -165,7 +165,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_5 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_5], + opcode: &opcodeArray[OpData5], data: make([]byte, 6), }, expectedErr: scriptError(ErrInternal, ""), @@ -173,7 +173,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_6 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_6], + opcode: &opcodeArray[OpData6], data: make([]byte, 5), }, expectedErr: scriptError(ErrInternal, ""), @@ -181,7 +181,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_6", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_6], + opcode: &opcodeArray[OpData6], data: make([]byte, 6), }, expectedErr: nil, @@ -189,7 +189,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_6 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_6], + opcode: &opcodeArray[OpData6], data: make([]byte, 7), }, expectedErr: scriptError(ErrInternal, ""), @@ -197,7 +197,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_7 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_7], + opcode: &opcodeArray[OpData7], data: make([]byte, 6), }, expectedErr: scriptError(ErrInternal, ""), @@ -205,7 +205,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_7", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_7], + opcode: &opcodeArray[OpData7], data: make([]byte, 7), }, expectedErr: nil, @@ -213,7 +213,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_7 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_7], + opcode: &opcodeArray[OpData7], data: make([]byte, 8), }, expectedErr: scriptError(ErrInternal, ""), @@ -221,7 +221,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_8 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_8], + opcode: &opcodeArray[OpData8], data: make([]byte, 7), }, expectedErr: scriptError(ErrInternal, ""), @@ -229,7 +229,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_8", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_8], + opcode: &opcodeArray[OpData8], data: make([]byte, 8), }, expectedErr: nil, @@ -237,7 +237,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_8 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_8], + opcode: &opcodeArray[OpData8], data: make([]byte, 9), }, expectedErr: scriptError(ErrInternal, ""), @@ -245,7 +245,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_9 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_9], + opcode: &opcodeArray[OpData9], data: make([]byte, 8), }, expectedErr: scriptError(ErrInternal, ""), @@ -253,7 +253,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_9", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_9], + opcode: &opcodeArray[OpData9], data: make([]byte, 9), }, expectedErr: nil, @@ -261,7 +261,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_9 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_9], + opcode: &opcodeArray[OpData9], data: make([]byte, 10), }, expectedErr: scriptError(ErrInternal, ""), @@ -269,7 +269,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_10 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_10], + opcode: &opcodeArray[OpData10], data: make([]byte, 9), }, expectedErr: scriptError(ErrInternal, ""), @@ -277,7 +277,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_10", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_10], + opcode: &opcodeArray[OpData10], data: make([]byte, 10), }, expectedErr: nil, @@ -285,7 +285,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_10 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_10], + opcode: &opcodeArray[OpData10], data: make([]byte, 11), }, expectedErr: scriptError(ErrInternal, ""), @@ -293,7 +293,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_11 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_11], + opcode: &opcodeArray[OpData11], data: make([]byte, 10), }, expectedErr: scriptError(ErrInternal, ""), @@ -301,7 +301,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_11", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_11], + opcode: &opcodeArray[OpData11], data: make([]byte, 11), }, expectedErr: nil, @@ -309,7 +309,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_11 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_11], + opcode: &opcodeArray[OpData11], data: make([]byte, 12), }, expectedErr: scriptError(ErrInternal, ""), @@ -317,7 +317,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_12 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_12], + opcode: &opcodeArray[OpData12], data: make([]byte, 11), }, expectedErr: scriptError(ErrInternal, ""), @@ -325,7 +325,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_12", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_12], + opcode: &opcodeArray[OpData12], data: make([]byte, 12), }, expectedErr: nil, @@ -333,7 +333,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_12 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_12], + opcode: &opcodeArray[OpData12], data: make([]byte, 13), }, expectedErr: scriptError(ErrInternal, ""), @@ -341,7 +341,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_13 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_13], + opcode: &opcodeArray[OpData13], data: make([]byte, 12), }, expectedErr: scriptError(ErrInternal, ""), @@ -349,7 +349,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_13", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_13], + opcode: &opcodeArray[OpData13], data: make([]byte, 13), }, expectedErr: nil, @@ -357,7 +357,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_13 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_13], + opcode: &opcodeArray[OpData13], data: make([]byte, 14), }, expectedErr: scriptError(ErrInternal, ""), @@ -365,7 +365,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_14 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_14], + opcode: &opcodeArray[OpData14], data: make([]byte, 13), }, expectedErr: scriptError(ErrInternal, ""), @@ -373,7 +373,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_14", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_14], + opcode: &opcodeArray[OpData14], data: make([]byte, 14), }, expectedErr: nil, @@ -381,7 +381,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_14 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_14], + opcode: &opcodeArray[OpData14], data: make([]byte, 15), }, expectedErr: scriptError(ErrInternal, ""), @@ -389,7 +389,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_15 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_15], + opcode: &opcodeArray[OpData15], data: make([]byte, 14), }, expectedErr: scriptError(ErrInternal, ""), @@ -397,7 +397,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_15", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_15], + opcode: &opcodeArray[OpData15], data: make([]byte, 15), }, expectedErr: nil, @@ -405,7 +405,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_15 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_15], + opcode: &opcodeArray[OpData15], data: make([]byte, 16), }, expectedErr: scriptError(ErrInternal, ""), @@ -413,7 +413,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_16 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_16], + opcode: &opcodeArray[OpData16], data: make([]byte, 15), }, expectedErr: scriptError(ErrInternal, ""), @@ -421,7 +421,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_16", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_16], + opcode: &opcodeArray[OpData16], data: make([]byte, 16), }, expectedErr: nil, @@ -429,7 +429,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_16 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_16], + opcode: &opcodeArray[OpData16], data: make([]byte, 17), }, expectedErr: scriptError(ErrInternal, ""), @@ -437,7 +437,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_17 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_17], + opcode: &opcodeArray[OpData17], data: make([]byte, 16), }, expectedErr: scriptError(ErrInternal, ""), @@ -445,7 +445,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_17", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_17], + opcode: &opcodeArray[OpData17], data: make([]byte, 17), }, expectedErr: nil, @@ -453,7 +453,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_17 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_17], + opcode: &opcodeArray[OpData17], data: make([]byte, 18), }, expectedErr: scriptError(ErrInternal, ""), @@ -461,7 +461,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_18 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_18], + opcode: &opcodeArray[OpData18], data: make([]byte, 17), }, expectedErr: scriptError(ErrInternal, ""), @@ -469,7 +469,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_18", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_18], + opcode: &opcodeArray[OpData18], data: make([]byte, 18), }, expectedErr: nil, @@ -477,7 +477,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_18 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_18], + opcode: &opcodeArray[OpData18], data: make([]byte, 19), }, expectedErr: scriptError(ErrInternal, ""), @@ -485,7 +485,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_19 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_19], + opcode: &opcodeArray[OpData19], data: make([]byte, 18), }, expectedErr: scriptError(ErrInternal, ""), @@ -493,7 +493,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_19", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_19], + opcode: &opcodeArray[OpData19], data: make([]byte, 19), }, expectedErr: nil, @@ -501,7 +501,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_19 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_19], + opcode: &opcodeArray[OpData19], data: make([]byte, 20), }, expectedErr: scriptError(ErrInternal, ""), @@ -509,7 +509,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_20 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_20], + opcode: &opcodeArray[OpData20], data: make([]byte, 19), }, expectedErr: scriptError(ErrInternal, ""), @@ -517,7 +517,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_20", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_20], + opcode: &opcodeArray[OpData20], data: make([]byte, 20), }, expectedErr: nil, @@ -525,7 +525,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_20 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_20], + opcode: &opcodeArray[OpData20], data: make([]byte, 21), }, expectedErr: scriptError(ErrInternal, ""), @@ -533,7 +533,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_21 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_21], + opcode: &opcodeArray[OpData21], data: make([]byte, 20), }, expectedErr: scriptError(ErrInternal, ""), @@ -541,7 +541,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_21", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_21], + opcode: &opcodeArray[OpData21], data: make([]byte, 21), }, expectedErr: nil, @@ -549,7 +549,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_21 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_21], + opcode: &opcodeArray[OpData21], data: make([]byte, 22), }, expectedErr: scriptError(ErrInternal, ""), @@ -557,7 +557,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_22 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_22], + opcode: &opcodeArray[OpData22], data: make([]byte, 21), }, expectedErr: scriptError(ErrInternal, ""), @@ -565,7 +565,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_22", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_22], + opcode: &opcodeArray[OpData22], data: make([]byte, 22), }, expectedErr: nil, @@ -573,7 +573,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_22 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_22], + opcode: &opcodeArray[OpData22], data: make([]byte, 23), }, expectedErr: scriptError(ErrInternal, ""), @@ -581,7 +581,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_23 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_23], + opcode: &opcodeArray[OpData23], data: make([]byte, 22), }, expectedErr: scriptError(ErrInternal, ""), @@ -589,7 +589,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_23", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_23], + opcode: &opcodeArray[OpData23], data: make([]byte, 23), }, expectedErr: nil, @@ -597,7 +597,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_23 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_23], + opcode: &opcodeArray[OpData23], data: make([]byte, 24), }, expectedErr: scriptError(ErrInternal, ""), @@ -605,7 +605,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_24 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_24], + opcode: &opcodeArray[OpData24], data: make([]byte, 23), }, expectedErr: scriptError(ErrInternal, ""), @@ -613,7 +613,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_24", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_24], + opcode: &opcodeArray[OpData24], data: make([]byte, 24), }, expectedErr: nil, @@ -621,7 +621,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_24 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_24], + opcode: &opcodeArray[OpData24], data: make([]byte, 25), }, expectedErr: scriptError(ErrInternal, ""), @@ -629,7 +629,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_25 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_25], + opcode: &opcodeArray[OpData25], data: make([]byte, 24), }, expectedErr: scriptError(ErrInternal, ""), @@ -637,7 +637,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_25", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_25], + opcode: &opcodeArray[OpData25], data: make([]byte, 25), }, expectedErr: nil, @@ -645,7 +645,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_25 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_25], + opcode: &opcodeArray[OpData25], data: make([]byte, 26), }, expectedErr: scriptError(ErrInternal, ""), @@ -653,7 +653,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_26 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_26], + opcode: &opcodeArray[OpData26], data: make([]byte, 25), }, expectedErr: scriptError(ErrInternal, ""), @@ -661,7 +661,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_26", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_26], + opcode: &opcodeArray[OpData26], data: make([]byte, 26), }, expectedErr: nil, @@ -669,7 +669,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_26 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_26], + opcode: &opcodeArray[OpData26], data: make([]byte, 27), }, expectedErr: scriptError(ErrInternal, ""), @@ -677,7 +677,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_27 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_27], + opcode: &opcodeArray[OpData27], data: make([]byte, 26), }, expectedErr: scriptError(ErrInternal, ""), @@ -685,7 +685,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_27", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_27], + opcode: &opcodeArray[OpData27], data: make([]byte, 27), }, expectedErr: nil, @@ -693,7 +693,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_27 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_27], + opcode: &opcodeArray[OpData27], data: make([]byte, 28), }, expectedErr: scriptError(ErrInternal, ""), @@ -701,7 +701,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_28 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_28], + opcode: &opcodeArray[OpData28], data: make([]byte, 27), }, expectedErr: scriptError(ErrInternal, ""), @@ -709,7 +709,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_28", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_28], + opcode: &opcodeArray[OpData28], data: make([]byte, 28), }, expectedErr: nil, @@ -717,7 +717,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_28 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_28], + opcode: &opcodeArray[OpData28], data: make([]byte, 29), }, expectedErr: scriptError(ErrInternal, ""), @@ -725,7 +725,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_29 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_29], + opcode: &opcodeArray[OpData29], data: make([]byte, 28), }, expectedErr: scriptError(ErrInternal, ""), @@ -733,7 +733,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_29", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_29], + opcode: &opcodeArray[OpData29], data: make([]byte, 29), }, expectedErr: nil, @@ -741,7 +741,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_29 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_29], + opcode: &opcodeArray[OpData29], data: make([]byte, 30), }, expectedErr: scriptError(ErrInternal, ""), @@ -749,7 +749,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_30 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_30], + opcode: &opcodeArray[OpData30], data: make([]byte, 29), }, expectedErr: scriptError(ErrInternal, ""), @@ -757,7 +757,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_30", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_30], + opcode: &opcodeArray[OpData30], data: make([]byte, 30), }, expectedErr: nil, @@ -765,7 +765,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_30 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_30], + opcode: &opcodeArray[OpData30], data: make([]byte, 31), }, expectedErr: scriptError(ErrInternal, ""), @@ -773,7 +773,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_31 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_31], + opcode: &opcodeArray[OpData31], data: make([]byte, 30), }, expectedErr: scriptError(ErrInternal, ""), @@ -781,7 +781,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_31", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_31], + opcode: &opcodeArray[OpData31], data: make([]byte, 31), }, expectedErr: nil, @@ -789,7 +789,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_31 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_31], + opcode: &opcodeArray[OpData31], data: make([]byte, 32), }, expectedErr: scriptError(ErrInternal, ""), @@ -797,7 +797,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_32 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_32], + opcode: &opcodeArray[OpData32], data: make([]byte, 31), }, expectedErr: scriptError(ErrInternal, ""), @@ -805,7 +805,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_32", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_32], + opcode: &opcodeArray[OpData32], data: make([]byte, 32), }, expectedErr: nil, @@ -813,7 +813,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_32 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_32], + opcode: &opcodeArray[OpData32], data: make([]byte, 33), }, expectedErr: scriptError(ErrInternal, ""), @@ -821,7 +821,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_33 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_33], + opcode: &opcodeArray[OpData33], data: make([]byte, 32), }, expectedErr: scriptError(ErrInternal, ""), @@ -829,7 +829,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_33", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_33], + opcode: &opcodeArray[OpData33], data: make([]byte, 33), }, expectedErr: nil, @@ -837,7 +837,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_33 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_33], + opcode: &opcodeArray[OpData33], data: make([]byte, 34), }, expectedErr: scriptError(ErrInternal, ""), @@ -845,7 +845,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_34 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_34], + opcode: &opcodeArray[OpData34], data: make([]byte, 33), }, expectedErr: scriptError(ErrInternal, ""), @@ -853,7 +853,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_34", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_34], + opcode: &opcodeArray[OpData34], data: make([]byte, 34), }, expectedErr: nil, @@ -861,7 +861,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_34 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_34], + opcode: &opcodeArray[OpData34], data: make([]byte, 35), }, expectedErr: scriptError(ErrInternal, ""), @@ -869,7 +869,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_35 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_35], + opcode: &opcodeArray[OpData35], data: make([]byte, 34), }, expectedErr: scriptError(ErrInternal, ""), @@ -877,7 +877,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_35", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_35], + opcode: &opcodeArray[OpData35], data: make([]byte, 35), }, expectedErr: nil, @@ -885,7 +885,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_35 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_35], + opcode: &opcodeArray[OpData35], data: make([]byte, 36), }, expectedErr: scriptError(ErrInternal, ""), @@ -893,7 +893,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_36 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_36], + opcode: &opcodeArray[OpData36], data: make([]byte, 35), }, expectedErr: scriptError(ErrInternal, ""), @@ -901,7 +901,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_36", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_36], + opcode: &opcodeArray[OpData36], data: make([]byte, 36), }, expectedErr: nil, @@ -909,7 +909,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_36 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_36], + opcode: &opcodeArray[OpData36], data: make([]byte, 37), }, expectedErr: scriptError(ErrInternal, ""), @@ -917,7 +917,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_37 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_37], + opcode: &opcodeArray[OpData37], data: make([]byte, 36), }, expectedErr: scriptError(ErrInternal, ""), @@ -925,7 +925,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_37", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_37], + opcode: &opcodeArray[OpData37], data: make([]byte, 37), }, expectedErr: nil, @@ -933,7 +933,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_37 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_37], + opcode: &opcodeArray[OpData37], data: make([]byte, 38), }, expectedErr: scriptError(ErrInternal, ""), @@ -941,7 +941,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_38 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_38], + opcode: &opcodeArray[OpData38], data: make([]byte, 37), }, expectedErr: scriptError(ErrInternal, ""), @@ -949,7 +949,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_38", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_38], + opcode: &opcodeArray[OpData38], data: make([]byte, 38), }, expectedErr: nil, @@ -957,7 +957,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_38 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_38], + opcode: &opcodeArray[OpData38], data: make([]byte, 39), }, expectedErr: scriptError(ErrInternal, ""), @@ -965,7 +965,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_39 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_39], + opcode: &opcodeArray[OpData39], data: make([]byte, 38), }, expectedErr: scriptError(ErrInternal, ""), @@ -973,7 +973,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_39", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_39], + opcode: &opcodeArray[OpData39], data: make([]byte, 39), }, expectedErr: nil, @@ -981,7 +981,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_39 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_39], + opcode: &opcodeArray[OpData39], data: make([]byte, 40), }, expectedErr: scriptError(ErrInternal, ""), @@ -989,7 +989,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_40 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_40], + opcode: &opcodeArray[OpData40], data: make([]byte, 39), }, expectedErr: scriptError(ErrInternal, ""), @@ -997,7 +997,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_40", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_40], + opcode: &opcodeArray[OpData40], data: make([]byte, 40), }, expectedErr: nil, @@ -1005,7 +1005,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_40 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_40], + opcode: &opcodeArray[OpData40], data: make([]byte, 41), }, expectedErr: scriptError(ErrInternal, ""), @@ -1013,7 +1013,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_41 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_41], + opcode: &opcodeArray[OpData41], data: make([]byte, 40), }, expectedErr: scriptError(ErrInternal, ""), @@ -1021,7 +1021,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_41", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_41], + opcode: &opcodeArray[OpData41], data: make([]byte, 41), }, expectedErr: nil, @@ -1029,7 +1029,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_41 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_41], + opcode: &opcodeArray[OpData41], data: make([]byte, 42), }, expectedErr: scriptError(ErrInternal, ""), @@ -1037,7 +1037,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_42 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_42], + opcode: &opcodeArray[OpData42], data: make([]byte, 41), }, expectedErr: scriptError(ErrInternal, ""), @@ -1045,7 +1045,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_42", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_42], + opcode: &opcodeArray[OpData42], data: make([]byte, 42), }, expectedErr: nil, @@ -1053,7 +1053,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_42 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_42], + opcode: &opcodeArray[OpData42], data: make([]byte, 43), }, expectedErr: scriptError(ErrInternal, ""), @@ -1061,7 +1061,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_43 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_43], + opcode: &opcodeArray[OpData43], data: make([]byte, 42), }, expectedErr: scriptError(ErrInternal, ""), @@ -1069,7 +1069,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_43", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_43], + opcode: &opcodeArray[OpData43], data: make([]byte, 43), }, expectedErr: nil, @@ -1077,7 +1077,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_43 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_43], + opcode: &opcodeArray[OpData43], data: make([]byte, 44), }, expectedErr: scriptError(ErrInternal, ""), @@ -1085,7 +1085,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_44 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_44], + opcode: &opcodeArray[OpData44], data: make([]byte, 43), }, expectedErr: scriptError(ErrInternal, ""), @@ -1093,7 +1093,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_44", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_44], + opcode: &opcodeArray[OpData44], data: make([]byte, 44), }, expectedErr: nil, @@ -1101,7 +1101,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_44 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_44], + opcode: &opcodeArray[OpData44], data: make([]byte, 45), }, expectedErr: scriptError(ErrInternal, ""), @@ -1109,7 +1109,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_45 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_45], + opcode: &opcodeArray[OpData45], data: make([]byte, 44), }, expectedErr: scriptError(ErrInternal, ""), @@ -1117,7 +1117,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_45", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_45], + opcode: &opcodeArray[OpData45], data: make([]byte, 45), }, expectedErr: nil, @@ -1125,7 +1125,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_45 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_45], + opcode: &opcodeArray[OpData45], data: make([]byte, 46), }, expectedErr: scriptError(ErrInternal, ""), @@ -1133,7 +1133,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_46 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_46], + opcode: &opcodeArray[OpData46], data: make([]byte, 45), }, expectedErr: scriptError(ErrInternal, ""), @@ -1141,7 +1141,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_46", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_46], + opcode: &opcodeArray[OpData46], data: make([]byte, 46), }, expectedErr: nil, @@ -1149,7 +1149,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_46 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_46], + opcode: &opcodeArray[OpData46], data: make([]byte, 47), }, expectedErr: scriptError(ErrInternal, ""), @@ -1157,7 +1157,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_47 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_47], + opcode: &opcodeArray[OpData47], data: make([]byte, 46), }, expectedErr: scriptError(ErrInternal, ""), @@ -1165,7 +1165,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_47", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_47], + opcode: &opcodeArray[OpData47], data: make([]byte, 47), }, expectedErr: nil, @@ -1173,7 +1173,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_47 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_47], + opcode: &opcodeArray[OpData47], data: make([]byte, 48), }, expectedErr: scriptError(ErrInternal, ""), @@ -1181,7 +1181,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_48 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_48], + opcode: &opcodeArray[OpData48], data: make([]byte, 47), }, expectedErr: scriptError(ErrInternal, ""), @@ -1189,7 +1189,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_48", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_48], + opcode: &opcodeArray[OpData48], data: make([]byte, 48), }, expectedErr: nil, @@ -1197,7 +1197,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_48 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_48], + opcode: &opcodeArray[OpData48], data: make([]byte, 49), }, expectedErr: scriptError(ErrInternal, ""), @@ -1205,7 +1205,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_49 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_49], + opcode: &opcodeArray[OpData49], data: make([]byte, 48), }, expectedErr: scriptError(ErrInternal, ""), @@ -1213,7 +1213,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_49", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_49], + opcode: &opcodeArray[OpData49], data: make([]byte, 49), }, expectedErr: nil, @@ -1221,7 +1221,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_49 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_49], + opcode: &opcodeArray[OpData49], data: make([]byte, 50), }, expectedErr: scriptError(ErrInternal, ""), @@ -1229,7 +1229,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_50 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_50], + opcode: &opcodeArray[OpData50], data: make([]byte, 49), }, expectedErr: scriptError(ErrInternal, ""), @@ -1237,7 +1237,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_50", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_50], + opcode: &opcodeArray[OpData50], data: make([]byte, 50), }, expectedErr: nil, @@ -1245,7 +1245,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_50 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_50], + opcode: &opcodeArray[OpData50], data: make([]byte, 51), }, expectedErr: scriptError(ErrInternal, ""), @@ -1253,7 +1253,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_51 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_51], + opcode: &opcodeArray[OpData51], data: make([]byte, 50), }, expectedErr: scriptError(ErrInternal, ""), @@ -1261,7 +1261,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_51", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_51], + opcode: &opcodeArray[OpData51], data: make([]byte, 51), }, expectedErr: nil, @@ -1269,7 +1269,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_51 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_51], + opcode: &opcodeArray[OpData51], data: make([]byte, 52), }, expectedErr: scriptError(ErrInternal, ""), @@ -1277,7 +1277,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_52 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_52], + opcode: &opcodeArray[OpData52], data: make([]byte, 51), }, expectedErr: scriptError(ErrInternal, ""), @@ -1285,7 +1285,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_52", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_52], + opcode: &opcodeArray[OpData52], data: make([]byte, 52), }, expectedErr: nil, @@ -1293,7 +1293,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_52 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_52], + opcode: &opcodeArray[OpData52], data: make([]byte, 53), }, expectedErr: scriptError(ErrInternal, ""), @@ -1301,7 +1301,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_53 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_53], + opcode: &opcodeArray[OpData53], data: make([]byte, 52), }, expectedErr: scriptError(ErrInternal, ""), @@ -1309,7 +1309,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_53", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_53], + opcode: &opcodeArray[OpData53], data: make([]byte, 53), }, expectedErr: nil, @@ -1317,7 +1317,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_53 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_53], + opcode: &opcodeArray[OpData53], data: make([]byte, 54), }, expectedErr: scriptError(ErrInternal, ""), @@ -1325,7 +1325,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_54 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_54], + opcode: &opcodeArray[OpData54], data: make([]byte, 53), }, expectedErr: scriptError(ErrInternal, ""), @@ -1333,7 +1333,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_54", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_54], + opcode: &opcodeArray[OpData54], data: make([]byte, 54), }, expectedErr: nil, @@ -1341,7 +1341,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_54 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_54], + opcode: &opcodeArray[OpData54], data: make([]byte, 55), }, expectedErr: scriptError(ErrInternal, ""), @@ -1349,7 +1349,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_55 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_55], + opcode: &opcodeArray[OpData55], data: make([]byte, 54), }, expectedErr: scriptError(ErrInternal, ""), @@ -1357,7 +1357,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_55", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_55], + opcode: &opcodeArray[OpData55], data: make([]byte, 55), }, expectedErr: nil, @@ -1365,7 +1365,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_55 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_55], + opcode: &opcodeArray[OpData55], data: make([]byte, 56), }, expectedErr: scriptError(ErrInternal, ""), @@ -1373,7 +1373,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_56 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_56], + opcode: &opcodeArray[OpData56], data: make([]byte, 55), }, expectedErr: scriptError(ErrInternal, ""), @@ -1381,7 +1381,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_56", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_56], + opcode: &opcodeArray[OpData56], data: make([]byte, 56), }, expectedErr: nil, @@ -1389,7 +1389,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_56 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_56], + opcode: &opcodeArray[OpData56], data: make([]byte, 57), }, expectedErr: scriptError(ErrInternal, ""), @@ -1397,7 +1397,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_57 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_57], + opcode: &opcodeArray[OpData57], data: make([]byte, 56), }, expectedErr: scriptError(ErrInternal, ""), @@ -1405,7 +1405,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_57", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_57], + opcode: &opcodeArray[OpData57], data: make([]byte, 57), }, expectedErr: nil, @@ -1413,7 +1413,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_57 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_57], + opcode: &opcodeArray[OpData57], data: make([]byte, 58), }, expectedErr: scriptError(ErrInternal, ""), @@ -1421,7 +1421,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_58 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_58], + opcode: &opcodeArray[OpData58], data: make([]byte, 57), }, expectedErr: scriptError(ErrInternal, ""), @@ -1429,7 +1429,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_58", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_58], + opcode: &opcodeArray[OpData58], data: make([]byte, 58), }, expectedErr: nil, @@ -1437,7 +1437,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_58 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_58], + opcode: &opcodeArray[OpData58], data: make([]byte, 59), }, expectedErr: scriptError(ErrInternal, ""), @@ -1445,7 +1445,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_59 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_59], + opcode: &opcodeArray[OpData59], data: make([]byte, 58), }, expectedErr: scriptError(ErrInternal, ""), @@ -1453,7 +1453,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_59", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_59], + opcode: &opcodeArray[OpData59], data: make([]byte, 59), }, expectedErr: nil, @@ -1461,7 +1461,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_59 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_59], + opcode: &opcodeArray[OpData59], data: make([]byte, 60), }, expectedErr: scriptError(ErrInternal, ""), @@ -1469,7 +1469,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_60 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_60], + opcode: &opcodeArray[OpData60], data: make([]byte, 59), }, expectedErr: scriptError(ErrInternal, ""), @@ -1477,7 +1477,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_60", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_60], + opcode: &opcodeArray[OpData60], data: make([]byte, 60), }, expectedErr: nil, @@ -1485,7 +1485,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_60 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_60], + opcode: &opcodeArray[OpData60], data: make([]byte, 61), }, expectedErr: scriptError(ErrInternal, ""), @@ -1493,7 +1493,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_61 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_61], + opcode: &opcodeArray[OpData61], data: make([]byte, 60), }, expectedErr: scriptError(ErrInternal, ""), @@ -1501,7 +1501,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_61", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_61], + opcode: &opcodeArray[OpData61], data: make([]byte, 61), }, expectedErr: nil, @@ -1509,7 +1509,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_61 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_61], + opcode: &opcodeArray[OpData61], data: make([]byte, 62), }, expectedErr: scriptError(ErrInternal, ""), @@ -1517,7 +1517,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_62 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_62], + opcode: &opcodeArray[OpData62], data: make([]byte, 61), }, expectedErr: scriptError(ErrInternal, ""), @@ -1525,7 +1525,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_62", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_62], + opcode: &opcodeArray[OpData62], data: make([]byte, 62), }, expectedErr: nil, @@ -1533,7 +1533,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_62 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_62], + opcode: &opcodeArray[OpData62], data: make([]byte, 63), }, expectedErr: scriptError(ErrInternal, ""), @@ -1541,7 +1541,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_63 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_63], + opcode: &opcodeArray[OpData63], data: make([]byte, 62), }, expectedErr: scriptError(ErrInternal, ""), @@ -1549,7 +1549,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_63", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_63], + opcode: &opcodeArray[OpData63], data: make([]byte, 63), }, expectedErr: nil, @@ -1557,7 +1557,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_63 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_63], + opcode: &opcodeArray[OpData63], data: make([]byte, 64), }, expectedErr: scriptError(ErrInternal, ""), @@ -1565,7 +1565,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_64 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_64], + opcode: &opcodeArray[OpData64], data: make([]byte, 63), }, expectedErr: scriptError(ErrInternal, ""), @@ -1573,7 +1573,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_64", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_64], + opcode: &opcodeArray[OpData64], data: make([]byte, 64), }, expectedErr: nil, @@ -1581,7 +1581,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_64 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_64], + opcode: &opcodeArray[OpData64], data: make([]byte, 65), }, expectedErr: scriptError(ErrInternal, ""), @@ -1589,7 +1589,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_65 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_65], + opcode: &opcodeArray[OpData65], data: make([]byte, 64), }, expectedErr: scriptError(ErrInternal, ""), @@ -1597,7 +1597,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_65", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_65], + opcode: &opcodeArray[OpData65], data: make([]byte, 65), }, expectedErr: nil, @@ -1605,7 +1605,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_65 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_65], + opcode: &opcodeArray[OpData65], data: make([]byte, 66), }, expectedErr: scriptError(ErrInternal, ""), @@ -1613,7 +1613,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_66 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_66], + opcode: &opcodeArray[OpData66], data: make([]byte, 65), }, expectedErr: scriptError(ErrInternal, ""), @@ -1621,7 +1621,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_66", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_66], + opcode: &opcodeArray[OpData66], data: make([]byte, 66), }, expectedErr: nil, @@ -1629,7 +1629,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_66 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_66], + opcode: &opcodeArray[OpData66], data: make([]byte, 67), }, expectedErr: scriptError(ErrInternal, ""), @@ -1637,7 +1637,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_67 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_67], + opcode: &opcodeArray[OpData67], data: make([]byte, 66), }, expectedErr: scriptError(ErrInternal, ""), @@ -1645,7 +1645,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_67", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_67], + opcode: &opcodeArray[OpData67], data: make([]byte, 67), }, expectedErr: nil, @@ -1653,7 +1653,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_67 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_67], + opcode: &opcodeArray[OpData67], data: make([]byte, 68), }, expectedErr: scriptError(ErrInternal, ""), @@ -1661,7 +1661,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_68 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_68], + opcode: &opcodeArray[OpData68], data: make([]byte, 67), }, expectedErr: scriptError(ErrInternal, ""), @@ -1669,7 +1669,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_68", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_68], + opcode: &opcodeArray[OpData68], data: make([]byte, 68), }, expectedErr: nil, @@ -1677,7 +1677,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_68 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_68], + opcode: &opcodeArray[OpData68], data: make([]byte, 69), }, expectedErr: scriptError(ErrInternal, ""), @@ -1685,7 +1685,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_69 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_69], + opcode: &opcodeArray[OpData69], data: make([]byte, 68), }, expectedErr: scriptError(ErrInternal, ""), @@ -1693,7 +1693,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_69", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_69], + opcode: &opcodeArray[OpData69], data: make([]byte, 69), }, expectedErr: nil, @@ -1701,7 +1701,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_69 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_69], + opcode: &opcodeArray[OpData69], data: make([]byte, 70), }, expectedErr: scriptError(ErrInternal, ""), @@ -1709,7 +1709,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_70 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_70], + opcode: &opcodeArray[OpData70], data: make([]byte, 69), }, expectedErr: scriptError(ErrInternal, ""), @@ -1717,7 +1717,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_70", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_70], + opcode: &opcodeArray[OpData70], data: make([]byte, 70), }, expectedErr: nil, @@ -1725,7 +1725,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_70 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_70], + opcode: &opcodeArray[OpData70], data: make([]byte, 71), }, expectedErr: scriptError(ErrInternal, ""), @@ -1733,7 +1733,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_71 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_71], + opcode: &opcodeArray[OpData71], data: make([]byte, 70), }, expectedErr: scriptError(ErrInternal, ""), @@ -1741,7 +1741,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_71", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_71], + opcode: &opcodeArray[OpData71], data: make([]byte, 71), }, expectedErr: nil, @@ -1749,7 +1749,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_71 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_71], + opcode: &opcodeArray[OpData71], data: make([]byte, 72), }, expectedErr: scriptError(ErrInternal, ""), @@ -1757,7 +1757,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_72 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_72], + opcode: &opcodeArray[OpData72], data: make([]byte, 71), }, expectedErr: scriptError(ErrInternal, ""), @@ -1765,7 +1765,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_72", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_72], + opcode: &opcodeArray[OpData72], data: make([]byte, 72), }, expectedErr: nil, @@ -1773,7 +1773,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_72 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_72], + opcode: &opcodeArray[OpData72], data: make([]byte, 73), }, expectedErr: scriptError(ErrInternal, ""), @@ -1781,7 +1781,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_73 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_73], + opcode: &opcodeArray[OpData73], data: make([]byte, 72), }, expectedErr: scriptError(ErrInternal, ""), @@ -1789,7 +1789,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_73", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_73], + opcode: &opcodeArray[OpData73], data: make([]byte, 73), }, expectedErr: nil, @@ -1797,7 +1797,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_73 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_73], + opcode: &opcodeArray[OpData73], data: make([]byte, 74), }, expectedErr: scriptError(ErrInternal, ""), @@ -1805,7 +1805,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_74 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_74], + opcode: &opcodeArray[OpData74], data: make([]byte, 73), }, expectedErr: scriptError(ErrInternal, ""), @@ -1813,7 +1813,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_74", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_74], + opcode: &opcodeArray[OpData74], data: make([]byte, 74), }, expectedErr: nil, @@ -1821,7 +1821,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_74 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_74], + opcode: &opcodeArray[OpData74], data: make([]byte, 75), }, expectedErr: scriptError(ErrInternal, ""), @@ -1829,7 +1829,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_75 short", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_75], + opcode: &opcodeArray[OpData75], data: make([]byte, 74), }, expectedErr: scriptError(ErrInternal, ""), @@ -1837,7 +1837,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_75", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_75], + opcode: &opcodeArray[OpData75], data: make([]byte, 75), }, expectedErr: nil, @@ -1845,7 +1845,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DATA_75 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DATA_75], + opcode: &opcodeArray[OpData75], data: make([]byte, 76), }, expectedErr: scriptError(ErrInternal, ""), @@ -1853,7 +1853,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUSHDATA1", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUSHDATA1], + opcode: &opcodeArray[OpPushData1], data: []byte{0, 1, 2, 3, 4}, }, expectedErr: nil, @@ -1861,7 +1861,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUSHDATA2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUSHDATA2], + opcode: &opcodeArray[OpPushData2], data: []byte{0, 1, 2, 3, 4}, }, expectedErr: nil, @@ -1869,7 +1869,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUSHDATA4", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUSHDATA1], + opcode: &opcodeArray[OpPushData1], data: []byte{0, 1, 2, 3, 4}, }, expectedErr: nil, @@ -1877,7 +1877,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1NEGATE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1NEGATE], + opcode: &opcodeArray[Op1Negate], data: nil, }, expectedErr: nil, @@ -1885,7 +1885,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1NEGATE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1NEGATE], + opcode: &opcodeArray[Op1Negate], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1893,7 +1893,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED], + opcode: &opcodeArray[OpReserved], data: nil, }, expectedErr: nil, @@ -1901,7 +1901,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED], + opcode: &opcodeArray[OpReserved], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1909,7 +1909,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TRUE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TRUE], + opcode: &opcodeArray[OpTrue], data: nil, }, expectedErr: nil, @@ -1917,7 +1917,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TRUE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TRUE], + opcode: &opcodeArray[OpTrue], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1925,7 +1925,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2], + opcode: &opcodeArray[Op2], data: nil, }, expectedErr: nil, @@ -1933,7 +1933,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2], + opcode: &opcodeArray[Op2], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1941,7 +1941,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2], + opcode: &opcodeArray[Op2], data: nil, }, expectedErr: nil, @@ -1949,7 +1949,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2], + opcode: &opcodeArray[Op2], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1957,7 +1957,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_3", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_3], + opcode: &opcodeArray[Op3], data: nil, }, expectedErr: nil, @@ -1965,7 +1965,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_3 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_3], + opcode: &opcodeArray[Op3], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1973,7 +1973,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_4", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_4], + opcode: &opcodeArray[Op4], data: nil, }, expectedErr: nil, @@ -1981,7 +1981,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_4 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_4], + opcode: &opcodeArray[Op4], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -1989,7 +1989,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_5", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_5], + opcode: &opcodeArray[Op5], data: nil, }, expectedErr: nil, @@ -1997,7 +1997,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_5 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_5], + opcode: &opcodeArray[Op5], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2005,7 +2005,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_6", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_6], + opcode: &opcodeArray[Op6], data: nil, }, expectedErr: nil, @@ -2013,7 +2013,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_6 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_6], + opcode: &opcodeArray[Op6], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2021,7 +2021,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_7", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_7], + opcode: &opcodeArray[Op7], data: nil, }, expectedErr: nil, @@ -2029,7 +2029,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_7 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_7], + opcode: &opcodeArray[Op7], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2037,7 +2037,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_8", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_8], + opcode: &opcodeArray[Op8], data: nil, }, expectedErr: nil, @@ -2045,7 +2045,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_8 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_8], + opcode: &opcodeArray[Op8], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2053,7 +2053,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_9", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_9], + opcode: &opcodeArray[Op9], data: nil, }, expectedErr: nil, @@ -2061,7 +2061,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_9 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_9], + opcode: &opcodeArray[Op9], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2069,7 +2069,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_10", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_10], + opcode: &opcodeArray[Op10], data: nil, }, expectedErr: nil, @@ -2077,7 +2077,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_10 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_10], + opcode: &opcodeArray[Op10], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2085,7 +2085,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_11", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_11], + opcode: &opcodeArray[Op11], data: nil, }, expectedErr: nil, @@ -2093,7 +2093,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_11 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_11], + opcode: &opcodeArray[Op11], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2101,7 +2101,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_12", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_12], + opcode: &opcodeArray[Op12], data: nil, }, expectedErr: nil, @@ -2109,7 +2109,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_12 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_12], + opcode: &opcodeArray[Op12], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2117,7 +2117,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_13", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_13], + opcode: &opcodeArray[Op13], data: nil, }, expectedErr: nil, @@ -2125,7 +2125,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_13 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_13], + opcode: &opcodeArray[Op13], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2133,7 +2133,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_14", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_14], + opcode: &opcodeArray[Op14], data: nil, }, expectedErr: nil, @@ -2141,7 +2141,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_14 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_14], + opcode: &opcodeArray[Op14], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2149,7 +2149,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_15", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_15], + opcode: &opcodeArray[Op15], data: nil, }, expectedErr: nil, @@ -2157,7 +2157,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_15 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_15], + opcode: &opcodeArray[Op15], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2165,7 +2165,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_16", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_16], + opcode: &opcodeArray[Op16], data: nil, }, expectedErr: nil, @@ -2173,7 +2173,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_16 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_16], + opcode: &opcodeArray[Op16], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2181,7 +2181,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP], + opcode: &opcodeArray[OpNop], data: nil, }, expectedErr: nil, @@ -2189,7 +2189,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP], + opcode: &opcodeArray[OpNop], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2197,7 +2197,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VER", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VER], + opcode: &opcodeArray[OpVer], data: nil, }, expectedErr: nil, @@ -2205,7 +2205,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VER long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VER], + opcode: &opcodeArray[OpVer], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2213,7 +2213,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_IF", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_IF], + opcode: &opcodeArray[OpIf], data: nil, }, expectedErr: nil, @@ -2221,7 +2221,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_IF long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_IF], + opcode: &opcodeArray[OpIf], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2229,7 +2229,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOTIF", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOTIF], + opcode: &opcodeArray[OpNotIf], data: nil, }, expectedErr: nil, @@ -2237,7 +2237,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOTIF long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOTIF], + opcode: &opcodeArray[OpNotIf], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2245,7 +2245,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERIF", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERIF], + opcode: &opcodeArray[OpVerIf], data: nil, }, expectedErr: nil, @@ -2253,7 +2253,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERIF long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERIF], + opcode: &opcodeArray[OpVerIf], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2261,7 +2261,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERNOTIF", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERNOTIF], + opcode: &opcodeArray[OpVerNotIf], data: nil, }, expectedErr: nil, @@ -2269,7 +2269,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERNOTIF long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERNOTIF], + opcode: &opcodeArray[OpVerNotIf], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2277,7 +2277,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ELSE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ELSE], + opcode: &opcodeArray[OpElse], data: nil, }, expectedErr: nil, @@ -2285,7 +2285,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ELSE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ELSE], + opcode: &opcodeArray[OpElse], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2293,7 +2293,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ENDIF", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ENDIF], + opcode: &opcodeArray[OpEndIf], data: nil, }, expectedErr: nil, @@ -2301,7 +2301,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ENDIF long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ENDIF], + opcode: &opcodeArray[OpEndIf], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2309,7 +2309,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERIFY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERIFY], + opcode: &opcodeArray[OpVerify], data: nil, }, expectedErr: nil, @@ -2317,7 +2317,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_VERIFY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_VERIFY], + opcode: &opcodeArray[OpVerify], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2325,7 +2325,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RETURN", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RETURN], + opcode: &opcodeArray[OpReturn], data: nil, }, expectedErr: nil, @@ -2333,7 +2333,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RETURN long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RETURN], + opcode: &opcodeArray[OpReturn], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2341,7 +2341,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TOALTSTACK", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TOALTSTACK], + opcode: &opcodeArray[OpToAltStack], data: nil, }, expectedErr: nil, @@ -2349,7 +2349,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TOALTSTACK long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TOALTSTACK], + opcode: &opcodeArray[OpToAltStack], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2357,7 +2357,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_FROMALTSTACK", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_FROMALTSTACK], + opcode: &opcodeArray[OpFromAltStack], data: nil, }, expectedErr: nil, @@ -2365,7 +2365,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_FROMALTSTACK long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_FROMALTSTACK], + opcode: &opcodeArray[OpFromAltStack], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2373,7 +2373,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DROP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DROP], + opcode: &opcodeArray[Op2Drop], data: nil, }, expectedErr: nil, @@ -2381,7 +2381,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DROP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DROP], + opcode: &opcodeArray[Op2Drop], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2389,7 +2389,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DUP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DUP], + opcode: &opcodeArray[Op2Dup], data: nil, }, expectedErr: nil, @@ -2397,7 +2397,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DUP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DUP], + opcode: &opcodeArray[Op2Dup], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2405,7 +2405,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_3DUP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_3DUP], + opcode: &opcodeArray[Op3Dup], data: nil, }, expectedErr: nil, @@ -2413,7 +2413,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_3DUP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_3DUP], + opcode: &opcodeArray[Op3Dup], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2421,7 +2421,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2OVER", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2OVER], + opcode: &opcodeArray[Op2Over], data: nil, }, expectedErr: nil, @@ -2429,7 +2429,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2OVER long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2OVER], + opcode: &opcodeArray[Op2Over], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2437,7 +2437,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2ROT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2ROT], + opcode: &opcodeArray[Op2Rot], data: nil, }, expectedErr: nil, @@ -2445,7 +2445,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2ROT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2ROT], + opcode: &opcodeArray[Op2Rot], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2453,7 +2453,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2SWAP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2SWAP], + opcode: &opcodeArray[Op2Swap], data: nil, }, expectedErr: nil, @@ -2461,7 +2461,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2SWAP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2SWAP], + opcode: &opcodeArray[Op2Swap], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2469,7 +2469,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_IFDUP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_IFDUP], + opcode: &opcodeArray[OpIfDup], data: nil, }, expectedErr: nil, @@ -2477,7 +2477,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_IFDUP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_IFDUP], + opcode: &opcodeArray[OpIfDup], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2485,7 +2485,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DEPTH", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DEPTH], + opcode: &opcodeArray[OpDepth], data: nil, }, expectedErr: nil, @@ -2493,7 +2493,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DEPTH long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DEPTH], + opcode: &opcodeArray[OpDepth], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2501,7 +2501,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DROP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DROP], + opcode: &opcodeArray[OpDrop], data: nil, }, expectedErr: nil, @@ -2509,7 +2509,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DROP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DROP], + opcode: &opcodeArray[OpDrop], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2517,7 +2517,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DUP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DUP], + opcode: &opcodeArray[OpDup], data: nil, }, expectedErr: nil, @@ -2525,7 +2525,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DUP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DUP], + opcode: &opcodeArray[OpDup], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2533,7 +2533,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NIP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NIP], + opcode: &opcodeArray[OpNip], data: nil, }, expectedErr: nil, @@ -2541,7 +2541,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NIP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NIP], + opcode: &opcodeArray[OpNip], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2549,7 +2549,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_OVER", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_OVER], + opcode: &opcodeArray[OpOver], data: nil, }, expectedErr: nil, @@ -2557,7 +2557,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_OVER long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_OVER], + opcode: &opcodeArray[OpOver], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2565,7 +2565,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PICK", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PICK], + opcode: &opcodeArray[OpPick], data: nil, }, expectedErr: nil, @@ -2573,7 +2573,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PICK long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PICK], + opcode: &opcodeArray[OpPick], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2581,7 +2581,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ROLL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ROLL], + opcode: &opcodeArray[OpRoll], data: nil, }, expectedErr: nil, @@ -2589,7 +2589,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ROLL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ROLL], + opcode: &opcodeArray[OpRoll], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2597,7 +2597,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ROT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ROT], + opcode: &opcodeArray[OpRot], data: nil, }, expectedErr: nil, @@ -2605,7 +2605,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ROT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ROT], + opcode: &opcodeArray[OpRot], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2613,7 +2613,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SWAP", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SWAP], + opcode: &opcodeArray[OpSwap], data: nil, }, expectedErr: nil, @@ -2621,7 +2621,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SWAP long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SWAP], + opcode: &opcodeArray[OpSwap], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2629,7 +2629,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TUCK", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TUCK], + opcode: &opcodeArray[OpTuck], data: nil, }, expectedErr: nil, @@ -2637,7 +2637,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_TUCK long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_TUCK], + opcode: &opcodeArray[OpTuck], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2645,7 +2645,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CAT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CAT], + opcode: &opcodeArray[OpCat], data: nil, }, expectedErr: nil, @@ -2653,7 +2653,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CAT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CAT], + opcode: &opcodeArray[OpCat], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2661,7 +2661,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SUBSTR", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SUBSTR], + opcode: &opcodeArray[OpSubStr], data: nil, }, expectedErr: nil, @@ -2669,7 +2669,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SUBSTR long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SUBSTR], + opcode: &opcodeArray[OpSubStr], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2677,7 +2677,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LEFT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LEFT], + opcode: &opcodeArray[OpLeft], data: nil, }, expectedErr: nil, @@ -2685,7 +2685,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LEFT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LEFT], + opcode: &opcodeArray[OpLeft], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2693,7 +2693,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LEFT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LEFT], + opcode: &opcodeArray[OpLeft], data: nil, }, expectedErr: nil, @@ -2701,7 +2701,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LEFT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LEFT], + opcode: &opcodeArray[OpLeft], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2709,7 +2709,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RIGHT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RIGHT], + opcode: &opcodeArray[OpRight], data: nil, }, expectedErr: nil, @@ -2717,7 +2717,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RIGHT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RIGHT], + opcode: &opcodeArray[OpRight], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2725,7 +2725,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SIZE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SIZE], + opcode: &opcodeArray[OpSize], data: nil, }, expectedErr: nil, @@ -2733,7 +2733,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SIZE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SIZE], + opcode: &opcodeArray[OpSize], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2741,7 +2741,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_INVERT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_INVERT], + opcode: &opcodeArray[OpInvert], data: nil, }, expectedErr: nil, @@ -2749,7 +2749,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_INVERT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_INVERT], + opcode: &opcodeArray[OpInvert], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2757,7 +2757,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_AND", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_AND], + opcode: &opcodeArray[OpAnd], data: nil, }, expectedErr: nil, @@ -2765,7 +2765,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_AND long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_AND], + opcode: &opcodeArray[OpAnd], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2773,7 +2773,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_OR", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_OR], + opcode: &opcodeArray[OpOr], data: nil, }, expectedErr: nil, @@ -2781,7 +2781,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_OR long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_OR], + opcode: &opcodeArray[OpOr], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2789,7 +2789,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_XOR", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_XOR], + opcode: &opcodeArray[OpXor], data: nil, }, expectedErr: nil, @@ -2797,7 +2797,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_XOR long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_XOR], + opcode: &opcodeArray[OpXor], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2805,7 +2805,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_EQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_EQUAL], + opcode: &opcodeArray[OpEqual], data: nil, }, expectedErr: nil, @@ -2813,7 +2813,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_EQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_EQUAL], + opcode: &opcodeArray[OpEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2821,7 +2821,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_EQUALVERIFY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_EQUALVERIFY], + opcode: &opcodeArray[OpEqualVerify], data: nil, }, expectedErr: nil, @@ -2829,7 +2829,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_EQUALVERIFY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_EQUALVERIFY], + opcode: &opcodeArray[OpEqualVerify], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2837,7 +2837,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED1", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED1], + opcode: &opcodeArray[OpReserved1], data: nil, }, expectedErr: nil, @@ -2845,7 +2845,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED1 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED1], + opcode: &opcodeArray[OpReserved1], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2853,7 +2853,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED2], + opcode: &opcodeArray[OpReserved2], data: nil, }, expectedErr: nil, @@ -2861,7 +2861,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RESERVED2 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RESERVED2], + opcode: &opcodeArray[OpReserved2], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2869,7 +2869,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1ADD", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1ADD], + opcode: &opcodeArray[Op1Add], data: nil, }, expectedErr: nil, @@ -2877,7 +2877,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1ADD long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1ADD], + opcode: &opcodeArray[Op1Add], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2885,7 +2885,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1SUB", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1SUB], + opcode: &opcodeArray[Op1Sub], data: nil, }, expectedErr: nil, @@ -2893,7 +2893,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_1SUB long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_1SUB], + opcode: &opcodeArray[Op1Sub], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2901,7 +2901,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2MUL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2MUL], + opcode: &opcodeArray[Op2Mul], data: nil, }, expectedErr: nil, @@ -2909,7 +2909,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2MUL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2MUL], + opcode: &opcodeArray[Op2Mul], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2917,7 +2917,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DIV", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DIV], + opcode: &opcodeArray[Op2Div], data: nil, }, expectedErr: nil, @@ -2925,7 +2925,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_2DIV long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_2DIV], + opcode: &opcodeArray[Op2Div], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2933,7 +2933,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NEGATE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NEGATE], + opcode: &opcodeArray[OpNegate], data: nil, }, expectedErr: nil, @@ -2941,7 +2941,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NEGATE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NEGATE], + opcode: &opcodeArray[OpNegate], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2949,7 +2949,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ABS", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ABS], + opcode: &opcodeArray[OpAbs], data: nil, }, expectedErr: nil, @@ -2957,7 +2957,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ABS long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ABS], + opcode: &opcodeArray[OpAbs], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2965,7 +2965,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOT], + opcode: &opcodeArray[OpNot], data: nil, }, expectedErr: nil, @@ -2973,7 +2973,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOT], + opcode: &opcodeArray[OpNot], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2981,7 +2981,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_0NOTEQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_0NOTEQUAL], + opcode: &opcodeArray[Op0NotEqual], data: nil, }, expectedErr: nil, @@ -2989,7 +2989,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_0NOTEQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_0NOTEQUAL], + opcode: &opcodeArray[Op0NotEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -2997,7 +2997,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ADD", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ADD], + opcode: &opcodeArray[OpAdd], data: nil, }, expectedErr: nil, @@ -3005,7 +3005,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_ADD long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_ADD], + opcode: &opcodeArray[OpAdd], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3013,7 +3013,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SUB", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SUB], + opcode: &opcodeArray[OpSub], data: nil, }, expectedErr: nil, @@ -3021,7 +3021,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SUB long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SUB], + opcode: &opcodeArray[OpSub], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3029,7 +3029,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MUL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MUL], + opcode: &opcodeArray[OpMul], data: nil, }, expectedErr: nil, @@ -3037,7 +3037,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MUL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MUL], + opcode: &opcodeArray[OpMul], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3045,7 +3045,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DIV", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DIV], + opcode: &opcodeArray[OpDiv], data: nil, }, expectedErr: nil, @@ -3053,7 +3053,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_DIV long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_DIV], + opcode: &opcodeArray[OpDiv], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3061,7 +3061,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MOD", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MOD], + opcode: &opcodeArray[OpMod], data: nil, }, expectedErr: nil, @@ -3069,7 +3069,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MOD long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MOD], + opcode: &opcodeArray[OpMod], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3077,7 +3077,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LSHIFT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LSHIFT], + opcode: &opcodeArray[OpLShift], data: nil, }, expectedErr: nil, @@ -3085,7 +3085,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LSHIFT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LSHIFT], + opcode: &opcodeArray[OpLShift], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3093,7 +3093,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RSHIFT", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RSHIFT], + opcode: &opcodeArray[OpRShift], data: nil, }, expectedErr: nil, @@ -3101,7 +3101,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RSHIFT long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RSHIFT], + opcode: &opcodeArray[OpRShift], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3109,7 +3109,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_BOOLAND", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_BOOLAND], + opcode: &opcodeArray[OpBoolAnd], data: nil, }, expectedErr: nil, @@ -3117,7 +3117,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_BOOLAND long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_BOOLAND], + opcode: &opcodeArray[OpBoolAnd], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3125,7 +3125,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_BOOLOR", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_BOOLOR], + opcode: &opcodeArray[OpBoolOr], data: nil, }, expectedErr: nil, @@ -3133,7 +3133,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_BOOLOR long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_BOOLOR], + opcode: &opcodeArray[OpBoolOr], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3141,7 +3141,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMEQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMEQUAL], + opcode: &opcodeArray[OpNumEqual], data: nil, }, expectedErr: nil, @@ -3149,7 +3149,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMEQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMEQUAL], + opcode: &opcodeArray[OpNumEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3157,7 +3157,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMEQUALVERIFY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMEQUALVERIFY], + opcode: &opcodeArray[OpNumEqualVerify], data: nil, }, expectedErr: nil, @@ -3165,7 +3165,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMEQUALVERIFY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMEQUALVERIFY], + opcode: &opcodeArray[OpNumEqualVerify], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3173,7 +3173,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMNOTEQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMNOTEQUAL], + opcode: &opcodeArray[OpNumNotEqual], data: nil, }, expectedErr: nil, @@ -3181,7 +3181,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NUMNOTEQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NUMNOTEQUAL], + opcode: &opcodeArray[OpNumNotEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3189,7 +3189,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LESSTHAN", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LESSTHAN], + opcode: &opcodeArray[OpLessThan], data: nil, }, expectedErr: nil, @@ -3197,7 +3197,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LESSTHAN long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LESSTHAN], + opcode: &opcodeArray[OpLessThan], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3205,7 +3205,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_GREATERTHAN", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_GREATERTHAN], + opcode: &opcodeArray[OpGreaterThan], data: nil, }, expectedErr: nil, @@ -3213,7 +3213,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_GREATERTHAN long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_GREATERTHAN], + opcode: &opcodeArray[OpGreaterThan], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3221,7 +3221,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LESSTHANOREQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LESSTHANOREQUAL], + opcode: &opcodeArray[OpLessThanOrEqual], data: nil, }, expectedErr: nil, @@ -3229,7 +3229,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_LESSTHANOREQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_LESSTHANOREQUAL], + opcode: &opcodeArray[OpLessThanOrEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3237,7 +3237,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_GREATERTHANOREQUAL", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_GREATERTHANOREQUAL], + opcode: &opcodeArray[OpGreaterThanOrEqual], data: nil, }, expectedErr: nil, @@ -3245,7 +3245,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_GREATERTHANOREQUAL long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_GREATERTHANOREQUAL], + opcode: &opcodeArray[OpGreaterThanOrEqual], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3253,7 +3253,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MIN", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MIN], + opcode: &opcodeArray[OpMin], data: nil, }, expectedErr: nil, @@ -3261,7 +3261,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MIN long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MIN], + opcode: &opcodeArray[OpMin], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3269,7 +3269,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MAX", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MAX], + opcode: &opcodeArray[OpMax], data: nil, }, expectedErr: nil, @@ -3277,7 +3277,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_MAX long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_MAX], + opcode: &opcodeArray[OpMax], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3285,7 +3285,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_WITHIN", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_WITHIN], + opcode: &opcodeArray[OpWithin], data: nil, }, expectedErr: nil, @@ -3293,7 +3293,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_WITHIN long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_WITHIN], + opcode: &opcodeArray[OpWithin], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3301,7 +3301,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RIPEMD160", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RIPEMD160], + opcode: &opcodeArray[OpRipeMD160], data: nil, }, expectedErr: nil, @@ -3309,7 +3309,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_RIPEMD160 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_RIPEMD160], + opcode: &opcodeArray[OpRipeMD160], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3317,7 +3317,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SHA1", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SHA1], + opcode: &opcodeArray[OpSHA1], data: nil, }, expectedErr: nil, @@ -3325,7 +3325,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SHA1 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SHA1], + opcode: &opcodeArray[OpSHA1], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3333,7 +3333,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SHA256", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SHA256], + opcode: &opcodeArray[OpSHA256], data: nil, }, expectedErr: nil, @@ -3341,7 +3341,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_SHA256 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_SHA256], + opcode: &opcodeArray[OpSHA256], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3349,7 +3349,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_HASH160", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_HASH160], + opcode: &opcodeArray[OpHash160], data: nil, }, expectedErr: nil, @@ -3357,7 +3357,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_HASH160 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_HASH160], + opcode: &opcodeArray[OpHash160], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3365,7 +3365,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_HASH256", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_HASH256], + opcode: &opcodeArray[OpHash256], data: nil, }, expectedErr: nil, @@ -3373,7 +3373,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_HASH256 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_HASH256], + opcode: &opcodeArray[OpHash256], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3381,7 +3381,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CODESAPERATOR", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CODESEPARATOR], + opcode: &opcodeArray[OpCodeSeparator], data: nil, }, expectedErr: nil, @@ -3389,7 +3389,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CODESEPARATOR long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CODESEPARATOR], + opcode: &opcodeArray[OpCodeSeparator], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3397,7 +3397,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKSIG", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKSIG], + opcode: &opcodeArray[OpCheckSig], data: nil, }, expectedErr: nil, @@ -3405,7 +3405,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKSIG long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKSIG], + opcode: &opcodeArray[OpCheckSig], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3413,7 +3413,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKSIGVERIFY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKSIGVERIFY], + opcode: &opcodeArray[OpCheckSigVerify], data: nil, }, expectedErr: nil, @@ -3421,7 +3421,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKSIGVERIFY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKSIGVERIFY], + opcode: &opcodeArray[OpCheckSigVerify], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3429,7 +3429,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKMULTISIG", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKMULTISIG], + opcode: &opcodeArray[OpCheckMultiSig], data: nil, }, expectedErr: nil, @@ -3437,7 +3437,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKMULTISIG long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKMULTISIG], + opcode: &opcodeArray[OpCheckMultiSig], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3445,7 +3445,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKMULTISIGVERIFY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKMULTISIGVERIFY], + opcode: &opcodeArray[OpCheckMultiSigVerify], data: nil, }, expectedErr: nil, @@ -3453,7 +3453,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_CHECKMULTISIGVERIFY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_CHECKMULTISIGVERIFY], + opcode: &opcodeArray[OpCheckMultiSigVerify], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3461,7 +3461,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP1", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP1], + opcode: &opcodeArray[OpNop1], data: nil, }, expectedErr: nil, @@ -3469,7 +3469,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP1 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP1], + opcode: &opcodeArray[OpNop1], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3477,7 +3477,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP2", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP2], + opcode: &opcodeArray[OpNop2], data: nil, }, expectedErr: nil, @@ -3485,7 +3485,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP2 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP2], + opcode: &opcodeArray[OpNop2], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3493,7 +3493,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP3", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP3], + opcode: &opcodeArray[OpNop3], data: nil, }, expectedErr: nil, @@ -3501,7 +3501,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP3 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP3], + opcode: &opcodeArray[OpNop3], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3509,7 +3509,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP4", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP4], + opcode: &opcodeArray[OpNop4], data: nil, }, expectedErr: nil, @@ -3517,7 +3517,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP4 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP4], + opcode: &opcodeArray[OpNop4], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3525,7 +3525,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP5", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP5], + opcode: &opcodeArray[OpNop5], data: nil, }, expectedErr: nil, @@ -3533,7 +3533,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP5 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP5], + opcode: &opcodeArray[OpNop5], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3541,7 +3541,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP6", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP6], + opcode: &opcodeArray[OpNop6], data: nil, }, expectedErr: nil, @@ -3549,7 +3549,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP6 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP6], + opcode: &opcodeArray[OpNop6], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3557,7 +3557,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP7", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP7], + opcode: &opcodeArray[OpNop7], data: nil, }, expectedErr: nil, @@ -3565,7 +3565,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP7 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP7], + opcode: &opcodeArray[OpNop7], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3573,7 +3573,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP8", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP8], + opcode: &opcodeArray[OpNop8], data: nil, }, expectedErr: nil, @@ -3581,7 +3581,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP8 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP8], + opcode: &opcodeArray[OpNop8], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3589,7 +3589,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP9", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP9], + opcode: &opcodeArray[OpNop9], data: nil, }, expectedErr: nil, @@ -3597,7 +3597,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP9 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP9], + opcode: &opcodeArray[OpNop9], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3605,7 +3605,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP10", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP10], + opcode: &opcodeArray[OpNop10], data: nil, }, expectedErr: nil, @@ -3613,7 +3613,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_NOP10 long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_NOP10], + opcode: &opcodeArray[OpNop10], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3621,7 +3621,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUBKEYHASH", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUBKEYHASH], + opcode: &opcodeArray[OpPubKeyHash], data: nil, }, expectedErr: nil, @@ -3629,7 +3629,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUBKEYHASH long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUBKEYHASH], + opcode: &opcodeArray[OpPubKeyHash], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3637,7 +3637,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUBKEY", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUBKEY], + opcode: &opcodeArray[OpPubKey], data: nil, }, expectedErr: nil, @@ -3645,7 +3645,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_PUBKEY long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_PUBKEY], + opcode: &opcodeArray[OpPubKey], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3653,7 +3653,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_INVALIDOPCODE", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_INVALIDOPCODE], + opcode: &opcodeArray[OpInvalidOpCode], data: nil, }, expectedErr: nil, @@ -3661,7 +3661,7 @@ func TestUnparsingInvalidOpcodes(t *testing.T) { { name: "OP_INVALIDOPCODE long", pop: &parsedOpcode{ - opcode: &opcodeArray[OP_INVALIDOPCODE], + opcode: &opcodeArray[OpInvalidOpCode], data: make([]byte, 1), }, expectedErr: scriptError(ErrInternal, ""), @@ -3860,14 +3860,14 @@ func TestRemoveOpcodes(t *testing.T) { // Nothing to remove. name: "nothing to remove", before: "NOP", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, after: "NOP", }, { // Test basic opcode removal. name: "codeseparator 1", before: "NOP CODESEPARATOR TRUE", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, after: "NOP TRUE", }, { @@ -3875,25 +3875,25 @@ func TestRemoveOpcodes(t *testing.T) { // in a previous opcode. name: "codeseparator by coincidence", before: "NOP DATA_1 CODESEPARATOR TRUE", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, after: "NOP DATA_1 CODESEPARATOR TRUE", }, { name: "invalid opcode", before: "CAT", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, after: "CAT", }, { name: "invalid length (instruction)", before: "PUSHDATA1", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, err: scriptError(ErrMalformedPush, ""), }, { name: "invalid length (data)", before: "PUSHDATA1 0xff 0xfe", - remove: OP_CODESEPARATOR, + remove: OpCodeSeparator, err: scriptError(ErrMalformedPush, ""), }, } @@ -3940,26 +3940,26 @@ func TestRemoveOpcodeByData(t *testing.T) { }{ { name: "nothing to do", - before: []byte{OP_NOP}, + before: []byte{OpNop}, remove: []byte{1, 2, 3, 4}, - after: []byte{OP_NOP}, + after: []byte{OpNop}, }, { name: "simple case", - before: []byte{OP_DATA_4, 1, 2, 3, 4}, + before: []byte{OpData4, 1, 2, 3, 4}, remove: []byte{1, 2, 3, 4}, after: nil, }, { name: "simple case (miss)", - before: []byte{OP_DATA_4, 1, 2, 3, 4}, + before: []byte{OpData4, 1, 2, 3, 4}, remove: []byte{1, 2, 3, 5}, - after: []byte{OP_DATA_4, 1, 2, 3, 4}, + after: []byte{OpData4, 1, 2, 3, 4}, }, { // padded to keep it canonical. name: "simple case (pushdata1)", - before: append(append([]byte{OP_PUSHDATA1, 76}, + before: append(append([]byte{OpPushData1, 76}, bytes.Repeat([]byte{0}, 72)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 4}, @@ -3967,23 +3967,23 @@ func TestRemoveOpcodeByData(t *testing.T) { }, { name: "simple case (pushdata1 miss)", - before: append(append([]byte{OP_PUSHDATA1, 76}, + before: append(append([]byte{OpPushData1, 76}, bytes.Repeat([]byte{0}, 72)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 5}, - after: append(append([]byte{OP_PUSHDATA1, 76}, + after: append(append([]byte{OpPushData1, 76}, bytes.Repeat([]byte{0}, 72)...), []byte{1, 2, 3, 4}...), }, { name: "simple case (pushdata1 miss noncanonical)", - before: []byte{OP_PUSHDATA1, 4, 1, 2, 3, 4}, + before: []byte{OpPushData1, 4, 1, 2, 3, 4}, remove: []byte{1, 2, 3, 4}, - after: []byte{OP_PUSHDATA1, 4, 1, 2, 3, 4}, + after: []byte{OpPushData1, 4, 1, 2, 3, 4}, }, { name: "simple case (pushdata2)", - before: append(append([]byte{OP_PUSHDATA2, 0, 1}, + before: append(append([]byte{OpPushData2, 0, 1}, bytes.Repeat([]byte{0}, 252)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 4}, @@ -3991,24 +3991,24 @@ func TestRemoveOpcodeByData(t *testing.T) { }, { name: "simple case (pushdata2 miss)", - before: append(append([]byte{OP_PUSHDATA2, 0, 1}, + before: append(append([]byte{OpPushData2, 0, 1}, bytes.Repeat([]byte{0}, 252)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 4, 5}, - after: append(append([]byte{OP_PUSHDATA2, 0, 1}, + after: append(append([]byte{OpPushData2, 0, 1}, bytes.Repeat([]byte{0}, 252)...), []byte{1, 2, 3, 4}...), }, { name: "simple case (pushdata2 miss noncanonical)", - before: []byte{OP_PUSHDATA2, 4, 0, 1, 2, 3, 4}, + before: []byte{OpPushData2, 4, 0, 1, 2, 3, 4}, remove: []byte{1, 2, 3, 4}, - after: []byte{OP_PUSHDATA2, 4, 0, 1, 2, 3, 4}, + after: []byte{OpPushData2, 4, 0, 1, 2, 3, 4}, }, { // This is padded to make the push canonical. name: "simple case (pushdata4)", - before: append(append([]byte{OP_PUSHDATA4, 0, 0, 1, 0}, + before: append(append([]byte{OpPushData4, 0, 0, 1, 0}, bytes.Repeat([]byte{0}, 65532)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 4}, @@ -4016,34 +4016,34 @@ func TestRemoveOpcodeByData(t *testing.T) { }, { name: "simple case (pushdata4 miss noncanonical)", - before: []byte{OP_PUSHDATA4, 4, 0, 0, 0, 1, 2, 3, 4}, + before: []byte{OpPushData4, 4, 0, 0, 0, 1, 2, 3, 4}, remove: []byte{1, 2, 3, 4}, - after: []byte{OP_PUSHDATA4, 4, 0, 0, 0, 1, 2, 3, 4}, + after: []byte{OpPushData4, 4, 0, 0, 0, 1, 2, 3, 4}, }, { // This is padded to make the push canonical. name: "simple case (pushdata4 miss)", - before: append(append([]byte{OP_PUSHDATA4, 0, 0, 1, 0}, + before: append(append([]byte{OpPushData4, 0, 0, 1, 0}, bytes.Repeat([]byte{0}, 65532)...), []byte{1, 2, 3, 4}...), remove: []byte{1, 2, 3, 4, 5}, - after: append(append([]byte{OP_PUSHDATA4, 0, 0, 1, 0}, + after: append(append([]byte{OpPushData4, 0, 0, 1, 0}, bytes.Repeat([]byte{0}, 65532)...), []byte{1, 2, 3, 4}...), }, { name: "invalid opcode ", - before: []byte{OP_UNKNOWN187}, + before: []byte{OpUnknown187}, remove: []byte{1, 2, 3, 4}, - after: []byte{OP_UNKNOWN187}, + after: []byte{OpUnknown187}, }, { name: "invalid length (instruction)", - before: []byte{OP_PUSHDATA1}, + before: []byte{OpPushData1}, remove: []byte{1, 2, 3, 4}, err: scriptError(ErrMalformedPush, ""), }, { name: "invalid length (data)", - before: []byte{OP_PUSHDATA1, 255, 254}, + before: []byte{OpPushData1, 255, 254}, remove: []byte{1, 2, 3, 4}, err: scriptError(ErrMalformedPush, ""), }, diff --git a/txscript/scriptbuilder.go b/txscript/scriptbuilder.go index 7984dd966..780a93138 100644 --- a/txscript/scriptbuilder.go +++ b/txscript/scriptbuilder.go @@ -110,7 +110,7 @@ func canonicalDataSize(data []byte) int { return 1 } - if dataLen < OP_PUSHDATA1 { + if dataLen < OpPushData1 { return 1 + dataLen } else if dataLen <= 0xff { return 2 + dataLen @@ -132,13 +132,13 @@ func (b *ScriptBuilder) addData(data []byte) *ScriptBuilder { // by one of the "small integer" opcodes, use that opcode instead of // a data push opcode followed by the number. if dataLen == 0 || dataLen == 1 && data[0] == 0 { - b.script = append(b.script, OP_0) + b.script = append(b.script, Op0) return b } else if dataLen == 1 && data[0] <= 16 { - b.script = append(b.script, (OP_1-1)+data[0]) + b.script = append(b.script, (Op1-1)+data[0]) return b } else if dataLen == 1 && data[0] == 0x81 { - b.script = append(b.script, byte(OP_1NEGATE)) + b.script = append(b.script, byte(Op1Negate)) return b } @@ -146,19 +146,19 @@ func (b *ScriptBuilder) addData(data []byte) *ScriptBuilder { // enough so the data push instruction is only a single byte. // Otherwise, choose the smallest possible OP_PUSHDATA# opcode that // can represent the length of the data. - if dataLen < OP_PUSHDATA1 { - b.script = append(b.script, byte((OP_DATA_1-1)+dataLen)) + if dataLen < OpPushData1 { + b.script = append(b.script, byte((OpData1-1)+dataLen)) } else if dataLen <= 0xff { - b.script = append(b.script, OP_PUSHDATA1, byte(dataLen)) + b.script = append(b.script, OpPushData1, byte(dataLen)) } else if dataLen <= 0xffff { buf := make([]byte, 2) binary.LittleEndian.PutUint16(buf, uint16(dataLen)) - b.script = append(b.script, OP_PUSHDATA2) + b.script = append(b.script, OpPushData2) b.script = append(b.script, buf...) } else { buf := make([]byte, 4) binary.LittleEndian.PutUint32(buf, uint32(dataLen)) - b.script = append(b.script, OP_PUSHDATA4) + b.script = append(b.script, OpPushData4) b.script = append(b.script, buf...) } @@ -240,11 +240,11 @@ func (b *ScriptBuilder) AddInt64(val int64) *ScriptBuilder { // Fast path for small integers and OP_1NEGATE. if val == 0 { - b.script = append(b.script, OP_0) + b.script = append(b.script, Op0) return b } if val == -1 || (val >= 1 && val <= 16) { - b.script = append(b.script, byte((OP_1-1)+val)) + b.script = append(b.script, byte((Op1-1)+val)) return b } diff --git a/txscript/scriptbuilder_test.go b/txscript/scriptbuilder_test.go index 89f2b861a..1b78fbaab 100644 --- a/txscript/scriptbuilder_test.go +++ b/txscript/scriptbuilder_test.go @@ -21,18 +21,18 @@ func TestScriptBuilderAddOp(t *testing.T) { }{ { name: "push OP_0", - opcodes: []byte{OP_0}, - expected: []byte{OP_0}, + opcodes: []byte{Op0}, + expected: []byte{Op0}, }, { name: "push OP_1 OP_2", - opcodes: []byte{OP_1, OP_2}, - expected: []byte{OP_1, OP_2}, + opcodes: []byte{Op1, Op2}, + expected: []byte{Op1, Op2}, }, { name: "push OP_HASH160 OP_EQUAL", - opcodes: []byte{OP_HASH160, OP_EQUAL}, - expected: []byte{OP_HASH160, OP_EQUAL}, + opcodes: []byte{OpHash160, OpEqual}, + expected: []byte{OpHash160, OpEqual}, }, } @@ -88,44 +88,44 @@ func TestScriptBuilderAddInt64(t *testing.T) { val int64 expected []byte }{ - {name: "push -1", val: -1, expected: []byte{OP_1NEGATE}}, - {name: "push small int 0", val: 0, expected: []byte{OP_0}}, - {name: "push small int 1", val: 1, expected: []byte{OP_1}}, - {name: "push small int 2", val: 2, expected: []byte{OP_2}}, - {name: "push small int 3", val: 3, expected: []byte{OP_3}}, - {name: "push small int 4", val: 4, expected: []byte{OP_4}}, - {name: "push small int 5", val: 5, expected: []byte{OP_5}}, - {name: "push small int 6", val: 6, expected: []byte{OP_6}}, - {name: "push small int 7", val: 7, expected: []byte{OP_7}}, - {name: "push small int 8", val: 8, expected: []byte{OP_8}}, - {name: "push small int 9", val: 9, expected: []byte{OP_9}}, - {name: "push small int 10", val: 10, expected: []byte{OP_10}}, - {name: "push small int 11", val: 11, expected: []byte{OP_11}}, - {name: "push small int 12", val: 12, expected: []byte{OP_12}}, - {name: "push small int 13", val: 13, expected: []byte{OP_13}}, - {name: "push small int 14", val: 14, expected: []byte{OP_14}}, - {name: "push small int 15", val: 15, expected: []byte{OP_15}}, - {name: "push small int 16", val: 16, expected: []byte{OP_16}}, - {name: "push 17", val: 17, expected: []byte{OP_DATA_1, 0x11}}, - {name: "push 65", val: 65, expected: []byte{OP_DATA_1, 0x41}}, - {name: "push 127", val: 127, expected: []byte{OP_DATA_1, 0x7f}}, - {name: "push 128", val: 128, expected: []byte{OP_DATA_2, 0x80, 0}}, - {name: "push 255", val: 255, expected: []byte{OP_DATA_2, 0xff, 0}}, - {name: "push 256", val: 256, expected: []byte{OP_DATA_2, 0, 0x01}}, - {name: "push 32767", val: 32767, expected: []byte{OP_DATA_2, 0xff, 0x7f}}, - {name: "push 32768", val: 32768, expected: []byte{OP_DATA_3, 0, 0x80, 0}}, - {name: "push -2", val: -2, expected: []byte{OP_DATA_1, 0x82}}, - {name: "push -3", val: -3, expected: []byte{OP_DATA_1, 0x83}}, - {name: "push -4", val: -4, expected: []byte{OP_DATA_1, 0x84}}, - {name: "push -5", val: -5, expected: []byte{OP_DATA_1, 0x85}}, - {name: "push -17", val: -17, expected: []byte{OP_DATA_1, 0x91}}, - {name: "push -65", val: -65, expected: []byte{OP_DATA_1, 0xc1}}, - {name: "push -127", val: -127, expected: []byte{OP_DATA_1, 0xff}}, - {name: "push -128", val: -128, expected: []byte{OP_DATA_2, 0x80, 0x80}}, - {name: "push -255", val: -255, expected: []byte{OP_DATA_2, 0xff, 0x80}}, - {name: "push -256", val: -256, expected: []byte{OP_DATA_2, 0x00, 0x81}}, - {name: "push -32767", val: -32767, expected: []byte{OP_DATA_2, 0xff, 0xff}}, - {name: "push -32768", val: -32768, expected: []byte{OP_DATA_3, 0x00, 0x80, 0x80}}, + {name: "push -1", val: -1, expected: []byte{Op1Negate}}, + {name: "push small int 0", val: 0, expected: []byte{Op0}}, + {name: "push small int 1", val: 1, expected: []byte{Op1}}, + {name: "push small int 2", val: 2, expected: []byte{Op2}}, + {name: "push small int 3", val: 3, expected: []byte{Op3}}, + {name: "push small int 4", val: 4, expected: []byte{Op4}}, + {name: "push small int 5", val: 5, expected: []byte{Op5}}, + {name: "push small int 6", val: 6, expected: []byte{Op6}}, + {name: "push small int 7", val: 7, expected: []byte{Op7}}, + {name: "push small int 8", val: 8, expected: []byte{Op8}}, + {name: "push small int 9", val: 9, expected: []byte{Op9}}, + {name: "push small int 10", val: 10, expected: []byte{Op10}}, + {name: "push small int 11", val: 11, expected: []byte{Op11}}, + {name: "push small int 12", val: 12, expected: []byte{Op12}}, + {name: "push small int 13", val: 13, expected: []byte{Op13}}, + {name: "push small int 14", val: 14, expected: []byte{Op14}}, + {name: "push small int 15", val: 15, expected: []byte{Op15}}, + {name: "push small int 16", val: 16, expected: []byte{Op16}}, + {name: "push 17", val: 17, expected: []byte{OpData1, 0x11}}, + {name: "push 65", val: 65, expected: []byte{OpData1, 0x41}}, + {name: "push 127", val: 127, expected: []byte{OpData1, 0x7f}}, + {name: "push 128", val: 128, expected: []byte{OpData2, 0x80, 0}}, + {name: "push 255", val: 255, expected: []byte{OpData2, 0xff, 0}}, + {name: "push 256", val: 256, expected: []byte{OpData2, 0, 0x01}}, + {name: "push 32767", val: 32767, expected: []byte{OpData2, 0xff, 0x7f}}, + {name: "push 32768", val: 32768, expected: []byte{OpData3, 0, 0x80, 0}}, + {name: "push -2", val: -2, expected: []byte{OpData1, 0x82}}, + {name: "push -3", val: -3, expected: []byte{OpData1, 0x83}}, + {name: "push -4", val: -4, expected: []byte{OpData1, 0x84}}, + {name: "push -5", val: -5, expected: []byte{OpData1, 0x85}}, + {name: "push -17", val: -17, expected: []byte{OpData1, 0x91}}, + {name: "push -65", val: -65, expected: []byte{OpData1, 0xc1}}, + {name: "push -127", val: -127, expected: []byte{OpData1, 0xff}}, + {name: "push -128", val: -128, expected: []byte{OpData2, 0x80, 0x80}}, + {name: "push -255", val: -255, expected: []byte{OpData2, 0xff, 0x80}}, + {name: "push -256", val: -256, expected: []byte{OpData2, 0x00, 0x81}}, + {name: "push -32767", val: -32767, expected: []byte{OpData2, 0xff, 0xff}}, + {name: "push -32768", val: -32768, expected: []byte{OpData3, 0x00, 0x80, 0x80}}, } builder := NewScriptBuilder() @@ -159,70 +159,70 @@ func TestScriptBuilderAddData(t *testing.T) { useFull bool // use AddFullData instead of AddData. }{ // BIP0062: Pushing an empty byte sequence must use OP_0. - {name: "push empty byte sequence", data: nil, expected: []byte{OP_0}}, - {name: "push 1 byte 0x00", data: []byte{0x00}, expected: []byte{OP_0}}, + {name: "push empty byte sequence", data: nil, expected: []byte{Op0}}, + {name: "push 1 byte 0x00", data: []byte{0x00}, expected: []byte{Op0}}, // BIP0062: Pushing a 1-byte sequence of byte 0x01 through 0x10 must use OP_n. - {name: "push 1 byte 0x01", data: []byte{0x01}, expected: []byte{OP_1}}, - {name: "push 1 byte 0x02", data: []byte{0x02}, expected: []byte{OP_2}}, - {name: "push 1 byte 0x03", data: []byte{0x03}, expected: []byte{OP_3}}, - {name: "push 1 byte 0x04", data: []byte{0x04}, expected: []byte{OP_4}}, - {name: "push 1 byte 0x05", data: []byte{0x05}, expected: []byte{OP_5}}, - {name: "push 1 byte 0x06", data: []byte{0x06}, expected: []byte{OP_6}}, - {name: "push 1 byte 0x07", data: []byte{0x07}, expected: []byte{OP_7}}, - {name: "push 1 byte 0x08", data: []byte{0x08}, expected: []byte{OP_8}}, - {name: "push 1 byte 0x09", data: []byte{0x09}, expected: []byte{OP_9}}, - {name: "push 1 byte 0x0a", data: []byte{0x0a}, expected: []byte{OP_10}}, - {name: "push 1 byte 0x0b", data: []byte{0x0b}, expected: []byte{OP_11}}, - {name: "push 1 byte 0x0c", data: []byte{0x0c}, expected: []byte{OP_12}}, - {name: "push 1 byte 0x0d", data: []byte{0x0d}, expected: []byte{OP_13}}, - {name: "push 1 byte 0x0e", data: []byte{0x0e}, expected: []byte{OP_14}}, - {name: "push 1 byte 0x0f", data: []byte{0x0f}, expected: []byte{OP_15}}, - {name: "push 1 byte 0x10", data: []byte{0x10}, expected: []byte{OP_16}}, + {name: "push 1 byte 0x01", data: []byte{0x01}, expected: []byte{Op1}}, + {name: "push 1 byte 0x02", data: []byte{0x02}, expected: []byte{Op2}}, + {name: "push 1 byte 0x03", data: []byte{0x03}, expected: []byte{Op3}}, + {name: "push 1 byte 0x04", data: []byte{0x04}, expected: []byte{Op4}}, + {name: "push 1 byte 0x05", data: []byte{0x05}, expected: []byte{Op5}}, + {name: "push 1 byte 0x06", data: []byte{0x06}, expected: []byte{Op6}}, + {name: "push 1 byte 0x07", data: []byte{0x07}, expected: []byte{Op7}}, + {name: "push 1 byte 0x08", data: []byte{0x08}, expected: []byte{Op8}}, + {name: "push 1 byte 0x09", data: []byte{0x09}, expected: []byte{Op9}}, + {name: "push 1 byte 0x0a", data: []byte{0x0a}, expected: []byte{Op10}}, + {name: "push 1 byte 0x0b", data: []byte{0x0b}, expected: []byte{Op11}}, + {name: "push 1 byte 0x0c", data: []byte{0x0c}, expected: []byte{Op12}}, + {name: "push 1 byte 0x0d", data: []byte{0x0d}, expected: []byte{Op13}}, + {name: "push 1 byte 0x0e", data: []byte{0x0e}, expected: []byte{Op14}}, + {name: "push 1 byte 0x0f", data: []byte{0x0f}, expected: []byte{Op15}}, + {name: "push 1 byte 0x10", data: []byte{0x10}, expected: []byte{Op16}}, // BIP0062: Pushing the byte 0x81 must use OP_1NEGATE. - {name: "push 1 byte 0x81", data: []byte{0x81}, expected: []byte{OP_1NEGATE}}, + {name: "push 1 byte 0x81", data: []byte{0x81}, expected: []byte{Op1Negate}}, // BIP0062: Pushing any other byte sequence up to 75 bytes must // use the normal data push (opcode byte n, with n the number of // bytes, followed n bytes of data being pushed). - {name: "push 1 byte 0x11", data: []byte{0x11}, expected: []byte{OP_DATA_1, 0x11}}, - {name: "push 1 byte 0x80", data: []byte{0x80}, expected: []byte{OP_DATA_1, 0x80}}, - {name: "push 1 byte 0x82", data: []byte{0x82}, expected: []byte{OP_DATA_1, 0x82}}, - {name: "push 1 byte 0xff", data: []byte{0xff}, expected: []byte{OP_DATA_1, 0xff}}, + {name: "push 1 byte 0x11", data: []byte{0x11}, expected: []byte{OpData1, 0x11}}, + {name: "push 1 byte 0x80", data: []byte{0x80}, expected: []byte{OpData1, 0x80}}, + {name: "push 1 byte 0x82", data: []byte{0x82}, expected: []byte{OpData1, 0x82}}, + {name: "push 1 byte 0xff", data: []byte{0xff}, expected: []byte{OpData1, 0xff}}, { name: "push data len 17", data: bytes.Repeat([]byte{0x49}, 17), - expected: append([]byte{OP_DATA_17}, bytes.Repeat([]byte{0x49}, 17)...), + expected: append([]byte{OpData17}, bytes.Repeat([]byte{0x49}, 17)...), }, { name: "push data len 75", data: bytes.Repeat([]byte{0x49}, 75), - expected: append([]byte{OP_DATA_75}, bytes.Repeat([]byte{0x49}, 75)...), + expected: append([]byte{OpData75}, bytes.Repeat([]byte{0x49}, 75)...), }, // BIP0062: Pushing 76 to 255 bytes must use OP_PUSHDATA1. { name: "push data len 76", data: bytes.Repeat([]byte{0x49}, 76), - expected: append([]byte{OP_PUSHDATA1, 76}, bytes.Repeat([]byte{0x49}, 76)...), + expected: append([]byte{OpPushData1, 76}, bytes.Repeat([]byte{0x49}, 76)...), }, { name: "push data len 255", data: bytes.Repeat([]byte{0x49}, 255), - expected: append([]byte{OP_PUSHDATA1, 255}, bytes.Repeat([]byte{0x49}, 255)...), + expected: append([]byte{OpPushData1, 255}, bytes.Repeat([]byte{0x49}, 255)...), }, // BIP0062: Pushing 256 to 520 bytes must use OP_PUSHDATA2. { name: "push data len 256", data: bytes.Repeat([]byte{0x49}, 256), - expected: append([]byte{OP_PUSHDATA2, 0, 1}, bytes.Repeat([]byte{0x49}, 256)...), + expected: append([]byte{OpPushData2, 0, 1}, bytes.Repeat([]byte{0x49}, 256)...), }, { name: "push data len 520", data: bytes.Repeat([]byte{0x49}, 520), - expected: append([]byte{OP_PUSHDATA2, 0x08, 0x02}, bytes.Repeat([]byte{0x49}, 520)...), + expected: append([]byte{OpPushData2, 0x08, 0x02}, bytes.Repeat([]byte{0x49}, 520)...), }, // BIP0062: OP_PUSHDATA4 can never be used, as pushes over 520 @@ -252,7 +252,7 @@ func TestScriptBuilderAddData(t *testing.T) { { name: "push data len 32767 (non-canonical)", data: bytes.Repeat([]byte{0x49}, 32767), - expected: append([]byte{OP_PUSHDATA2, 255, 127}, bytes.Repeat([]byte{0x49}, 32767)...), + expected: append([]byte{OpPushData2, 255, 127}, bytes.Repeat([]byte{0x49}, 32767)...), useFull: true, }, @@ -260,7 +260,7 @@ func TestScriptBuilderAddData(t *testing.T) { { name: "push data len 65536 (non-canonical)", data: bytes.Repeat([]byte{0x49}, 65536), - expected: append([]byte{OP_PUSHDATA4, 0, 0, 1, 0}, bytes.Repeat([]byte{0x49}, 65536)...), + expected: append([]byte{OpPushData4, 0, 0, 1, 0}, bytes.Repeat([]byte{0x49}, 65536)...), useFull: true, }, } @@ -312,7 +312,7 @@ func TestExceedMaxScriptSize(t *testing.T) { // Ensure adding an opcode that would exceed the maximum size of the // script does not add the data. builder.Reset().AddFullData(make([]byte, MaxScriptSize-3)) - script, err = builder.AddOp(OP_0).Script() + script, err = builder.AddOp(Op0).Script() if _, ok := err.(ErrScriptNotCanonical); !ok || err == nil { t.Fatalf("ScriptBuilder.AddOp unexpected modified script - "+ "got len %d, want len %d", len(script), len(origScript)) @@ -384,7 +384,7 @@ func TestErroredScript(t *testing.T) { } // Ensure adding an opcode to a script that has errored doesn't succeed. - script, err = builder.AddOp(OP_0).Script() + script, err = builder.AddOp(Op0).Script() if _, ok := err.(ErrScriptNotCanonical); !ok || err == nil { t.Fatal("ScriptBuilder.AddOp succeeded on errored script") } diff --git a/txscript/sign.go b/txscript/sign.go index c3d44914e..a88e66988 100644 --- a/txscript/sign.go +++ b/txscript/sign.go @@ -74,7 +74,7 @@ func signMultiSig(tx *wire.MsgTx, idx int, subScript []byte, hashType SigHashTyp // We start with a single OP_FALSE to work around the (now standard) // but in the reference implementation that causes a spurious pop at // the end of OP_CHECKMULTISIG. - builder := NewScriptBuilder().AddOp(OP_FALSE) + builder := NewScriptBuilder().AddOp(OpFalse) signed := 0 for _, addr := range addresses { key, _, err := kdb.GetKey(addr) @@ -315,7 +315,7 @@ sigLoop: // Extra opcode to handle the extra arg consumed (due to previous bugs // in the reference implementation). - builder := NewScriptBuilder().AddOp(OP_FALSE) + builder := NewScriptBuilder().AddOp(OpFalse) doneSigs := 0 // This assumes that addresses are in the same order as in the script. for _, addr := range addresses { @@ -332,7 +332,7 @@ sigLoop: // padding for missing ones. for i := doneSigs; i < nRequired; i++ { - builder.AddOp(OP_0) + builder.AddOp(Op0) } script, _ := builder.Script() diff --git a/txscript/sign_test.go b/txscript/sign_test.go index 82623fc13..190af9610 100644 --- a/txscript/sign_test.go +++ b/txscript/sign_test.go @@ -1608,7 +1608,7 @@ nexttest: for i := range sigScriptTests { tx := wire.NewMsgTx(wire.TxVersion) - output := wire.NewTxOut(500, []byte{OP_RETURN}) + output := wire.NewTxOut(500, []byte{OpReturn}) tx.AddTxOut(output) for range sigScriptTests[i].inputs { diff --git a/txscript/standard.go b/txscript/standard.go index 398d77a33..b4e980f97 100644 --- a/txscript/standard.go +++ b/txscript/standard.go @@ -80,18 +80,18 @@ func isPubkey(pops []parsedOpcode) bool { // Valid pubkeys are either 33 or 65 bytes. return len(pops) == 2 && (len(pops[0].data) == 33 || len(pops[0].data) == 65) && - pops[1].opcode.value == OP_CHECKSIG + pops[1].opcode.value == OpCheckSig } // isPubkeyHash returns true if the script passed is a pay-to-pubkey-hash // transaction, false otherwise. func isPubkeyHash(pops []parsedOpcode) bool { return len(pops) == 5 && - pops[0].opcode.value == OP_DUP && - pops[1].opcode.value == OP_HASH160 && - pops[2].opcode.value == OP_DATA_20 && - pops[3].opcode.value == OP_EQUALVERIFY && - pops[4].opcode.value == OP_CHECKSIG + pops[0].opcode.value == OpDup && + pops[1].opcode.value == OpHash160 && + pops[2].opcode.value == OpData20 && + pops[3].opcode.value == OpEqualVerify && + pops[4].opcode.value == OpCheckSig } @@ -110,7 +110,7 @@ func isMultiSig(pops []parsedOpcode) bool { if !isSmallInt(pops[l-2].opcode) { return false } - if pops[l-1].opcode.value != OP_CHECKMULTISIG { + if pops[l-1].opcode.value != OpCheckMultiSig { return false } @@ -136,14 +136,14 @@ func isNullData(pops []parsedOpcode) bool { // OP_RETURN SMALLDATA (where SMALLDATA is a data push up to // MaxDataCarrierSize bytes). l := len(pops) - if l == 1 && pops[0].opcode.value == OP_RETURN { + if l == 1 && pops[0].opcode.value == OpReturn { return true } return l == 2 && - pops[0].opcode.value == OP_RETURN && + pops[0].opcode.value == OpReturn && (isSmallInt(pops[1].opcode) || pops[1].opcode.value <= - OP_PUSHDATA4) && + OpPushData4) && len(pops[1].data) <= MaxDataCarrierSize } @@ -311,23 +311,23 @@ func CalcMultiSigStats(script []byte) (int, int, error) { // output to a 20-byte pubkey hash. It is expected that the input is a valid // hash. func payToPubKeyHashScript(pubKeyHash []byte) ([]byte, error) { - return NewScriptBuilder().AddOp(OP_DUP).AddOp(OP_HASH160). - AddData(pubKeyHash).AddOp(OP_EQUALVERIFY).AddOp(OP_CHECKSIG). + return NewScriptBuilder().AddOp(OpDup).AddOp(OpHash160). + AddData(pubKeyHash).AddOp(OpEqualVerify).AddOp(OpCheckSig). Script() } // payToScriptHashScript creates a new script to pay a transaction output to a // script hash. It is expected that the input is a valid hash. func payToScriptHashScript(scriptHash []byte) ([]byte, error) { - return NewScriptBuilder().AddOp(OP_HASH160).AddData(scriptHash). - AddOp(OP_EQUAL).Script() + return NewScriptBuilder().AddOp(OpHash160).AddData(scriptHash). + AddOp(OpEqual).Script() } // payToPubkeyScript creates a new script to pay a transaction output to a // public key. It is expected that the input is a valid pubkey. func payToPubKeyScript(serializedPubKey []byte) ([]byte, error) { return NewScriptBuilder().AddData(serializedPubKey). - AddOp(OP_CHECKSIG).Script() + AddOp(OpCheckSig).Script() } // PayToAddrScript creates a new script to pay a transaction output to a the @@ -373,7 +373,7 @@ func NullDataScript(data []byte) ([]byte, error) { return nil, scriptError(ErrTooMuchNullData, str) } - return NewScriptBuilder().AddOp(OP_RETURN).AddData(data).Script() + return NewScriptBuilder().AddOp(OpReturn).AddData(data).Script() } // MultiSigScript returns a valid script for a multisignature redemption where @@ -393,7 +393,7 @@ func MultiSigScript(pubkeys []*btcutil.AddressPubKey, nrequired int) ([]byte, er builder.AddData(key.ScriptAddress()) } builder.AddInt64(int64(len(pubkeys))) - builder.AddOp(OP_CHECKMULTISIG) + builder.AddOp(OpCheckMultiSig) return builder.Script() } @@ -410,7 +410,7 @@ func PushedData(script []byte) ([][]byte, error) { for _, pop := range pops { if pop.data != nil { data = append(data, pop.data) - } else if pop.opcode.value == OP_0 { + } else if pop.opcode.value == Op0 { data = append(data, nil) } } @@ -528,26 +528,26 @@ func ExtractAtomicSwapDataPushes(version uint16, pkScript []byte) (*AtomicSwapDa if len(pops) != 20 { return nil, nil } - isAtomicSwap := pops[0].opcode.value == OP_IF && - pops[1].opcode.value == OP_SIZE && + isAtomicSwap := pops[0].opcode.value == OpIf && + pops[1].opcode.value == OpSize && canonicalPush(pops[2]) && - pops[3].opcode.value == OP_EQUALVERIFY && - pops[4].opcode.value == OP_SHA256 && - pops[5].opcode.value == OP_DATA_32 && - pops[6].opcode.value == OP_EQUALVERIFY && - pops[7].opcode.value == OP_DUP && - pops[8].opcode.value == OP_HASH160 && - pops[9].opcode.value == OP_DATA_20 && - pops[10].opcode.value == OP_ELSE && + pops[3].opcode.value == OpEqualVerify && + pops[4].opcode.value == OpSHA256 && + pops[5].opcode.value == OpData32 && + pops[6].opcode.value == OpEqualVerify && + pops[7].opcode.value == OpDup && + pops[8].opcode.value == OpHash160 && + pops[9].opcode.value == OpData20 && + pops[10].opcode.value == OpElse && canonicalPush(pops[11]) && - pops[12].opcode.value == OP_CHECKLOCKTIMEVERIFY && - pops[13].opcode.value == OP_DROP && - pops[14].opcode.value == OP_DUP && - pops[15].opcode.value == OP_HASH160 && - pops[16].opcode.value == OP_DATA_20 && - pops[17].opcode.value == OP_ENDIF && - pops[18].opcode.value == OP_EQUALVERIFY && - pops[19].opcode.value == OP_CHECKSIG + pops[12].opcode.value == OpCheckLockTimeVerify && + pops[13].opcode.value == OpDrop && + pops[14].opcode.value == OpDup && + pops[15].opcode.value == OpHash160 && + pops[16].opcode.value == OpData20 && + pops[17].opcode.value == OpEndIf && + pops[18].opcode.value == OpEqualVerify && + pops[19].opcode.value == OpCheckSig if !isAtomicSwap { return nil, nil } diff --git a/txscript/standard_test.go b/txscript/standard_test.go index ebb5a1cc5..749548e74 100644 --- a/txscript/standard_test.go +++ b/txscript/standard_test.go @@ -332,7 +332,7 @@ func TestExtractPkScriptAddrs(t *testing.T) { }, { name: "script that does not parse", - script: []byte{OP_DATA_45}, + script: []byte{OpData45}, addrs: nil, reqSigs: 0, class: NonStandardTy, @@ -529,22 +529,22 @@ func TestPayToAddrScript(t *testing.T) { } // mainnet p2pk 13CG6SJ3yHUXo4Cr2RY4THLLJrNFuG3gUg - p2pkCompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("02192d"+ + p2pkCompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("02192d" + "74d0cb94344c9569c2e77901573d8d7903c3ebec3a957724895dca52c6b4")) if err != nil { t.Fatalf("Unable to create pubkey address (compressed): %v", err) } - p2pkCompressed2Main, err := btcutil.NewAddressPubKey(hexToBytes("03b0b"+ + p2pkCompressed2Main, err := btcutil.NewAddressPubKey(hexToBytes("03b0b" + "d634234abbb1ba1e986e884185c61cf43e001f9137f23c2c409273eb16e65")) if err != nil { t.Fatalf("Unable to create pubkey address (compressed 2): %v", err) } - p2pkUncompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("0411"+ - "db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5"+ - "cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b4"+ + p2pkUncompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("0411" + + "db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5" + + "cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b4" + "12a3")) if err != nil { t.Fatalf("Unable to create pubkey address (uncompressed): %v", @@ -631,22 +631,22 @@ func TestMultiSigScript(t *testing.T) { t.Parallel() // mainnet p2pk 13CG6SJ3yHUXo4Cr2RY4THLLJrNFuG3gUg - p2pkCompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("02192d"+ + p2pkCompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("02192d" + "74d0cb94344c9569c2e77901573d8d7903c3ebec3a957724895dca52c6b4")) if err != nil { t.Fatalf("Unable to create pubkey address (compressed): %v", err) } - p2pkCompressed2Main, err := btcutil.NewAddressPubKey(hexToBytes("03b0b"+ + p2pkCompressed2Main, err := btcutil.NewAddressPubKey(hexToBytes("03b0b" + "d634234abbb1ba1e986e884185c61cf43e001f9137f23c2c409273eb16e65")) if err != nil { t.Fatalf("Unable to create pubkey address (compressed 2): %v", err) } - p2pkUncompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("0411"+ - "db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5"+ - "cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b4"+ + p2pkUncompressedMain, err := btcutil.NewAddressPubKey(hexToBytes("0411" + + "db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5" + + "cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b4" + "12a3")) if err != nil { t.Fatalf("Unable to create pubkey address (uncompressed): %v",