pub trait StakingRewardHandler<AccountId> {
// Required methods
fn staker_and_dapp_reward_pools(
total_value_staked: Balance,
) -> (Balance, Balance);
fn bonus_reward_pool() -> Balance;
fn payout_reward(beneficiary: &AccountId, reward: Balance) -> Result<(), ()>;
}Expand description
Interface for staking reward handler.
Provides reward pool values for stakers - normal & bonus rewards, as well as dApp reward pool. Also provides a safe function for paying out rewards.
Required Methods§
Sourcefn staker_and_dapp_reward_pools(
total_value_staked: Balance,
) -> (Balance, Balance)
fn staker_and_dapp_reward_pools( total_value_staked: Balance, ) -> (Balance, Balance)
Returns the staker reward pool & dApp reward pool for an era.
The total staker reward pool is dynamic and depends on the total value staked.
Sourcefn bonus_reward_pool() -> Balance
fn bonus_reward_pool() -> Balance
Returns the bonus reward pool for a period.
Sourcefn payout_reward(beneficiary: &AccountId, reward: Balance) -> Result<(), ()>
fn payout_reward(beneficiary: &AccountId, reward: Balance) -> Result<(), ()>
Attempts to pay out the rewards to the beneficiary.
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.