Repository navigation
Propagate errors correctly when decoding and parsing PSBTs - #363
emma31-dev wants to merge 1 commit into
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 |
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: