Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com>
  • Loading branch information
michalkucharczyk and iulianbarbu authored Jan 13, 2025
1 parent b4290cd commit 80a94b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ pub struct DroppedTransaction<Hash> {
}

impl<Hash> DroppedTransaction<Hash> {
/// Creates an new instnance with reason set to `DroppedReason::Usurped(by)`.
/// Creates a new instance with reason set to `DroppedReason::Usurped(by)`.
pub fn new_usurped(tx_hash: Hash, by: Hash) -> Self {
Self { reason: DroppedReason::Usurped(by), tx_hash }
}

/// Creates an new instnance with reason set to `DroppedReason::LimitsEnforced`.
/// Creates a new instance with reason set to `DroppedReason::LimitsEnforced`.
pub fn new_enforced_by_limts(tx_hash: Hash) -> Self {
Self { reason: DroppedReason::LimitsEnforced, tx_hash }
}
Expand Down Expand Up @@ -258,7 +258,7 @@ where
self.future_transaction_views.entry(tx_hash).or_default().insert(block_hash);
},
TransactionStatus::Ready | TransactionStatus::InBlock(..) => {
// note: if future transaction was once seens as the ready we may want to treat it
// note: if future transaction was once seen as the ready we may want to treat it
// as ready transaction. The rationale behind this is as follows: we want to remove
// unreferenced future transactions when the last referencing view is removed (to
// avoid clogging mempool). For ready transactions we prefer to keep them in mempool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ where
match result {
Err(TxPoolApiError::ImmediatelyDropped) =>
self.attempt_transaction_replacement(source, false, xt).await,
result @ _ => result,
_ => result,
}
})
.collect::<Vec<_>>();
Expand All @@ -687,7 +687,7 @@ where
self.metrics
.report(|metrics| metrics.submitted_transactions.inc_by(to_be_submitted.len() as _));

// ... and submit them to the view_store. Please note that transaction rejected by mempool
// ... and submit them to the view_store. Please note that transactions rejected by mempool
// are not sent here.
let mempool = self.mempool.clone();
let results_map = view_store.submit(to_be_submitted.into_iter()).await;
Expand Down
2 changes: 0 additions & 2 deletions substrate/client/transaction-pool/tests/fatp_prios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ fn fatp_prios_watcher_full_mempool_higher_prio_is_accepted_with_subtree() {
assert_pool_status!(header01.hash(), &pool, 4, 0);
assert_eq!(pool.mempool_len().1, 4);

// let header02 = api.push_block_with_parent(header01.hash(), vec![], true);
// block_on(pool.maintain(new_best_block_event(&pool, Some(header01.hash()), header02.hash())));

let xt4_watcher = block_on(pool.submit_and_watch(invalid_hash(), SOURCE, xt4.clone())).unwrap();
assert_pool_status!(header01.hash(), &pool, 2, 0);
Expand Down

0 comments on commit 80a94b8

Please sign in to comment.