From: 志宇 Date: Sat, 20 Apr 2024 06:51:26 +0000 (+0800) Subject: Merge bitcoindevkit/bdk#1387: fix(wallet): remove the generic from wallet X-Git-Tag: v1.0.0-alpha.10~7 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandStringError.html?a=commitdiff_plain;h=f00de9e0c192683c30298bcebfdeda6b7c2214d3;p=bdk Merge bitcoindevkit/bdk#1387: fix(wallet): remove the generic from wallet e51af49ffa951e14203ac2b465ade351dd90f6cd fix(wallet): remove generic from wallet (Rob N) Pull request description: ### Description The `PersistenceBackend` uses generics to describe errors returned while applying the change set to the persistence layer. This change removes generics wherever possible and introduces a new public error enum. Removing the generics from `PersistenceBackend` errors is the first step towards #1363 *Update*: I proceeded with removing the generics from `Wallet` by introducing a `Box` . ### Notes to the reviewers This one sort of blew up in the number of changes due to the use of generics for most of the `Wallet` error variants. The generics were only used for the persistence errors, so I removed the generics from higher level errors whenever possible. The error variants of `PersistenceBackend` may also be more expressive, but I will level that up for discussion and make any changes required. ### Changelog notice - Changed `PersistenceBackend` errors to depend on the `anyhow` crate. - Remove the generic `T` from `Wallet` ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [ ] I've added tests for the new feature * [x] I've added docs for the new feature #### Bugfixes: * [x] This pull request breaks the existing API * [ ] I've added tests to reproduce the issue which are now passing * [x] I'm linking the issue being fixed by this PR ACKs for top commit: evanlinjin: ACK e51af49ffa951e14203ac2b465ade351dd90f6cd Tree-SHA512: 8ce4f1c495310e16145555f4a6a29a0f42cf8944eda68004595c3532580767f64f779185022147a00d75001c40d69fdf8f8de2d348eb68484b170d2a181117ff --- f00de9e0c192683c30298bcebfdeda6b7c2214d3