remove mining_pool from stake_state (#4804)

This commit is contained in:
Rob Walker 2019-06-24 16:01:02 -07:00 committed by GitHub
parent 3f8ff23125
commit 70f93cc126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 23 deletions

View File

@ -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, &current)
@ -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!(

View File

@ -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()