mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(op): Add OpChainSpec (#10516)
This commit is contained in:
@ -14,7 +14,6 @@ workspace = true
|
||||
[dependencies]
|
||||
# reth
|
||||
reth-cli-runner.workspace = true
|
||||
reth-chainspec.workspace = true
|
||||
|
||||
# misc
|
||||
clap.workspace = true
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
use clap::builder::TypedValueParser;
|
||||
use reth_chainspec::ChainSpec;
|
||||
use std::sync::Arc;
|
||||
|
||||
use clap::builder::TypedValueParser;
|
||||
|
||||
/// Trait for parsing chain specifications.
|
||||
///
|
||||
/// This trait extends [`clap::builder::TypedValueParser`] to provide a parser for chain
|
||||
/// specifications. Implementers of this trait must provide a list of supported chains and a
|
||||
/// function to parse a given string into a [`ChainSpec`].
|
||||
pub trait ChainSpecParser: TypedValueParser<Value = Arc<ChainSpec>> + Default {
|
||||
/// function to parse a given string into a chain spec.
|
||||
pub trait ChainSpecParser<ChainSpec>: TypedValueParser<Value = Arc<ChainSpec>> + Default {
|
||||
/// List of supported chains.
|
||||
const SUPPORTED_CHAINS: &'static [&'static str];
|
||||
|
||||
/// Parses the given string into a [`ChainSpec`].
|
||||
/// Parses the given string into a chain spec.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -20,6 +20,6 @@ pub trait ChainSpecParser: TypedValueParser<Value = Arc<ChainSpec>> + Default {
|
||||
/// # Errors
|
||||
///
|
||||
/// This function will return an error if the input string cannot be parsed into a valid
|
||||
/// [`ChainSpec`].
|
||||
/// chain spec.
|
||||
fn parse(s: &str) -> eyre::Result<Arc<ChainSpec>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user