Skip to content

Commit

Permalink
Expose session in dkg-metadata as a runtime constant (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone authored Feb 14, 2023
1 parent 2c61088 commit 92e7720
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pallets/dkg-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ pub mod pallet {
#[pallet::constant]
type UnsignedPriority: Get<TransactionPriority>;

/// Session length helper allowing to query session length across runtime upgrades.
#[pallet::constant]
type SessionPeriod: Get<Self::BlockNumber>;

type WeightInfo: WeightInfo;
}

Expand Down
1 change: 1 addition & 0 deletions pallets/dkg-metadata/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ impl pallet_dkg_metadata::Config for Test {
type UnsignedPriority = frame_support::traits::ConstU64<{ 1 << 20 }>;
type AuthorityIdOf = pallet_dkg_metadata::AuthorityIdOf<Self>;
type ProposalHandler = ();
type SessionPeriod = Period;
type WeightInfo = ();
}

Expand Down
1 change: 1 addition & 0 deletions parachain/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ impl pallet_dkg_metadata::Config for Runtime {
type Reputation = Reputation;
type AuthorityIdOf = pallet_dkg_metadata::AuthorityIdOf<Self>;
type ProposalHandler = DKGProposalHandler;
type SessionPeriod = Period;
type WeightInfo = pallet_dkg_metadata::weights::WebbWeight<Runtime>;
}

Expand Down
1 change: 1 addition & 0 deletions standalone/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ impl pallet_dkg_metadata::Config for Runtime {
type Reputation = Reputation;
type AuthorityIdOf = pallet_dkg_metadata::AuthorityIdOf<Self>;
type ProposalHandler = DKGProposalHandler;
type SessionPeriod = Period;
type WeightInfo = pallet_dkg_metadata::weights::WebbWeight<Runtime>;
}

Expand Down

0 comments on commit 92e7720

Please sign in to comment.