penumbra_governance::component

Trait StateReadExt

Source
pub trait StateReadExt: StateRead + StateReadExt {
Show 34 methods // Provided methods fn is_pre_upgrade_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn get_governance_params<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GovernanceParameters>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn next_proposal_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_definition<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Proposal>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_payload<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ProposalPayload>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_deposit_amount<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Amount>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_state<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ProposalState>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn unfinished_proposals<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<u64>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn validator_vote<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<Option<Vote>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_voting_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_voting_end<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_voting_start_position<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn total_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_nullifier_unvoted_for_proposal<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn rate_data_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<Option<RateData>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_proposal_votable<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_proposal_started_at_position<'life0, 'async_trait>( &'life0 self, proposal_id: u64, claimed_position: Position, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_nullifier_unspent_before_start_block_height<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn validator_by_delegation_asset<'life0, 'async_trait>( &'life0 self, asset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<IdentityKey>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_unbonded_amount_correct_exchange_for_proposal<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, proposal_id: u64, value: &'life1 Value, unbonded_amount: &'life2 Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn check_height_in_future_of_voting_end<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_validator_has_not_voted<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: &'life1 IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn check_governance_key_matches_validator<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, identity_key: &'life1 IdentityKey, governance_key: &'life2 GovernanceKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn check_proposal_claimable<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_proposal_claim_valid_deposit<'life0, 'async_trait>( &'life0 self, proposal_id: u64, claim_deposit_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn specific_validator_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn validator_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, u64>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn check_validator_active_at_proposal_start<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: &'life1 IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn validator_votes<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, Vote>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn tallied_delegator_votes<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, Tally>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn current_tally<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Tally>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn param_changes_for_height<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ParameterChange>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn proposal_started(&self) -> bool { ... } fn is_chain_halted<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... }
}
Available on crate feature component only.

Provided Methods§

Source

fn is_pre_upgrade_height<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns true if the next height is an upgrade height. We look-ahead to the next height because we want to halt the chain immediately after committing the block.

Source

fn get_governance_params<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<GovernanceParameters>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets the governance parameters from the JMT.

Source

fn next_proposal_id<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the id of the next proposal in the sequence of ids.

Source

fn proposal_definition<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Proposal>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal definition for a proposal.

Source

fn proposal_payload<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ProposalPayload>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal payload for a proposal.

Source

fn proposal_deposit_amount<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Amount>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal deposit amount for a proposal.

Source

fn proposal_state<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ProposalState>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the state of a proposal.

Source

fn unfinished_proposals<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BTreeSet<u64>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get all the unfinished proposal ids.

Source

fn validator_vote<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<Option<Vote>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the vote of a validator on a particular proposal.

Source

fn proposal_voting_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal voting start block for a given proposal.

Source

fn proposal_voting_end<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal voting end block for a given proposal.

Source

fn proposal_voting_start_position<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<Position>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the proposal voting start block for a given proposal.

Source

fn total_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the total voting power across all validators.

Source

fn check_nullifier_unvoted_for_proposal<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check whether a nullifier was spent for a given proposal.

Source

fn rate_data_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<Option<RateData>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get the RateData for a validator at the start height of a given proposal.

Source

fn check_proposal_votable<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Throw an error if the proposal is not votable.

Source

fn check_proposal_started_at_position<'life0, 'async_trait>( &'life0 self, proposal_id: u64, claimed_position: Position, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Throw an error if the proposal was not started at the claimed position.

Source

fn check_nullifier_unspent_before_start_block_height<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Throw an error if the nullifier was spent before the proposal started.

Source

fn validator_by_delegation_asset<'life0, 'async_trait>( &'life0 self, asset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<IdentityKey>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Look up the validator for a given asset ID, if it is a delegation token.

Source

fn check_unbonded_amount_correct_exchange_for_proposal<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, proposal_id: u64, value: &'life1 Value, unbonded_amount: &'life2 Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Throw an error if the exchange between the value and the unbonded amount isn’t correct for the proposal given.

Source

fn check_height_in_future_of_voting_end<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source

fn check_validator_has_not_voted<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: &'life1 IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check that the validator has not voted on the proposal.

Source

fn check_governance_key_matches_validator<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, identity_key: &'life1 IdentityKey, governance_key: &'life2 GovernanceKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check that the governance key matches the validator’s identity key.

Source

fn check_proposal_claimable<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Check that a deposit claim could be made on the proposal.

Source

fn check_proposal_claim_valid_deposit<'life0, 'async_trait>( &'life0 self, proposal_id: u64, claim_deposit_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Check that the deposit claim amount matches the proposal’s deposit amount.

Source

fn specific_validator_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get a specific validator’s voting power for a proposal.

Source

fn validator_voting_power_at_proposal_start<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, u64>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get all the active validator voting power for the proposal.

Source

fn check_validator_active_at_proposal_start<'life0, 'life1, 'async_trait>( &'life0 self, proposal_id: u64, identity_key: &'life1 IdentityKey, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check whether a validator was active at the start of a proposal, and fail if not.

Source

fn validator_votes<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, Vote>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get all the validator votes for the proposal.

Source

fn tallied_delegator_votes<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<IdentityKey, Tally>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Get all the tallied delegator votes for the proposal (excluding those which have been cast but not tallied).

Source

fn current_tally<'life0, 'async_trait>( &'life0 self, proposal_id: u64, ) -> Pin<Box<dyn Future<Output = Result<Tally>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Add up all the currently tallied votes (without tallying any cast votes that haven’t been tallied yet).

Source

fn param_changes_for_height<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<ParameterChange>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets the parameter changes scheduled for the given height, if any.

Source

fn proposal_started(&self) -> bool

Check if any proposal is started in this block.

Source

fn is_chain_halted<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§