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

Add trait method Transaction::is_dynamic_fee #1638

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Conversation

emhane
Copy link
Member

@emhane emhane commented Nov 12, 2024

Motivation

Migrate reth utility method paradigmxyz/reth#12437 (comment)

Solution

Adds trait method alloy_consensus::Transaction::is_dynamic_fee

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@emhane emhane changed the title chore(sdk): Add trait method Transaction::is_dynamic_fee Add trait method Transaction::is_dynamic_fee Nov 12, 2024
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.

smol nit

Comment on lines +150 to +151
self.fields.get_deserialized::<U128>("maxFeePerGas").is_some()
|| self.fields.get_deserialized::<U128>("maxFeePerBlobGas").is_some()
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 use the self.ty here?

Copy link
Member Author

Choose a reason for hiding this comment

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

how? I thought ab it too, but it would be incorrect for eg deposit tx to do smthg like self.ty() > 1

Copy link
Member

Choose a reason for hiding this comment

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

oh, yeah we'd only catch known types, which defeats the purpose here

@emhane emhane requested a review from mattsse November 12, 2024 11:46
@mattsse mattsse merged commit 185e58c into main Nov 12, 2024
25 of 26 checks passed
@mattsse mattsse deleted the emhane/dynamic-fee branch November 12, 2024 11:48
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