Skip to content

Commit

Permalink
feat(mempool): add contains func to suspended tx pool (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeletstarkware authored Sep 17, 2024
1 parent b1bca27 commit d60d6e9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/mempool/src/suspended_transaction_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ use starknet_api::core::{ContractAddress, Nonce};

use crate::mempool::TransactionReference;

type AddressNonceToTransaction = HashMap<(ContractAddress, Nonce), TransactionReference>;
type _AddressNonceToTransaction = HashMap<(ContractAddress, Nonce), TransactionReference>;

#[derive(Debug, Default)]
pub struct SuspendedTransactionPool {
_suspended_tx_pool: AddressNonceToTransaction,
#[derive(Debug)]
pub struct _SuspendedTransactionPool {
suspended_tx_pool: _AddressNonceToTransaction,
}

impl SuspendedTransactionPool {}
impl _SuspendedTransactionPool {
pub fn _contains(&self, address: ContractAddress, nonce: Nonce) -> bool {
self.suspended_tx_pool.contains_key(&(address, nonce))
}
}

0 comments on commit d60d6e9

Please sign in to comment.