diff --git a/pallas-rolldb/src/chain/store.rs b/pallas-rolldb/src/chain/store.rs index 3988334..f809850 100644 --- a/pallas-rolldb/src/chain/store.rs +++ b/pallas-rolldb/src/chain/store.rs @@ -265,6 +265,10 @@ impl Store { Ok(false) } + pub fn is_empty(&self) -> bool { + HashBySlotKV::is_empty(&self.db) && BlockByHashKV::is_empty(&self.db) + } + pub fn destroy(path: impl AsRef) -> Result<(), Error> { DB::destroy(&Options::default(), path).map_err(|_| Error::IO) } diff --git a/pallas-rolldb/src/wal/store.rs b/pallas-rolldb/src/wal/store.rs index 1a7cd92..7f55c42 100644 --- a/pallas-rolldb/src/wal/store.rs +++ b/pallas-rolldb/src/wal/store.rs @@ -355,6 +355,10 @@ impl Store { Ok(()) } + pub fn is_empty(&self) -> bool { + WalKV::is_empty(&self.db) + } + pub fn destroy(path: impl AsRef) -> Result<(), Error> { DB::destroy(&Options::default(), path).map_err(|_| Error::IO) }