Skip to content

Commit ddef30e

Browse files
committed
move SwitchingToLive assertions to make clear when its emitted
1 parent 6efe5b6 commit ddef30e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/sync/from_block.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ async fn replays_historical_then_switches_to_live() -> anyhow::Result<()> {
3232
]
3333
);
3434

35+
// chain tip reached
36+
assert_next!(stream, Notification::SwitchingToLive);
37+
3538
// now emit live events
3639
contract.increase().send().await?.watch().await?;
3740
contract.increase().send().await?.watch().await?;
3841

39-
// chain tip reached
40-
assert_next!(stream, Notification::SwitchingToLive);
41-
4242
// live events
4343
assert_event_sequence_final!(
4444
stream,
@@ -100,14 +100,13 @@ async fn block_confirmations_mitigate_reorgs() -> anyhow::Result<()> {
100100
TestCounter::CountIncreased { newCount: U256::from(2) }
101101
]
102102
);
103+
assert_next!(stream, Notification::SwitchingToLive);
103104

104105
// emit "live" events
105106
for _ in 0..2 {
106107
contract.increase().send().await?.watch().await?;
107108
}
108109

109-
// switching to "live" phase
110-
assert_next!(stream, Notification::SwitchingToLive);
111110
// assert confirmed live events are streamed separately
112111
let stream = assert_event_sequence_final!(
113112
stream,

0 commit comments

Comments
 (0)