pallet_rewards

Trait Config

source
pub trait Config: Config {
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type Currency: Currency<Self::AccountId>;
    type AvgBlockspaceUsageNumBlocks: Get<u32>;
    type TransactionByteFee: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
    type MaxRewardPoints: Get<u32>;
    type ProposerTaxOnVotes: Get<(u32, u32)>;
    type RewardsEnabled: RewardsEnabled;
    type FindBlockRewardAddress: FindBlockRewardAddress<Self::AccountId>;
    type FindVotingRewardAddresses: FindVotingRewardAddresses<Self::AccountId>;
    type WeightInfo: WeightInfo;
    type OnReward: OnReward<Self::AccountId, <<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait.

Required Associated Types§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

pallet-rewards events

source

type Currency: Currency<Self::AccountId>

source

type AvgBlockspaceUsageNumBlocks: Get<u32>

Number of blocks over which to compute average blockspace usage

source

type TransactionByteFee: Get<<<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>

Cost of one byte of blockspace

source

type MaxRewardPoints: Get<u32>

Max number of reward points

source

type ProposerTaxOnVotes: Get<(u32, u32)>

Tax of the proposer on vote rewards

source

type RewardsEnabled: RewardsEnabled

Determine whether rewards are enabled or not

source

type FindBlockRewardAddress: FindBlockRewardAddress<Self::AccountId>

Reward address of block producer

source

type FindVotingRewardAddresses: FindVotingRewardAddresses<Self::AccountId>

Reward addresses of all receivers of voting rewards

source

type WeightInfo: WeightInfo

source

type OnReward: OnReward<Self::AccountId, <<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>

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.

Implementors§