reth_ethereum_cli/
lib.rs

1//! Reth CLI implementation.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/SeismicSystems/seismic-reth/issues/"
7)]
8#![cfg_attr(not(test), warn(unused_crate_dependencies))]
9#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
10
11/// Chain specification parser.
12pub mod chainspec;
13pub mod debug_cmd;
14pub mod interface;
15pub use interface::Cli;
16
17#[cfg(test)]
18mod test {
19    use crate::chainspec::EthereumChainSpecParser;
20    use clap::Parser;
21    use reth_chainspec::DEV;
22    use reth_cli_commands::NodeCommand;
23
24    #[test]
25    #[ignore = "reth cmd will print op-reth output if optimism feature enabled"]
26    fn parse_dev() {
27        let cmd: NodeCommand<EthereumChainSpecParser> = NodeCommand::parse_from(["reth", "--dev"]);
28        let chain = DEV.clone();
29        assert_eq!(cmd.chain.chain, chain.chain);
30        assert_eq!(cmd.chain.genesis_hash(), chain.genesis_hash());
31        assert_eq!(
32            cmd.chain.paris_block_and_final_difficulty,
33            chain.paris_block_and_final_difficulty
34        );
35        assert_eq!(cmd.chain.hardforks, chain.hardforks);
36
37        assert!(cmd.rpc.http);
38        assert!(cmd.network.discovery.disable_discovery);
39
40        assert!(cmd.dev.dev);
41    }
42}