You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1bce12a test: add test for `descriptorprocesspsbt` RPC (ishaanam)
fb2a3a7 rpc: add descriptorprocesspsbt rpc (ishaanam)
Pull request description:
This PR implements an RPC called `descriptorprocesspsbt`. This RPC is based off of `walletprocesspsbt`, but instead of interacting with the wallet to update, sign and finalize a psbt, it instead accepts an array of output descriptors and uses that information along with information from the mempool, txindex, and the utxo set to do so. `utxoupdatepsbt` also updates a psbt in this manner, but doesn't sign or finalize it. Because of this overlap, a helper function that is added in this PR is called by both `utxoupdatepsbt` and `descriptorprocesspsbt`. Whether or not the helper function signs a psbt is dictated by if the HidingSigningProvider passed to it contains any private information. There is also a test added in this PR for this new RPC that uses p2wsh, p2wpkh, and legacy outputs.
Edit: see bitcoin/bitcoin#25796 (comment)
ACKs for top commit:
achow101:
re-ACK 1bce12a
instagibbs:
reACK bitcoin/bitcoin@1bce12a
Tree-SHA512: e1d0334739943e71f2ee68b4db7637ebe725da62e7aa4be071f71c7196d2a5970a31ece96d91e372d34454cde8509e95ab0eebd2c8edb94f7d5a781a84f8fc5d
{"range", RPCArg::Type::RANGE, RPCArg::Default{1000}, "Up to what index HD chains should be explored (either end or [begin,end])"},
1933
+
}},
1934
+
}},
1935
+
{"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
1936
+
"\"DEFAULT\"\n"
1937
+
"\"ALL\"\n"
1938
+
"\"NONE\"\n"
1939
+
"\"SINGLE\"\n"
1940
+
"\"ALL|ANYONECANPAY\"\n"
1941
+
"\"NONE|ANYONECANPAY\"\n"
1942
+
"\"SINGLE|ANYONECANPAY\""},
1943
+
{"bip32derivs", RPCArg::Type::BOOL, RPCArg::Default{true}, "Include BIP 32 derivation paths for public keys if we know them"},
1944
+
{"finalize", RPCArg::Type::BOOL, RPCArg::Default{true}, "Also finalize inputs if possible"},
1945
+
},
1946
+
RPCResult{
1947
+
RPCResult::Type::OBJ, "", "",
1948
+
{
1949
+
{RPCResult::Type::STR, "psbt", "The base64-encoded partially signed transaction"},
1950
+
{RPCResult::Type::BOOL, "complete", "If the transaction has a complete set of signatures"},
self.log.info("Test we don't crash when making a 0-value funded transaction at 0 fee without forcing an input selection")
943
946
assert_raises_rpc_error(-4, "Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input", self.nodes[0].walletcreatefundedpsbt, [], [{"data": "deadbeef"}], 0, {"fee_rate": "0"})
944
947
948
+
self.log.info("Test descriptorprocesspsbt updates and signs a psbt with descriptors")
949
+
950
+
self.generate(self.nodes[2], 1)
951
+
952
+
# Disable the wallet for node 2 since `descriptorprocesspsbt` does not use the wallet
0 commit comments