mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
rpc: remove special module handling for eth_callBundle (#10486)
This commit is contained in:
@ -366,17 +366,12 @@ mod tests {
|
||||
|
||||
#[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 args =
|
||||
CommandParser::<RpcServerArgs>::parse_from(["reth", "--http.api", "eth,admin,debug"])
|
||||
.args;
|
||||
|
||||
let apis = args.http_api.unwrap();
|
||||
let expected =
|
||||
RpcModuleSelection::try_from_selection(["eth", "admin", "debug", "eth-call-bundle"])
|
||||
.unwrap();
|
||||
let expected = RpcModuleSelection::try_from_selection(["eth", "admin", "debug"]).unwrap();
|
||||
|
||||
assert_eq!(apis, expected);
|
||||
}
|
||||
|
||||
@ -1068,6 +1068,15 @@ where
|
||||
let mut module = eth_api.clone().into_rpc();
|
||||
module.merge(eth_filter.clone().into_rpc()).expect("No conflicts");
|
||||
module.merge(eth_pubsub.clone().into_rpc()).expect("No conflicts");
|
||||
module
|
||||
.merge(
|
||||
EthBundle::new(
|
||||
eth_api.clone(),
|
||||
self.blocking_pool_guard.clone(),
|
||||
)
|
||||
.into_rpc(),
|
||||
)
|
||||
.expect("No conflicts");
|
||||
|
||||
module.into()
|
||||
}
|
||||
@ -1099,11 +1108,6 @@ where
|
||||
.into_rpc()
|
||||
.into()
|
||||
}
|
||||
RethRpcModule::EthCallBundle => {
|
||||
EthBundle::new(eth_api.clone(), self.blocking_pool_guard.clone())
|
||||
.into_rpc()
|
||||
.into()
|
||||
}
|
||||
})
|
||||
.clone()
|
||||
})
|
||||
@ -1819,27 +1823,13 @@ impl RpcServerHandle {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn parse_eth_call_bundle() {
|
||||
let selection = "eth-call-bundle".parse::<RethRpcModule>().unwrap();
|
||||
assert_eq!(selection, RethRpcModule::EthCallBundle);
|
||||
let selection = "eth_callBundle".parse::<RethRpcModule>().unwrap();
|
||||
assert_eq!(selection, RethRpcModule::EthCallBundle);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_eth_call_bundle_selection() {
|
||||
let selection = "eth,admin,debug,eth-call-bundle".parse::<RpcModuleSelection>().unwrap();
|
||||
let selection = "eth,admin,debug".parse::<RpcModuleSelection>().unwrap();
|
||||
assert_eq!(
|
||||
selection,
|
||||
RpcModuleSelection::Selection(
|
||||
[
|
||||
RethRpcModule::Eth,
|
||||
RethRpcModule::Admin,
|
||||
RethRpcModule::Debug,
|
||||
RethRpcModule::EthCallBundle,
|
||||
]
|
||||
.into()
|
||||
[RethRpcModule::Eth, RethRpcModule::Admin, RethRpcModule::Debug,].into()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -255,11 +255,6 @@ pub enum RethRpcModule {
|
||||
Reth,
|
||||
/// `ots_` module
|
||||
Ots,
|
||||
/// For single non-standard `eth_` namespace call `eth_callBundle`
|
||||
///
|
||||
/// This is separate from [`RethRpcModule::Eth`] because it is a non standardized call that
|
||||
/// should be opt-in.
|
||||
EthCallBundle,
|
||||
}
|
||||
|
||||
// === impl RethRpcModule ===
|
||||
@ -308,7 +303,6 @@ impl FromStr for RethRpcModule {
|
||||
"rpc" => Self::Rpc,
|
||||
"reth" => Self::Reth,
|
||||
"ots" => Self::Ots,
|
||||
"eth-call-bundle" | "eth_callBundle" => Self::EthCallBundle,
|
||||
_ => return Err(ParseError::VariantNotFound),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user