Struct snapshot_lib::VoterHIR
source · pub struct VoterHIR {
pub voting_key: Identifier,
pub address: Address,
pub voting_group: VotingGroup,
pub voting_power: Value,
pub underthreshold: bool,
pub overlimit: bool,
pub private_key: Option<String>,
}
Expand description
Define High Level Intermediate Representation (HIR) for voting entities in the Catalyst ecosystem.
This is intended as a high level description of the setup, which is not enough on its own to spin a blockchain, but it’s slimmer, easier to understand and free from implementation constraints.
You can roughly read this as
“voting_key
will participate in this voting round with role voting_group and will have voting_power influence”
Fields§
§voting_key: Identifier
§address: Address
§voting_group: VotingGroup
Voting group this key belongs to. If this key belong to multiple voting groups, multiple records for the same key will be used.
voting_power: Value
Voting power as processed by the snapshot
underthreshold: bool
Under threshold (voter doesn’t have enough voting power)
if true
this voter can not participate in voting.
overlimit: bool
Overlimit (voter is max voting power threshold limited) This field is just an indication and doesn’t affect ability to vote.
private_key: Option<String>
PrivateKey is only created when making a loadtest snapshot. Its ONLY used for fake accounts used in the load test, and can not be created or derived for a legitimate voter.
Implementations§
source§impl VoterHIR
impl VoterHIR
pub fn to_loadtest_snapshot(&self) -> Self
pub fn cap_voting_power(&self, cap: u64) -> Self
Trait Implementations§
source§impl Arbitrary for VoterHIR
impl Arbitrary for VoterHIR
§type Parameters = (String, VpRange)
type Parameters = (String, VpRange)
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.