Skip to content

Commit

Permalink
test(mempool): mempool state empty func
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeletstarkware committed Jul 25, 2024
1 parent 93de0bd commit 052837e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/mempool/src/mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl MempoolState {
MempoolState { tx_pool, tx_queue }
}

// TODO(Ayelet): Use in all relevant tests.
fn empty() -> Self {
MempoolState::new([], [])
}

fn assert_eq_mempool_state(&self, mempool: &Mempool) {
assert_eq!(self.tx_pool, mempool.tx_pool);
assert_eq!(self.tx_queue, mempool.tx_queue);
Expand Down Expand Up @@ -193,7 +198,7 @@ fn test_get_txs_multi_nonce() {

// Assert that the account's next tx was added the queue.
assert_eq!(txs, &[tx_address_0_nonce_0, tx_address_0_nonce_1]);
let expected_mempool_state = MempoolState::new([], []);
let expected_mempool_state = MempoolState::empty();
expected_mempool_state.assert_eq_mempool_state(&mempool);
}

Expand Down

0 comments on commit 052837e

Please sign in to comment.