Skip to content

Commit

Permalink
update instruction comments to indicate stake config is unused
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Apr 4, 2024
1 parent 14dddce commit 1a48d35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/program/src/stake/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub enum StakeInstruction {
/// 1. `[]` Vote account to which this stake will be delegated
/// 2. `[]` Clock sysvar
/// 3. `[]` Stake history sysvar that carries stake warmup/cooldown history
/// 4. `[]` Address of config account that carries stake config
/// 4. `[]` Unused account, formerly the stake config
/// 5. `[SIGNER]` Stake authority
///
/// The entire balance of the staking account is staked. DelegateStake
Expand Down Expand Up @@ -289,7 +289,7 @@ pub enum StakeInstruction {
/// plus rent exempt minimum
/// 1. `[WRITE]` Uninitialized stake account that will hold the redelegated stake
/// 2. `[]` Vote account to which this stake will be re-delegated
/// 3. `[]` Address of config account that carries stake config
/// 3. `[]` Unused account, formerly the stake config
/// 4. `[SIGNER]` Stake authority
///
Redelegate,
Expand Down Expand Up @@ -677,6 +677,7 @@ pub fn delegate_stake(
AccountMeta::new_readonly(sysvar::clock::id(), false),
AccountMeta::new_readonly(sysvar::stake_history::id(), false),
#[allow(deprecated)]
// For backwards compatibility we pass the stake config, although this account is unused
AccountMeta::new_readonly(config::id(), false),
AccountMeta::new_readonly(*authorized_pubkey, true),
];
Expand Down Expand Up @@ -782,6 +783,7 @@ fn _redelegate(
AccountMeta::new(*uninitialized_stake_pubkey, false),
AccountMeta::new_readonly(*vote_pubkey, false),
#[allow(deprecated)]
// For backwards compatibility we pass the stake config, although this account is unused
AccountMeta::new_readonly(config::id(), false),
AccountMeta::new_readonly(*authorized_pubkey, true),
];
Expand Down

0 comments on commit 1a48d35

Please sign in to comment.