#[repr(C)]pub struct ValidatorStakeInfo {
pub active_stake_lamports: PodU64,
pub transient_stake_lamports: PodU64,
pub last_update_epoch: PodU64,
pub transient_seed_suffix: PodU64,
pub unused: PodU32,
pub validator_seed_suffix: PodU32,
pub status: PodStakeStatus,
pub vote_account_address: Pubkey,
}Expand description
Information about a validator in the pool
NOTE: ORDER IS VERY IMPORTANT HERE, PLEASE DO NOT RE-ORDER THE FIELDS UNLESS THERE’S AN EXTREMELY GOOD REASON.
To save on BPF instructions, the serialized bytes are reinterpreted with a
bytemuck transmute, which means that this structure cannot have any
undeclared alignment-padding in its representation.
Fields§
§active_stake_lamports: PodU64Amount of lamports on the validator stake account, including rent
Note that if last_update_epoch does not match the current epoch then
this field may not be accurate
transient_stake_lamports: PodU64Amount of transient stake delegated to this validator
Note that if last_update_epoch does not match the current epoch then
this field may not be accurate
last_update_epoch: PodU64Last epoch the active and transient stake lamports fields were updated
transient_seed_suffix: PodU64Transient account seed suffix, used to derive the transient stake account address
unused: PodU32Unused space, initially meant to specify the end of seed suffixes
validator_seed_suffix: PodU32Validator account seed suffix
status: PodStakeStatusStatus of the validator stake account
vote_account_address: PubkeyValidator vote account address
Implementations§
Source§impl ValidatorStakeInfo
impl ValidatorStakeInfo
Sourcepub fn stake_lamports(&self) -> Result<u64, StakePoolError>
pub fn stake_lamports(&self) -> Result<u64, StakePoolError>
Get the total lamports on this validator (active and transient)
Sourcepub fn memcmp_pubkey(data: &[u8], vote_address: &Pubkey) -> bool
pub fn memcmp_pubkey(data: &[u8], vote_address: &Pubkey) -> bool
Performs a very cheap comparison, for checking if this validator stake info matches the vote account address
Sourcepub fn active_lamports_greater_than(data: &[u8], lamports: &u64) -> bool
pub fn active_lamports_greater_than(data: &[u8], lamports: &u64) -> bool
Performs a comparison, used to check if this validator stake info has more active lamports than some limit
Sourcepub fn transient_lamports_greater_than(data: &[u8], lamports: &u64) -> bool
pub fn transient_lamports_greater_than(data: &[u8], lamports: &u64) -> bool
Performs a comparison, used to check if this validator stake info has more transient lamports than some limit
Sourcepub fn is_not_removed(data: &[u8]) -> bool
pub fn is_not_removed(data: &[u8]) -> bool
Check that the validator stake info is valid
Trait Implementations§
Source§impl BorshDeserialize for ValidatorStakeInfo
impl BorshDeserialize for ValidatorStakeInfo
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>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSchema for ValidatorStakeInfo
impl BorshSchema for ValidatorStakeInfo
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Source§impl BorshSerialize for ValidatorStakeInfo
impl BorshSerialize for ValidatorStakeInfo
Source§impl Clone for ValidatorStakeInfo
impl Clone for ValidatorStakeInfo
Source§fn clone(&self) -> ValidatorStakeInfo
fn clone(&self) -> ValidatorStakeInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidatorStakeInfo
impl Debug for ValidatorStakeInfo
Source§impl Default for ValidatorStakeInfo
impl Default for ValidatorStakeInfo
Source§fn default() -> ValidatorStakeInfo
fn default() -> ValidatorStakeInfo
Source§impl Pack for ValidatorStakeInfo
impl Pack for ValidatorStakeInfo
Source§fn get_packed_len() -> usize
fn get_packed_len() -> usize
Source§fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Source§impl PartialEq for ValidatorStakeInfo
impl PartialEq for ValidatorStakeInfo
impl Copy for ValidatorStakeInfo
impl Pod for ValidatorStakeInfo
impl Sealed for ValidatorStakeInfo
impl StructuralPartialEq for ValidatorStakeInfo
Auto Trait Implementations§
impl Freeze for ValidatorStakeInfo
impl RefUnwindSafe for ValidatorStakeInfo
impl Send for ValidatorStakeInfo
impl Sync for ValidatorStakeInfo
impl Unpin for ValidatorStakeInfo
impl UnwindSafe for ValidatorStakeInfo
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.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>
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>
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