pub struct StakeSystem {
pub stake_list: List,
pub delayed_unstake_cooling_down: u64,
pub stake_deposit_bump_seed: u8,
pub stake_withdraw_bump_seed: u8,
pub slots_for_stake_delta: u64,
pub last_stake_delta_epoch: u64,
pub min_stake: u64,
pub extra_stake_delta_runs: u32,
}Fields§
§stake_list: List§delayed_unstake_cooling_down: u64§stake_deposit_bump_seed: u8§stake_withdraw_bump_seed: u8§slots_for_stake_delta: u64set by admin, how much slots before the end of the epoch, stake-delta can start
last_stake_delta_epoch: u64Marks the start of stake-delta operations, meaning that if somebody starts a delayed-unstake ticket after this var is set with epoch_num the ticket will have epoch_created = current_epoch+1 (the user must wait one more epoch, because their unstake-delta will be execute in this epoch)
min_stake: u64§extra_stake_delta_runs: u32can be set by validator-manager-auth to allow a second run of stake-delta to stake late stakers in the last minute of the epoch so we maximize user’s rewards
Implementations§
Source§impl StakeSystem
impl StakeSystem
pub const STAKE_WITHDRAW_SEED: &'static [u8] = b"withdraw"
pub const STAKE_DEPOSIT_SEED: &'static [u8] = b"deposit"
pub fn bytes_for_list(count: u32, additional_record_space: u32) -> u32
pub fn stake_list_address(&self) -> &Pubkey
pub fn stake_count(&self) -> u32
pub fn stake_list_capacity( &self, stake_list_len: usize, ) -> Result<u32, ProgramError>
pub fn stake_record_size(&self) -> u32
pub fn get( &self, stake_list_data: &[u8], index: u32, ) -> Result<StakeRecord, ProgramError>
pub fn check_stake_list<'info>( &self, stake_list: &AccountInfo<'info>, ) -> ProgramResult
Trait Implementations§
Source§impl BorshDeserialize for StakeSystem
impl BorshDeserialize for StakeSystem
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for StakeSystem
impl BorshSerialize for StakeSystem
Source§impl Clone for StakeSystem
impl Clone for StakeSystem
Source§fn clone(&self) -> StakeSystem
fn clone(&self) -> StakeSystem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StakeSystem
impl RefUnwindSafe for StakeSystem
impl Send for StakeSystem
impl Sync for StakeSystem
impl Unpin for StakeSystem
impl UnwindSafe for StakeSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more