-
Notifications
You must be signed in to change notification settings - Fork 6
feat(anvil-polkadot): add transaction pool RPCs 2/2 #370
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-polkadot): add transaction pool RPCs 2/2 #370
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.
Really nice work <3. Left some nits.
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!
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 work, thanks!
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.
LGTM
Fixes issue #47
Summary
Implements the second half of transaction pool RPC support, completing the txpool API integration. Part 2 of 2.
Changes
RPC Methods Implemented
txpool_inspect()- Returns transaction summaries (to, value, gas, gas_price) for all pool transactionstxpool_content()- Returns full TransactionInfo objects with transaction detailsanvil_removePoolTransactions(address)- Removes all transactions from a specific sender addressImplementation Details
extract_tx_fieldshelper to parse 5 ETH transaction types (Legacy, EIP-2930, EIP-1559, EIP-4844, EIP-7702)extract_tx_summaryhelper to createTxpoolInspectSummaryfrom Substrate extrinsicsextract_tx_infohelper to create fullTransactionInfofrom extrinsicsextract_senderhelper to efficiently extract sender address from extrinsicsTesting
Added 3 new integration tests:
test_txpool_inspect- Tests transaction summaries for pending and queued pools, including nonce gap scenariostest_txpool_content- Tests full transaction info retrieval with sender verificationtest_remove_pool_transactions- Tests removing all transactions from specific address with multiple sendersNotes