Skip to content

Commit

Permalink
fix: map RPC aliases to what Lotus uses
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs committed Feb 24, 2025
1 parent 32a34e9 commit 966d594
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rpc/methods/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,10 @@ impl RpcMethod<0> for Web3ClientVersion {
_: Ctx<impl Blockstore + Send + Sync + 'static>,
(): Self::Params,
) -> Result<Self::Ok, ServerError> {
Ok(crate::utils::version::FOREST_VERSION_STRING.clone())
Ok(format!(
"forest/{}",
*crate::utils::version::FOREST_VERSION_STRING
))
}
}

Expand Down Expand Up @@ -2842,7 +2845,7 @@ impl RpcMethod<1> for EthGetFilterLogs {
pub enum EthTraceBlock {}
impl RpcMethod<1> for EthTraceBlock {
const NAME: &'static str = "Filecoin.EthTraceBlock";
const NAME_ALIAS: Option<&'static str> = Some("eth_traceBlock");
const NAME_ALIAS: Option<&'static str> = Some("trace_block");
const N_REQUIRED_PARAMS: usize = 1;
const PARAM_NAMES: [&'static str; 1] = ["block_param"];
const API_PATHS: ApiPaths = ApiPaths::V1;
Expand Down Expand Up @@ -2912,7 +2915,7 @@ pub enum EthTraceReplayBlockTransactions {}
impl RpcMethod<2> for EthTraceReplayBlockTransactions {
const N_REQUIRED_PARAMS: usize = 2;
const NAME: &'static str = "Filecoin.EthTraceReplayBlockTransactions";
const NAME_ALIAS: Option<&'static str> = Some("eth_traceReplayBlockTransactions");
const NAME_ALIAS: Option<&'static str> = Some("trace_replayBlockTransactions");
const PARAM_NAMES: [&'static str; 2] = ["block_param", "trace_types"];
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/methods/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl RpcMethod<0> for NetListening {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;
const NAME_ALIAS: Option<&'static str> = Some("net_listening");

type Params = ();
type Ok = bool;
Expand Down Expand Up @@ -249,6 +250,7 @@ impl RpcMethod<0> for NetVersion {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;
const NAME_ALIAS: Option<&'static str> = Some("net_version");

type Params = ();
type Ok = String;
Expand Down

0 comments on commit 966d594

Please sign in to comment.