pub struct ValidatorState {
pub id: ValidatorId,
pub public_key: PublicKey,
pub self_stake: u64,
pub delegated_stake: u64,
pub score: u32,
pub jailed: bool,
pub jail_until_height: u64,
}Expand description
Validator state within the staking system.
Fields§
§id: ValidatorId§public_key: PublicKey§self_stake: u64Self-bonded stake.
delegated_stake: u64Total delegated stake from other stakers.
score: u32Reputation score (0 to config.max_score).
jailed: boolWhether the validator is jailed (temporarily removed from active set).
jail_until_height: u64Block height until which the validator remains jailed.
Implementations§
Source§impl ValidatorState
impl ValidatorState
Sourcepub fn total_stake(&self) -> u64
pub fn total_stake(&self) -> u64
Total stake = self-bonded + delegated.
Sourcepub fn voting_power(&self) -> u64
pub fn voting_power(&self) -> u64
Voting power: total stake if not jailed, 0 otherwise.
Trait Implementations§
Source§impl Clone for ValidatorState
impl Clone for ValidatorState
Source§fn clone(&self) -> ValidatorState
fn clone(&self) -> ValidatorState
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 moreSource§impl Debug for ValidatorState
impl Debug for ValidatorState
Source§impl<'de> Deserialize<'de> for ValidatorState
impl<'de> Deserialize<'de> for ValidatorState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ValidatorState
impl RefUnwindSafe for ValidatorState
impl Send for ValidatorState
impl Sync for ValidatorState
impl Unpin for ValidatorState
impl UnsafeUnpin for ValidatorState
impl UnwindSafe for ValidatorState
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