Skip to content

Commit

Permalink
refactor(mempool): remove test_add_tx_sequential_nonces redudant test (
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadNassar1 authored Nov 3, 2024
1 parent 8eaf172 commit 46e459a
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions crates/mempool/src/mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ fn test_add_tx(mut mempool: Mempool) {
}

#[rstest]
fn test_add_tx_multi_nonce_success(mut mempool: Mempool) {
fn test_add_tx_correctly_places_txs_in_queue_and_pool(mut mempool: Mempool) {
// Setup.
let input_address_0_nonce_0 =
add_tx_input!(tx_hash: 1, address: "0x0", tx_nonce: 0, account_nonce: 0);
Expand Down Expand Up @@ -442,27 +442,6 @@ fn test_add_tx_tip_priority_over_tx_hash(mut mempool: Mempool) {
expected_mempool_content.assert_eq(&mempool);
}

#[rstest]
fn test_add_tx_sequential_nonces(mut mempool: Mempool) {
// Setup.
let input_nonce_0 = add_tx_input!(tx_hash: 0, tx_nonce: 0, account_nonce: 0);
let input_nonce_1 = add_tx_input!(tx_hash: 1, tx_nonce: 1, account_nonce: 0);

// Test.
for input in [&input_nonce_0, &input_nonce_1] {
add_tx(&mut mempool, input);
}

// Assert: only eligible transaction appears in the queue.
let expected_queue_txs = [TransactionReference::new(&input_nonce_0.tx)];
let expected_pool_txs = [input_nonce_0.tx, input_nonce_1.tx];
let expected_mempool_content = MempoolContentBuilder::new()
.with_pool(expected_pool_txs)
.with_priority_queue(expected_queue_txs)
.build();
expected_mempool_content.assert_eq(&mempool);
}

#[rstest]
fn test_add_tx_fills_nonce_gap(mut mempool: Mempool) {
// Setup.
Expand Down

0 comments on commit 46e459a

Please sign in to comment.