diff --git a/tests/memory_keccak.rs b/tests/memory_keccak.rs index 0094539..6d94bf9 100644 --- a/tests/memory_keccak.rs +++ b/tests/memory_keccak.rs @@ -37,6 +37,14 @@ impl Database for MemoryDB { Ok(()) } + + fn close(&mut self) -> PmtreeResult<()> { + Ok(()) + } + + fn flush(&mut self) -> PmtreeResult<()> { + Ok(()) + } } impl Hasher for MyKeccak { diff --git a/tests/sled_keccak.rs b/tests/sled_keccak.rs index 890b71d..baab08e 100644 --- a/tests/sled_keccak.rs +++ b/tests/sled_keccak.rs @@ -62,6 +62,22 @@ impl Database for MySled { Ok(()) } + + fn close(&mut self) -> PmtreeResult<()> { + self.0.close().map_err(|_| { + PmtreeErrorKind::DatabaseError(DatabaseErrorKind::CustomError( + String::from("Error closing database"), + )) + }) + } + + fn flush(&mut self) -> PmtreeResult<()> { + self.0.flush().map_err(|_| { + PmtreeErrorKind::DatabaseError(DatabaseErrorKind::CustomError( + String::from("Error flushing database"), + )) + }) + } } impl Hasher for MyKeccak {