Skip to content

Commit 8a0b48d

Browse files
committed
test: ref
1 parent f276554 commit 8a0b48d

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

tests/latest_events/basic.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,11 @@ async fn latest_scanner_mixed_events_and_filters_return_correct_streams() -> any
229229
.event(TestCounter::CountDecreased::SIGNATURE);
230230
let mut stream_dec = scanner.subscribe(filter_dec);
231231

232-
// Sequence: inc(1), inc(2), dec(1), inc(2), dec(1)
233-
// inc -> 1
234-
contract.increase().send().await?.watch().await?;
235-
// inc -> 2
236-
contract.increase().send().await?.watch().await?;
237-
// dec -> 1
238-
contract.decrease().send().await?.watch().await?;
239-
// inc -> 2
240-
contract.increase().send().await?.watch().await?;
241-
// dec -> 1
242-
contract.decrease().send().await?.watch().await?;
232+
contract.increase().send().await?.watch().await?; // inc(1)
233+
contract.increase().send().await?.watch().await?; // inc(2)
234+
contract.decrease().send().await?.watch().await?; // dec(1)
235+
contract.increase().send().await?.watch().await?; // inc(2)
236+
contract.decrease().send().await?.watch().await?; // dec(1)
243237

244238
scanner.start().await?;
245239

tests/sync/from_block.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ async fn replays_historical_then_switches_to_live() -> anyhow::Result<()> {
2222

2323
scanner.start().await?;
2424

25-
// now emit new events
26-
contract.increase().send().await?.watch().await?;
27-
contract.increase().send().await?.watch().await?;
28-
2925
// historical events
3026
assert_next!(
3127
stream,
@@ -36,6 +32,10 @@ async fn replays_historical_then_switches_to_live() -> anyhow::Result<()> {
3632
]
3733
);
3834

35+
// now emit live events
36+
contract.increase().send().await?.watch().await?;
37+
contract.increase().send().await?.watch().await?;
38+
3939
// chain tip reached
4040
assert_next!(stream, ScannerStatus::SwitchingToLive);
4141

@@ -93,11 +93,6 @@ async fn block_confirmations_mitigate_reorgs() -> anyhow::Result<()> {
9393

9494
scanner.start().await?;
9595

96-
// emit "live" events
97-
for _ in 0..2 {
98-
contract.increase().send().await?.watch().await?;
99-
}
100-
10196
// assert historic events are streamed in a batch
10297
assert_next!(
10398
stream,
@@ -106,6 +101,12 @@ async fn block_confirmations_mitigate_reorgs() -> anyhow::Result<()> {
106101
TestCounter::CountIncreased { newCount: U256::from(2) }
107102
]
108103
);
104+
105+
// emit "live" events
106+
for _ in 0..2 {
107+
contract.increase().send().await?.watch().await?;
108+
}
109+
109110
// switching to "live" phase
110111
assert_next!(stream, ScannerStatus::SwitchingToLive);
111112
// assert confirmed live events are streamed separately

0 commit comments

Comments
 (0)