Trait penumbra_governance::component::StateWriteExt
source · pub trait StateWriteExt: StateWrite + ConnectionStateWriteExt {
Show 18 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<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
}
component
only.Provided Methods§
sourcefn put_governance_params(&mut self, params: GovernanceParameters)
fn put_governance_params(&mut self, params: GovernanceParameters)
Writes the provided governance parameters to the JMT.
sourcefn init_proposal_counter(&mut self)
fn init_proposal_counter(&mut self)
Initialize the proposal counter so that it can always be read.
sourcefn 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 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.
sourcefn 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_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.
sourcefn mark_proposal_started(&mut self)
fn mark_proposal_started(&mut self)
Record in the object store that some proposal has started.
sourcefn put_deposit_amount(&mut self, proposal_id: u64, amount: Amount)
fn put_deposit_amount(&mut self, proposal_id: u64, amount: Amount)
Store the proposal deposit amount.
sourcefn put_proposal_state(&mut self, proposal_id: u64, state: ProposalState)
fn put_proposal_state(&mut self, proposal_id: u64, state: ProposalState)
Set the state of a proposal.
sourcefn cast_validator_vote(
&mut self,
proposal_id: u64,
identity_key: IdentityKey,
vote: Vote,
reason: ValidatorVoteReason
)
fn cast_validator_vote( &mut self, proposal_id: u64, identity_key: IdentityKey, vote: Vote, reason: ValidatorVoteReason )
Record a validator vote for a proposal.
sourcefn put_proposal_voting_start(&mut self, proposal_id: u64, end_block: u64)
fn put_proposal_voting_start(&mut self, proposal_id: u64, end_block: u64)
Set the proposal voting start block height for a proposal.
sourcefn put_proposal_voting_end(&mut self, proposal_id: u64, end_block: u64)
fn put_proposal_voting_end(&mut self, proposal_id: u64, end_block: u64)
Set the proposal voting end block height for a proposal.
sourcefn put_proposal_voting_start_position(
&mut self,
proposal_id: u64,
start_position: Position
)
fn put_proposal_voting_start_position( &mut self, proposal_id: u64, start_position: Position )
Set the proposal voting start position for a proposal.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
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,
sourcefn 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_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 incrementing the application TOTAL_HALT_COUNT
.