test: use `sendall` in wallet_taproot.py tests #25159

pull ishaanam wants to merge 1 commits into bitcoin:master from ishaanam:wallet_taproot_sendall_fix changing 1 files +2 −2
  1. ishaanam commented at 5:52 PM on May 17, 2022: contributor

    Fixes #25129 (subtractfeefromamount=true fails with insufficient funds)

  2. test: use sendall in wallet_taproot.py tests
    Fixes #25129 (subtractfeefromamount=true fails with insufficient
    funds)
    c6122f560b
  3. fanquake added the label Tests on May 17, 2022
  4. in test/functional/wallet_taproot.py:448 in c6122f560b
     445 | +        txid = self.rpc_online.sendall(recipients=[self.boring.getnewaddress()])["txid"]
     446 |          self.generatetoaddress(self.nodes[0], 1, self.boring.getnewaddress(), sync_fun=self.no_op)
     447 |          assert(self.rpc_online.gettransaction(txid)["confirmations"] > 0)
     448 |  
     449 | -        psbt = self.psbt_online.walletcreatefundedpsbt([], [{self.boring.getnewaddress(): self.psbt_online.getbalance()}], None, {"subtractFeeFromOutputs": [0]})['psbt']
     450 | +        psbt = self.psbt_online.sendall(recipients=[self.boring.getnewaddress()], options={"psbt": True})["psbt"]
    


    murchandamus commented at 7:06 PM on May 17, 2022:

    No change needed: I was today years old, when I learned that

            psbt = self.psbt_online.sendall(recipients=[self.boring.getnewaddress()])["psbt"]
    

    would also work, because the wallet automatically returns a PSBT when it cannot sign for a transaction. I do prefer it explicitly stated as proposed by @ishaanam, though.

  5. murchandamus approved
  6. murchandamus commented at 7:07 PM on May 17, 2022: contributor

    tACK c6122f560b5ed57f11441d2616108b43b10721bb

    Nice, that was a quick turn around. I played around a bit with the change and think that this should remedy the occasional test failure in /test/functional/wallet_taproot.py.

  7. brunoerg approved
  8. brunoerg commented at 7:25 PM on May 17, 2022: contributor

    ACK c6122f560b5ed57f11441d2616108b43b10721bb

  9. achow101 commented at 11:51 PM on May 17, 2022: member

    ACK c6122f560b5ed57f11441d2616108b43b10721bb

  10. achow101 merged this on May 17, 2022
  11. achow101 closed this on May 17, 2022

  12. michaelfolkson cross-referenced this on May 18, 2022 from issue wallet_taproot.py fails with "Insufficient funds (-4)" by MarcoFalke
  13. sidhujag referenced this in commit 40c71c94cd on May 28, 2022
  14. ishaanam deleted the branch on Jun 23, 2022
  15. bitcoin locked this on Jun 23, 2023

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-05-19 12:53 UTC

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