From fa03b833517ea81cc743879e63301a8885a9ecf9 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 18 Nov 2020 15:23:18 +1000 Subject: [PATCH] Update some contextual validation comments and error messages --- zebra-state/src/service/check.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zebra-state/src/service/check.rs b/zebra-state/src/service/check.rs index cdc0439e..817cff37 100644 --- a/zebra-state/src/service/check.rs +++ b/zebra-state/src/service/check.rs @@ -14,6 +14,8 @@ use super::check; /// /// The relevant chain is an iterator over the ancestors of `block`, starting /// with its parent block. +/// +/// Panics if the finalized state is empty. #[tracing::instrument( name = "contextual_validation", fields(?network), @@ -30,7 +32,7 @@ where C::Item: AsRef, { let finalized_tip_height = finalized_tip_height - .expect("finalized state must contain at least one block to use the non-finalized state"); + .expect("finalized state must contain at least one block to do contextual validation"); check::block_is_not_orphaned(finalized_tip_height, prepared.height)?; let mut relevant_chain = relevant_chain.into_iter();