From 6885cb99f18ba9e96763948a0ca111a4d406cee0 Mon Sep 17 00:00:00 2001 From: green Date: Fri, 5 Jul 2024 00:14:09 +0200 Subject: [PATCH] Return error instead of panic --- crates/fuel-core/src/state/in_memory/memory_store.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/fuel-core/src/state/in_memory/memory_store.rs b/crates/fuel-core/src/state/in_memory/memory_store.rs index 483712da5af..c524d29a32f 100644 --- a/crates/fuel-core/src/state/in_memory/memory_store.rs +++ b/crates/fuel-core/src/state/in_memory/memory_store.rs @@ -164,7 +164,10 @@ where _: &Description::Height, ) -> StorageResult> { // TODO: https://github.com/FuelLabs/fuel-core/issues/1995 - unimplemented!("The historical view is not implemented for `MemoryStore`") + Err( + anyhow::anyhow!("The historical view is not implemented for `MemoryStore`") + .into(), + ) } fn latest_view(&self) -> StorageResult> { @@ -176,7 +179,10 @@ where fn rollback_last_block(&self) -> StorageResult<()> { // TODO: https://github.com/FuelLabs/fuel-core/issues/1995 - unimplemented!("The historical view is not implemented for `MemoryStore`") + Err( + anyhow::anyhow!("The historical view is not implemented for `MemoryStore`") + .into(), + ) } }