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: EIP-7685 requests helpers #1699

Merged
merged 3 commits into from
Nov 29, 2024
Merged

feat: EIP-7685 requests helpers #1699

merged 3 commits into from
Nov 29, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Nov 28, 2024

Motivation

Adds constant DEPOSIT_REQUEST_TYPE similarly to
https://github.com/alloy-rs/alloy/blob/eb8fb7133e19248b8ba3cda009b3f63deacce0c5/crates/eips/src/eip7002.rs#L18-L20
and https://github.com/alloy-rs/alloy/blob/eb8fb7133e19248b8ba3cda009b3f63deacce0c5/crates/eips/src/eip7251.rs#L15-L17

And a helper Requests::push_request_with_type which appends request data to the given request typ

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines 38 to 39
request: impl IntoIterator<Item = u8>,
request_type: u8,
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 flip the order here?
feels more natural to have the correct order

also I assume there's a more efficient way to prepend a Bytes with a single byte, perhaps @DaniPopes knows?

Copy link
Member

Choose a reason for hiding this comment

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

Nope Bytes is immutable so it must be done at construction using a vec

@mattsse mattsse merged commit a33937d into main Nov 29, 2024
26 checks passed
@mattsse mattsse deleted the klkvr/request-fixes branch November 29, 2024 06:25
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