From 81b5b1c3153f2d53488bbdc1d759c587601d8164 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 8 Jan 2024 20:58:13 +0200 Subject: [PATCH] TODO: backend: allow finalized before new block Signed-off-by: Alexandru Vasile --- subxt/src/backend/unstable/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subxt/src/backend/unstable/mod.rs b/subxt/src/backend/unstable/mod.rs index 74d734c0cd..ce0b9f7b5d 100644 --- a/subxt/src/backend/unstable/mod.rs +++ b/subxt/src/backend/unstable/mod.rs @@ -532,9 +532,17 @@ impl Backend for UnstableBackend { SeenBlock::Finalized(block_refs) => { for block_ref in block_refs { seen_blocks - .get_mut(&block_ref.hash()) - .expect("finalized block seen before new block") + .entry(block_ref.hash()) + .or_insert(( + SeenBlockMarker::Finalized, + block_ref.clone(), + block_ref, + )) .0 = SeenBlockMarker::Finalized; + + // .get_mut(&block_ref.hash()) + // .expect("finalized block seen before new block") + // .0 = SeenBlockMarker::Finalized; } } }