Skip to content

Commit

Permalink
Move get_stake_activation to deprecated list
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg committed Feb 7, 2024
1 parent 571a34f commit 2960ac1
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2976,14 +2976,6 @@ pub mod rpc_accounts {
block: Slot,
) -> Result<RpcBlockCommitment<BlockCommitmentArray>>;

#[rpc(meta, name = "getStakeActivation")]
fn get_stake_activation(
&self,
meta: Self::Metadata,
pubkey_str: String,
config: Option<RpcEpochConfig>,
) -> Result<RpcStakeActivation>;

// SPL Token-specific RPC endpoints
// See https://github.com/solana-labs/solana-program-library/releases/tag/token-v2.0.0 for
// program details
Expand Down Expand Up @@ -3056,20 +3048,6 @@ pub mod rpc_accounts {
Ok(meta.get_block_commitment(block))
}

fn get_stake_activation(
&self,
meta: Self::Metadata,
pubkey_str: String,
config: Option<RpcEpochConfig>,
) -> Result<RpcStakeActivation> {
debug!(
"get_stake_activation rpc request received: {:?}",
pubkey_str
);
let pubkey = verify_pubkey(&pubkey_str)?;
meta.get_stake_activation(&pubkey, config)
}

fn get_token_account_balance(
&self,
meta: Self::Metadata,
Expand Down Expand Up @@ -4081,11 +4059,34 @@ pub mod rpc_deprecated_v1_18 {
#[rpc]
pub trait DeprecatedV1_18 {
type Metadata;

// DEPRECATED
#[rpc(meta, name = "getStakeActivation")]
fn get_stake_activation(
&self,
meta: Self::Metadata,
pubkey_str: String,
config: Option<RpcEpochConfig>,
) -> Result<RpcStakeActivation>;
}

pub struct DeprecatedV1_18Impl;
impl DeprecatedV1_18 for DeprecatedV1_18Impl {
type Metadata = JsonRpcRequestProcessor;

fn get_stake_activation(
&self,
meta: Self::Metadata,
pubkey_str: String,
config: Option<RpcEpochConfig>,
) -> Result<RpcStakeActivation> {
debug!(
"get_stake_activation rpc request received: {:?}",
pubkey_str
);
let pubkey = verify_pubkey(&pubkey_str)?;
meta.get_stake_activation(&pubkey, config)
}
}
}

Expand Down

0 comments on commit 2960ac1

Please sign in to comment.