Check for spendable UTXOs before payjoin operations
This PR improves error handling when a wallet has no UTXOs. Previously, attempting to send or receive without UTXOs returned a generic Error: Obtained failure status(500): Internal Server Error. This change lets the code now performs UTXO checks and provides informative error messages for both send and receive operations. This makes failures more user-friendly and easier to debug. Closes #1070
Pull Request Checklist
Please confirm the following before requesting review:
- [x] I have disclosed my use of AI in the body of this PR.
- [x] I have read CONTRIBUTING.md and rebased my branch to produce hygienic commits.
Pull Request Test Coverage Report for Build 17735121824
Details
- 13 of 22 (59.09%) changed or added relevant lines in 4 files are covered.
- 3 unchanged lines in 1 file lost coverage.
- Overall coverage decreased (-0.1%) to 85.688%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| payjoin-cli/src/app/mod.rs | 2 | 5 | 40.0% |
| payjoin-cli/src/app/v1.rs | 2 | 8 | 25.0% |
| <!-- | Total: | 13 | 22 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| payjoin-cli/src/app/v2/mod.rs | 3 | 79.07% |
| <!-- | Total: | 3 |
| Totals | |
|---|---|
| Change from base Build 17685450439: | -0.1% |
| Covered Lines: | 8065 |
| Relevant Lines: | 9412 |
💛 - Coveralls
cACK
New validation and its use look correct to me. I had one suggestion for the error messages. Lastly, do you mind re-writing your commit message to include the rationale for the change. Not just what changes were made.
Great work 🔥
Thank you @arminsabouri i'll fix it now
Is this actually a payjoin-cli issue or was our RPC client (ripped out in https://github.com/payjoin/rust-payjoin/pull/1063) just just not displaying the bitcoind error properly?