mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 06:18:31 +00:00
Accept TTD override as decimal (#2676)
This commit is contained in:
@@ -14,7 +14,9 @@ use std::net::{IpAddr, Ipv4Addr, ToSocketAddrs};
|
||||
use std::net::{TcpListener, UdpSocket};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use types::{ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, GRAFFITI_BYTES_LEN};
|
||||
use types::{
|
||||
ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, Uint256, GRAFFITI_BYTES_LEN,
|
||||
};
|
||||
|
||||
/// Gets the fully-initialized global client.
|
||||
///
|
||||
@@ -240,9 +242,17 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.execution_endpoints = Some(client_config.eth1.endpoints.clone());
|
||||
}
|
||||
|
||||
if let Some(terminal_total_difficulty) =
|
||||
clap_utils::parse_optional(cli_args, "terminal-total-difficulty-override")?
|
||||
if let Some(string) =
|
||||
clap_utils::parse_optional::<String>(cli_args, "terminal-total-difficulty-override")?
|
||||
{
|
||||
let stripped = string.replace(",", "");
|
||||
let terminal_total_difficulty = Uint256::from_dec_str(&stripped).map_err(|e| {
|
||||
format!(
|
||||
"Could not parse --terminal-total-difficulty-override as decimal value: {:?}",
|
||||
e
|
||||
)
|
||||
})?;
|
||||
|
||||
if client_config.execution_endpoints.is_none() {
|
||||
return Err(
|
||||
"The --merge flag must be provided when using --terminal-total-difficulty-override"
|
||||
|
||||
Reference in New Issue
Block a user