Skip to content

Commit 8c2bfc7

Browse files
committed
tests: migration after merge
1 parent 066609d commit 8c2bfc7

File tree

5 files changed

+229
-98
lines changed

5 files changed

+229
-98
lines changed

Cargo.lock

Lines changed: 179 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/node/src/test_utils/event_utils.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ impl<'a> EventWaiter<'a> {
105105
.await
106106
}
107107

108+
/// Wait for an L1 reorg event.
109+
pub async fn l1_reorg(self) -> eyre::Result<()> {
110+
self.wait_for_event(|e| matches!(e, ChainOrchestratorEvent::L1Reorg { .. }).then_some(()))
111+
.await
112+
}
113+
108114
/// Wait for a new block received event from the network.
109115
pub async fn new_block_received(self) -> eyre::Result<ScrollBlock> {
110116
self.wait_for_event(|e| {

crates/node/src/test_utils/l1_helpers.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ impl<'a> L1MessageBuilder<'a> {
173173

174174
/// Send the L1 message to the database and notify nodes.
175175
pub async fn send(self) -> eyre::Result<TxL1Message> {
176-
let sender = self
177-
.sender
178-
.unwrap_or_else(|| self.l1_helper.fixture.wallet().blocking_lock().inner.address());
176+
let sender = self.sender.unwrap_or_else(|| Address::random());
179177

180178
let tx_l1_message = TxL1Message {
181179
queue_index: self.queue_index,

crates/node/src/test_utils/tx_helpers.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ impl<'a> TxHelper<'a> {
2727
pub fn transfer(self) -> TransferTxBuilder<'a> {
2828
TransferTxBuilder::new(self)
2929
}
30-
31-
/// Quickly inject a simple transfer transaction.
32-
pub async fn quick_transfer(self) -> eyre::Result<B256> {
33-
self.transfer().inject().await
34-
}
35-
36-
/// Inject N transfer transactions and return their hashes.
37-
pub async fn inject_many(self, count: usize) -> eyre::Result<Vec<B256>> {
38-
let mut hashes = Vec::with_capacity(count);
39-
for _ in 0..count {
40-
let hash = self.fixture.tx().for_node(self.target_node_index).quick_transfer().await?;
41-
hashes.push(hash);
42-
}
43-
Ok(hashes)
44-
}
4530
}
4631

4732
/// Builder for creating transfer transactions.

0 commit comments

Comments
 (0)