Struct spl_stake_pool::state::ValidatorStakeInfo
source · [−]#[repr(C)]pub struct ValidatorStakeInfo {
pub active_stake_lamports: u64,
pub transient_stake_lamports: u64,
pub last_update_epoch: u64,
pub transient_seed_suffix_start: u64,
pub transient_seed_suffix_end: u64,
pub status: StakeStatus,
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 an unsafe pointer cast, which means that this structure cannot have any undeclared alignment-padding in its representation.
Fields
active_stake_lamports: u64Amount of active stake delegated to this validator, minus the minimum
required stake amount of rent-exemption + crate::MINIMUM_ACTIVE_STAKE
(currently 0.001 SOL).
Note that if last_update_epoch does not match the current epoch then
this field may not be accurate
transient_stake_lamports: u64Amount 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: u64Last epoch the active and transient stake lamports fields were updated
transient_seed_suffix_start: u64Start of the validator transient account seed suffixess
transient_seed_suffix_end: u64End of the validator transient account seed suffixes
status: StakeStatusStatus of the validator stake account
vote_account_address: PubkeyValidator vote account address
Implementations
sourceimpl ValidatorStakeInfo
impl ValidatorStakeInfo
sourcepub fn stake_lamports(&self) -> u64
pub fn stake_lamports(&self) -> u64
Get the total lamports delegated to this validator (active and transient)
sourcepub fn memcmp_pubkey(data: &[u8], vote_address_bytes: &[u8]) -> bool
pub fn memcmp_pubkey(data: &[u8], vote_address_bytes: &[u8]) -> bool
Performs a very cheap comparison, for checking if this validator stake info matches the vote account address
sourcepub fn active_lamports_not_equal(data: &[u8], lamports_le_bytes: &[u8]) -> bool
pub fn active_lamports_not_equal(data: &[u8], lamports_le_bytes: &[u8]) -> bool
Performs a very cheap comparison, for checking if this validator stake info does not have active lamports equal to the given bytes
Trait Implementations
sourceimpl BorshDeserialize for ValidatorStakeInfo where
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
StakeStatus: BorshDeserialize,
Pubkey: BorshDeserialize,
impl BorshDeserialize for ValidatorStakeInfo where
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
StakeStatus: BorshDeserialize,
Pubkey: BorshDeserialize,
sourceimpl BorshSchema for ValidatorStakeInfo where
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
StakeStatus: BorshSchema,
Pubkey: BorshSchema,
impl BorshSchema for ValidatorStakeInfo where
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
StakeStatus: BorshSchema,
Pubkey: BorshSchema,
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more
sourcefn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for ValidatorStakeInfo where
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
StakeStatus: BorshSerialize,
Pubkey: BorshSerialize,
impl BorshSerialize for ValidatorStakeInfo where
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
StakeStatus: BorshSerialize,
Pubkey: BorshSerialize,
sourceimpl Clone for ValidatorStakeInfo
impl Clone for ValidatorStakeInfo
sourcefn clone(&self) -> ValidatorStakeInfo
fn clone(&self) -> ValidatorStakeInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ValidatorStakeInfo
impl Debug for ValidatorStakeInfo
sourceimpl Default for ValidatorStakeInfo
impl Default for ValidatorStakeInfo
sourcefn default() -> ValidatorStakeInfo
fn default() -> ValidatorStakeInfo
Returns the “default value” for a type. Read more
sourceimpl Pack for ValidatorStakeInfo
impl Pack for ValidatorStakeInfo
sourcefn get_packed_len() -> usize
fn get_packed_len() -> usize
Get the packed length
sourcefn unpack(input: &[u8]) -> Result<Self, ProgramError> where
Self: IsInitialized,
fn unpack(input: &[u8]) -> Result<Self, ProgramError> where
Self: IsInitialized,
Unpack from slice and check if initialized
sourcefn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Unpack from slice without checking if initialized
sourceimpl PartialEq<ValidatorStakeInfo> for ValidatorStakeInfo
impl PartialEq<ValidatorStakeInfo> for ValidatorStakeInfo
sourcefn eq(&self, other: &ValidatorStakeInfo) -> bool
fn eq(&self, other: &ValidatorStakeInfo) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ValidatorStakeInfo) -> bool
fn ne(&self, other: &ValidatorStakeInfo) -> bool
This method tests for !=.
impl Copy for ValidatorStakeInfo
impl Sealed for ValidatorStakeInfo
impl StructuralPartialEq for ValidatorStakeInfo
Auto Trait Implementations
impl RefUnwindSafe for ValidatorStakeInfo
impl Send for ValidatorStakeInfo
impl Sync for ValidatorStakeInfo
impl Unpin for ValidatorStakeInfo
impl UnwindSafe for ValidatorStakeInfo
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more