Skip to content

Commit

Permalink
feat(mempool): add insert func to suspended tx pool (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeletstarkware authored Sep 17, 2024
1 parent d60d6e9 commit 74f6d11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/mempool/src/suspended_transaction_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ impl _SuspendedTransactionPool {
pub fn _contains(&self, address: ContractAddress, nonce: Nonce) -> bool {
self.suspended_tx_pool.contains_key(&(address, nonce))
}

pub fn _insert(&mut self, tx: TransactionReference) {
assert_eq!(
self.suspended_tx_pool.insert((tx.sender_address, tx.nonce), tx),
None,
"Keys should be unique; duplicates are checked prior."
);
}
}

0 comments on commit 74f6d11

Please sign in to comment.