Skip to content

Commit 040e2b5

Browse files
committed
review addressed
1 parent c187458 commit 040e2b5

File tree

3 files changed

+13
-56
lines changed

3 files changed

+13
-56
lines changed

node/src/bootstrapper.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,8 @@ mod tests {
11631163
"5123",
11641164
"--data-directory",
11651165
data_dir.to_str().unwrap(),
1166+
"--neighborhood-mode",
1167+
"standard",
11661168
]),
11671169
&mut FakeStreamHolder::new().streams(),
11681170
)
@@ -1285,6 +1287,8 @@ mod tests {
12851287
"1.2.3.4",
12861288
"--clandestine-port",
12871289
"5123",
1290+
"--neighborhood-mode",
1291+
"standard",
12881292
]),
12891293
&mut FakeStreamHolder::new().streams(),
12901294
)
@@ -1338,6 +1342,8 @@ mod tests {
13381342
data_dir.to_str().unwrap(),
13391343
"--clandestine-port",
13401344
"5124",
1345+
"--neighborhood-mode",
1346+
"standard",
13411347
]),
13421348
&mut holder.streams(),
13431349
)
@@ -1655,6 +1661,8 @@ mod tests {
16551661
"1.2.3.4",
16561662
"--data-directory",
16571663
data_dir.to_str().unwrap(),
1664+
"--neighborhood-mode",
1665+
"standard",
16581666
]),
16591667
&mut holder.streams(),
16601668
)

node/src/daemon/setup_reporter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ mod tests {
14591459
&DEFAULT_PAYMENT_THRESHOLDS.to_string(),
14601460
Default,
14611461
),
1462-
("rate-pack", &DEFAULT_RATE_PACK.to_string(), Default),
1462+
("rate-pack", &"".to_string(), Blank),
14631463
#[cfg(not(target_os = "windows"))]
14641464
(
14651465
"real-user",

node/src/node_configurator/unprivileged_parse_args_configuration.rs

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,7 @@ fn make_neighborhood_mode(
304304
"--neighborhood-mode {} has not been properly provided for in the code",
305305
s
306306
),
307-
None => {
308-
let rate_pack = configure_rate_pack(multi_config, persistent_config)?;
309-
neighborhood_mode_standard(multi_config, neighbor_configs, rate_pack)
310-
}
307+
None => Ok(NeighborhoodMode::ZeroHop),
311308
}
312309
}
313310

@@ -1537,33 +1534,7 @@ mod tests {
15371534
.unwrap()
15381535
)),
15391536
);
1540-
assert_eq!(
1541-
config.neighborhood_config.mode,
1542-
NeighborhoodMode::Standard(
1543-
NodeAddr::new(&IpAddr::from_str("34.56.78.90").unwrap(), &[]),
1544-
vec![
1545-
NodeDescriptor::try_from((
1546-
CRYPTDE_PAIR.main.as_ref(),
1547-
format!(
1548-
"masq://{}:[email protected]:1234/2345",
1549-
DEFAULT_CHAIN.rec().literal_identifier
1550-
)
1551-
.as_str()
1552-
))
1553-
.unwrap(),
1554-
NodeDescriptor::try_from((
1555-
CRYPTDE_PAIR.main.as_ref(),
1556-
format!(
1557-
"masq://{}:[email protected]:3456/4567",
1558-
DEFAULT_CHAIN.rec().literal_identifier
1559-
)
1560-
.as_str()
1561-
))
1562-
.unwrap(),
1563-
],
1564-
DEFAULT_RATE_PACK.clone()
1565-
)
1566-
);
1537+
assert_eq!(config.neighborhood_config.mode, NeighborhoodMode::ZeroHop);
15671538
assert_eq!(config.db_password_opt, Some(password.to_string()));
15681539
assert_eq!(config.mapping_protocol_opt, Some(AutomapProtocol::Pcp));
15691540
}
@@ -1597,15 +1568,7 @@ mod tests {
15971568
.mode
15981569
.neighbor_configs()
15991570
.is_empty());
1600-
assert_eq!(
1601-
config
1602-
.neighborhood_config
1603-
.mode
1604-
.node_addr_opt()
1605-
.unwrap()
1606-
.ip_addr(),
1607-
IpAddr::from_str("0.0.0.0").unwrap(),
1608-
);
1571+
assert_eq!(config.neighborhood_config.mode.node_addr_opt(), None,);
16091572
assert_eq!(config.earning_wallet, DEFAULT_EARNING_WALLET.clone(),);
16101573
assert_eq!(config.consuming_wallet_opt, None);
16111574
assert_eq!(config.mapping_protocol_opt, None);
@@ -1655,21 +1618,7 @@ mod tests {
16551618
)
16561619
.unwrap();
16571620

1658-
assert_eq!(
1659-
config.neighborhood_config.mode.neighbor_configs(),
1660-
&[
1661-
NodeDescriptor::try_from((
1662-
CRYPTDE_PAIR.main.as_ref(),
1663-
"masq://eth-ropsten:[email protected]:1234"
1664-
))
1665-
.unwrap(),
1666-
NodeDescriptor::try_from((
1667-
CRYPTDE_PAIR.main.as_ref(),
1668-
"masq://eth-ropsten:[email protected]:2345"
1669-
))
1670-
.unwrap(),
1671-
]
1672-
);
1621+
assert_eq!(config.neighborhood_config.mode.neighbor_configs(), &[]);
16731622
let past_neighbors_params = past_neighbors_params_arc.lock().unwrap();
16741623
assert_eq!(past_neighbors_params[0], "password".to_string());
16751624
assert_eq!(config.mapping_protocol_opt, Some(AutomapProtocol::Pcp));

0 commit comments

Comments
 (0)