Skip to content

Commit

Permalink
chore: remove redundant create_for_testing mempool ctor
Browse files Browse the repository at this point in the history
commit-id:ba5c6b05
  • Loading branch information
Itay-Tsabary-Starkware committed Jun 4, 2024
1 parent 52fc054 commit b1c4b84
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/mempool/src/mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ macro_rules! add_tx_input {
};
}

fn create_for_testing(inputs: impl IntoIterator<Item = MempoolInput>) -> Mempool {
Mempool::new(inputs)
}

#[fixture]
fn mempool() -> Mempool {
create_for_testing([])
Mempool::new([])
}

#[rstest]
Expand All @@ -48,7 +44,7 @@ fn test_get_txs(#[case] requested_txs: usize) {
let (tx_tip_10_address_2, account3) =
add_tx_input!(Tip(10), TransactionHash(StarkFelt::THREE), contract_address!("0x2"));

let mut mempool = create_for_testing([
let mut mempool = Mempool::new([
MempoolInput { tx: tx_tip_50_address_0.clone(), account: account1 },
MempoolInput { tx: tx_tip_100_address_1.clone(), account: account2 },
MempoolInput { tx: tx_tip_10_address_2.clone(), account: account3 },
Expand Down Expand Up @@ -91,7 +87,7 @@ fn test_mempool_initialization_with_duplicate_sender_addresses() {
let inputs = vec![MempoolInput { tx, account }, MempoolInput { tx: same_tx, account }];

// This call should panic because of duplicate sender addresses
let _mempool = create_for_testing(inputs.into_iter());
let _mempool = Mempool::new(inputs.into_iter());
}

#[rstest]
Expand Down

0 comments on commit b1c4b84

Please sign in to comment.