@@ -29,10 +29,10 @@ pub struct StakingAccountDetails<T: Config> {
29
29
/// What type of staking this account is doing
30
30
pub staking_type : StakingType ,
31
31
/// The None or Some(number): never, or the last RewardEra that this account's rewards were claimed.
32
- pub last_rewards_claimed_at : Option < RewardEra > ,
32
+ pub last_rewards_claimed_at : Option < T :: RewardEra > ,
33
33
/// Chunks that have been retargeted within T::UnstakingThawPeriod
34
34
pub stake_change_unlocking :
35
- BoundedVec < UnlockChunk < BalanceOf < T > , RewardEra > , T :: MaxUnlockingChunks > ,
35
+ BoundedVec < UnlockChunk < BalanceOf < T > , T :: RewardEra > , T :: MaxUnlockingChunks > ,
36
36
}
37
37
38
38
/// The type that is used to record a single request for a number of tokens to be unlocked.
@@ -260,25 +260,25 @@ pub struct StakingRewardClaim<T: Config> {
260
260
/// The end state of the staking account if the operations are valid
261
261
pub staking_account_end_state : StakingAccountDetails < T > ,
262
262
/// The starting era for the claimed reward period, inclusive
263
- pub from_era : RewardEra ,
263
+ pub from_era : T :: RewardEra ,
264
264
/// The ending era for the claimed reward period, inclusive
265
- pub to_era : RewardEra ,
265
+ pub to_era : T :: RewardEra ,
266
266
}
267
267
268
268
/// A trait that provides the Economic Model for Provider Boosting.
269
269
pub trait StakingRewardsProvider < T : Config > {
270
270
/// Return the size of the reward pool for the given era, in token
271
271
/// Errors:
272
272
/// - EraOutOfRange when `era` is prior to the history retention limit, or greater than the current Era.
273
- fn reward_pool_size ( era : RewardEra ) -> BalanceOf < T > ;
273
+ fn reward_pool_size ( era : T :: RewardEra ) -> BalanceOf < T > ;
274
274
275
275
/// Return the total unclaimed reward in token for `accountId` for `from_era` --> `to_era`, inclusive
276
276
/// Errors:
277
277
/// - EraOutOfRange when from_era or to_era are prior to the history retention limit, or greater than the current Era.
278
278
fn staking_reward_total (
279
- account_id : AccountId ,
280
- from_era : RewardEra ,
281
- to_era : RewardEra ,
279
+ account_id : T :: AccountId ,
280
+ from_era : T :: RewardEra ,
281
+ to_era : T :: RewardEra ,
282
282
) -> BalanceOf < T > ;
283
283
284
284
/// Validate a payout claim for `accountId`, using `proof` and the provided `payload` StakingRewardClaim.
@@ -303,5 +303,16 @@ pub trait StakingRewardsProvider<T: Config> {
303
303
fn payout_eligible ( account_id : AccountId ) -> bool ;
304
304
}
305
305
306
+ /// The information needed to track a Reward Era
307
+ #[ derive(
308
+ PartialEq , Eq , Clone , Default , PartialOrd , Encode , Decode , RuntimeDebug , TypeInfo , MaxEncodedLen ,
309
+ ) ]
310
+ pub struct RewardEraInfo < RewardEra , BlockNumber > {
311
+ /// the index of this era
312
+ pub current_era : RewardEra ,
313
+ /// the starting block of this era
314
+ pub era_start : BlockNumber ,
315
+ }
316
+
306
317
/// Needed data about a RewardPool for a given RewardEra.
307
318
pub struct RewardPoolInfo { }
0 commit comments