pub trait Staking: Module<ExecT = StakingMsg, QueryT = StakingQuery, SudoT = StakingSudo> {
// Provided method
fn process_queue<ExecC: CustomMsg, QueryC: CustomQuery>(
&self,
_api: &dyn Api,
_storage: &mut dyn Storage,
_router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>,
_block: &BlockInfo,
) -> AnyResult<AppResponse> { ... }
}
Expand description
A trait defining a behavior of the stake keeper.
Manages staking operations, vital for testing contracts in proof-of-stake (PoS) blockchain environments. This trait simulates staking behaviors, including delegation, validator operations, and reward mechanisms.
Provided Methods§
Sourcefn process_queue<ExecC: CustomMsg, QueryC: CustomQuery>(
&self,
_api: &dyn Api,
_storage: &mut dyn Storage,
_router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>,
_block: &BlockInfo,
) -> AnyResult<AppResponse>
fn process_queue<ExecC: CustomMsg, QueryC: CustomQuery>( &self, _api: &dyn Api, _storage: &mut dyn Storage, _router: &dyn CosmosRouter<ExecC = ExecC, QueryC = QueryC>, _block: &BlockInfo, ) -> AnyResult<AppResponse>
This is called from the end blocker (update_block
/ set_block
) to process the
staking queue. Needed because unbonding has a waiting time.
If you’re implementing a dummy staking module, this can be a no-op.
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.