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

Replace DynEthApiBuilder with a trait #12509

Open
mattsse opened this issue Nov 13, 2024 · 0 comments
Open

Replace DynEthApiBuilder with a trait #12509

mattsse opened this issue Nov 13, 2024 · 0 comments
Labels
C-enhancement New feature or request D-complex Quite challenging from either a design or technical perspective Ask for help!

Comments

@mattsse
Copy link
Collaborator

mattsse commented Nov 13, 2024

Describe the feature

we currently use

/// Alias for `eth` namespace API builder.
pub type DynEthApiBuilder<Provider, Pool, EvmConfig, Network, Tasks, Events, EthApi> =
Box<dyn FnOnce(&EthApiBuilderCtx<Provider, Pool, EvmConfig, Network, Tasks, Events>) -> EthApi>;

and

eth_api_builder: impl FnOnce(&EthApiBuilderCtx<Node>) -> EthApi + Send + Sync + 'static,

as the constructor for the EthApi, like:

/// Creates a new, shareable instance.
pub fn with_spawner<Tasks, Events>(
ctx: &EthApiBuilderCtx<Provider, Pool, EvmConfig, Network, Tasks, Events>,
) -> Self
where
Tasks: TaskSpawner + Clone + 'static,
Events: CanonStateSubscriptions,
{

and

Self(RpcAddOns::new(move |ctx| OpEthApi::new(ctx, sequencer_http), Default::default()))

this makes it very difficult to navigate and is a bit confusing. With a trait it would be easier to find all places where this is used.

TODO

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Nov 13, 2024
@mattsse mattsse added D-complex Quite challenging from either a design or technical perspective Ask for help! and removed S-needs-triage This issue needs to be labelled labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-complex Quite challenging from either a design or technical perspective Ask for help!
Projects
Status: Todo
Development

No branches or pull requests

1 participant