mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: add another module parser test (#5496)
This commit is contained in:
@ -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;
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user