pub struct ValidatorSystem {
pub validator_list: List,
pub manager_authority: Pubkey,
pub total_validator_score: u32,
pub total_active_balance: u64,
pub auto_add_validator_enabled: u8,
}Fields§
§validator_list: List§total_validator_score: u32§total_active_balance: u64sum of all active lamports staked
auto_add_validator_enabled: u8allow & auto-add validator when a user deposits a stake-account of a non-listed validator
Implementations§
Source§impl ValidatorSystem
impl ValidatorSystem
pub fn bytes_for_list(count: u32, additional_record_space: u32) -> u32
pub fn validator_list_address(&self) -> &Pubkey
pub fn validator_count(&self) -> u32
pub fn validator_list_capacity( &self, validator_list_len: usize, ) -> Result<u32, ProgramError>
pub fn validator_record_size(&self) -> u32
pub fn get( &self, validator_list_data: &[u8], index: u32, ) -> Result<ValidatorRecord, ProgramError>
pub fn validator_stake_target( &self, validator: &ValidatorRecord, total_stake_target: u64, ) -> Result<u64, CommonError>
pub fn check_validator_list<'info>( &self, validator_list: &AccountInfo<'info>, ) -> ProgramResult
Trait Implementations§
Source§impl BorshDeserialize for ValidatorSystemwhere
List: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
impl BorshDeserialize for ValidatorSystemwhere
List: BorshDeserialize,
Pubkey: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
u8: BorshDeserialize,
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 ValidatorSystemwhere
List: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
impl BorshSerialize for ValidatorSystemwhere
List: BorshSerialize,
Pubkey: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Source§impl Clone for ValidatorSystem
impl Clone for ValidatorSystem
Source§fn clone(&self) -> ValidatorSystem
fn clone(&self) -> ValidatorSystem
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 ValidatorSystem
impl RefUnwindSafe for ValidatorSystem
impl Send for ValidatorSystem
impl Sync for ValidatorSystem
impl Unpin for ValidatorSystem
impl UnwindSafe for ValidatorSystem
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