[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

@@ -940,6 +940,13 @@ impl<A: Ord> Append for Additions<A> {
.collect::<Vec<_>>(),
);
}
fn is_empty(&self) -> bool {
self.tx.is_empty()
&& self.txout.is_empty()
&& self.anchors.is_empty()
&& self.last_seen.is_empty()
}
}
impl<A> AsRef<TxGraph<A>> for TxGraph<A> {