penumbra_governance::component

Trait StateWriteExt

Source
pub trait StateWriteExt: StateWrite + ConnectionStateWriteExt {
Show 19 methods // Provided methods fn put_governance_params(&mut self, params: GovernanceParameters) { ... } fn init_proposal_counter(&mut self) { ... } fn new_proposal<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal: &'life1 Proposal, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn mark_nullifier_voted<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn mark_proposal_started(&mut self) { ... } fn put_deposit_amount(&mut self, proposal_id: u64, amount: Amount) { ... } fn put_proposal_state(&mut self, proposal_id: u64, state: ProposalState) { ... } fn cast_validator_vote( &mut self, proposal_id: u64, identity_key: IdentityKey, vote: Vote, reason: ValidatorVoteReason, ) { ... } fn put_proposal_voting_start(&mut self, proposal_id: u64, end_block: u64) { ... } fn put_proposal_voting_end(&mut self, proposal_id: u64, end_block: u64) { ... } fn put_proposal_voting_start_position( &mut self, proposal_id: u64, start_position: Position, ) { ... } fn mark_nullifier_voted_on_proposal<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, nullifier: &'life1 Nullifier, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn cast_delegator_vote<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, identity_key: IdentityKey, vote: Vote, nullifier: &'life1 Nullifier, unbonded_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn tally_delegator_votes<'life0, 'async_trait>( &'life0 mut self, just_for_proposal: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn enact_proposal<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, payload: &'life1 ProposalPayload, ) -> Pin<Box<dyn Future<Output = Result<Result<()>>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn deliver_community_pool_transaction<'life0, 'async_trait>( &'life0 mut self, proposal: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn signal_upgrade<'life0, 'async_trait>( &'life0 mut self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn signal_halt(&mut self) { ... } fn ready_to_start(&mut self) { ... }
}
Available on crate feature component only.

Provided Methods§

Source

fn put_governance_params(&mut self, params: GovernanceParameters)

Writes the provided governance parameters to the JMT.

Source

fn init_proposal_counter(&mut self)

Initialize the proposal counter so that it can always be read.

Source

fn new_proposal<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal: &'life1 Proposal, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a new proposal with a new proposal id.

Source

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

Mark a nullifier as spent for a given proposal.

Source

fn mark_proposal_started(&mut self)

Record in the object store that some proposal has started.

Source

fn put_deposit_amount(&mut self, proposal_id: u64, amount: Amount)

Store the proposal deposit amount.

Source

fn put_proposal_state(&mut self, proposal_id: u64, state: ProposalState)

Set the state of a proposal.

Source

fn cast_validator_vote( &mut self, proposal_id: u64, identity_key: IdentityKey, vote: Vote, reason: ValidatorVoteReason, )

Record a validator vote for a proposal.

Source

fn put_proposal_voting_start(&mut self, proposal_id: u64, end_block: u64)

Set the proposal voting start block height for a proposal.

Source

fn put_proposal_voting_end(&mut self, proposal_id: u64, end_block: u64)

Set the proposal voting end block height for a proposal.

Source

fn put_proposal_voting_start_position( &mut self, proposal_id: u64, start_position: Position, )

Set the proposal voting start position for a proposal.

Source

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

Mark a nullifier as having voted on a proposal.

Source

fn cast_delegator_vote<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, identity_key: IdentityKey, vote: Vote, nullifier: &'life1 Nullifier, unbonded_amount: Amount, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a delegator vote on a proposal.

Source

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

Tally delegator votes by sweeping them into the aggregate for each validator, for each proposal.

Source

fn enact_proposal<'life0, 'life1, 'async_trait>( &'life0 mut self, proposal_id: u64, payload: &'life1 ProposalPayload, ) -> Pin<Box<dyn Future<Output = Result<Result<()>>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Records the next upgrade height. After commititng the height, the chain should halt and wait for an upgrade. It re-uses the same mechanism as emergency halting that prevents the chain from restarting, without setting halt_bit.

Source

fn signal_halt(&mut self)

Sets the application halt_bit to true, signaling that the chain should be halted, and preventing restarts until a migration is ran.

Source

fn ready_to_start(&mut self)

Sets the application halt_bit to false, signaling that the chain can resume, and the application is ready to start.

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§