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: params.ExtraPayloads.SetOnChainConfig() + Rules equiv #14

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Sep 12, 2024

Why this should be merged

Idiomatic API for setting an extra payload:

extras := params.RegisterExtras(Extras[Foo,...]{})

var x ChainConfig
extras.SetOnChainConfig(&x, Foo{...})
// instead of
*extras.PointerFromChainConfig(&x) = Foo{...}

How this works

Just a convenience wrapper of the "instead of" line above.

The type ExtraPayloadGetter is now called ExtraPayloads because it's not just a getter. All references to getter are changed to extras or payloads, depending on what felt most appropriate.

How this was tested

Existing unit test changed to work via the wrapper.

@ARR4N ARR4N changed the title feat: params.ExtraPayloadGetter.SetOnChainConfig() + Rules equiv feat: params.ExtraPayloads.SetOnChainConfig() + Rules equiv Sep 12, 2024
@ARR4N ARR4N marked this pull request as ready for review September 12, 2024 10:13
@ARR4N ARR4N requested review from a team, darioush, ceyonur and michaelkaplan13 and removed request for a team September 12, 2024 10:16
@ARR4N ARR4N merged commit a574ae6 into libevm Sep 12, 2024
1 check passed
@ARR4N ARR4N deleted the arr4n/payload-setter branch September 12, 2024 18:51
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