Skip to content

Commit

Permalink
GH-525: remove fetching of --entry-dns in unpriviledged args
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarshg6 committed Oct 9, 2024
1 parent 2f2d634 commit 5f8dc71
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
4 changes: 0 additions & 4 deletions node/src/actor_system_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,6 @@ mod tests {
log_level: LevelFilter::Off,
crash_point: CrashPoint::None,
dns_servers: vec![],
entry_dns: false,
scan_intervals_opt: Some(ScanIntervals::default()),
suppress_initial_scans: false,
clandestine_discriminator_factories: Vec::new(),
Expand Down Expand Up @@ -1222,7 +1221,6 @@ mod tests {
log_level: LevelFilter::Off,
crash_point: CrashPoint::None,
dns_servers: vec![],
entry_dns: false,
scan_intervals_opt: None,
suppress_initial_scans: false,
clandestine_discriminator_factories: Vec::new(),
Expand Down Expand Up @@ -1526,7 +1524,6 @@ mod tests {
log_level: LevelFilter::Off,
crash_point: CrashPoint::None,
dns_servers: vec![],
entry_dns: false,
scan_intervals_opt: None,
suppress_initial_scans: false,
clandestine_discriminator_factories: Vec::new(),
Expand Down Expand Up @@ -1713,7 +1710,6 @@ mod tests {
log_level: LevelFilter::Off,
crash_point: CrashPoint::None,
dns_servers: vec![],
entry_dns: false,
scan_intervals_opt: None,
suppress_initial_scans: false,
clandestine_discriminator_factories: Vec::new(),
Expand Down
2 changes: 0 additions & 2 deletions node/src/bootstrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ pub struct BootstrapperConfig {
pub dns_servers: Vec<SocketAddr>,
pub scan_intervals_opt: Option<ScanIntervals>,
pub suppress_initial_scans: bool,
pub entry_dns: bool,
pub when_pending_too_long_sec: u64,
pub crash_point: CrashPoint,
pub clandestine_discriminator_factories: Vec<Box<dyn DiscriminatorFactory>>,
Expand Down Expand Up @@ -371,7 +370,6 @@ impl BootstrapperConfig {
// These fields can be set while privileged without penalty
log_level: LevelFilter::Off,
dns_servers: vec![],
entry_dns: false,
scan_intervals_opt: None,
suppress_initial_scans: false,
crash_point: CrashPoint::None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pub trait UnprivilegedParseArgsConfiguration {
}
};
unprivileged_config.db_password_opt = value_m!(multi_config, "db-password", String);
unprivileged_config.entry_dns = has_user_specified(multi_config, "entry-dns");
configure_accountant_config(multi_config, unprivileged_config, persistent_config)?;
unprivileged_config.mapping_protocol_opt =
compute_mapping_protocol_opt(multi_config, persistent_config, logger);
Expand Down Expand Up @@ -2624,48 +2623,6 @@ mod tests {
assert_eq!(bootstrapper_config.suppress_initial_scans, false);
}

#[test]
fn unprivileged_configuration_handles_entry_dns() {
running_test();
let subject = UnprivilegedParseArgsConfigurationDaoReal {};
let args = ["--ip", "1.2.3.4", "--entry-dns"];
let mut bootstrapper_config = BootstrapperConfig::new();

subject
.unprivileged_parse_args(
&make_simplified_multi_config(args),
&mut bootstrapper_config,
&mut configure_default_persistent_config(
ACCOUNTANT_CONFIG_PARAMS | MAPPING_PROTOCOL | RATE_PACK,
),
&Logger::new("test"),
)
.unwrap();

assert_eq!(bootstrapper_config.entry_dns, true);
}

#[test]
fn unprivileged_configuration_defaults_entry_dns() {
running_test();
let subject = UnprivilegedParseArgsConfigurationDaoReal {};
let args = ["--ip", "1.2.3.4"];
let mut bootstrapper_config = BootstrapperConfig::new();

subject
.unprivileged_parse_args(
&make_simplified_multi_config(args),
&mut bootstrapper_config,
&mut configure_default_persistent_config(
ACCOUNTANT_CONFIG_PARAMS | MAPPING_PROTOCOL | RATE_PACK,
),
&Logger::new("test"),
)
.unwrap();

assert_eq!(bootstrapper_config.entry_dns, false);
}

fn make_persistent_config(
db_password_opt: Option<&str>,
consuming_wallet_private_key_opt: Option<&str>,
Expand Down

0 comments on commit 5f8dc71

Please sign in to comment.