]> Untitled Git - bdk/commit
feat!: change `load_from_persistence` to return an option
author志宇 <hello@evanlinjin.me>
Wed, 1 Nov 2023 01:21:24 +0000 (09:21 +0800)
committer志宇 <hello@evanlinjin.me>
Wed, 15 Nov 2023 23:07:49 +0000 (07:07 +0800)
commit06a956ad20ca5f1dcd108e45a1a1fed924128cdb
treed525751614743229f9c9926ba1413f47bbcf357b
parentc3265e2514070bd4da92ca343fe884e13e831360
feat!: change `load_from_persistence` to return an option

`PersistBackend::is_empty` is removed. Instead, `load_from_persistence`
returns an option of the changeset. `None` means persistence is empty.
This is a better API than a separate method. We can now differentiate
between a persisted single changeset and nothing persisted.

`Store::aggregate_changeset` is refactored to return a `Result` instead
of a tuple. A new error type (`AggregateChangesetsError`) is introduced
to include the partially-aggregated changeset in the error. This is a
more idiomatic API.
crates/bdk/src/wallet/mod.rs
crates/chain/src/persist.rs
crates/file_store/src/store.rs
example-crates/example_cli/src/lib.rs