mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Fix proposer-nodes cli flag name (#6125)
* Fix `proposer-nodes` cli flag name * Add tests for `--proposer-nodes` cli arg.
This commit is contained in:
@@ -2,6 +2,7 @@ use validator_client::{config::DEFAULT_WEB3SIGNER_KEEP_ALIVE, ApiTopic, Config};
|
|||||||
|
|
||||||
use crate::exec::CommandLineTestExec;
|
use crate::exec::CommandLineTestExec;
|
||||||
use bls::{Keypair, PublicKeyBytes};
|
use bls::{Keypair, PublicKeyBytes};
|
||||||
|
use sensitive_url::SensitiveUrl;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
@@ -672,3 +673,26 @@ fn validator_web3_signer_keep_alive_override() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn validator_proposer_nodes_default_empty() {
|
||||||
|
CommandLineTest::new().run().with_config(|config| {
|
||||||
|
assert_eq!(config.proposer_nodes, vec![]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn validator_proposer_nodes() {
|
||||||
|
CommandLineTest::new()
|
||||||
|
.flag("proposer-nodes", Some("http://bn-1:5052,http://bn-2:5052"))
|
||||||
|
.run()
|
||||||
|
.with_config(|config| {
|
||||||
|
assert_eq!(
|
||||||
|
config.proposer_nodes,
|
||||||
|
vec![
|
||||||
|
SensitiveUrl::parse("http://bn-1:5052").unwrap(),
|
||||||
|
SensitiveUrl::parse("http://bn-2:5052").unwrap()
|
||||||
|
]
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ impl Config {
|
|||||||
.collect::<Result<_, _>>()
|
.collect::<Result<_, _>>()
|
||||||
.map_err(|e| format!("Unable to parse beacon node URL: {:?}", e))?;
|
.map_err(|e| format!("Unable to parse beacon node URL: {:?}", e))?;
|
||||||
}
|
}
|
||||||
if let Some(proposer_nodes) = parse_optional::<String>(cli_args, "proposer_nodes")? {
|
if let Some(proposer_nodes) = parse_optional::<String>(cli_args, "proposer-nodes")? {
|
||||||
config.proposer_nodes = proposer_nodes
|
config.proposer_nodes = proposer_nodes
|
||||||
.split(',')
|
.split(',')
|
||||||
.map(SensitiveUrl::parse)
|
.map(SensitiveUrl::parse)
|
||||||
|
|||||||
Reference in New Issue
Block a user