Skip to content

Commit

Permalink
Remove rpc methods from mock sender (anza-xyz#1996)
Browse files Browse the repository at this point in the history
Remove deleted RPC methods from mock_sender
  • Loading branch information
CriesofCarrots authored Jul 3, 2024
1 parent efdbdc0 commit 27988e7
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions rpc-client/src/mock_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
request::RpcRequest,
response::{
Response, RpcAccountBalance, RpcBlockProduction, RpcBlockProductionRange, RpcBlockhash,
RpcConfirmedTransactionStatusWithSignature, RpcContactInfo, RpcFees, RpcIdentity,
RpcConfirmedTransactionStatusWithSignature, RpcContactInfo, RpcIdentity,
RpcInflationGovernor, RpcInflationRate, RpcInflationReward, RpcKeyedAccount,
RpcPerfSample, RpcPrioritizationFee, RpcResponseContext, RpcSimulateTransactionResult,
RpcSnapshotSlotInfo, RpcStakeActivation, RpcSupply, RpcVersionInfo, RpcVoteAccountInfo,
Expand All @@ -23,7 +23,6 @@ use {
account::Account,
clock::{Slot, UnixTimestamp},
epoch_info::EpochInfo,
fee_calculator::{FeeCalculator, FeeRateGovernor},
instruction::InstructionError,
message::MessageHeader,
pubkey::Pubkey,
Expand Down Expand Up @@ -117,13 +116,6 @@ impl RpcSender for MockSender {
context: RpcResponseContext { slot: 1, api_version: None },
value: Value::Number(Number::from(50)),
})?,
"getRecentBlockhash" => serde_json::to_value(Response {
context: RpcResponseContext { slot: 1, api_version: None },
value: (
Value::String(PUBKEY.to_string()),
serde_json::to_value(FeeCalculator::default()).unwrap(),
),
})?,
"getEpochInfo" => serde_json::to_value(EpochInfo {
epoch: 1,
slot_index: 2,
Expand All @@ -132,31 +124,6 @@ impl RpcSender for MockSender {
block_height: 34,
transaction_count: Some(123),
})?,
"getFeeCalculatorForBlockhash" => {
let value = if self.url == "blockhash_expired" {
Value::Null
} else {
serde_json::to_value(Some(FeeCalculator::default())).unwrap()
};
serde_json::to_value(Response {
context: RpcResponseContext { slot: 1, api_version: None },
value,
})?
}
"getFeeRateGovernor" => serde_json::to_value(Response {
context: RpcResponseContext { slot: 1, api_version: None },
value: serde_json::to_value(FeeRateGovernor::default()).unwrap(),
})?,
"getFees" => serde_json::to_value(Response {
context: RpcResponseContext { slot: 1, api_version: None },
value: serde_json::to_value(RpcFees {
blockhash: PUBKEY.to_string(),
fee_calculator: FeeCalculator::default(),
last_valid_slot: 42,
last_valid_block_height: 42,
})
.unwrap(),
})?,
"getSignatureStatuses" => {
let status: transaction::Result<()> = if self.url == "account_in_use" {
Err(TransactionError::AccountInUse)
Expand Down Expand Up @@ -242,7 +209,6 @@ impl RpcSender for MockSender {
"getSlot" => json![0],
"getMaxShredInsertSlot" => json![0],
"requestAirdrop" => Value::String(Signature::from([8; 64]).to_string()),
"getSnapshotSlot" => Value::Number(Number::from(0)),
"getHighestSnapshotSlot" => json!(RpcSnapshotSlotInfo {
full: 100,
incremental: Some(110),
Expand Down

0 comments on commit 27988e7

Please sign in to comment.