[persist_redesign] Introduce redesigned persist types

This is a more generic version of `keychain::persist::*` structures.

Additional changes:

* The `Append` trait has a new method `is_empty`.
* Introduce `Store` structure for `bdk_file_store`.
This commit is contained in:
志宇
2023-05-09 09:59:42 +08:00
parent e3c137043f
commit 2aa08a5898
10 changed files with 560 additions and 100 deletions

View File

@@ -301,6 +301,10 @@ impl<A: Anchor, IA: Append> Append for IndexedAdditions<A, IA> {
self.graph_additions.append(other.graph_additions);
self.index_additions.append(other.index_additions);
}
fn is_empty(&self) -> bool {
self.graph_additions.is_empty() && self.index_additions.is_empty()
}
}
/// Represents a structure that can index transaction data.