refactor: remove duplicate RPC namespaces from arguments (#4418)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Alp Güneysel
2023-09-19 06:51:14 -04:00
committed by GitHub
parent 11ee5d7530
commit d846199525
2 changed files with 56 additions and 4 deletions

View File

@@ -550,6 +550,25 @@ mod tests {
);
}
#[test]
fn test_unique_rpc_modules() {
let args = CommandParser::<RpcServerArgs>::parse_from([
"reth",
"--http.api",
" eth, admin, debug, eth,admin",
"--http",
"--ws",
])
.args;
let config = args.transport_rpc_module_config();
let expected = vec![RethRpcModule::Eth, RethRpcModule::Admin, RethRpcModule::Debug];
assert_eq!(config.http().cloned().unwrap().into_selection(), expected);
assert_eq!(
config.ws().cloned().unwrap().into_selection(),
RpcModuleSelection::standard_modules()
);
}
#[test]
fn test_rpc_server_config() {
let args = CommandParser::<RpcServerArgs>::parse_from([