The only coverage of combinerawtransaction is in a legacy wallet only test. So also use it in rpc_createmultisig so that this RPC remains tested after the legacy wallet is removed.
Split from #28710
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31249.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | maflcko, BrandonOdiwuor, Abdulkbk, brunoerg, rkrux |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Forgot to move ab98e6fd039 as well? Otherwise
lgtm ACK af4d23178b420f46196fbace2176ce1fe94ed9cd
The only coverage of combinerawtransaction is in a legacy wallet only
test. So also use it in rpc_createmultisig so that this RPC remains
tested after the legacy wallet is removed.
193@@ -194,13 +194,19 @@ def do_multisig(self, nkeys, nsigs, output_type, wallet_multi):
194 assert_raises_rpc_error(-8, "redeemScript/witnessScript does not match scriptPubKey", node2.signrawtransactionwithkey, rawtx, priv_keys[0:nsigs-1], [prevtx_err])
195
Lacking before this change as well, can we add a comment here just like there is one in all the code blocks above and below?
sign the rawtx with nsigs-1 signatures, then sign with the last sig, and then combine to create fully signed tx
193@@ -194,13 +194,19 @@ def do_multisig(self, nkeys, nsigs, output_type, wallet_multi):
194 assert_raises_rpc_error(-8, "redeemScript/witnessScript does not match scriptPubKey", node2.signrawtransactionwithkey, rawtx, priv_keys[0:nsigs-1], [prevtx_err])
195
196 rawtx2 = node2.signrawtransactionwithkey(rawtx, priv_keys[0:nsigs - 1], prevtxs)
197- rawtx3 = node2.signrawtransactionwithkey(rawtx2["hex"], [priv_keys[-1]], prevtxs)
198- assert rawtx3['complete']
199-
200- tx = node0.sendrawtransaction(rawtx3["hex"], 0)
201+ assert_equal(rawtx2["complete"], False)
202+ rawtx3 = node2.signrawtransactionwithkey(rawtx, [priv_keys[-1]], prevtxs)
priv_keys[-1]
, and not priv_keys[nsigs]
. Maybe the author intended to test signatures from non-consecutive keys as well.
201+ assert_equal(rawtx2["complete"], False)
202+ rawtx3 = node2.signrawtransactionwithkey(rawtx, [priv_keys[-1]], prevtxs)
203+ assert_equal(rawtx3["complete"], False)
204+ assert_raises_rpc_error(-22, "TX decode failed", node2.combinerawtransaction, [rawtx2['hex'], rawtx3['hex'] + "00"])
205+ assert_raises_rpc_error(-22, "Missing transactions", node2.combinerawtransaction, [])
206+ combined_rawtx = node2.combinerawtransaction([rawtx2["hex"], rawtx3["hex"]])
For readability
0 full_signed_tx = node2.combinerawtransaction([rawtx2["hex"], rawtx3["hex"]])
tACK 83fab3212c91d91fc5502f940c901a07772ff747
Make and functional tests successful.
Thanks for ensuring coverage for this RPC is not lost.