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): Port middleware (layers) from ethers-rs #9

Merged
merged 17 commits into from
Mar 25, 2024

Conversation

zerosnacks
Copy link
Member

Motivation

To add examples from ethers-rs: middleware (layers)

Solution

Implements a subset of the examples from ethers-rs, specifically the NonceManagerMiddleware and the SignerMiddleware.

Currently not implemented as an example, due to the implementation missing in Alloy:

  • GasEscalatorMiddleware
  • GasOracleMiddleware
  • PolicyMiddleware

Some examples are not implemented due to the builder pattern being used throughout all examples in Alloy.

CustomMiddleware has not been implemented yet as I think it likely will require some implementation work to be able to define a robust way of handling this. Users can refer to the existing implementations as a starting point.

I've decided to refer to these as layers rather than ether-rs's middleware.

@zerosnacks zerosnacks self-assigned this Mar 18, 2024
@zerosnacks zerosnacks requested a review from mattsse March 18, 2024 17:04
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.

we want to showcase the request builder here

examples/layers/examples/nonce_layer.rs Outdated Show resolved Hide resolved
examples/layers/examples/signer_layer.rs Outdated Show resolved Hide resolved
@zerosnacks zerosnacks requested a review from mattsse March 22, 2024 12:13
@zerosnacks
Copy link
Member Author

Merging this, requested changes were addressed

@zerosnacks zerosnacks merged commit e82c1e6 into main Mar 25, 2024
2 checks passed
@zerosnacks zerosnacks deleted the zerosnacks/middleware branch March 25, 2024 07:43
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.

3 participants