diff --git a/substrate/frame/assets/src/lib.rs b/substrate/frame/assets/src/lib.rs index d901f82701..2531f14f45 100644 --- a/substrate/frame/assets/src/lib.rs +++ b/substrate/frame/assets/src/lib.rs @@ -189,19 +189,24 @@ pub mod pallet { type ForceOrigin: EnsureOrigin; /// The basic amount of funds that must be reserved for an asset. + #[pallet::constant] type AssetDeposit: Get>; /// The basic amount of funds that must be reserved when adding metadata to your asset. + #[pallet::constant] type MetadataDepositBase: Get>; /// The additional funds that must be reserved for the number of bytes you store in your /// metadata. + #[pallet::constant] type MetadataDepositPerByte: Get>; /// The amount of funds that must be reserved when creating a new approval. + #[pallet::constant] type ApprovalDeposit: Get>; /// The maximum length of a name or symbol stored on-chain. + #[pallet::constant] type StringLimit: Get; /// A hook to allow a per-asset, per-account minimum balance to be enforced. This must be diff --git a/substrate/frame/atomic-swap/src/lib.rs b/substrate/frame/atomic-swap/src/lib.rs index 4c19a61bb7..829328a74e 100644 --- a/substrate/frame/atomic-swap/src/lib.rs +++ b/substrate/frame/atomic-swap/src/lib.rs @@ -159,6 +159,7 @@ pub mod pallet { /// If B sees A is on a blockchain with larger proof length limit, then it should kindly refuse /// to accept the atomic swap request if A generates the proof, and asks that B generates the /// proof instead. + #[pallet::constant] type ProofLimit: Get; } diff --git a/substrate/frame/authorship/src/lib.rs b/substrate/frame/authorship/src/lib.rs index de60d1a4ca..ca03320306 100644 --- a/substrate/frame/authorship/src/lib.rs +++ b/substrate/frame/authorship/src/lib.rs @@ -137,6 +137,7 @@ pub mod pallet { /// The number of blocks back we should accept uncles. /// This means that we will deal with uncle-parents that are /// `UncleGenerations + 1` before `now`. + #[pallet::constant] type UncleGenerations: Get; /// A filter for uncles within a block. This is for implementing /// further constraints on what uncles can be included, other than their ancestry. diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index 27b015bc1c..6e3a3b1e2f 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -214,9 +214,11 @@ pub mod pallet { /// The maximum number of locks that should exist on an account. /// Not strictly enforced, but used for weight estimation. + #[pallet::constant] type MaxLocks: Get; /// The maximum number of named reserves that can exist on an account. + #[pallet::constant] type MaxReserves: Get; /// The id type for named reserves. diff --git a/substrate/frame/democracy/src/lib.rs b/substrate/frame/democracy/src/lib.rs index 6ebe917f56..4eace01a56 100644 --- a/substrate/frame/democracy/src/lib.rs +++ b/substrate/frame/democracy/src/lib.rs @@ -301,6 +301,7 @@ pub mod pallet { /// Indicator for whether an emergency origin is even allowed to happen. Some chains may want /// to set this permanently to `false`, others may want to condition it on things such as /// an upgrade having happened recently. + #[pallet::constant] type InstantAllowed: Get; /// Minimum voting period allowed for a fast-track referendum. @@ -355,6 +356,7 @@ pub mod pallet { type WeightInfo: WeightInfo; /// The maximum number of public proposals that can exist at any time. + #[pallet::constant] type MaxProposals: Get; } diff --git a/substrate/frame/election-provider-multi-phase/src/lib.rs b/substrate/frame/election-provider-multi-phase/src/lib.rs index d66b971d80..e552335d02 100644 --- a/substrate/frame/election-provider-multi-phase/src/lib.rs +++ b/substrate/frame/election-provider-multi-phase/src/lib.rs @@ -587,15 +587,18 @@ pub mod pallet { type OffchainRepeat: Get; /// The priority of the unsigned transaction submitted in the unsigned-phase + #[pallet::constant] type MinerTxPriority: Get; /// Maximum number of iteration of balancing that will be executed in the embedded miner of /// the pallet. + #[pallet::constant] type MinerMaxIterations: Get; /// Maximum weight that the miner should consume. /// /// The miner will ensure that the total weight of the unsigned solution will not exceed /// this value, based on [`WeightInfo::submit_unsigned`]. + #[pallet::constant] type MinerMaxWeight: Get; /// Maximum number of signed submissions that can be queued. @@ -640,6 +643,7 @@ pub mod pallet { /// /// The miner will ensure that the total length of the unsigned solution will not exceed /// this value. + #[pallet::constant] type MinerMaxLength: Get; /// Something that will provide the election data. diff --git a/substrate/frame/gilt/src/lib.rs b/substrate/frame/gilt/src/lib.rs index 23596a8b6e..6956191ecb 100644 --- a/substrate/frame/gilt/src/lib.rs +++ b/substrate/frame/gilt/src/lib.rs @@ -117,6 +117,7 @@ pub mod pallet { /// The issuance to ignore. This is subtracted from the `Currency`'s `total_issuance` to get /// the issuance by which we inflate or deflate the gilt. + #[pallet::constant] type IgnoredIssuance: Get>; /// Number of duration queues in total. This sets the maximum duration supported, which is diff --git a/substrate/frame/im-online/src/lib.rs b/substrate/frame/im-online/src/lib.rs index 3df5df7bb4..90ba04f3b6 100644 --- a/substrate/frame/im-online/src/lib.rs +++ b/substrate/frame/im-online/src/lib.rs @@ -280,6 +280,7 @@ pub mod pallet { /// /// This is exposed so that it can be tuned for particular runtime, when /// multiple pallets send unsigned transactions. + #[pallet::constant] type UnsignedPriority: Get; /// Weight information for extrinsics in this pallet. diff --git a/substrate/frame/lottery/src/lib.rs b/substrate/frame/lottery/src/lib.rs index 53cadbf02b..c979500b36 100644 --- a/substrate/frame/lottery/src/lib.rs +++ b/substrate/frame/lottery/src/lib.rs @@ -156,6 +156,7 @@ pub mod pallet { /// Number of time we should try to generate a random number that has no modulo bias. /// The larger this number, the more potential computation is used for picking the winner, /// but also the more likely that the chosen winner is done fairly. + #[pallet::constant] type MaxGenerateRandom: Get; /// Weight information for extrinsics in this pallet. diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index f1abea29e1..4fdf1891be 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -148,6 +148,7 @@ pub mod pallet { /// The maximum weight that may be scheduled per block for any dispatchables of less priority /// than `schedule::HARD_DEADLINE`. + #[pallet::constant] type MaximumWeight: Get; /// Required origin to schedule or cancel calls. @@ -155,6 +156,7 @@ pub mod pallet { /// The maximum number of scheduled calls in the queue for a single block. /// Not strictly enforced, but used for weight estimation. + #[pallet::constant] type MaxScheduledPerBlock: Get; /// Weight information for extrinsics in this pallet. diff --git a/substrate/frame/scored-pool/src/lib.rs b/substrate/frame/scored-pool/src/lib.rs index 2279bdfbfc..5892862b43 100644 --- a/substrate/frame/scored-pool/src/lib.rs +++ b/substrate/frame/scored-pool/src/lib.rs @@ -141,10 +141,12 @@ pub mod pallet { // The deposit which is reserved from candidates if they want to // start a candidacy. The deposit gets returned when the candidacy is // withdrawn or when the candidate is kicked. + #[pallet::constant] type CandidateDeposit: Get>; /// Every `Period` blocks the `Members` are filled with the highest scoring /// members in the `Pool`. + #[pallet::constant] type Period: Get; /// The receiver of the signal for when the membership has been initialized. diff --git a/substrate/frame/treasury/src/lib.rs b/substrate/frame/treasury/src/lib.rs index dd89ec0791..b6b9097e3a 100644 --- a/substrate/frame/treasury/src/lib.rs +++ b/substrate/frame/treasury/src/lib.rs @@ -187,6 +187,7 @@ pub mod pallet { type SpendFunds: SpendFunds; /// The maximum number of approvals that can wait in the spending queue. + #[pallet::constant] type MaxApprovals: Get; } diff --git a/substrate/frame/uniques/src/lib.rs b/substrate/frame/uniques/src/lib.rs index 70a9e58d7b..2275be6419 100644 --- a/substrate/frame/uniques/src/lib.rs +++ b/substrate/frame/uniques/src/lib.rs @@ -79,28 +79,36 @@ pub mod pallet { type ForceOrigin: EnsureOrigin; /// The basic amount of funds that must be reserved for an asset class. + #[pallet::constant] type ClassDeposit: Get>; /// The basic amount of funds that must be reserved for an asset instance. + #[pallet::constant] type InstanceDeposit: Get>; /// The basic amount of funds that must be reserved when adding metadata to your asset. + #[pallet::constant] type MetadataDepositBase: Get>; /// The basic amount of funds that must be reserved when adding an attribute to an asset. + #[pallet::constant] type AttributeDepositBase: Get>; /// The additional funds that must be reserved for the number of bytes store in metadata, /// either "normal" metadata or attribute metadata. + #[pallet::constant] type DepositPerByte: Get>; /// The maximum length of data stored on-chain. + #[pallet::constant] type StringLimit: Get; /// The maximum length of an attribute key. + #[pallet::constant] type KeyLimit: Get; /// The maximum length of an attribute value. + #[pallet::constant] type ValueLimit: Get; /// Weight information for extrinsics in this pallet.