remove mining_pool from stake_state (#4804)
This commit is contained in:
parent
3f8ff23125
commit
70f93cc126
|
@ -18,13 +18,6 @@ use std::cmp;
|
|||
pub enum StakeState {
|
||||
Uninitialized,
|
||||
Stake(Stake),
|
||||
MiningPool {
|
||||
/// epoch for which this Pool will redeem rewards
|
||||
epoch: u64,
|
||||
|
||||
/// the number of lamports each point is worth
|
||||
point_value: f64,
|
||||
},
|
||||
RewardsPool,
|
||||
}
|
||||
|
||||
|
@ -430,10 +423,8 @@ mod tests {
|
|||
Err(InstructionError::InsufficientFunds)
|
||||
);
|
||||
|
||||
let stake_state = StakeState::MiningPool {
|
||||
epoch: 0,
|
||||
point_value: 0.0,
|
||||
};
|
||||
let stake_state = StakeState::RewardsPool;
|
||||
|
||||
stake_keyed_account.set_state(&stake_state).unwrap();
|
||||
assert!(stake_keyed_account
|
||||
.delegate_stake(&vote_keyed_account, 0, ¤t)
|
||||
|
@ -627,10 +618,7 @@ mod tests {
|
|||
let mut to_keyed_account = KeyedAccount::new(&to, false, &mut to_account);
|
||||
|
||||
let mut stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &mut stake_account);
|
||||
let stake_state = StakeState::MiningPool {
|
||||
epoch: 0,
|
||||
point_value: 0.0,
|
||||
};
|
||||
let stake_state = StakeState::RewardsPool;
|
||||
stake_keyed_account.set_state(&stake_state).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
|
|
|
@ -128,14 +128,6 @@ impl Stakes {
|
|||
&self.vote_accounts
|
||||
}
|
||||
|
||||
pub fn mining_pools(&self) -> impl Iterator<Item = (&Pubkey, &Account)> {
|
||||
self.stake_accounts
|
||||
.iter()
|
||||
.filter(|(_key, account)| match StakeState::from(account) {
|
||||
Some(StakeState::MiningPool { .. }) => true,
|
||||
_ => false,
|
||||
})
|
||||
}
|
||||
pub fn rewards_pools(&self) -> impl Iterator<Item = (&Pubkey, &Account)> {
|
||||
self.stake_accounts
|
||||
.iter()
|
||||
|
|
Loading…
Reference in New Issue