@@ -16,8 +16,8 @@ use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
16
16
use sp_runtime:: {
17
17
create_runtime_str, generic, impl_opaque_keys,
18
18
traits:: {
19
- BlakeTwo256 , Block as BlockT , DispatchInfoOf , IdentityLookup , NumberFor , Saturating ,
20
- SignedExtension ,
19
+ BlakeTwo256 , Block as BlockT , DispatchInfoOf , IdentityLookup , NumberFor , OpaqueKeys ,
20
+ Saturating , SignedExtension ,
21
21
} ,
22
22
transaction_validity:: {
23
23
InvalidTransaction , TransactionSource , TransactionValidity , TransactionValidityError ,
@@ -300,10 +300,17 @@ impl xpallet_contracts::Trait for Runtime {
300
300
type WeightPrice = xpallet_transaction_payment:: Module < Self > ;
301
301
}
302
302
303
+ pub struct SimpleTreasuryAccount ;
304
+ impl xp_mining_staking:: TreasuryAccount < AccountId > for SimpleTreasuryAccount {
305
+ fn treasury_account ( ) -> AccountId {
306
+ todo ! ( "Treasury::account_id()" )
307
+ }
308
+ }
309
+
303
310
impl xpallet_mining_staking:: Trait for Runtime {
304
311
type Event = Event ;
305
- type CollectAssetMiningInfo = ( ) ;
306
- type OnMinting = ( ) ;
312
+ type TreasuryAccount = SimpleTreasuryAccount ;
313
+ type AssetMining = ( ) ;
307
314
type DetermineRewardPotAccount =
308
315
xpallet_mining_staking:: SimpleValidatorRewardPotAccountDeterminer < Runtime > ;
309
316
}
@@ -328,6 +335,24 @@ impl xpallet_transaction_payment::Trait for Runtime {
328
335
TargetedFeeAdjustment < Self , TargetBlockFullness , AdjustmentVariable , MinimumMultiplier > ;
329
336
}
330
337
338
+ parameter_types ! {
339
+ pub const Offset : BlockNumber = 0 ;
340
+ pub const Period : BlockNumber = 50 ;
341
+ pub const DisabledValidatorsThreshold : Perbill = Perbill :: from_percent( 17 ) ;
342
+ }
343
+
344
+ impl pallet_session:: Trait for Runtime {
345
+ type Event = Event ;
346
+ type ValidatorId = <Self as frame_system:: Trait >:: AccountId ;
347
+ type ValidatorIdOf = ( ) ;
348
+ type ShouldEndSession = pallet_session:: PeriodicSessions < Period , Offset > ;
349
+ type NextSessionRotation = pallet_session:: PeriodicSessions < Period , Offset > ;
350
+ type SessionManager = XStaking ;
351
+ type SessionHandler = <SessionKeys as OpaqueKeys >:: KeyTypeIdProviders ;
352
+ type Keys = SessionKeys ;
353
+ type DisabledValidatorsThreshold = DisabledValidatorsThreshold ;
354
+ }
355
+
331
356
construct_runtime ! (
332
357
pub enum Runtime where
333
358
Block = Block ,
@@ -340,13 +365,14 @@ construct_runtime!(
340
365
Aura : pallet_aura:: { Module , Config <T >, Inherent ( Timestamp ) } ,
341
366
Grandpa : pallet_grandpa:: { Module , Call , Storage , Config , Event } ,
342
367
Utility : pallet_utility:: { Module , Call , Event } ,
368
+ Session : pallet_session:: { Module , Call , Storage , Event , Config <T >} ,
343
369
Sudo : pallet_sudo:: { Module , Call , Config <T >, Storage , Event <T >} ,
344
370
345
371
XSystem : xpallet_system:: { Module , Call , Storage , Event <T >, Config } ,
346
372
XAssets : xpallet_assets:: { Module , Call , Storage , Event <T >, Config <T >} ,
347
373
XBridgeBitcoin : xpallet_bridge_bitcoin:: { Module , Call , Storage , Event <T >, Config } ,
348
374
XContracts : xpallet_contracts:: { Module , Call , Config , Storage , Event <T >} ,
349
- XMiningStaking : xpallet_mining_staking:: { Module , Call , Storage , Event <T >, Config <T >} ,
375
+ XStaking : xpallet_mining_staking:: { Module , Call , Storage , Event <T >, Config <T >} ,
350
376
XMiningAsset : xpallet_mining_asset:: { Module , Call , Storage , Event <T >} ,
351
377
XTransactionPayment : xpallet_transaction_payment:: { Module , Storage } ,
352
378
XSpot : xpallet_dex_spot:: { Module , Call , Storage , Event <T >, Config <T >} ,
0 commit comments