Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Jul 18, 2023
1 parent 88c52a5 commit 7b3b11a
Show file tree
Hide file tree
Showing 12 changed files with 996 additions and 120 deletions.
6 changes: 3 additions & 3 deletions account-decoder/src/parse_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn parse_stake(data: &[u8]) -> Result<StakeAccountType, ParseAccountError> {
meta: meta.into(),
stake: None,
}),
StakeState::Stake(meta, stake) => StakeAccountType::Delegated(UiStakeAccount {
StakeState::Stake(meta, stake, _) => StakeAccountType::Delegated(UiStakeAccount {
meta: meta.into(),
stake: Some(stake.into()),
}),
Expand Down Expand Up @@ -136,7 +136,7 @@ impl From<Delegation> for UiDelegation {

#[cfg(test)]
mod test {
use {super::*, bincode::serialize};
use {super::*, bincode::serialize, solana_sdk::stake::stake_flags::StakeFlags};

#[test]
fn test_parse_stake() {
Expand Down Expand Up @@ -194,7 +194,7 @@ mod test {
credits_observed: 10,
};

let stake_state = StakeState::Stake(meta, stake);
let stake_state = StakeState::Stake(meta, stake, StakeFlags::empty());
let stake_data = serialize(&stake_state).unwrap();
assert_eq!(
parse_stake(&stake_data).unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ pub fn process_show_stakes(
});
}
}
StakeState::Stake(_, stake) => {
StakeState::Stake(_, stake, _) => {
if vote_account_pubkeys.is_none()
|| vote_account_pubkeys
.unwrap()
Expand Down
3 changes: 2 additions & 1 deletion cli/src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ pub fn process_deactivate_stake_account(

let vote_account_address = match stake_account.state() {
Ok(stake_state) => match stake_state {
StakeState::Stake(_, stake) => stake.delegation.voter_pubkey,
StakeState::Stake(_, stake, _) => stake.delegation.voter_pubkey,
_ => {
return Err(CliError::BadParameter(format!(
"{stake_account_address} is not a delegated stake account",
Expand Down Expand Up @@ -2195,6 +2195,7 @@ pub fn build_stake_state(
lockup,
},
stake,
_,
) => {
let current_epoch = clock.epoch;
let StakeActivationStatus {
Expand Down
Loading

0 comments on commit 7b3b11a

Please sign in to comment.