From 75da6528a94be40930ae7a7f7d84955d4899cef0 Mon Sep 17 00:00:00 2001
From: Dan Cline <6798349+Rjected@users.noreply.github.com>
Date: Thu, 17 Aug 2023 06:11:26 -0400
Subject: [PATCH] fix: return None instead of BlockBodyIndicesNotFound in
BlockReader (#4239)
---
.../src/providers/database/provider.rs | 33 +++++++++++++++----
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs
index 1d80bf4662..0ac58a3b7d 100644
--- a/crates/storage/provider/src/providers/database/provider.rs
+++ b/crates/storage/provider/src/providers/database/provider.rs
@@ -938,14 +938,24 @@ impl<'this, TX: DbTx<'this>> BlockReader for DatabaseProvider<'this, TX> {
}
}
+ /// Returns the block with matching number from database.
+ ///
+ /// If the header for this block is not found, this returns `None`.
+ /// If the header is found, but the transactions either do not exist, or are not indexed, this
+ /// will return None.
fn block(&self, id: BlockHashOrNumber) -> Result