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 for chainspec parsing #9220

Closed
Tracked by #7576
mattsse opened this issue Jul 1, 2024 · 1 comment · Fixed by #9259
Closed
Tracked by #7576

Add trait for chainspec parsing #9220

mattsse opened this issue Jul 1, 2024 · 1 comment · Fixed by #9259
Assignees
Labels
A-cli Related to the reth CLI D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jul 1, 2024

we have

default_value = SUPPORTED_CHAINS[0],
value_parser = chain_value_parser
)]
chain: Arc<ChainSpec>,

which conflicts with eth and ethereum

#[cfg(feature = "optimism")]
/// Chains supported by op-reth. First value should be used as the default.
pub const SUPPORTED_CHAINS: &[&str] = &["optimism", "optimism-sepolia", "base", "base-sepolia"];
#[cfg(not(feature = "optimism"))]
/// Chains supported by reth. First value should be used as the default.
pub const SUPPORTED_CHAINS: &[&str] = &["mainnet", "sepolia", "goerli", "holesky", "dev"];

this should be abstracted via a helper trait that
a) defines the default supported traits as const
b) defines a valueparser for the chainspec type

something like:

trait ChainSpecParser: TypedValueParser< Value = ChainSpec> + Default  {
   const SUPPORTED_CHAINS : ...
} 

should be defined in crates/cli/cli crate

@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started A-cli Related to the reth CLI labels Jul 1, 2024
@loocapro
Copy link
Contributor

loocapro commented Jul 1, 2024

Can I?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants