Repository navigation
Commit 2fceeba
committed
Merge #363: Propagate errors correctly when decoding and parsing PSBTs
d8176e8 Propagate PSBT decoding and parsing errors (emma31-dev)
Pull request description:
### Description
Propagate PSBT decoding and parsing errors instead of wrapping them in `Error::Generic`.
- `BASE64_STANDARD.decode()` failures in `sign`, `finalize_psbt`, and `broadcast` now propagate directly via `?`
- `Psbt::deserialize()` failures are no longer swallowed into a generic string message
- `BlockchainClient::broadcast()` maps backend errors to dedicated typed variants (`Error::Electrum`, `Error::Esplora`, `Error::BitcoinCoreRpcError`)
- `wallet.apply_update()` / `apply_update_events()` map to `Error::Chain` instead of `Error::Generic`
- Integration tests added for `sign`, `finalize_psbt`, and `broadcast` error paths
Fixes #357 . Related to the broader error-propagation cleanup across the codebase.
### Notes to the reviewers
Uses the existing `From` conversions for `DecodeError` and `PsbtError`.
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### Bugfixes:
* [x] I'm linking the issue being fixed by this PR
ACKs for top commit:
tvpeter:
ACK d8176e8
vadim-anfv:
ACK d8176e8
Tree-SHA512: 81a703a8758e3a91a46278346b425f71b526d34982d3da36279703fec309eaa407674ea641cc130d5ec2ae36fdf30744e7893d71b0407751e21ed6fdca0cfbb14 files changed
Lines changed: 73 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| |||
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 142 | + | |
147 | 143 | | |
148 | 144 | | |
149 | 145 | | |
| |||
190 | 186 | | |
191 | 187 | | |
192 | 188 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 189 | + | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
| |||
307 | 301 | | |
308 | 302 | | |
309 | 303 | | |
310 | | - | |
| 304 | + | |
311 | 305 | | |
312 | 306 | | |
313 | 307 | | |
| |||
364 | 358 | | |
365 | 359 | | |
366 | 360 | | |
367 | | - | |
368 | | - | |
369 | | - | |
| 361 | + | |
370 | 362 | | |
371 | 363 | | |
372 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
| 657 | + | |
| 658 | + | |
661 | 659 | | |
662 | 660 | | |
663 | 661 | | |
| |||
708 | 706 | | |
709 | 707 | | |
710 | 708 | | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
| 709 | + | |
| 710 | + | |
715 | 711 | | |
716 | 712 | | |
717 | 713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
374 | | - | |
| 372 | + | |
375 | 373 | | |
376 | 374 | | |
377 | 375 | | |
| |||
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
419 | | - | |
420 | | - | |
421 | | - | |
| 417 | + | |
422 | 418 | | |
423 | 419 | | |
424 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
48 | 105 | | |
49 | 106 | | |
50 | 107 | | |
| |||
0 commit comments