Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Update RpcSimulateTransactionConfig for rpc_client::get_stake_minimum_delegation() #25426

Closed
Closed
Changes from all commits
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
13 changes: 11 additions & 2 deletions client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4517,8 +4517,17 @@ impl RpcClient {
/// Returns the stake minimum delegation, in lamports.
pub async fn get_stake_minimum_delegation(&self) -> ClientResult<u64> {
let instruction = solana_sdk::stake::instruction::get_minimum_delegation();
let transaction = Transaction::new_with_payer(&[instruction], None);
let response = self.simulate_transaction(&transaction).await?;
let transaction = Transaction::new_with_payer(&[instruction], Some(&Pubkey::default()));
let response = self
.simulate_transaction_with_config(
&transaction,
RpcSimulateTransactionConfig {
sig_verify: false,
replace_recent_blockhash: true,
..RpcSimulateTransactionConfig::default()
},
)
.await?;
let RpcTransactionReturnData {
program_id,
data: (data, encoding),
Expand Down