-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(anvil): remove all txs from tx pool by sender origin #7480
feat(anvil): remove all txs from tx pool by sender origin #7480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, one suggestion
crates/anvil/src/eth/pool/mod.rs
Outdated
self.pending_transactions.transactions_by_sender(sender).map(|tx| tx.hash()).collect(); | ||
tx_hashes.extend( | ||
self.ready_transactions | ||
.transactions_by_sender(sender) | ||
.map(|tx| tx.hash()) | ||
.collect::<Vec<TxHash>>(), | ||
); | ||
|
||
if tx_hashes.is_empty() { | ||
return vec![] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extract this to a transactions_by_sender
that merges those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored! Let me know if this is what you meant!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty
Motivation
Context: #7250
Solution
Adds
anvil_removePoolTransactions
method that removes pool transactions by sender origin.