Added a couple of test cases for joinpsbts to cover empty and single PSBT inputs.
The existing tests only covered cases with two or more PSBTs, so these tests make sure the minimum input requirement is handled correctly.
Added a couple of test cases for joinpsbts to cover empty and single PSBT inputs.
The existing tests only covered cases with two or more PSBTs, so these tests make sure the minimum input requirement is handled correctly.
Added tests for joinpsbts with empty and single PSBT inputs to make sure both return the expected error.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
1399 | @@ -1400,8 +1400,12 @@ def test_psbt_input_keys(psbt_input, keys): 1400 | test_psbt_input_keys(decoded['inputs'][1], psbt_v2_required_keys + ['non_witness_utxo', 'bip32_derivs']) 1401 | test_psbt_input_keys(decoded['inputs'][2], psbt_v2_required_keys + ['non_witness_utxo', 'witness_utxo', 'bip32_derivs', 'redeem_script']) 1402 | 1403 | - # Cannot join PSBTv2s 1404 | + # joinpsbts requires at least two PSBTs 1405 | psbt1 = self.nodes[1].createpsbt(inputs=[utxo1], outputs={self.nodes[0].getnewaddress():Decimal('10.999')}, psbt_version=0)
Feel free to ignore this nit, but I would create psbt1 after checking that empty joinpsbts fails.
assert_raises_rpc_error(-8, "At least two PSBTs are required to join PSBTs", self.nodes[1].joinpsbts, [])
psbt1 = self.nodes[1].createpsbt(inputs=[utxo1], outputs={self.nodes[0].getnewaddress():Decimal('10.999')}, psbt_version=0)
ACK 701f48ad463bee92706d493940b0df4f77461426