Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPC getStakeMinimumDelegation #26638

Merged
merged 6 commits into from
Jul 17, 2022

Conversation

brooksprumo
Copy link
Contributor

Problem

There is not an RPC method to get the stake minimum delegation.

Summary of Changes

Add one 😊

Fixes #24690

@brooksprumo brooksprumo marked this pull request as ready for review July 15, 2022 17:32
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?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old way of simulate_transaction() does not actually work due to checks in load_account().

@brooksprumo brooksprumo marked this pull request as draft July 15, 2022 20:00
@brooksprumo
Copy link
Contributor Author

brooksprumo commented Jul 15, 2022

Found some issues in this PR when I was building on it to add CLI support. Moving back to draft.

Resolved!

@brooksprumo brooksprumo marked this pull request as ready for review July 16, 2022 00:52
mvines
mvines previously approved these changes Jul 16, 2022
CriesofCarrots
CriesofCarrots previously approved these changes Jul 16, 2022
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ nit (alphabetizing RpcRequest variant)

client/src/rpc_request.rs Outdated Show resolved Hide resolved
client/src/rpc_request.rs Outdated Show resolved Hide resolved
joncinque
joncinque previously approved these changes Jul 16, 2022
@mergify mergify bot dismissed stale reviews from mvines, CriesofCarrots, and joncinque July 17, 2022 16:52

Pull request has been modified.

@brooksprumo brooksprumo added the automerge Merge this Pull Request automatically once CI passes label Jul 17, 2022
@mergify mergify bot merged commit a8be960 into solana-labs:master Jul 17, 2022
@brooksprumo brooksprumo deleted the minimum-stake/rpc branch July 18, 2022 00:29
Lcchy pushed a commit to Bonfida/solana that referenced this pull request Jul 22, 2022
* Add RPC getStakeMinimumDelegation

* fixup! rpc

* fixup rpc

* fixup rpc client mock sender

* fixup docs

* pr: sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to get stake minimum delegation from RPC
4 participants