Skip to content

Commit

Permalink
update Stake with the additional deactivation flag
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Jun 7, 2023
1 parent df9aff2 commit ebb2704
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions stake-pool/program/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn get_stake_state(
let stake_state =
try_from_slice_unchecked::<stake::state::StakeState>(&stake_account_info.data.borrow())?;
match stake_state {
stake::state::StakeState::Stake(meta, stake) => Ok((meta, stake)),
stake::state::StakeState::Stake(meta, stake, _) => Ok((meta, stake)),
_ => Err(StakePoolError::WrongStakeState.into()),
}
}
Expand Down Expand Up @@ -1737,7 +1737,7 @@ impl Processor {
)?;
match stake_state {
// if it was delegated on or before this epoch, we're good
stake::state::StakeState::Stake(_, stake)
stake::state::StakeState::Stake(_, stake, _)
if stake.delegation.activation_epoch <= clock.epoch => {}
// all other situations, delegate!
_ => {
Expand Down Expand Up @@ -2274,7 +2274,7 @@ impl Processor {
}
}
}
Some(stake::state::StakeState::Stake(meta, stake)) => {
Some(stake::state::StakeState::Stake(meta, stake, _)) => {
if stake_is_usable_by_pool(
&meta,
withdraw_authority_info.key,
Expand All @@ -2296,7 +2296,7 @@ impl Processor {
)?;
validator_stake_record.status.remove_transient_stake();
} else if stake.delegation.activation_epoch < clock.epoch {
if let Some(stake::state::StakeState::Stake(_, validator_stake)) =
if let Some(stake::state::StakeState::Stake(_, validator_stake, _)) =
validator_stake_state
{
if validator_stake.delegation.activation_epoch < clock.epoch {
Expand Down Expand Up @@ -2337,7 +2337,7 @@ impl Processor {
)
.ok();
match validator_stake_state {
Some(stake::state::StakeState::Stake(meta, stake)) => {
Some(stake::state::StakeState::Stake(meta, stake, _)) => {
let additional_lamports = validator_stake_info
.lamports()
.saturating_sub(stake.delegation.stake)
Expand Down

0 comments on commit ebb2704

Please sign in to comment.