Struct diem_types::validator_info::ValidatorInfo
source · pub struct ValidatorInfo { /* private fields */ }
Expand description
After executing a special transaction indicates a change to the next epoch, consensus and networking get the new list of validators, their keys, and their voting power. Consensus has a public key to validate signed messages and networking will has public identity keys for creating secure channels of communication between validators. The validators and their public keys and voting power may or may not change between epochs.
Implementations§
source§impl ValidatorInfo
impl ValidatorInfo
pub fn new( account_address: AccountAddress, consensus_voting_power: u64, config: ValidatorConfig ) -> Self
pub fn new_with_test_network_keys( account_address: AccountAddress, consensus_public_key: Ed25519PublicKey, consensus_voting_power: u64 ) -> Self
sourcepub fn account_address(&self) -> &AccountAddress
pub fn account_address(&self) -> &AccountAddress
Returns the id of this validator (hash of the current public key of the validator associated account address)
sourcepub fn consensus_public_key(&self) -> &Ed25519PublicKey
pub fn consensus_public_key(&self) -> &Ed25519PublicKey
Returns the key for validating signed messages from this validator
sourcepub fn consensus_voting_power(&self) -> u64
pub fn consensus_voting_power(&self) -> u64
Returns the voting power for this validator
sourcepub fn config(&self) -> &ValidatorConfig
pub fn config(&self) -> &ValidatorConfig
Returns the validator’s config
sourcepub fn into_config(self) -> ValidatorConfig
pub fn into_config(self) -> ValidatorConfig
Returns the validator’s config, consuming self
Trait Implementations§
source§impl Arbitrary for ValidatorInfo
impl Arbitrary for ValidatorInfo
§type Parameters = (<AccountAddress as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters, <ValidatorConfig as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters)
type Parameters = (<AccountAddress as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters, <ValidatorConfig as Arbitrary>::Parameters, <u64 as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<AccountAddress as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy, <ValidatorConfig as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (AccountAddress, u64, ValidatorConfig, u64)) -> ValidatorInfo>
type Strategy = Map<(<AccountAddress as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy, <ValidatorConfig as Arbitrary>::Strategy, <u64 as Arbitrary>::Strategy), fn(_: (AccountAddress, u64, ValidatorConfig, u64)) -> ValidatorInfo>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for ValidatorInfo
impl Clone for ValidatorInfo
source§fn clone(&self) -> ValidatorInfo
fn clone(&self) -> ValidatorInfo
Returns a copy 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 ValidatorInfo
impl Debug for ValidatorInfo
source§impl<'de> Deserialize<'de> for ValidatorInfo
impl<'de> Deserialize<'de> for ValidatorInfo
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
source§impl Display for ValidatorInfo
impl Display for ValidatorInfo
source§impl PartialEq<ValidatorInfo> for ValidatorInfo
impl PartialEq<ValidatorInfo> for ValidatorInfo
source§fn eq(&self, other: &ValidatorInfo) -> bool
fn eq(&self, other: &ValidatorInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ValidatorInfo
impl Serialize for ValidatorInfo
impl Eq for ValidatorInfo
impl StructuralEq for ValidatorInfo
impl StructuralPartialEq for ValidatorInfo
Auto Trait Implementations§
impl RefUnwindSafe for ValidatorInfo
impl Send for ValidatorInfo
impl Sync for ValidatorInfo
impl Unpin for ValidatorInfo
impl UnwindSafe for ValidatorInfo
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.