feat(net/manager): apply trust-nodes-only for incoming nodes (#7177)

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
Delweng
2024-03-18 18:51:14 +08:00
committed by GitHub
parent 7c03881cf8
commit 7b3e418950
6 changed files with 127 additions and 24 deletions

View File

@ -671,4 +671,21 @@ nanos = 0
#";
let _conf: Config = toml::from_str(alpha_0_0_19).unwrap();
}
#[test]
fn test_conf_trust_nodes_only() {
let trusted_nodes_only = r"#
[peers]
trusted_nodes_only = true
#";
let conf: Config = toml::from_str(trusted_nodes_only).unwrap();
assert!(conf.peers.trusted_nodes_only);
let trusted_nodes_only = r"#
[peers]
connect_trusted_nodes_only = true
#";
let conf: Config = toml::from_str(trusted_nodes_only).unwrap();
assert!(conf.peers.trusted_nodes_only);
}
}