test: add coverage for joinpsbts with fewer than two PSBTs #36851

pull Pranav-error wants to merge 1 commits into bitcoin:master from Pranav-error:test-joinpsbts-min-count changing 1 files +5 −1
  1. Pranav-error commented at 7:29 AM on November 13, 2026: none

    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.

  2. test: add coverage for joinpsbts with fewer than two PSBTs
    Added tests for joinpsbts with empty and single PSBT inputs to make sure both return the expected error.
    701f48ad46
  3. DrahtBot added the label Tests on Nov 13, 2026
  4. DrahtBot commented at 7:29 AM on November 13, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK nebula-21, mercie-ux

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. in test/functional/rpc_psbt.py:1404 in 701f48ad46
    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)
    


    nebula-21 commented at 11:49 AM on November 13, 2026:

    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)
    
  6. nebula-21 commented at 11:51 AM on November 13, 2026: contributor

    ACK 701f48ad463bee92706d493940b0df4f77461426

  7. mercie-ux commented at 9:07 AM on November 14, 2026: contributor

    ACK 701f48a


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-14 18:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me