[RPC] add new utxoupdatepsbt arguments to the CRPCCommand and CPRCConvertParam tables
The new `descriptors` argument needs to be added to the Command and ConvertParams tables to by usable as a named argument and by bitcoin-cli. Also update the test to use named arguments to test this.
This commit is contained in:
parent
2f717fb5cd
commit
3b11420b3c
3 changed files with 3 additions and 2 deletions
|
@ -28,6 +28,7 @@ public:
|
||||||
static const CRPCConvertParam vRPCConvertParams[] =
|
static const CRPCConvertParam vRPCConvertParams[] =
|
||||||
{
|
{
|
||||||
{ "setmocktime", 0, "timestamp" },
|
{ "setmocktime", 0, "timestamp" },
|
||||||
|
{ "utxoupdatepsbt", 1, "descriptors" },
|
||||||
{ "generatetoaddress", 0, "nblocks" },
|
{ "generatetoaddress", 0, "nblocks" },
|
||||||
{ "generatetoaddress", 2, "maxtries" },
|
{ "generatetoaddress", 2, "maxtries" },
|
||||||
{ "getnetworkhashps", 0, "nblocks" },
|
{ "getnetworkhashps", 0, "nblocks" },
|
||||||
|
|
|
@ -1776,7 +1776,7 @@ static const CRPCCommand commands[] =
|
||||||
{ "rawtransactions", "finalizepsbt", &finalizepsbt, {"psbt", "extract"} },
|
{ "rawtransactions", "finalizepsbt", &finalizepsbt, {"psbt", "extract"} },
|
||||||
{ "rawtransactions", "createpsbt", &createpsbt, {"inputs","outputs","locktime","replaceable"} },
|
{ "rawtransactions", "createpsbt", &createpsbt, {"inputs","outputs","locktime","replaceable"} },
|
||||||
{ "rawtransactions", "converttopsbt", &converttopsbt, {"hexstring","permitsigdata","iswitness"} },
|
{ "rawtransactions", "converttopsbt", &converttopsbt, {"hexstring","permitsigdata","iswitness"} },
|
||||||
{ "rawtransactions", "utxoupdatepsbt", &utxoupdatepsbt, {"psbt"} },
|
{ "rawtransactions", "utxoupdatepsbt", &utxoupdatepsbt, {"psbt", "descriptors"} },
|
||||||
{ "rawtransactions", "joinpsbts", &joinpsbts, {"txs"} },
|
{ "rawtransactions", "joinpsbts", &joinpsbts, {"txs"} },
|
||||||
{ "rawtransactions", "analyzepsbt", &analyzepsbt, {"psbt"} },
|
{ "rawtransactions", "analyzepsbt", &analyzepsbt, {"psbt"} },
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ class PSBTTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Try again, now while providing descriptors, making P2SH-segwit work, and causing bip32_derivs and redeem_script to be filled in
|
# Try again, now while providing descriptors, making P2SH-segwit work, and causing bip32_derivs and redeem_script to be filled in
|
||||||
descs = [self.nodes[1].getaddressinfo(addr)['desc'] for addr in [addr1,addr2,addr3]]
|
descs = [self.nodes[1].getaddressinfo(addr)['desc'] for addr in [addr1,addr2,addr3]]
|
||||||
updated = self.nodes[1].utxoupdatepsbt(psbt, descs)
|
updated = self.nodes[1].utxoupdatepsbt(psbt=psbt, descriptors=descs)
|
||||||
decoded = self.nodes[1].decodepsbt(updated)
|
decoded = self.nodes[1].decodepsbt(updated)
|
||||||
test_psbt_input_keys(decoded['inputs'][0], ['witness_utxo', 'bip32_derivs'])
|
test_psbt_input_keys(decoded['inputs'][0], ['witness_utxo', 'bip32_derivs'])
|
||||||
test_psbt_input_keys(decoded['inputs'][1], [])
|
test_psbt_input_keys(decoded['inputs'][1], [])
|
||||||
|
|
Loading…
Reference in a new issue