add MiningPools, fund validator MiningPools from inflation (#4676)
* add MiningPool fund validator MinigPools from inflation * fixup * finish rename of MINIMUM_SLOT_LENGTH to MINIMUM_SLOTS_PER_EPOCH * deterministic miningpool location * point_value, not credit_value... use f64
This commit is contained in:
@ -97,7 +97,12 @@ impl VoteState {
|
||||
|
||||
// utility function, used by Stakes, tests
|
||||
pub fn from(account: &Account) -> Option<VoteState> {
|
||||
account.state().ok()
|
||||
Self::deserialize(&account.data).ok()
|
||||
}
|
||||
|
||||
// utility function, used by Stakes, tests
|
||||
pub fn to(&self, account: &mut Account) -> Option<()> {
|
||||
Self::serialize(self, &mut account.data).ok()
|
||||
}
|
||||
|
||||
pub fn deserialize(input: &[u8]) -> Result<Self, InstructionError> {
|
||||
@ -111,6 +116,11 @@ impl VoteState {
|
||||
})
|
||||
}
|
||||
|
||||
// utility function, used by Stakes, tests
|
||||
pub fn credits_from(account: &Account) -> Option<u64> {
|
||||
Self::from(account).map(|state| state.credits())
|
||||
}
|
||||
|
||||
/// returns commission split as (voter_portion, staker_portion, was_split) tuple
|
||||
///
|
||||
/// if commission calculation is 100% one way or other,
|
||||
|
Reference in New Issue
Block a user