Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/rpc/methods/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0, MIT

mod types;
use enumflags2::BitFlags;
use enumflags2::{BitFlags, make_bitflags};
use types::*;

#[cfg(test)]
Expand Down Expand Up @@ -127,6 +127,24 @@ pub(crate) fn logs<DB: Blockstore + Sync + Send + 'static>(
(receiver, handle)
}

pub enum ChainGetFinalizedTipset {}
impl RpcMethod<0> for ChainGetFinalizedTipset {
const NAME: &'static str = "Filecoin.ChainGetFinalizedTipSet";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = make_bitflags!(ApiPaths::V1);
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> = Some(
"Returns the latest F3 finalized tipset, or falls back to EC finality if F3 is not operational on the node or if the F3 finalized tipset is further back than EC finalized tipset.",
);

type Params = ();
type Ok = Tipset;

async fn handle(_ctx: Ctx<impl Blockstore>, (): Self::Params) -> Result<Self::Ok, ServerError> {
Err(ServerError::stubbed_for_openrpc())
}
}

pub enum ChainGetMessage {}
impl RpcMethod<1> for ChainGetMessage {
const NAME: &'static str = "Filecoin.ChainGetMessage";
Expand Down
1 change: 1 addition & 0 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ macro_rules! for_each_rpc_method {
$callback!($crate::rpc::chain::ChainGetBlockMessages);
$callback!($crate::rpc::chain::ChainGetEvents);
$callback!($crate::rpc::chain::ChainGetGenesis);
$callback!($crate::rpc::chain::ChainGetFinalizedTipset);
$callback!($crate::rpc::chain::ChainGetMessage);
$callback!($crate::rpc::chain::ChainGetMessagesInTipset);
$callback!($crate::rpc::chain::ChainGetMinBaseFee);
Expand Down
1 change: 1 addition & 0 deletions src/tool/subcommands/api_cmd/test_snapshots_ignored.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Filecoin.AuthNew
Filecoin.AuthVerify
Filecoin.ChainExport
Filecoin.ChainGetEvents
Filecoin.ChainGetFinalizedTipset
Filecoin.ChainSetHead
Filecoin.EthEstimateGas
Filecoin.EthGetFilterChanges
Expand Down
Loading