Repository navigation
Propagate errors correctly when decoding and parsing PSBTs - #363
Conversation
d6c1825 to
1dd6f05
Compare
tvpeter
left a comment
There was a problem hiding this comment.
This a low impact PR. The only thing it did is change the error type from "Generic error" to "Basse64 decoding error". Maybe you should extend it to cover finalize_psbt and broadcast, because they also return the "Generic" error type. Also, you can add a test that they return the specific error.
Thank you
|
@tvpeter I've extended it past just sign. |
|
While reviewing this PR, I added five tests to help cover the specific errors mentioned in the review, the tests check that All the 13 tests in the offline test module passed successfully locally including the new five added tests. This is my test commit: 1d00acd @emma31-dev, you can check and cherry-pick it if it’s useful. @tvpeter, I also want to check if this covers what you have in mind, I’m happy to adjust if needed. |
|
@muawiya1 Thanks. send a pr to this branch or if its too stressful to you i'll copy it out |
Check specific Base64 and PSBT parsing errors for sign and finalize_psbt, and Base64 decoding errors for broadcast. Related to bitcoindevkit#363.
- Decode Base64 and parse PSBTs without wrapping the error in `Error::Generic` - Use the dedicated `Electrum`, `Esplora`, `BitcoinCoreRpcError` and `Chain` error variants in `BlockchainClient` - Cover sign, finalize_psbt and broadcast error paths with integration tests Related to bitcoindevkit#363.
2ee52fb to
d8176e8
Compare
|
@tvpeter I have updated the PR description. Thank you. |
Ensure all the CI jobs are passing |
It seems something wrong with CI, my pr template edit also fails on CI - https://github.com/bitcoindevkit/bdk-cli/pull/386/checks |
|
@tvpeter The CI failure appears to be a transient network issue with the GitHub Actions runner, not related to the changes in this PR: Evidence this is not from my changes:
I recommend we re-run the failed jobs. This should resolve the issue once the runner has proper network connectivity. If this becomes a recurring issue, the CI could be made more resilient by adding retry logic to the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #363 +/- ##
==========================================
- Coverage 59.97% 59.63% -0.34%
==========================================
Files 25 25
Lines 4734 4544 -190
==========================================
- Hits 2839 2710 -129
+ Misses 1895 1834 -61
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vadim-anfv
left a comment
There was a problem hiding this comment.
ACK d8176e8
Please drop the empty chore: rerun CI commit, and keep this commit's hash unchanged so the ACKs stay valid.
e2811c0 to
d8176e8
Compare
|
@vadim-anfv I have returned to d8176e8 . I just needed a way to rerun ci jobs . Thank you. |
- Decode Base64 and parse PSBTs without wrapping the error in `Error::Generic` - Use the dedicated `Electrum`, `Esplora`, `BitcoinCoreRpcError` and `Chain` error variants in `BlockchainClient` - Cover sign, finalize_psbt and broadcast error paths with integration tests Related to bitcoindevkit#363.
Description
Propagate PSBT decoding and parsing errors instead of wrapping them in
Error::Generic.BASE64_STANDARD.decode()failures insign,finalize_psbt, andbroadcastnow propagate directly via?Psbt::deserialize()failures are no longer swallowed into a generic string messageBlockchainClient::broadcast()maps backend errors to dedicated typed variants (Error::Electrum,Error::Esplora,Error::BitcoinCoreRpcError)wallet.apply_update()/apply_update_events()map toError::Chaininstead ofError::Genericsign,finalize_psbt, andbroadcasterror pathsFixes #357 . Related to the broader error-propagation cleanup across the codebase.
Notes to the reviewers
Uses the existing
Fromconversions forDecodeErrorandPsbtError.Checklists
All Submissions:
cargo fmtandcargo clippybefore committingBugfixes: