chore: add another module parser test (#5496)

This commit is contained in:
Matthias Seitz
2023-11-20 16:03:03 +01:00
committed by GitHub
parent 3c7989c541
commit 39a2dc6bc8
2 changed files with 31 additions and 0 deletions

View File

@ -532,6 +532,23 @@ mod tests {
assert_eq!(apis, expected);
}
#[test]
fn test_rpc_server_eth_call_bundle_args() {
let args = CommandParser::<RpcServerArgs>::parse_from([
"reth",
"--http.api",
"eth,admin,debug,eth-call-bundle",
])
.args;
let apis = args.http_api.unwrap();
let expected =
RpcModuleSelection::try_from_selection(["eth", "admin", "debug", "eth-call-bundle"])
.unwrap();
assert_eq!(apis, expected);
}
#[test]
fn test_rpc_server_args_parser_none() {
let args = CommandParser::<RpcServerArgs>::parse_from(["reth", "--http.api", "none"]).args;

View File

@ -2081,6 +2081,20 @@ mod tests {
assert_eq!(selection, RethRpcModule::EthCallBundle);
}
#[test]
fn parse_eth_call_bundle_selection() {
let selection = "eth,admin,debug,eth-call-bundle".parse::<RpcModuleSelection>().unwrap();
assert_eq!(
selection,
RpcModuleSelection::Selection(vec![
RethRpcModule::Eth,
RethRpcModule::Admin,
RethRpcModule::Debug,
RethRpcModule::EthCallBundle,
])
);
}
#[test]
fn parse_rpc_module_selection() {
let selection = "all".parse::<RpcModuleSelection>().unwrap();