pub trait StateWriteExt: StateWrite {
// Provided methods
fn put_stake_params(&mut self, params: StakeParameters) { ... }
fn put_delegation_changes(&mut self, delegation_changes: DelegationChanges) { ... }
fn push_delegation(&mut self, delegation: Delegate) { ... }
fn push_undelegation(&mut self, undelegation: Undelegate) { ... }
fn queue_staking_rewards(
&mut self,
staking_reward_queue: Vec<(IdentityKey, FundingStreams, Amount)>,
) { ... }
fn register_consensus_key(
&mut self,
identity_key: &IdentityKey,
consensus_key: &PublicKey,
) { ... }
}
component
only.Expand description
Extension trait providing write access to staking data.
Provided Methods§
Sourcefn put_stake_params(&mut self, params: StakeParameters)
fn put_stake_params(&mut self, params: StakeParameters)
Writes the provided stake parameters to the JMT.
Sourcefn put_delegation_changes(&mut self, delegation_changes: DelegationChanges)
fn put_delegation_changes(&mut self, delegation_changes: DelegationChanges)
Delegation changes accumulated over the course of this block, to be persisted at the end of the block for processing at the end of the next epoch.
Sourcefn push_delegation(&mut self, delegation: Delegate)
fn push_delegation(&mut self, delegation: Delegate)
Push an entry in the delegation queue for the current block (object-storage).
Sourcefn push_undelegation(&mut self, undelegation: Undelegate)
fn push_undelegation(&mut self, undelegation: Undelegate)
Push an entry in the undelegation queue for the current block (object-storage).
fn queue_staking_rewards( &mut self, staking_reward_queue: Vec<(IdentityKey, FundingStreams, Amount)>, )
Sourcefn register_consensus_key(
&mut self,
identity_key: &IdentityKey,
consensus_key: &PublicKey,
)
fn register_consensus_key( &mut self, identity_key: &IdentityKey, consensus_key: &PublicKey, )
Register a consensus key in the state, via two verifiable indices:
- CometBFT address ->
PublicKey
PublicKey
->IdentityKey
§Important note
We do not delete obsolete entries on purpose. This is so that the staking component can do evidence attribution even if a byzantine validator has changed the consensus key that was used at the time of the misbehavior.
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.