mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Adapt bitcoin-tx to CA
This commit is contained in:
parent
0b5066143d
commit
6493ad902a
4 changed files with 196 additions and 93 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include <config/bitcoin-config.h>
|
||||
#endif
|
||||
|
||||
#include <asset.h>
|
||||
#include <clientversion.h>
|
||||
#include <coins.h>
|
||||
#include <consensus/consensus.h>
|
||||
|
|
@ -46,7 +47,7 @@ static void SetupBitcoinTxArgs()
|
|||
gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("locktime=N", "Set TX lock time to N", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("nversion=N", "Set TX version to N", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("outaddr=VALUE:ADDRESS(:ASSET)", "Add address-based output to TX", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", false, OptionsCategory::COMMANDS);
|
||||
gArgs.AddArg("outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. "
|
||||
"Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output. "
|
||||
|
|
@ -67,6 +68,8 @@ static void SetupBitcoinTxArgs()
|
|||
gArgs.AddArg("load=NAME:FILENAME", "Load JSON file FILENAME into register NAME", false, OptionsCategory::REGISTER_COMMANDS);
|
||||
gArgs.AddArg("set=NAME:JSON-STRING", "Set register NAME to given JSON-STRING", false, OptionsCategory::REGISTER_COMMANDS);
|
||||
|
||||
gArgs.AddArg("-serialization=TYPE", "Sets the serialization of transactions. ELEMENTS or BITCOIN are the two valid options.", false, OptionsCategory::REGISTER_COMMANDS);
|
||||
|
||||
// Hidden
|
||||
gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN);
|
||||
gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN);
|
||||
|
|
@ -270,7 +273,7 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn
|
|||
std::vector<std::string> vStrInputParts;
|
||||
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
|
||||
|
||||
if (vStrInputParts.size() != 2)
|
||||
if (vStrInputParts.size() < 2)
|
||||
throw std::runtime_error("TX output missing or too many separators");
|
||||
|
||||
// Extract and validate VALUE
|
||||
|
|
@ -284,8 +287,22 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn
|
|||
}
|
||||
CScript scriptPubKey = GetScriptForDestination(destination);
|
||||
|
||||
// extract and validate ASSET
|
||||
CAsset asset;
|
||||
if (!g_con_elementsmode && vStrInputParts.size() == 3) {
|
||||
throw std::runtime_error("TX output asset type invalid for BITCOIN serialization");
|
||||
}
|
||||
if (vStrInputParts.size() == 3) {
|
||||
asset = CAsset(uint256S(vStrInputParts[2]));
|
||||
if (asset.IsNull()) {
|
||||
throw std::runtime_error("invalid TX output asset type");
|
||||
}
|
||||
} else {
|
||||
asset = Params().GetConsensus().pegged_asset;
|
||||
}
|
||||
|
||||
// construct TxOut, append to transaction output list
|
||||
CTxOut txout(value, scriptPubKey);
|
||||
CTxOut txout(asset, CConfidentialValue(value), scriptPubKey);
|
||||
tx.vout.push_back(txout);
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +346,7 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str
|
|||
}
|
||||
|
||||
// construct TxOut, append to transaction output list
|
||||
CTxOut txout(value, scriptPubKey);
|
||||
CTxOut txout(Params().GetConsensus().pegged_asset, CConfidentialValue(value), scriptPubKey);
|
||||
tx.vout.push_back(txout);
|
||||
}
|
||||
|
||||
|
|
@ -403,7 +420,7 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s
|
|||
}
|
||||
|
||||
// construct TxOut, append to transaction output list
|
||||
CTxOut txout(value, scriptPubKey);
|
||||
CTxOut txout(Params().GetConsensus().pegged_asset, CConfidentialValue(value), scriptPubKey);
|
||||
tx.vout.push_back(txout);
|
||||
}
|
||||
|
||||
|
|
@ -411,26 +428,46 @@ static void MutateTxAddOutData(CMutableTransaction& tx, const std::string& strIn
|
|||
{
|
||||
CAmount value = 0;
|
||||
|
||||
// separate [VALUE:]DATA in string
|
||||
size_t pos = strInput.find(':');
|
||||
// separate [VALUE:]DATA[:ASSET] in string
|
||||
std::vector<std::string> vStrInputParts;
|
||||
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
|
||||
|
||||
if (pos==0)
|
||||
// Check that there are enough parameters
|
||||
if (vStrInputParts[0].empty())
|
||||
throw std::runtime_error("TX output value not specified");
|
||||
|
||||
if (pos != std::string::npos) {
|
||||
// Extract and validate VALUE
|
||||
value = ExtractAndValidateValue(strInput.substr(0, pos));
|
||||
if (vStrInputParts.size()>3)
|
||||
throw std::runtime_error("too many separators");
|
||||
|
||||
std::vector<unsigned char> data;
|
||||
CAsset asset(Params().GetConsensus().pegged_asset);
|
||||
|
||||
if (vStrInputParts.size()==1) {
|
||||
std::string strData = vStrInputParts[0];
|
||||
if (!IsHex(strData))
|
||||
throw std::runtime_error("invalid TX output data");
|
||||
data = ParseHex(strData);
|
||||
|
||||
} else {
|
||||
value = ExtractAndValidateValue(vStrInputParts[0]);
|
||||
std::string strData = vStrInputParts[1];
|
||||
if (!IsHex(strData))
|
||||
throw std::runtime_error("invalid TX output data");
|
||||
data = ParseHex(strData);
|
||||
|
||||
if (vStrInputParts.size()==3) {
|
||||
std::string strAsset = vStrInputParts[2];
|
||||
if (!IsHex(strAsset))
|
||||
throw std::runtime_error("invalid TX output asset type");
|
||||
|
||||
asset.SetHex(strAsset);
|
||||
if (asset.IsNull()) {
|
||||
throw std::runtime_error("invalid TX output asset type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// extract and validate DATA
|
||||
std::string strData = strInput.substr(pos + 1, std::string::npos);
|
||||
|
||||
if (!IsHex(strData))
|
||||
throw std::runtime_error("invalid TX output data");
|
||||
|
||||
std::vector<unsigned char> data = ParseHex(strData);
|
||||
|
||||
CTxOut txout(value, CScript() << OP_RETURN << data);
|
||||
CTxOut txout(asset, CConfidentialValue(value), CScript() << OP_RETURN << data);
|
||||
tx.vout.push_back(txout);
|
||||
}
|
||||
|
||||
|
|
@ -475,7 +512,7 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& str
|
|||
}
|
||||
|
||||
// construct TxOut, append to transaction output list
|
||||
CTxOut txout(value, scriptPubKey);
|
||||
CTxOut txout(Params().GetConsensus().pegged_asset, CConfidentialValue(value), scriptPubKey);
|
||||
tx.vout.push_back(txout);
|
||||
}
|
||||
|
||||
|
|
@ -612,7 +649,7 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
|
|||
newcoin.out.scriptPubKey = scriptPubKey;
|
||||
newcoin.out.nValue = 0;
|
||||
if (prevOut.exists("amount")) {
|
||||
newcoin.out.nValue = AmountFromValue(prevOut["amount"]);
|
||||
newcoin.out.nValue = CConfidentialValue(AmountFromValue(prevOut["amount"]));
|
||||
}
|
||||
newcoin.nHeight = 1;
|
||||
view.AddCoin(out, std::move(newcoin), true);
|
||||
|
|
@ -642,7 +679,7 @@ static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)
|
|||
continue;
|
||||
}
|
||||
const CScript& prevPubKey = coin.out.scriptPubKey;
|
||||
const CAmount& amount = coin.out.nValue;
|
||||
const CConfidentialValue& amount = coin.out.nValue;
|
||||
|
||||
SignatureData sigdata = DataFromTransaction(mergedTx, i, coin.out);
|
||||
// Only sign SIGHASH_SINGLE if there's a corresponding output:
|
||||
|
|
@ -812,6 +849,16 @@ static int CommandLineRawTx(int argc, char* argv[])
|
|||
value = arg.substr(eqpos + 1);
|
||||
}
|
||||
|
||||
std::string serialization = gArgs.GetArg("-serialization", "ELEMENTS");
|
||||
if (serialization == "ELEMENTS") {
|
||||
g_con_elementsmode = true;
|
||||
} else if (serialization == "BITCOIN") {
|
||||
g_con_elementsmode = false;
|
||||
} else {
|
||||
PrintExceptionContinue(nullptr, "Invalid serialization argument");
|
||||
throw;
|
||||
}
|
||||
|
||||
MutateTx(tx, key, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,110 +1,110 @@
|
|||
[
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "nversion=1"],
|
||||
"output_cmp": "blanktxv1.hex",
|
||||
"description": "Creates a blank v1 transaction"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json","-create", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json","-create", "nversion=1"],
|
||||
"output_cmp": "blanktxv1.json",
|
||||
"description": "Creates a blank v1 transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-"],
|
||||
"args": ["-serialization=BITCOIN", "-"],
|
||||
"input": "blanktxv2.hex",
|
||||
"output_cmp": "blanktxv2.hex",
|
||||
"description": "Creates a blank transaction when nothing is piped into bitcoin-tx"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json","-create"],
|
||||
"args": ["-serialization=BITCOIN", "-json","-create"],
|
||||
"output_cmp": "blanktxv2.json",
|
||||
"description": "Creates a blank transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json","-"],
|
||||
"args": ["-serialization=BITCOIN", "-json","-"],
|
||||
"input": "blanktxv2.hex",
|
||||
"output_cmp": "blanktxv2.json",
|
||||
"description": "Creates a blank transaction when nothing is piped into bitcoin-tx (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "nversion=1foo"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "nversion=1foo"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX version requested",
|
||||
"description": "Tests the check for invalid nversion value"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delin=1"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delin=1"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-delin1-out.hex",
|
||||
"description": "Deletes a single input from a transaction"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-", "delin=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-", "delin=1"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-delin1-out.json",
|
||||
"description": "Deletes a single input from a transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delin=31"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delin=31"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX input index '31'",
|
||||
"description": "Attempts to delete an input with a bad index from a transaction. Expected to fail."
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delin=1foo"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delin=1foo"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX input index",
|
||||
"description": "Tests the check for an invalid input index with delin"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delout=1"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delout=1"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-delout1-out.hex",
|
||||
"description": "Deletes a single output from a transaction"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-", "delout=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-", "delout=1"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-delout1-out.json",
|
||||
"description": "Deletes a single output from a transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delout=2"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delout=2"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX output index '2'",
|
||||
"description": "Attempts to delete an output with a bad index from a transaction. Expected to fail."
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "delout=1foo"],
|
||||
"args": ["-serialization=BITCOIN", "-", "delout=1foo"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX output index",
|
||||
"description": "Tests the check for an invalid output index with delout"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-", "locktime=317000"],
|
||||
"args": ["-serialization=BITCOIN", "-", "locktime=317000"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-locktime317000-out.hex",
|
||||
"description": "Adds an nlocktime to a transaction"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-", "locktime=317000"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-", "locktime=317000"],
|
||||
"input": "tx394b54bb.hex",
|
||||
"output_cmp": "tt-locktime317000-out.json",
|
||||
"description": "Adds an nlocktime to a transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "locktime=317000foo"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "locktime=317000foo"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Invalid TX locktime requested",
|
||||
"description": "Tests the check for invalid locktime value"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"replaceable=0foo"],
|
||||
"return_code": 1,
|
||||
|
|
@ -113,7 +113,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0x"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: invalid TX input vout",
|
||||
|
|
@ -121,7 +121,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"outaddr=1"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: TX output missing or too many separators",
|
||||
|
|
@ -129,15 +129,15 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"outaddr=1:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o:garbage"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: TX output missing or too many separators",
|
||||
"description": "Malformed outaddr argument (too many separators). Expected to fail."
|
||||
"error_txt": "error: TX output asset type invalid for BITCOIN serialization",
|
||||
"description": "Malformed outaddr argument (asset id for BITCOIN serialization). Expected to fail."
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"outpubkey=0"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: TX output missing or too many separators",
|
||||
|
|
@ -145,7 +145,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W:non53nse"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: TX output missing or too many separators",
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
|
||||
"in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1",
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
|
||||
|
|
@ -175,68 +175,68 @@
|
|||
"description": "Creates a new transaction with three inputs and two outputs (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outscript=0:"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outscript=0:"],
|
||||
"output_cmp": "txcreate2.hex",
|
||||
"description": "Creates a new transaction with a single empty output script"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outscript=0:"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outscript=0:"],
|
||||
"output_cmp": "txcreate2.json",
|
||||
"description": "Creates a new transaction with a single empty output script (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["02000000000100000000000000000000000000"],
|
||||
"args": ["-serialization=BITCOIN", "02000000000100000000000000000000000000"],
|
||||
"output_cmp": "txcreate2.hex",
|
||||
"description": "Parses a transaction with no inputs and a single output script"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "02000000000100000000000000000000000000"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "02000000000100000000000000000000000000"],
|
||||
"output_cmp": "txcreate2.json",
|
||||
"description": "Parses a transaction with no inputs and a single output script (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outscript=0:OP_DROP", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outscript=0:OP_DROP", "nversion=1"],
|
||||
"output_cmp": "txcreatescript1.hex",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outscript=0:OP_DROP", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outscript=0:OP_DROP", "nversion=1"],
|
||||
"output_cmp": "txcreatescript1.json",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outscript=0:OP_DROP:S", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outscript=0:OP_DROP:S", "nversion=1"],
|
||||
"output_cmp": "txcreatescript2.hex",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2SH"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outscript=0:OP_DROP:S", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outscript=0:OP_DROP:S", "nversion=1"],
|
||||
"output_cmp": "txcreatescript2.json",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2SH (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outscript=0:OP_DROP:W", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outscript=0:OP_DROP:W", "nversion=1"],
|
||||
"output_cmp": "txcreatescript3.hex",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outscript=0:OP_DROP:W", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outscript=0:OP_DROP:W", "nversion=1"],
|
||||
"output_cmp": "txcreatescript3.json",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outscript=0:OP_DROP:WS", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outscript=0:OP_DROP:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatescript4.hex",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH, wrapped in a P2SH"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outscript=0:OP_DROP:WS", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outscript=0:OP_DROP:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatescript4.json",
|
||||
"description": "Create a new transaction with a single output script (OP_DROP) in a P2SH, wrapped in a P2SH (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create", "nversion=1",
|
||||
["-serialization=BITCOIN", "-create", "nversion=1",
|
||||
"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
|
||||
"set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
|
||||
"set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"-create", "nversion=1",
|
||||
"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
|
||||
"set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
|
||||
|
|
@ -259,7 +259,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
|
||||
"set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
|
||||
"set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
|
||||
|
|
@ -270,7 +270,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
|
||||
"set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
|
||||
"set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":\"0foo\",\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
|
||||
|
|
@ -282,50 +282,50 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey1.hex",
|
||||
"description": "Creates a new transaction with a single pay-to-pubkey output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey1.json",
|
||||
"description": "Creates a new transaction with a single pay-to-pubkey output (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey2.hex",
|
||||
"description": "Creates a new transaction with a single pay-to-witness-pubkey output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey2.json",
|
||||
"description": "Creates a new transaction with a single pay-to-witness-pubkey output (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey3.hex",
|
||||
"description": "Creates a new transaction with a single pay-to-witness-pubkey, wrapped in P2SH output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
|
||||
"output_cmp": "txcreateoutpubkey3.json",
|
||||
"description": "Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json", "-create", "outpubkey=0:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS", "nversion=1"],
|
||||
["-serialization=BITCOIN", "-json", "-create", "outpubkey=0:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS", "nversion=1"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Uncompressed pubkeys are not useable for SegWit outputs",
|
||||
"description": "Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outdata=4:badhexdata"],
|
||||
"return_code": 1,
|
||||
|
|
@ -334,7 +334,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outdata=badhexdata"],
|
||||
"return_code": 1,
|
||||
|
|
@ -343,7 +343,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
|
||||
"outdata=4:54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
|
||||
|
|
@ -352,7 +352,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"-create", "nversion=1",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
|
||||
|
|
@ -362,7 +362,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
|
||||
"outdata=54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
|
||||
|
|
@ -371,7 +371,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
|
||||
|
|
@ -381,7 +381,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
["-serialization=BITCOIN", "-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o"],
|
||||
"output_cmp": "txcreatedata_seq0.hex",
|
||||
|
|
@ -389,7 +389,7 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"-create",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293",
|
||||
"outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o"],
|
||||
|
|
@ -398,68 +398,91 @@
|
|||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000",
|
||||
["-serialization=BITCOIN", "01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1"],
|
||||
"output_cmp": "txcreatedata_seq1.hex",
|
||||
"description": "Adds a new input with sequence number to a transaction"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-json",
|
||||
["-serialization=BITCOIN", "-json",
|
||||
"01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000",
|
||||
"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1"],
|
||||
"output_cmp": "txcreatedata_seq1.json",
|
||||
"description": "Adds a new input with sequence number to a transaction (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig1.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig1.json",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig output (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig2.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2SH output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig2.json",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2SH output (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig3.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig3.json",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig4.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig4.json",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:S"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:S"],
|
||||
"output_cmp": "txcreatemultisig5.json",
|
||||
"description": "Uncompressed pubkeys should work just fine for non-witness outputs"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS"],
|
||||
"args": ["-serialization=BITCOIN", "-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: Uncompressed pubkeys are not useable for SegWit outputs",
|
||||
"description": "Ensure adding witness outputs with uncompressed pubkeys fails"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-serialization=ELEMENTS", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig4_elements.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH. Elements serialization."
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "-json", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig4_elements.json",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH. Elements serialization, without serialization arg. (output in json)"
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args":
|
||||
["-create",
|
||||
"outaddr=1:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o:garbage"],
|
||||
"return_code": 1,
|
||||
"error_txt": "error: invalid TX output asset type",
|
||||
"description": "Malformed outaddr argument (bad asset id). Expected to fail."
|
||||
},
|
||||
{ "exec": "./bitcoin-tx",
|
||||
"args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
|
||||
"output_cmp": "txcreatemultisig4_elements.hex",
|
||||
"description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH. Elements serialization, without serialization arg."
|
||||
}
|
||||
]
|
||||
|
|
|
|||
1
test/util/data/txcreatemultisig4_elements.hex
Normal file
1
test/util/data/txcreatemultisig4_elements.hex
Normal file
|
|
@ -0,0 +1 @@
|
|||
01000000000001010000000000000000000000000000000000000000000000000000000000000000010000000005f5e1000017a9146edf12858999f0dae74f9c692e6694ee3621b2ac8700000000
|
||||
32
test/util/data/txcreatemultisig4_elements.json
Normal file
32
test/util/data/txcreatemultisig4_elements.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"txid": "95b2c6399f5624a7171d20ba4c7227874128e0addd9bf36a4aa9576dd8098226",
|
||||
"hash": "95b2c6399f5624a7171d20ba4c7227874128e0addd9bf36a4aa9576dd8098226",
|
||||
"wtxid": "95b2c6399f5624a7171d20ba4c7227874128e0addd9bf36a4aa9576dd8098226",
|
||||
"withash": "d0d3b17552f63780c06e5558483412d8384702cd777404f52a8a9680304fe582",
|
||||
"version": 1,
|
||||
"size": 78,
|
||||
"vsize": 78,
|
||||
"weight": 312,
|
||||
"locktime": 0,
|
||||
"vin": [
|
||||
],
|
||||
"vout": [
|
||||
{
|
||||
"value": 1.00000000,
|
||||
"asset": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"commitmentnonce": "",
|
||||
"commitmentnonce_fully_valid": false,
|
||||
"n": 0,
|
||||
"scriptPubKey": {
|
||||
"asm": "OP_HASH160 6edf12858999f0dae74f9c692e6694ee3621b2ac OP_EQUAL",
|
||||
"hex": "a9146edf12858999f0dae74f9c692e6694ee3621b2ac87",
|
||||
"reqSigs": 1,
|
||||
"type": "scripthash",
|
||||
"addresses": [
|
||||
"3BoFUz1StqcNcgUTZE5cC1eFhuYFzj3fGH"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"hex": "01000000000001010000000000000000000000000000000000000000000000000000000000000000010000000005f5e1000017a9146edf12858999f0dae74f9c692e6694ee3621b2ac8700000000"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue