Deprecate RpcClient methods, RpcRequest variants (#16516)
* Deprecate RpcClient methods, RpcRequest variants * Update cli to getSupply
This commit is contained in:
parent
17aa45fad1
commit
ccb11a939f
|
@ -1234,8 +1234,8 @@ pub fn process_supply(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_total_supply(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult {
|
pub fn process_total_supply(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult {
|
||||||
let total_supply = rpc_client.total_supply()?;
|
let supply = rpc_client.supply()?.value;
|
||||||
Ok(format!("{} SOL", lamports_to_sol(total_supply)))
|
Ok(format!("{} SOL", lamports_to_sol(supply.total)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_get_transaction_count(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult {
|
pub fn process_get_transaction_count(rpc_client: &RpcClient, _config: &CliConfig) -> ProcessResult {
|
||||||
|
|
|
@ -458,10 +458,17 @@ impl RpcClient {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deprecated(since = "1.5.19", note = "Please use RpcClient::supply() instead")]
|
||||||
|
#[allow(deprecated)]
|
||||||
pub fn total_supply(&self) -> ClientResult<u64> {
|
pub fn total_supply(&self) -> ClientResult<u64> {
|
||||||
self.total_supply_with_commitment(self.commitment_config)
|
self.total_supply_with_commitment(self.commitment_config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deprecated(
|
||||||
|
since = "1.5.19",
|
||||||
|
note = "Please use RpcClient::supply_with_commitment() instead"
|
||||||
|
)]
|
||||||
|
#[allow(deprecated)]
|
||||||
pub fn total_supply_with_commitment(
|
pub fn total_supply_with_commitment(
|
||||||
&self,
|
&self,
|
||||||
commitment_config: CommitmentConfig,
|
commitment_config: CommitmentConfig,
|
||||||
|
@ -611,6 +618,11 @@ impl RpcClient {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deprecated(
|
||||||
|
since = "1.5.19",
|
||||||
|
note = "Please use RpcClient::get_confirmed_signatures_for_address2() instead"
|
||||||
|
)]
|
||||||
|
#[allow(deprecated)]
|
||||||
pub fn get_confirmed_signatures_for_address(
|
pub fn get_confirmed_signatures_for_address(
|
||||||
&self,
|
&self,
|
||||||
address: &Pubkey,
|
address: &Pubkey,
|
||||||
|
|
|
@ -16,7 +16,13 @@ pub enum RpcRequest {
|
||||||
GetConfirmedBlock,
|
GetConfirmedBlock,
|
||||||
GetConfirmedBlocks,
|
GetConfirmedBlocks,
|
||||||
GetConfirmedBlocksWithLimit,
|
GetConfirmedBlocksWithLimit,
|
||||||
|
|
||||||
|
#[deprecated(
|
||||||
|
since = "1.5.19",
|
||||||
|
note = "Please use RpcRequest::GetConfirmedSignaturesForAddress2 instead"
|
||||||
|
)]
|
||||||
GetConfirmedSignaturesForAddress,
|
GetConfirmedSignaturesForAddress,
|
||||||
|
|
||||||
GetConfirmedSignaturesForAddress2,
|
GetConfirmedSignaturesForAddress2,
|
||||||
GetConfirmedTransaction,
|
GetConfirmedTransaction,
|
||||||
GetEpochInfo,
|
GetEpochInfo,
|
||||||
|
@ -55,7 +61,10 @@ pub enum RpcRequest {
|
||||||
GetTokenAccountsByDelegate,
|
GetTokenAccountsByDelegate,
|
||||||
GetTokenAccountsByOwner,
|
GetTokenAccountsByOwner,
|
||||||
GetTokenSupply,
|
GetTokenSupply,
|
||||||
|
|
||||||
|
#[deprecated(since = "1.5.19", note = "Please use RpcRequest::GetSupply instead")]
|
||||||
GetTotalSupply,
|
GetTotalSupply,
|
||||||
|
|
||||||
GetTransactionCount,
|
GetTransactionCount,
|
||||||
GetVersion,
|
GetVersion,
|
||||||
GetVoteAccounts,
|
GetVoteAccounts,
|
||||||
|
@ -67,6 +76,7 @@ pub enum RpcRequest {
|
||||||
SignVote,
|
SignVote,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(deprecated)]
|
||||||
impl fmt::Display for RpcRequest {
|
impl fmt::Display for RpcRequest {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let method = match self {
|
let method = match self {
|
||||||
|
|
Loading…
Reference in New Issue