Skip to content
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

Merged
merged 2 commits into from
Mar 24, 2024

Conversation

PanGan21
Copy link
Contributor

Motivation

Context: #7250

Solution

Adds anvil_removePoolTransactions method that removes pool transactions by sender origin.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, one suggestion

Comment on lines 354 to 364
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![]
}
Copy link
Member

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?

Copy link
Contributor Author

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!

@PanGan21 PanGan21 requested a review from mattsse March 24, 2024 11:30
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@mattsse mattsse added the C-anvil Command: anvil label Mar 24, 2024
@mattsse mattsse merged commit 88e09f6 into foundry-rs:master Mar 24, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants