From 4e0ad2b47bd841c1c379ccdb722dee81e971f717 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Mon, 9 Dec 2024 04:12:58 +0100 Subject: [PATCH] add test_get_block_not_found --- node_core/src/storage/block_store.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node_core/src/storage/block_store.rs b/node_core/src/storage/block_store.rs index d394304..f52432f 100644 --- a/node_core/src/storage/block_store.rs +++ b/node_core/src/storage/block_store.rs @@ -115,5 +115,14 @@ mod tests { assert_eq!(retrieved_block.hash, block.hash); } + #[test] + fn test_get_block_not_found() { + let temp_dir = tempdir().unwrap(); + let path = temp_dir.path(); + let node_store = NodeBlockStore::open_db_with_genesis(path, None).unwrap(); + + let result = node_store.get_block_at_id(42); + assert!(result.is_err()); + } }