Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move all RPC methods to V1 #4768

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/rpc/methods/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl RpcMethod<2> for AuthNew {
const N_REQUIRED_PARAMS: usize = 1;
// Note: Lotus does not support the optional `expiration_secs` parameter
const PARAM_NAMES: [&'static str; 2] = ["permissions", "expiration_secs"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Admin;
type Params = (Vec<String>, Option<i64>);
type Ok = Vec<u8>;
Expand All @@ -42,7 +42,7 @@ pub enum AuthVerify {}
impl RpcMethod<1> for AuthVerify {
const NAME: &'static str = "Filecoin.AuthVerify";
const PARAM_NAMES: [&'static str; 1] = ["header_raw"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;
type Params = (String,);
type Ok = Vec<String>;
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/methods/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum BeaconGetEntry {}
impl RpcMethod<1> for BeaconGetEntry {
const NAME: &'static str = "Filecoin.BeaconGetEntry";
const PARAM_NAMES: [&'static str; 1] = ["first"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V0; // Not supported in V1
const PERMISSION: Permission = Permission::Read;

type Params = (ChainEpoch,);
Expand Down
36 changes: 18 additions & 18 deletions src/rpc/methods/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub enum ChainGetMessage {}
impl RpcMethod<1> for ChainGetMessage {
const NAME: &'static str = "Filecoin.ChainGetMessage";
const PARAM_NAMES: [&'static str; 1] = ["msg_cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand Down Expand Up @@ -84,7 +84,7 @@ pub enum ChainGetParentMessages {}
impl RpcMethod<1> for ChainGetParentMessages {
const NAME: &'static str = "Filecoin.ChainGetParentMessages";
const PARAM_NAMES: [&'static str; 1] = ["block_cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand All @@ -111,7 +111,7 @@ pub enum ChainGetParentReceipts {}
impl RpcMethod<1> for ChainGetParentReceipts {
const NAME: &'static str = "Filecoin.ChainGetParentReceipts";
const PARAM_NAMES: [&'static str; 1] = ["block_cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand Down Expand Up @@ -156,7 +156,7 @@ pub enum ChainGetMessagesInTipset {}
impl RpcMethod<1> for ChainGetMessagesInTipset {
const NAME: &'static str = "Filecoin.ChainGetMessagesInTipset";
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ApiTipsetKey,);
Expand All @@ -175,7 +175,7 @@ pub enum ChainExport {}
impl RpcMethod<1> for ChainExport {
const NAME: &'static str = "Filecoin.ChainExport";
const PARAM_NAMES: [&'static str; 1] = ["params"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ChainExportParams,);
Expand Down Expand Up @@ -246,7 +246,7 @@ pub enum ChainReadObj {}
impl RpcMethod<1> for ChainReadObj {
const NAME: &'static str = "Filecoin.ChainReadObj";
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand All @@ -268,7 +268,7 @@ pub enum ChainHasObj {}
impl RpcMethod<1> for ChainHasObj {
const NAME: &'static str = "Filecoin.ChainHasObj";
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand All @@ -288,7 +288,7 @@ pub enum ChainStatObj {}
impl RpcMethod<2> for ChainStatObj {
const NAME: &'static str = "Filecoin.ChainStatObj";
const PARAM_NAMES: [&'static str; 2] = ["obj_cid", "base_cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid, Option<Cid>);
Expand Down Expand Up @@ -340,7 +340,7 @@ pub enum ChainGetBlockMessages {}
impl RpcMethod<1> for ChainGetBlockMessages {
const NAME: &'static str = "Filecoin.ChainGetBlockMessages";
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand Down Expand Up @@ -370,7 +370,7 @@ pub enum ChainGetPath {}
impl RpcMethod<2> for ChainGetPath {
const NAME: &'static str = "Filecoin.ChainGetPath";
const PARAM_NAMES: [&'static str; 2] = ["from", "to"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (TipsetKey, TipsetKey);
Expand Down Expand Up @@ -447,7 +447,7 @@ pub enum ChainGetTipSetByHeight {}
impl RpcMethod<2> for ChainGetTipSetByHeight {
const NAME: &'static str = "Filecoin.ChainGetTipSetByHeight";
const PARAM_NAMES: [&'static str; 2] = ["height", "tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ChainEpoch, ApiTipsetKey);
Expand Down Expand Up @@ -491,7 +491,7 @@ pub enum ChainGetGenesis {}
impl RpcMethod<0> for ChainGetGenesis {
const NAME: &'static str = "Filecoin.ChainGetGenesis";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = ();
Expand All @@ -507,7 +507,7 @@ pub enum ChainHead {}
impl RpcMethod<0> for ChainHead {
const NAME: &'static str = "Filecoin.ChainHead";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = ();
Expand All @@ -523,7 +523,7 @@ pub enum ChainGetBlock {}
impl RpcMethod<1> for ChainGetBlock {
const NAME: &'static str = "Filecoin.ChainGetBlock";
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Cid,);
Expand All @@ -542,7 +542,7 @@ pub enum ChainGetTipSet {}
impl RpcMethod<1> for ChainGetTipSet {
const NAME: &'static str = "Filecoin.ChainGetTipSet";
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ApiTipsetKey,);
Expand All @@ -561,7 +561,7 @@ pub enum ChainSetHead {}
impl RpcMethod<1> for ChainSetHead {
const NAME: &'static str = "Filecoin.ChainSetHead";
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Admin;

type Params = (TipsetKey,);
Expand Down Expand Up @@ -593,7 +593,7 @@ pub enum ChainGetMinBaseFee {}
impl RpcMethod<1> for ChainGetMinBaseFee {
const NAME: &'static str = "Filecoin.ChainGetMinBaseFee";
const PARAM_NAMES: [&'static str; 1] = ["lookback"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Admin;

type Params = (u32,);
Expand Down Expand Up @@ -622,7 +622,7 @@ pub enum ChainTipSetWeight {}
impl RpcMethod<1> for ChainTipSetWeight {
const NAME: &'static str = "Filecoin.ChainTipSetWeight";
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ApiTipsetKey,);
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/methods/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum Session {}
impl RpcMethod<0> for Session {
const NAME: &'static str = "Filecoin.Session";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = ();
Expand Down Expand Up @@ -54,7 +54,7 @@ pub enum Shutdown {}
impl RpcMethod<0> for Shutdown {
const NAME: &'static str = "Filecoin.Shutdown";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Admin;

type Params = ();
Expand All @@ -70,7 +70,7 @@ pub enum StartTime {}
impl RpcMethod<0> for StartTime {
const NAME: &'static str = "Filecoin.StartTime";
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = ();
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/methods/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub enum GasEstimateFeeCap {}
impl RpcMethod<3> for GasEstimateFeeCap {
const NAME: &'static str = "Filecoin.GasEstimateFeeCap";
const PARAM_NAMES: [&'static str; 3] = ["message", "max_queue_blocks", "tipset_key"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Message, i64, ApiTipsetKey);
Expand Down Expand Up @@ -69,7 +69,7 @@ pub enum GasEstimateGasPremium {}
impl RpcMethod<4> for GasEstimateGasPremium {
const NAME: &'static str = "Filecoin.GasEstimateGasPremium";
const PARAM_NAMES: [&'static str; 4] = ["nblocksincl", "sender", "gas_limit", "tipset_key"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (u64, Address, i64, ApiTipsetKey);
Expand Down Expand Up @@ -167,7 +167,7 @@ pub enum GasEstimateGasLimit {}
impl RpcMethod<2> for GasEstimateGasLimit {
const NAME: &'static str = "Filecoin.GasEstimateGasLimit";
const PARAM_NAMES: [&'static str; 2] = ["msg", "tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Message, ApiTipsetKey);
Expand Down Expand Up @@ -262,7 +262,7 @@ pub enum GasEstimateMessageGas {}
impl RpcMethod<3> for GasEstimateMessageGas {
const NAME: &'static str = "Filecoin.GasEstimateMessageGas";
const PARAM_NAMES: [&'static str; 3] = ["msg", "spec", "tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Message, Option<MessageSendSpec>, ApiTipsetKey);
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/methods/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub enum MinerCreateBlock {}
impl RpcMethod<1> for MinerCreateBlock {
const NAME: &'static str = "Filecoin.MinerCreateBlock";
const PARAM_NAMES: [&'static str; 1] = ["block_template"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Write;

type Params = (BlockTemplate,);
Expand Down Expand Up @@ -271,7 +271,7 @@ pub enum MinerGetBaseInfo {}
impl RpcMethod<3> for MinerGetBaseInfo {
const NAME: &'static str = "Filecoin.MinerGetBaseInfo";
const PARAM_NAMES: [&'static str; 3] = ["address", "epoch", "tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address, i64, ApiTipsetKey);
Expand Down
16 changes: 8 additions & 8 deletions src/rpc/methods/mpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum MpoolGetNonce {}
impl RpcMethod<1> for MpoolGetNonce {
const NAME: &'static str = "Filecoin.MpoolGetNonce";
const PARAM_NAMES: [&'static str; 1] = ["address"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address,);
Expand All @@ -39,7 +39,7 @@ pub enum MpoolPending {}
impl RpcMethod<1> for MpoolPending {
const NAME: &'static str = "Filecoin.MpoolPending";
const PARAM_NAMES: [&'static str; 1] = ["tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ApiTipsetKey,);
Expand Down Expand Up @@ -108,7 +108,7 @@ pub enum MpoolSelect {}
impl RpcMethod<2> for MpoolSelect {
const NAME: &'static str = "Filecoin.MpoolSelect";
const PARAM_NAMES: [&'static str; 2] = ["tipset_key", "ticket_quality"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (ApiTipsetKey, f64);
Expand All @@ -128,7 +128,7 @@ pub enum MpoolPush {}
impl RpcMethod<1> for MpoolPush {
const NAME: &'static str = "Filecoin.MpoolPush";
const PARAM_NAMES: [&'static str; 1] = ["msg"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Write;

type Params = (SignedMessage,);
Expand All @@ -148,7 +148,7 @@ pub enum MpoolBatchPush {}
impl RpcMethod<1> for MpoolBatchPush {
const NAME: &'static str = "Filecoin.MpoolBatchPush";
const PARAM_NAMES: [&'static str; 1] = ["msgs"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Write;

type Params = (Vec<SignedMessage>,);
Expand All @@ -171,7 +171,7 @@ pub enum MpoolPushUntrusted {}
impl RpcMethod<1> for MpoolPushUntrusted {
const NAME: &'static str = "Filecoin.MpoolPushUntrusted";
const PARAM_NAMES: [&'static str; 1] = ["msg"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Write;

type Params = (SignedMessage,);
Expand All @@ -193,7 +193,7 @@ pub enum MpoolBatchPushUntrusted {}
impl RpcMethod<1> for MpoolBatchPushUntrusted {
const NAME: &'static str = "Filecoin.MpoolBatchPushUntrusted";
const PARAM_NAMES: [&'static str; 1] = ["msgs"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Write;

type Params = (Vec<SignedMessage>,);
Expand All @@ -213,7 +213,7 @@ pub enum MpoolPushMessage {}
impl RpcMethod<2> for MpoolPushMessage {
const NAME: &'static str = "Filecoin.MpoolPushMessage";
const PARAM_NAMES: [&'static str; 2] = ["usmg", "spec"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Sign;

type Params = (Message, Option<MessageSendSpec>);
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/methods/msig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum MsigGetAvailableBalance {}
impl RpcMethod<2> for MsigGetAvailableBalance {
const NAME: &'static str = "Filecoin.MsigGetAvailableBalance";
const PARAM_NAMES: [&'static str; 2] = ["address", "tipset_key"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address, ApiTipsetKey);
Expand Down Expand Up @@ -45,7 +45,7 @@ pub enum MsigGetPending {}
impl RpcMethod<2> for MsigGetPending {
const NAME: &'static str = "Filecoin.MsigGetPending";
const PARAM_NAMES: [&'static str; 2] = ["address", "tipset_key"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address, ApiTipsetKey);
Expand Down Expand Up @@ -79,7 +79,7 @@ pub enum MsigGetVested {}
impl RpcMethod<3> for MsigGetVested {
const NAME: &'static str = "Filecoin.MsigGetVested";
const PARAM_NAMES: [&'static str; 3] = ["address", "start_tsk", "end_tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address, ApiTipsetKey, ApiTipsetKey);
Expand Down Expand Up @@ -118,7 +118,7 @@ pub enum MsigGetVestingSchedule {}
impl RpcMethod<2> for MsigGetVestingSchedule {
const NAME: &'static str = "Filecoin.MsigGetVestingSchedule";
const PARAM_NAMES: [&'static str; 2] = ["address", "tsk"];
const API_PATHS: ApiPaths = ApiPaths::V0;
const API_PATHS: ApiPaths = ApiPaths::V1;
const PERMISSION: Permission = Permission::Read;

type Params = (Address, ApiTipsetKey);
Expand Down
Loading
Loading