From 6feb9e404052b0a9891f6cf4df012bcd1542fd5f Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:48:42 +0530 Subject: [PATCH] chore: fix test --- tests/memory_keccak.rs | 8 ++++++++ tests/sled_keccak.rs | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) 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 {