pub struct Validator {Show 13 fields
pub operator_address: String,
pub consensus_pubkey: Option<Any>,
pub jailed: bool,
pub status: i32,
pub tokens: String,
pub delegator_shares: String,
pub description: Option<Description>,
pub unbonding_height: i64,
pub unbonding_time: Option<Timestamp>,
pub commission: Option<Commission>,
pub min_self_delegation: String,
pub unbonding_on_hold_ref_count: i64,
pub unbonding_ids: Vec<u64>,
}
Expand description
Validator defines a validator, together with the total amount of the Validator’s bond shares and their exchange rate to coins. Slashing results in a decrease in the exchange rate, allowing correct calculation of future undelegations without iterating over delegators. When coins are delegated to this validator, the validator is credited with a delegation whose number of bond shares is based on the amount of coins delegated divided by the current exchange rate. Voting power can be calculated as total bonded shares multiplied by exchange rate.
Fields§
§operator_address: String
operator_address defines the address of the validator’s operator; bech encoded in JSON.
consensus_pubkey: Option<Any>
consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
jailed: bool
jailed defined whether the validator has been jailed from bonded status or not.
status: i32
status is the validator status (bonded/unbonding/unbonded).
tokens: String
tokens define the delegated tokens (incl. self-delegation).
delegator_shares defines total shares issued to a validator’s delegators.
description: Option<Description>
description defines the description terms for the validator.
unbonding_height: i64
unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
unbonding_time: Option<Timestamp>
unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
commission: Option<Commission>
commission defines the commission parameters.
min_self_delegation: String
min_self_delegation is the validator’s self declared minimum self delegation.
Since: cosmos-sdk 0.46
unbonding_on_hold_ref_count: i64
strictly positive if this validator’s unbonding has been stopped by external modules
unbonding_ids: Vec<u64>
list of unbonding ids, each uniquely identifing an unbonding of this validator
Implementations§
Source§impl Validator
impl Validator
Sourcepub fn status(&self) -> BondStatus
pub fn status(&self) -> BondStatus
Returns the enum value of status
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_status(&mut self, value: BondStatus)
pub fn set_status(&mut self, value: BondStatus)
Sets status
to the provided enum value.
Trait Implementations§
Source§impl Message for Validator
impl Message for Validator
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.impl StructuralPartialEq for Validator
Auto Trait Implementations§
impl Freeze for Validator
impl RefUnwindSafe for Validator
impl Send for Validator
impl Sync for Validator
impl Unpin for Validator
impl UnwindSafe for Validator
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> 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 moreSource§impl<M> NibiruProstMsg for Mwhere
M: Message,
impl<M> NibiruProstMsg for Mwhere
M: Message,
fn to_binary(&self) -> Binary
Source§fn try_into_stargate_msg(&self, type_url: &str) -> CosmosMsg
fn try_into_stargate_msg(&self, type_url: &str) -> CosmosMsg
Name.type_url()
function. This method attempts
to downcast the message to prost::Name, and if successful, constructs a
CosmosMsg::Stargate
object corresponding to the type.