diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs index 9d7e62af3c68f496de34e4f0c02ffdc5a21cf978..34c6ca8b36eab3ccbfdcd00bb2e83baa5f670f09 100644 --- a/cumulus/pallets/collator-selection/src/lib.rs +++ b/cumulus/pallets/collator-selection/src/lib.rs @@ -150,22 +150,27 @@ pub mod pallet { type UpdateOrigin: EnsureOrigin<Self::RuntimeOrigin>; /// Account Identifier from which the internal Pot is generated. + #[pallet::constant] type PotId: Get<PalletId>; /// Maximum number of candidates that we should have. /// /// This does not take into account the invulnerables. + #[pallet::constant] type MaxCandidates: Get<u32>; /// Minimum number eligible collators. Should always be greater than zero. This includes /// Invulnerable collators. This ensures that there will always be one collator who can /// produce a block. + #[pallet::constant] type MinEligibleCollators: Get<u32>; /// Maximum number of invulnerables. + #[pallet::constant] type MaxInvulnerables: Get<u32>; // Will be kicked if block is not produced in threshold. + #[pallet::constant] type KickThreshold: Get<BlockNumberFor<Self>>; /// A stable ID for a validator. @@ -183,6 +188,14 @@ pub mod pallet { type WeightInfo: WeightInfo; } + #[pallet::extra_constants] + impl<T: Config> Pallet<T> { + /// Gets this pallet's derived pot account. + fn pot_account() -> T::AccountId { + Self::account_id() + } + } + /// Basic information about a collation candidate. #[derive( PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, scale_info::TypeInfo, MaxEncodedLen, diff --git a/prdoc/pr_7206.prdoc b/prdoc/pr_7206.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..d605308ba54c05ca02f766f33258c67977d1314d --- /dev/null +++ b/prdoc/pr_7206.prdoc @@ -0,0 +1,13 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: "Add an extra_constant to pallet-collator-selection" + +doc: + - audience: Runtime Dev + description: | + - Allows to query collator-selection's pot account via extra constant. + +crates: + - name: pallet-collator-selection + bump: minor \ No newline at end of file