mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 03:17:55 +00:00
Add tests for flags enable-enr-auto-update and disable-packet-filter (#2887)
Resolves https://github.com/sigp/lighthouse/issues/2602
## Issue Addressed
https://github.com/sigp/lighthouse/pull/2749#issue-1037552417
> ## Open TODO
> Add tests for boot_node flags `enable-enr-auto-update` and `disable-packet-filter`. They end up in [Discv5Config](9ed2cba6bc/boot_node/src/config.rs (L29)), which doesn't support serde (de)serialization.
## Proposed Changes
- Added tests for flags `enable-enr-auto-update` and `disable-packet-filter`
- Instead of (de)serialize Discv5Config, added the two fields copied from Discv5Config to BootNodeConfigSerialization.
This commit is contained in:
@@ -139,9 +139,25 @@ fn enr_port_flag() {
|
||||
})
|
||||
}
|
||||
|
||||
// TODO add tests for flags `enable-enr-auto-update` and `disable-packet-filter`.
|
||||
//
|
||||
// These options end up in `Discv5Config`, which doesn't support serde (de)serialization.
|
||||
#[test]
|
||||
fn disable_packet_filter_flag() {
|
||||
CommandLineTest::new()
|
||||
.flag("disable-packet-filter", None)
|
||||
.run_with_ip()
|
||||
.with_config(|config| {
|
||||
assert_eq!(config.disable_packet_filter, true);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enable_enr_auto_update_flag() {
|
||||
CommandLineTest::new()
|
||||
.flag("enable-enr-auto-update", None)
|
||||
.run_with_ip()
|
||||
.with_config(|config| {
|
||||
assert_eq!(config.enable_enr_auto_update, true);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn network_dir_flag() {
|
||||
|
||||
Reference in New Issue
Block a user