Skip to content

Commit 667d08f

Browse files
committed
test: ref shallow_block_confirmation_does_not_mitigate_reorg
1 parent aabd5e2 commit 667d08f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/block_range_scanner.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,17 @@ async fn shallow_block_confirmation_does_not_mitigate_reorg() -> anyhow::Result<
161161
// reorg more blocks than the block_confirmation config
162162
provider.anvil_reorg(ReorgOptions { depth: 8, tx_block_pairs: vec![] }).await?;
163163

164-
// mint additional blocks to allow the scanner to stream the pre-reorg blocks
165-
provider.anvil_mine(Some(3), None).await?;
164+
// mint 1 block to allow the scanner to process reorged blocks (previously streamed + the block
165+
// confirmed now)
166+
provider.anvil_mine(Some(1), None).await?;
166167

167168
assert_next!(stream, ScannerStatus::ReorgDetected);
168-
assert_range_coverage!(stream, 3..=10);
169+
assert_range_coverage!(stream, 3..=8);
170+
let mut stream = assert_empty!(stream);
171+
172+
// mint additional blocks to allow the scanner to stream all of the pre-reorg blocks
173+
provider.anvil_mine(Some(3), None).await?;
174+
assert_range_coverage!(stream, 9..=10);
169175
assert_empty!(stream);
170176

171177
Ok(())

0 commit comments

Comments
 (0)