Skip to content

Commit 954a9c2

Browse files
committed
Remove old uses of testnet
1 parent 3178743 commit 954a9c2

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

account_manager/src/validator/exit.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pub fn cli_run<E: EthSpec>(matches: &ArgMatches, env: Environment<E>) -> Result<
8484
Timeouts::set_all(Duration::from_secs(env.eth2_config.spec.seconds_per_slot)),
8585
);
8686

87-
let testnet_config = env
88-
.testnet
87+
let eth2_network_config = env
88+
.eth2_network_config
8989
.clone()
9090
.expect("network should have a valid config");
9191

@@ -95,7 +95,7 @@ pub fn cli_run<E: EthSpec>(matches: &ArgMatches, env: Environment<E>) -> Result<
9595
&client,
9696
&spec,
9797
stdin_inputs,
98-
&testnet_config,
98+
&eth2_network_config,
9999
no_wait,
100100
))?;
101101

@@ -109,11 +109,11 @@ async fn publish_voluntary_exit<E: EthSpec>(
109109
client: &BeaconNodeHttpClient,
110110
spec: &ChainSpec,
111111
stdin_inputs: bool,
112-
testnet_config: &Eth2NetworkConfig,
112+
eth2_network_config: &Eth2NetworkConfig,
113113
no_wait: bool,
114114
) -> Result<(), String> {
115115
let genesis_data = get_geneisis_data(client).await?;
116-
let testnet_genesis_root = testnet_config
116+
let testnet_genesis_root = eth2_network_config
117117
.beacon_state::<E>()
118118
.as_ref()
119119
.expect("network should have valid genesis state")

account_manager/src/validator/slashing_protection.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ pub fn cli_run<T: EthSpec>(
8282
) -> Result<(), String> {
8383
let slashing_protection_db_path = validator_base_dir.join(SLASHING_PROTECTION_FILENAME);
8484

85-
let testnet_config = env
86-
.testnet
85+
let eth2_network_config = env
86+
.eth2_network_config
8787
.ok_or("Unable to get testnet configuration from the environment")?;
8888

89-
let genesis_validators_root = testnet_config
89+
let genesis_validators_root = eth2_network_config
9090
.beacon_state::<T>()
9191
.map(|state: BeaconState<T>| state.genesis_validators_root())
9292
.map_err(|e| {

lighthouse/environment/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct EnvironmentBuilder<E: EthSpec> {
4444
log: Option<Logger>,
4545
eth_spec_instance: E,
4646
eth2_config: Eth2Config,
47-
testnet: Option<Eth2NetworkConfig>,
47+
eth2_network_config: Option<Eth2NetworkConfig>,
4848
}
4949

5050
impl EnvironmentBuilder<MinimalEthSpec> {
@@ -55,7 +55,7 @@ impl EnvironmentBuilder<MinimalEthSpec> {
5555
log: None,
5656
eth_spec_instance: MinimalEthSpec,
5757
eth2_config: Eth2Config::minimal(),
58-
testnet: None,
58+
eth2_network_config: None,
5959
}
6060
}
6161
}
@@ -68,7 +68,7 @@ impl EnvironmentBuilder<MainnetEthSpec> {
6868
log: None,
6969
eth_spec_instance: MainnetEthSpec,
7070
eth2_config: Eth2Config::mainnet(),
71-
testnet: None,
71+
eth2_network_config: None,
7272
}
7373
}
7474
}
@@ -216,19 +216,19 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
216216
Ok(self)
217217
}
218218

219-
/// Adds a testnet configuration to the environment.
219+
/// Adds a network configuration to the environment.
220220
pub fn eth2_network_config(
221221
mut self,
222222
eth2_network_config: Eth2NetworkConfig,
223223
) -> Result<Self, String> {
224224
// Create a new chain spec from the default configuration.
225225
self.eth2_config.spec = eth2_network_config.chain_spec::<E>()?;
226-
self.testnet = Some(eth2_network_config);
226+
self.eth2_network_config = Some(eth2_network_config);
227227

228228
Ok(self)
229229
}
230230

231-
/// Optionally adds a testnet configuration to the environment.
231+
/// Optionally adds a network configuration to the environment.
232232
pub fn optional_eth2_network_config(
233233
self,
234234
optional_config: Option<Eth2NetworkConfig>,
@@ -255,7 +255,7 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
255255
log: self.log.ok_or("Cannot build environment without log")?,
256256
eth_spec_instance: self.eth_spec_instance,
257257
eth2_config: self.eth2_config,
258-
testnet: self.testnet,
258+
eth2_network_config: self.eth2_network_config,
259259
})
260260
}
261261
}
@@ -307,7 +307,7 @@ pub struct Environment<E: EthSpec> {
307307
log: Logger,
308308
eth_spec_instance: E,
309309
pub eth2_config: Eth2Config,
310-
pub testnet: Option<Eth2NetworkConfig>,
310+
pub eth2_network_config: Option<Eth2NetworkConfig>,
311311
}
312312

313313
impl<E: EthSpec> Environment<E> {

lighthouse/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ fn main() {
193193
Builder::from_env(Env::default()).init();
194194
}
195195

196-
let result = get_eth2_network_config(&matches).and_then(|testnet_config| {
197-
let eth_spec_id = testnet_config.eth_spec_id()?;
196+
let result = get_eth2_network_config(&matches).and_then(|eth2_network_config| {
197+
let eth_spec_id = eth2_network_config.eth_spec_id()?;
198198

199199
// boot node subcommand circumvents the environment
200200
if let Some(bootnode_matches) = matches.subcommand_matches("boot_node") {
@@ -210,9 +210,9 @@ fn main() {
210210
}
211211

212212
match eth_spec_id {
213-
EthSpecId::Mainnet => run(EnvironmentBuilder::mainnet(), &matches, testnet_config),
213+
EthSpecId::Mainnet => run(EnvironmentBuilder::mainnet(), &matches, eth2_network_config),
214214
#[cfg(feature = "spec-minimal")]
215-
EthSpecId::Minimal => run(EnvironmentBuilder::minimal(), &matches, testnet_config),
215+
EthSpecId::Minimal => run(EnvironmentBuilder::minimal(), &matches, eth2_network_config),
216216
#[cfg(not(feature = "spec-minimal"))]
217217
other => {
218218
eprintln!(
@@ -242,7 +242,7 @@ fn main() {
242242
fn run<E: EthSpec>(
243243
environment_builder: EnvironmentBuilder<E>,
244244
matches: &ArgMatches,
245-
testnet_config: Eth2NetworkConfig,
245+
eth2_network_config: Eth2NetworkConfig,
246246
) -> Result<(), String> {
247247
if std::mem::size_of::<usize>() != 8 {
248248
return Err(format!(
@@ -268,7 +268,7 @@ fn run<E: EthSpec>(
268268

269269
let mut environment = builder
270270
.multi_threaded_tokio_runtime()?
271-
.optional_eth2_network_config(Some(testnet_config))?
271+
.optional_eth2_network_config(Some(eth2_network_config))?
272272
.build()?;
273273

274274
let log = environment.core_context().log().clone();

0 commit comments

Comments
 (0)