From 8542a5918a1e557714f05f6d5e9b72dff3080b3f Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Tue, 9 Jan 2024 17:13:40 +0200 Subject: [PATCH] backend: Panic on finalized before new Signed-off-by: Alexandru Vasile --- subxt/src/backend/unstable/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subxt/src/backend/unstable/mod.rs b/subxt/src/backend/unstable/mod.rs index 7dfe25bc6d..07177bb9d1 100644 --- a/subxt/src/backend/unstable/mod.rs +++ b/subxt/src/backend/unstable/mod.rs @@ -576,6 +576,10 @@ impl Backend for UnstableBackend { } SeenBlock::Finalized(block_refs) => { for block_ref in block_refs { + if !seen_blocks.contains_key(&block_ref.hash()) { + panic!("Finalized before new Finalized {:#?}\n MEMLOG{:#?}\n SeenBlocks{:#?} \n Other{:#?}", block_ref.hash(), mem_log, seen_blocks, seen_other); + } + let entry = seen_blocks.entry(block_ref.hash()).or_insert(( SeenBlockMarker::Finalized, block_ref.clone(),