Trait serp_traits::rewards::RewardHandler[][src]

pub trait RewardHandler<AccountId, BlockNumber> {
    type Share: AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + Debug;
    type Balance: AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + Debug;
    type PoolId: Copy + FullCodec;
    type CurrencyId: FullCodec + Eq + PartialEq + Copy + MaybeSerializeDeserialize + Debug;
    fn accumulate_reward(
        now: BlockNumber,
        callback: impl FnMut(Self::PoolId, Self::Balance)
    ) -> Vec<(Self::CurrencyId, Self::Balance)>;
fn payout(who: &AccountId, pool: Self::PoolId, amount: Self::Balance); }

Hooks to manage reward pool

Associated Types

type Share: AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + Debug[src]

The share type of pool

type Balance: AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + Debug[src]

The reward balance type

type PoolId: Copy + FullCodec[src]

The reward pool ID type

type CurrencyId: FullCodec + Eq + PartialEq + Copy + MaybeSerializeDeserialize + Debug[src]

The currency type

Loading content...

Required methods

fn accumulate_reward(
    now: BlockNumber,
    callback: impl FnMut(Self::PoolId, Self::Balance)
) -> Vec<(Self::CurrencyId, Self::Balance)>
[src]

Accumulate rewards

fn payout(who: &AccountId, pool: Self::PoolId, amount: Self::Balance)[src]

Payout the reward to who

Loading content...

Implementors

Loading content...