mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
Change hardcoded -> hard_coded
This commit is contained in:
@@ -199,8 +199,8 @@ fn run_new_validator_subcommand<T: EthSpec>(
|
|||||||
Eth2TestnetConfig::load(testnet_dir.clone())
|
Eth2TestnetConfig::load(testnet_dir.clone())
|
||||||
.map_err(|e| format!("Failed to load testnet dir at {:?}: {}", testnet_dir, e))?
|
.map_err(|e| format!("Failed to load testnet dir at {:?}: {}", testnet_dir, e))?
|
||||||
} else {
|
} else {
|
||||||
Eth2TestnetConfig::hardcoded()
|
Eth2TestnetConfig::hard_coded()
|
||||||
.map_err(|e| format!("Failed to load hardcoded testnet dir: {}", e))?
|
.map_err(|e| format!("Failed to load hard_coded testnet dir: {}", e))?
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert from `types::Address` to `web3::types::Address`.
|
// Convert from `types::Address` to `web3::types::Address`.
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ fn init_new_client<E: EthSpec>(
|
|||||||
Eth2TestnetConfig::load(testnet_dir.clone())
|
Eth2TestnetConfig::load(testnet_dir.clone())
|
||||||
.map_err(|e| format!("Unable to open testnet dir at {:?}: {}", testnet_dir, e))?
|
.map_err(|e| format!("Unable to open testnet dir at {:?}: {}", testnet_dir, e))?
|
||||||
} else {
|
} else {
|
||||||
Eth2TestnetConfig::hardcoded()
|
Eth2TestnetConfig::hard_coded()
|
||||||
.map_err(|e| format!("Unable to load hard-coded testnet dir: {}", e))?
|
.map_err(|e| format!("Unable to load hard-coded testnet dir: {}", e))?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl<E: EthSpec> Eth2TestnetConfig<E> {
|
|||||||
// considered the default Lighthouse testnet.
|
// considered the default Lighthouse testnet.
|
||||||
//
|
//
|
||||||
// Returns an error if those included bytes are invalid (this is unlikely).
|
// Returns an error if those included bytes are invalid (this is unlikely).
|
||||||
pub fn hardcoded() -> Result<Self, String> {
|
pub fn hard_coded() -> Result<Self, String> {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
deposit_contract_address: serde_yaml::from_reader(HARDCODED_DEPOSIT_CONTRACT)
|
deposit_contract_address: serde_yaml::from_reader(HARDCODED_DEPOSIT_CONTRACT)
|
||||||
.map_err(|e| format!("Unable to parse contract address: {:?}", e))?,
|
.map_err(|e| format!("Unable to parse contract address: {:?}", e))?,
|
||||||
@@ -200,9 +200,9 @@ mod tests {
|
|||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hardcoded_works() {
|
fn hard_coded_works() {
|
||||||
let dir: Eth2TestnetConfig<E> =
|
let dir: Eth2TestnetConfig<E> =
|
||||||
Eth2TestnetConfig::hardcoded().expect("should decode hardcoded params");
|
Eth2TestnetConfig::hard_coded().expect("should decode hard_coded params");
|
||||||
|
|
||||||
assert!(dir.boot_enr.is_some());
|
assert!(dir.boot_enr.is_some());
|
||||||
assert!(dir.genesis_state.is_some());
|
assert!(dir.genesis_state.is_some());
|
||||||
|
|||||||
Reference in New Issue
Block a user