Deprecate "confirmed" RpcClient methods (#16520)

* Remove obsolete client methods

* Deprecate GetConfirmed client methods

* Rename Confirmed config structs, with appropriate deprecation

* Fixup client apps

* Map RpcRequest to deprecated when targeting older nodes
This commit is contained in:
Tyera Eulberg
2021-04-15 17:00:14 -06:00
committed by GitHub
parent ba77e48c12
commit 974e6dd2c1
10 changed files with 398 additions and 104 deletions

View File

@@ -11,20 +11,32 @@ pub enum RpcRequest {
DeregisterNode,
GetAccountInfo,
GetBalance,
GetBlock,
GetBlocks,
GetBlocksWithLimit,
GetBlockTime,
GetClusterNodes,
#[deprecated(since = "1.7.0", note = "Please use RpcRequest::GetBlock instead")]
GetConfirmedBlock,
#[deprecated(since = "1.7.0", note = "Please use RpcRequest::GetBlocks instead")]
GetConfirmedBlocks,
GetConfirmedBlocksWithLimit,
#[deprecated(
since = "1.5.19",
note = "Please use RpcRequest::GetConfirmedSignaturesForAddress2 instead"
since = "1.7.0",
note = "Please use RpcRequest::GetBlocksWithLimit instead"
)]
GetConfirmedBlocksWithLimit,
#[deprecated(
since = "1.7.0",
note = "Please use RpcRequest::GetSignaturesForAddress instead"
)]
GetConfirmedSignaturesForAddress,
GetConfirmedSignaturesForAddress2,
#[deprecated(
since = "1.7.0",
note = "Please use RpcRequest::GetTransaction instead"
)]
GetConfirmedTransaction,
GetEpochInfo,
GetEpochSchedule,
GetFeeCalculatorForBlockhash,
@@ -47,6 +59,7 @@ pub enum RpcRequest {
GetRecentBlockhash,
GetRecentPerformanceSamples,
GetSnapshotSlot,
GetSignaturesForAddress,
GetSignatureStatuses,
GetSlot,
GetSlotLeader,
@@ -61,10 +74,7 @@ pub enum RpcRequest {
GetTokenAccountsByDelegate,
GetTokenAccountsByOwner,
GetTokenSupply,
#[deprecated(since = "1.5.19", note = "Please use RpcRequest::GetSupply instead")]
GetTotalSupply,
GetTransaction,
GetTransactionCount,
GetVersion,
GetVoteAccounts,
@@ -83,12 +93,14 @@ impl fmt::Display for RpcRequest {
RpcRequest::DeregisterNode => "deregisterNode",
RpcRequest::GetAccountInfo => "getAccountInfo",
RpcRequest::GetBalance => "getBalance",
RpcRequest::GetBlock => "getBlock",
RpcRequest::GetBlocks => "getBlocks",
RpcRequest::GetBlocksWithLimit => "getBlocksWithLimit",
RpcRequest::GetBlockTime => "getBlockTime",
RpcRequest::GetClusterNodes => "getClusterNodes",
RpcRequest::GetConfirmedBlock => "getConfirmedBlock",
RpcRequest::GetConfirmedBlocks => "getConfirmedBlocks",
RpcRequest::GetConfirmedBlocksWithLimit => "getConfirmedBlocksWithLimit",
RpcRequest::GetConfirmedSignaturesForAddress => "getConfirmedSignaturesForAddress",
RpcRequest::GetConfirmedSignaturesForAddress2 => "getConfirmedSignaturesForAddress2",
RpcRequest::GetConfirmedTransaction => "getConfirmedTransaction",
RpcRequest::GetEpochInfo => "getEpochInfo",
@@ -113,6 +125,7 @@ impl fmt::Display for RpcRequest {
RpcRequest::GetRecentBlockhash => "getRecentBlockhash",
RpcRequest::GetRecentPerformanceSamples => "getRecentPerformanceSamples",
RpcRequest::GetSnapshotSlot => "getSnapshotSlot",
RpcRequest::GetSignaturesForAddress => "getSignaturesForAddress",
RpcRequest::GetSignatureStatuses => "getSignatureStatuses",
RpcRequest::GetSlot => "getSlot",
RpcRequest::GetSlotLeader => "getSlotLeader",
@@ -127,7 +140,7 @@ impl fmt::Display for RpcRequest {
RpcRequest::GetTokenAccountsByDelegate => "getTokenAccountsByDelegate",
RpcRequest::GetTokenAccountsByOwner => "getTokenAccountsByOwner",
RpcRequest::GetTokenSupply => "getTokenSupply",
RpcRequest::GetTotalSupply => "getTotalSupply",
RpcRequest::GetTransaction => "getTransaction",
RpcRequest::GetTransactionCount => "getTransactionCount",
RpcRequest::GetVersion => "getVersion",
RpcRequest::GetVoteAccounts => "getVoteAccounts",