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(layers): FillTxLayer #374

Closed
wants to merge 2 commits into from

Conversation

yash-atreya
Copy link
Member

Motivation

Unify the ManagedNonceProvider and GasEstimatorProvider to concurrently populate missing tx fields.

Solution

Implement a FillTxLayer that concurrently calls the following methods:

  • get_next_nonce from ManagedNonceProvider to populate the nonce field.
  • handle_eip1559_tx and handle_legacy_tx from GasEstimatorProvider to populate gas related fields.
  • get_chain_id from provider directly to populate the chain_id field.

In order to achieve this, the following changes were made:

  1. Introduced the Clone trait bound on the Provider<N, T> for ProviderBuilder enable the cloning of the underlying provider and initializing of the ManageNonceProvider and GasEstimatorProvider directly in FillTxLayer

  2. Added pub(crate) fn new method to both ManageNonceProvider and GasEstimatorProvider to instantiate them directly from the FillTxLayer

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

* Clone bound on Provider<N, T> for ProviderBuilder

* new method to nonce and gas provider layers
@prestwich
Copy link
Member

closing in favor of #426

@prestwich prestwich closed this Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants