Skip to content

Commit

Permalink
test(mempool): refactor add-tx util (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadNassar1 authored Aug 6, 2024
1 parent 9eaca9c commit 1d04155
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/mempool/src/mempool_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ fn add_tx(mempool: &mut Mempool, input: &MempoolInput) {
assert_eq!(mempool.add_tx(input.clone()), Ok(()));
}

#[track_caller]
fn _add_tx_expect_error(mempool: &mut Mempool, input: &MempoolInput, expected_error: MempoolError) {
assert_eq!(mempool.add_tx(input.clone()), Err(expected_error));
}

/// Creates a valid input for mempool's `add_tx` with optional default values.
/// Usage:
/// 1. add_tx_input!(tip: 1, tx_hash: 2, sender_address: 3_u8, tx_nonce: 4, account_nonce: 3)
Expand Down

0 comments on commit 1d04155

Please sign in to comment.