diff --git a/bridges/snowbridge/parachain/pallets/inbound-queue/src/mock.rs b/bridges/snowbridge/parachain/pallets/inbound-queue/src/mock.rs index d75c3c6a186327bdd6a3d4a6b3c617f850c62789..110f611c6766020039bd1f73def900914da8cae2 100644 --- a/bridges/snowbridge/parachain/pallets/inbound-queue/src/mock.rs +++ b/bridges/snowbridge/parachain/pallets/inbound-queue/src/mock.rs @@ -88,7 +88,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/bridges/snowbridge/parachain/pallets/system/src/mock.rs b/bridges/snowbridge/parachain/pallets/system/src/mock.rs index bc22957813279e462fe63fb4c110d7df9fe91ce3..edc3f141b0735d7439b120c51da836fb8a77bd04 100644 --- a/bridges/snowbridge/parachain/pallets/system/src/mock.rs +++ b/bridges/snowbridge/parachain/pallets/system/src/mock.rs @@ -136,7 +136,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_xcm_origin::Config for Test { diff --git a/cumulus/pallets/collator-selection/src/mock.rs b/cumulus/pallets/collator-selection/src/mock.rs index ab9ad5ec11a21420c289f92803124b7106a48554..fe41e7318bcdafa025ec33a74c9651d664b03be2 100644 --- a/cumulus/pallets/collator-selection/src/mock.rs +++ b/cumulus/pallets/collator-selection/src/mock.rs @@ -95,7 +95,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/pallets/xcmp-queue/src/mock.rs b/cumulus/pallets/xcmp-queue/src/mock.rs index f8b89258f2f68e46e60b1c6c4635f239a2ab5edd..2bf1e3c6425a629909e950c72826f5c9385bf4f1 100644 --- a/cumulus/pallets/xcmp-queue/src/mock.rs +++ b/cumulus/pallets/xcmp-queue/src/mock.rs @@ -106,7 +106,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachain-template/runtime/src/lib.rs b/cumulus/parachain-template/runtime/src/lib.rs index 0ab36eba315ddf702145668b33ea3ece2a05e5a9..d9bc111fcef7f1932d4b52e3f0c9f42d0dccc6c0 100644 --- a/cumulus/parachain-template/runtime/src/lib.rs +++ b/cumulus/parachain-template/runtime/src/lib.rs @@ -337,7 +337,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/common/src/impls.rs b/cumulus/parachains/common/src/impls.rs index 69da325dd4fc541fca16eea3bbd29a710a8f54e4..957538b7cdadbd68ed298a5a867cd1a7754e083d 100644 --- a/cumulus/parachains/common/src/impls.rs +++ b/cumulus/parachains/common/src/impls.rs @@ -257,7 +257,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index b3d403fd33fd987de2d9fc99d32c3c0bbd4d73ac..d67595b10b4e21831ef05aad9fe4ac002b7a7ff8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -241,10 +241,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - // We allow each account to have holds on it from: - // - `NftFractionalization`: 1 - // - `StateTrieMigration`: 1 - type MaxHolds = ConstU32<2>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_balances.rs index 938e50aeebefbbb5622e2922dd71ae0f4100fef9..299a801ebd5964829271d6575a60a123f156b7e3 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 45_402_000 picoseconds. - Weight::from_parts(46_086_000, 0) + // Minimum execution time: 42_706_000 picoseconds. + Weight::from_parts(43_378_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 35_707_000 picoseconds. - Weight::from_parts(36_107_000, 0) + // Minimum execution time: 33_090_000 picoseconds. + Weight::from_parts(33_703_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 13_538_000 picoseconds. - Weight::from_parts(13_771_000, 0) + // Minimum execution time: 12_678_000 picoseconds. + Weight::from_parts(13_068_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 18_488_000 picoseconds. - Weight::from_parts(19_136_000, 0) + // Minimum execution time: 17_336_000 picoseconds. + Weight::from_parts(17_824_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 48_168_000 picoseconds. - Weight::from_parts(48_874_000, 0) + // Minimum execution time: 44_817_000 picoseconds. + Weight::from_parts(45_453_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 44_463_000 picoseconds. - Weight::from_parts(45_320_000, 0) + // Minimum execution time: 41_468_000 picoseconds. + Weight::from_parts(42_093_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_227_000 picoseconds. - Weight::from_parts(16_549_000, 0) + // Minimum execution time: 15_344_000 picoseconds. + Weight::from_parts(15_878_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 15_992_000 picoseconds. - Weight::from_parts(16_243_000, 0) + // Minimum execution time: 15_067_000 picoseconds. + Weight::from_parts(15_281_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 12_426 - .saturating_add(Weight::from_parts(13_617_673, 0).saturating_mul(u.into())) + // Standard Error: 11_009 + .saturating_add(Weight::from_parts(13_050_024, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_713_000 picoseconds. - Weight::from_parts(6_054_000, 0) + // Minimum execution time: 5_139_000 picoseconds. + Weight::from_parts(5_511_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index baeb360ce224eac8a5b54be1b083970197976ff5..6424cec675ddc5c2823bfe482407cd2051f71ee8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -199,9 +199,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - // We allow each account to have holds on it from: - // - `NftFractionalization`: 1 - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs index 08bfc62b7c304b3d948b5ba9459edce70e9fcd84..68aceca14c1589825e588e4a5491529120da01f5 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_658_000 picoseconds. - Weight::from_parts(43_649_000, 0) + // Minimum execution time: 43_122_000 picoseconds. + Weight::from_parts(43_640_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 33_810_000 picoseconds. - Weight::from_parts(34_322_000, 0) + // Minimum execution time: 33_636_000 picoseconds. + Weight::from_parts(34_571_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 11_825_000 picoseconds. - Weight::from_parts(12_258_000, 0) + // Minimum execution time: 12_101_000 picoseconds. + Weight::from_parts(12_511_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_540_000 picoseconds. - Weight::from_parts(17_058_000, 0) + // Minimum execution time: 17_077_000 picoseconds. + Weight::from_parts(17_362_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 45_138_000 picoseconds. - Weight::from_parts(45_481_000, 0) + // Minimum execution time: 44_352_000 picoseconds. + Weight::from_parts(45_045_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_147_000 picoseconds. - Weight::from_parts(43_120_000, 0) + // Minimum execution time: 41_836_000 picoseconds. + Weight::from_parts(43_201_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 14_730_000 picoseconds. - Weight::from_parts(14_867_000, 0) + // Minimum execution time: 14_413_000 picoseconds. + Weight::from_parts(14_743_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 14_425_000 picoseconds. - Weight::from_parts(14_590_000, 0) + // Minimum execution time: 14_542_000 picoseconds. + Weight::from_parts(14_731_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 12_643 - .saturating_add(Weight::from_parts(13_203_227, 0).saturating_mul(u.into())) + // Standard Error: 11_213 + .saturating_add(Weight::from_parts(13_160_721, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_397_000 picoseconds. - Weight::from_parts(5_689_000, 0) + // Minimum execution time: 5_208_000 picoseconds. + Weight::from_parts(5_619_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index e0204d1e75c94c6eb73e7b11564aaf31763d7267..94d5772861c1f16424ac5faeacd257d61650f7e7 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -307,7 +307,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs index c6969d92a75ee54fd9dc59319fb88236b3c7cd9f..861ccfc51fd8e9f7bf8a1367d4ab4ddf459891a0 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 43_019_000 picoseconds. - Weight::from_parts(43_897_000, 0) + // Minimum execution time: 41_696_000 picoseconds. + Weight::from_parts(42_201_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 33_615_000 picoseconds. - Weight::from_parts(34_331_000, 0) + // Minimum execution time: 32_855_000 picoseconds. + Weight::from_parts(33_554_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 12_917_000 picoseconds. - Weight::from_parts(13_310_000, 0) + // Minimum execution time: 12_977_000 picoseconds. + Weight::from_parts(13_473_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -91,7 +91,7 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Measured: `174` // Estimated: `3593` // Minimum execution time: 17_617_000 picoseconds. - Weight::from_parts(18_057_000, 0) + Weight::from_parts(18_234_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 44_458_000 picoseconds. - Weight::from_parts(45_097_000, 0) + // Minimum execution time: 43_174_000 picoseconds. + Weight::from_parts(43_685_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_431_000 picoseconds. - Weight::from_parts(42_910_000, 0) + // Minimum execution time: 41_125_000 picoseconds. + Weight::from_parts(41_636_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 15_726_000 picoseconds. - Weight::from_parts(16_245_000, 0) + // Minimum execution time: 15_749_000 picoseconds. + Weight::from_parts(16_163_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 13_929_000 picoseconds. - Weight::from_parts(14_306_000, 0) + // Minimum execution time: 14_238_000 picoseconds. + Weight::from_parts(14_469_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 10_984 - .saturating_add(Weight::from_parts(12_919_627, 0).saturating_mul(u.into())) + // Standard Error: 11_818 + .saturating_add(Weight::from_parts(12_621_051, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_132_000 picoseconds. - Weight::from_parts(5_467_000, 0) + // Minimum execution time: 4_904_000 picoseconds. + Weight::from_parts(5_459_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs index 792b5b63391f2bcce3ea6b287cd02287eb3174a1..5637c3552f58b9f4eea8195d77b8af71e979b9ae 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs @@ -279,7 +279,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_balances.rs index 46fa4f2a9178d062641afa08b606a9502596228b..3afef6564bdb8fec4e435948cf8cadb928bbf773 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-westend-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 43_103_000 picoseconds. - Weight::from_parts(43_576_000, 0) + // Minimum execution time: 42_912_000 picoseconds. + Weight::from_parts(43_690_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 33_412_000 picoseconds. - Weight::from_parts(33_984_000, 0) + // Minimum execution time: 33_823_000 picoseconds. + Weight::from_parts(34_415_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 13_412_000 picoseconds. - Weight::from_parts(13_907_000, 0) + // Minimum execution time: 13_226_000 picoseconds. + Weight::from_parts(13_557_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 18_143_000 picoseconds. - Weight::from_parts(18_756_000, 0) + // Minimum execution time: 18_055_000 picoseconds. + Weight::from_parts(18_407_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 43_676_000 picoseconds. - Weight::from_parts(44_575_000, 0) + // Minimum execution time: 44_442_000 picoseconds. + Weight::from_parts(45_101_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 41_403_000 picoseconds. - Weight::from_parts(42_162_000, 0) + // Minimum execution time: 42_485_000 picoseconds. + Weight::from_parts(43_157_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `174` // Estimated: `3593` - // Minimum execution time: 15_791_000 picoseconds. - Weight::from_parts(16_298_000, 0) + // Minimum execution time: 16_002_000 picoseconds. + Weight::from_parts(16_425_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 14_390_000 picoseconds. - Weight::from_parts(14_611_000, 0) + // Minimum execution time: 14_526_000 picoseconds. + Weight::from_parts(14_825_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 11_611 - .saturating_add(Weight::from_parts(12_871_155, 0).saturating_mul(u.into())) + // Standard Error: 10_967 + .saturating_add(Weight::from_parts(13_376_293, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_314_000 picoseconds. - Weight::from_parts(5_638_000, 0) + // Minimum execution time: 5_151_000 picoseconds. + Weight::from_parts(5_419_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs index 52a5e79de84334261f95bd9a27db352e774419ad..3f488d04ef0b5df8c3e703077c07a10aeceeb8b9 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs @@ -213,7 +213,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_balances.rs index ebfd948f6a2409c80b3deb744c8dd69e92773b15..602e7ca50c136c3c862bbf2f43fa452b9518116e 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-westend-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 44_910_000 picoseconds. - Weight::from_parts(45_866_000, 0) + // Minimum execution time: 45_085_000 picoseconds. + Weight::from_parts(45_772_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 35_331_000 picoseconds. - Weight::from_parts(36_168_000, 0) + // Minimum execution time: 35_447_000 picoseconds. + Weight::from_parts(36_143_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 12_540_000 picoseconds. - Weight::from_parts(12_942_000, 0) + // Minimum execution time: 12_314_000 picoseconds. + Weight::from_parts(12_679_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 17_385_000 picoseconds. - Weight::from_parts(17_926_000, 0) + // Minimum execution time: 17_455_000 picoseconds. + Weight::from_parts(17_902_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 47_232_000 picoseconds. - Weight::from_parts(47_740_000, 0) + // Minimum execution time: 46_785_000 picoseconds. + Weight::from_parts(47_436_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 44_311_000 picoseconds. - Weight::from_parts(45_264_000, 0) + // Minimum execution time: 43_948_000 picoseconds. + Weight::from_parts(44_680_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 15_430_000 picoseconds. - Weight::from_parts(15_654_000, 0) + // Minimum execution time: 15_267_000 picoseconds. + Weight::from_parts(15_499_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 14_919_000 picoseconds. - Weight::from_parts(15_212_000, 0) + // Minimum execution time: 14_817_000 picoseconds. + Weight::from_parts(15_287_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 17_333 - .saturating_add(Weight::from_parts(13_966_554, 0).saturating_mul(u.into())) + // Standard Error: 11_738 + .saturating_add(Weight::from_parts(13_511_800, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_438_000 picoseconds. - Weight::from_parts(5_736_000, 0) + // Minimum execution time: 5_382_000 picoseconds. + Weight::from_parts(5_768_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index eb428487b629669b4d408ada1d53266a52293b48..f3ef5e421fb0e50ea5314a47b0ede8802fa69942 100644 --- a/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -216,7 +216,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs index 5a5aaea7387d941c5cc218e12ed754d126741b52..66fc4b28cd23b50b2fb38250e96749251ed420fb 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs @@ -228,7 +228,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs index 0a0ace608d3de6a3cb3c12ab4c65342af3d860fc..aac7e10936615fddf39f9c306121dd9eda826ec6 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-rococo-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_729_000 picoseconds. - Weight::from_parts(43_214_000, 0) + // Minimum execution time: 41_557_000 picoseconds. + Weight::from_parts(42_618_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 33_717_000 picoseconds. - Weight::from_parts(34_160_000, 0) + // Minimum execution time: 33_046_000 picoseconds. + Weight::from_parts(33_550_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 11_581_000 picoseconds. - Weight::from_parts(11_822_000, 0) + // Minimum execution time: 11_804_000 picoseconds. + Weight::from_parts(12_007_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_235_000 picoseconds. - Weight::from_parts(16_797_000, 0) + // Minimum execution time: 16_261_000 picoseconds. + Weight::from_parts(16_655_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 43_581_000 picoseconds. - Weight::from_parts(44_465_000, 0) + // Minimum execution time: 42_967_000 picoseconds. + Weight::from_parts(43_870_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_289_000 picoseconds. - Weight::from_parts(42_861_000, 0) + // Minimum execution time: 41_022_000 picoseconds. + Weight::from_parts(41_475_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 14_583_000 picoseconds. - Weight::from_parts(15_088_000, 0) + // Minimum execution time: 14_339_000 picoseconds. + Weight::from_parts(14_641_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 14_263_000 picoseconds. - Weight::from_parts(14_431_000, 0) + // Minimum execution time: 14_241_000 picoseconds. + Weight::from_parts(14_463_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 11_589 - .saturating_add(Weight::from_parts(13_005_092, 0).saturating_mul(u.into())) + // Standard Error: 12_290 + .saturating_add(Weight::from_parts(12_903_900, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_091_000 picoseconds. - Weight::from_parts(5_272_000, 0) + // Minimum execution time: 5_116_000 picoseconds. + Weight::from_parts(5_345_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs index d0277fcbfaea4dbbf2d920912542d7489856cf24..e1db9158ce90907031a35814ca6dd380d2bc2c0c 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs @@ -219,7 +219,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_balances.rs index 589c5d0607d41a535796502ec595806a4ceb389e..2fc1495c804fcc2a692925af8f53ac57b84863cd 100644 --- a/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_balances.rs +++ b/cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_balances.rs @@ -16,10 +16,10 @@ //! Autogenerated weights for `pallet_balances` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-01-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-01-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `runner-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `runner-8idpd4bs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-westend-dev")`, DB CACHE: 1024 // Executed Command: @@ -54,8 +54,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 42_533_000 picoseconds. - Weight::from_parts(43_470_000, 0) + // Minimum execution time: 41_147_000 picoseconds. + Weight::from_parts(41_829_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -66,8 +66,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 33_442_000 picoseconds. - Weight::from_parts(34_851_000, 0) + // Minimum execution time: 32_566_000 picoseconds. + Weight::from_parts(33_012_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -78,8 +78,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 11_890_000 picoseconds. - Weight::from_parts(12_324_000, 0) + // Minimum execution time: 11_435_000 picoseconds. + Weight::from_parts(11_717_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 16_583_000 picoseconds. - Weight::from_parts(17_116_000, 0) + // Minimum execution time: 15_941_000 picoseconds. + Weight::from_parts(16_341_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `6196` - // Minimum execution time: 43_979_000 picoseconds. - Weight::from_parts(44_662_000, 0) + // Minimum execution time: 42_592_000 picoseconds. + Weight::from_parts(43_111_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `3593` - // Minimum execution time: 43_140_000 picoseconds. - Weight::from_parts(43_575_000, 0) + // Minimum execution time: 40_925_000 picoseconds. + Weight::from_parts(41_743_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -126,8 +126,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3593` - // Minimum execution time: 14_748_000 picoseconds. - Weight::from_parts(15_097_000, 0) + // Minimum execution time: 14_117_000 picoseconds. + Weight::from_parts(14_418_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -139,11 +139,11 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0 + u * (136 ±0)` // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 14_502_000 picoseconds. - Weight::from_parts(14_803_000, 0) + // Minimum execution time: 13_855_000 picoseconds. + Weight::from_parts(14_108_000, 0) .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 11_903 - .saturating_add(Weight::from_parts(13_484_935, 0).saturating_mul(u.into())) + // Standard Error: 11_673 + .saturating_add(Weight::from_parts(12_675_264, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) @@ -154,8 +154,8 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1501` - // Minimum execution time: 5_035_000 picoseconds. - Weight::from_parts(5_255_000, 0) + // Minimum execution time: 4_820_000 picoseconds. + Weight::from_parts(5_152_000, 0) .saturating_add(Weight::from_parts(0, 1501)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs index 37ab6af95686e12ba0c5a3bfd0b8f803cc1f5fb5..2074b81c2cc5ad7834b5dbe5daa5fa436760b23f 100644 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs @@ -210,7 +210,6 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs index 7a3977815050373a933579028c51d6ac2ee5f6a6..4f650fed3cda1a145bc4b9b9fe9288449bdabda1 100644 --- a/cumulus/parachains/runtimes/people/people-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/people/people-westend/src/lib.rs @@ -210,7 +210,6 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs index d33f51df5a9a6d3aa270f1e3003bb52455fd7f57..bf8dcbc24c8d51d61c70ea6a56fa8865ea32c893 100644 --- a/cumulus/parachains/runtimes/testing/penpal/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/penpal/src/lib.rs @@ -404,7 +404,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 253a492871b25d51803e2ab45935b3bb899fdb91..c43d79271de717cbe0273edfdc6a7ba10a96aa01 100644 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -259,7 +259,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/cumulus/test/runtime/src/lib.rs b/cumulus/test/runtime/src/lib.rs index 3de77cb1e58116838ff474d9b7b7e7d549675a66..6068f895c83bf6adba5e2d7fa68b3aa2b8821204 100644 --- a/cumulus/test/runtime/src/lib.rs +++ b/cumulus/test/runtime/src/lib.rs @@ -236,7 +236,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/runtime/common/src/assigned_slots/mod.rs b/polkadot/runtime/common/src/assigned_slots/mod.rs index 9976a7be548fec845738f3e3e6c773b062ded413..3419e3497f7d446f7bea02bf8134932c0a0cdbf6 100644 --- a/polkadot/runtime/common/src/assigned_slots/mod.rs +++ b/polkadot/runtime/common/src/assigned_slots/mod.rs @@ -724,7 +724,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/auctions.rs b/polkadot/runtime/common/src/auctions.rs index 0bd5ed1e733e04ea65c46a0c7d4e974a176483f2..46ab673a7a0cb9c685b486c89599c2d9dd324a0d 100644 --- a/polkadot/runtime/common/src/auctions.rs +++ b/polkadot/runtime/common/src/auctions.rs @@ -752,7 +752,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index 5b87cc9619ed988037afa4777c08e057940aca98..86550ea8b4ebf97054ce6713fffcdd0dd2cf628e 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -782,7 +782,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/crowdloan/mod.rs b/polkadot/runtime/common/src/crowdloan/mod.rs index b7dd06aee3a49f096608b881d207b1ffb83c1e65..7d1b892dfa7fc6c4057a7da8731e39a9a4b2d3e8 100644 --- a/polkadot/runtime/common/src/crowdloan/mod.rs +++ b/polkadot/runtime/common/src/crowdloan/mod.rs @@ -944,7 +944,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/impls.rs b/polkadot/runtime/common/src/impls.rs index 79ace0972adef57cda9a1b640040ba0a97365f64..1ddad37831b68582cfc14f882870922c67058f1d 100644 --- a/polkadot/runtime/common/src/impls.rs +++ b/polkadot/runtime/common/src/impls.rs @@ -304,7 +304,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/integration_tests.rs b/polkadot/runtime/common/src/integration_tests.rs index fe2f7d8365fcabf46ec99e2d76532a5b158f3c38..f551743b395cbdb3ffa1748b75c2a48d782a0d4a 100644 --- a/polkadot/runtime/common/src/integration_tests.rs +++ b/polkadot/runtime/common/src/integration_tests.rs @@ -189,7 +189,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index a41f338e79d22c2bee286063fa585cf9c777299c..c05c8a1ae00ba4e8a5a97095ad15a0a9a618cbbe 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -801,7 +801,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/purchase.rs b/polkadot/runtime/common/src/purchase.rs index 146a90fca866abab147e4da0a77c7e296773b10f..301f1f21fbce90d311c9b06ae376f2c99931ef27 100644 --- a/polkadot/runtime/common/src/purchase.rs +++ b/polkadot/runtime/common/src/purchase.rs @@ -556,7 +556,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/common/src/slots/mod.rs b/polkadot/runtime/common/src/slots/mod.rs index be02aa9961cc292b45e7c8fba522608fd3d05f6a..51bd0ba4debe6531da9cca604bb6aa069ad016f3 100644 --- a/polkadot/runtime/common/src/slots/mod.rs +++ b/polkadot/runtime/common/src/slots/mod.rs @@ -574,7 +574,6 @@ mod tests { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<1>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/parachains/src/mock.rs b/polkadot/runtime/parachains/src/mock.rs index e3fcf7dd603f3ca513536a22e6b07263132f8ff8..1925ca19501accce8148e23d5e34c8f6625097a2 100644 --- a/polkadot/runtime/parachains/src/mock.rs +++ b/polkadot/runtime/parachains/src/mock.rs @@ -147,7 +147,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 791ac947c58881e8124d17357bcd9e9d59b3afa5..79c848221fbfdf1490547179f46dc8b3d69a152d 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -311,10 +311,9 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; type WeightInfo = weights::pallet_balances_balances::WeightInfo<Runtime>; type FreezeIdentifier = (); - type MaxFreezes = ConstU32<1>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<3>; + type MaxFreezes = ConstU32<1>; } parameter_types! { @@ -1167,7 +1166,6 @@ impl pallet_balances::Config<NisCounterpartInstance> for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<3>; type MaxFreezes = ConstU32<1>; } diff --git a/polkadot/runtime/test-runtime/src/lib.rs b/polkadot/runtime/test-runtime/src/lib.rs index 51c199b7a054fd96e67f765fb7885de5bf7965d2..b74def5de8aadd718df48b27aff1a7ca324389c3 100644 --- a/polkadot/runtime/test-runtime/src/lib.rs +++ b/polkadot/runtime/test-runtime/src/lib.rs @@ -221,7 +221,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 6d8ba63f2699138ae569815436c30be67d55525a..cd9e57a9bdf2dbc7e3afda7209d33b875222d966 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -304,7 +304,6 @@ impl pallet_balances::Config for Runtime { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; - type MaxHolds = ConstU32<1>; } parameter_types! { diff --git a/polkadot/xcm/pallet-xcm/src/mock.rs b/polkadot/xcm/pallet-xcm/src/mock.rs index ec03a8b8668cf1e93becfc307d3b5d2b89f7a54f..434dac1659b50085f4e4f863e77c0cbe1b38af68 100644 --- a/polkadot/xcm/pallet-xcm/src/mock.rs +++ b/polkadot/xcm/pallet-xcm/src/mock.rs @@ -289,7 +289,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs index 91e36b2de4b9d1ca4077326822fbb09b6e6a6b0e..9892c500f2eebb7cd4a3cfd88f86c6669cca4111 100644 --- a/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs +++ b/polkadot/xcm/xcm-builder/src/tests/pay/mock.rs @@ -77,7 +77,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-builder/tests/mock/mod.rs b/polkadot/xcm/xcm-builder/tests/mock/mod.rs index 7e08cb779a4a1ac548d0cfb0f538bb31800b36f7..34508d7622c5f8a3e703cefa833ea6dafd900e56 100644 --- a/polkadot/xcm/xcm-builder/tests/mock/mod.rs +++ b/polkadot/xcm/xcm-builder/tests/mock/mod.rs @@ -124,7 +124,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-simulator/example/src/parachain.rs b/polkadot/xcm/xcm-simulator/example/src/parachain.rs index 9c9f481242f54f06c69c633478fa9237eb137e3b..64333b4d5815018381f86eca10199c0d90feb6e1 100644 --- a/polkadot/xcm/xcm-simulator/example/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/parachain.rs @@ -109,7 +109,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs index d96b39aca63132b98aed0715e66239eef6c1d704..54c5657c00d7f6c38ade3aadaf38056504abcc76 100644 --- a/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/example/src/relay_chain.rs @@ -95,7 +95,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs index 36db24b35a6e88ed186e5c222fd28fb4ae1a3f2e..d8327c9b401d0ba67ec6cccb12e16ea70ee1ba3e 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/parachain.rs @@ -100,7 +100,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs index 7879d781bd3e2b105cb3c362a9e8d837909540c3..7e42f558dd6e89cbac2e5f378e16d75fd07ffa78 100644 --- a/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs +++ b/polkadot/xcm/xcm-simulator/fuzzer/src/relay_chain.rs @@ -96,7 +96,6 @@ impl pallet_balances::Config for Runtime { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/prdoc/pr_2657.prdoc b/prdoc/pr_2657.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..9c5edf4ceee633c00583248fe380aa5f66a59358 --- /dev/null +++ b/prdoc/pr_2657.prdoc @@ -0,0 +1,21 @@ +# 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: "[frame] `#[pallet::composite_enum]` improved variant count handling + removed `pallet_balances`'s `MaxHolds` config" + +doc: + - audience: Runtime Dev + description: | + The implementation of the `VariantCount` trait for aggregate composite enums, + such as `RuntimeHoldReason` and `RuntimeFreezeReason`, has been fixed. + It is now calculated as the sum of `VariantCount::VARIANT_COUNT` for all corresponding `#[pallet::composite_enum]`. + The `Balances` pallet's `Config` item `type MaxHolds` has been removed, + and `type Holds` is now bound to the variant count of the composite enum `RuntimeHoldReason`. + Consequently, the runtime does not need to consider setting the correct value for `MaxHolds`. + + notes: + - Remove `type MaxHolds` from the `impl pallet_balances::Config for Runtime` in the runtime. + - When holds are expected to be used, ensure that `type RuntimeHoldReason = RuntimeHoldReason` is set for `impl pallet_balances::Config for Runtime`. + +crates: + - name: pallet-balances diff --git a/substrate/bin/node-template/runtime/src/lib.rs b/substrate/bin/node-template/runtime/src/lib.rs index bafd37384285911332b654edf417c57f82676181..3b6a74be2512c6214b2fadada68bb22d746f07a9 100644 --- a/substrate/bin/node-template/runtime/src/lib.rs +++ b/substrate/bin/node-template/runtime/src/lib.rs @@ -228,7 +228,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index d0a327fd9502265cbb60aa301ea765aade8c552b..c2472e906de6ac290d2f6cd5e902546ebb35eea8 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -533,7 +533,6 @@ impl pallet_balances::Config for Runtime { type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>; type FreezeIdentifier = RuntimeFreezeReason; type MaxFreezes = ConstU32<1>; - type MaxHolds = ConstU32<7>; } parameter_types! { diff --git a/substrate/frame/alliance/src/mock.rs b/substrate/frame/alliance/src/mock.rs index 69c74d0b2874c7f368e3b7416b14b236a5d17e03..627dde81afa84926b719803466fd5c5e14d9bc47 100644 --- a/substrate/frame/alliance/src/mock.rs +++ b/substrate/frame/alliance/src/mock.rs @@ -72,7 +72,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } const MOTION_DURATION_IN_BLOCKS: BlockNumber = 3; diff --git a/substrate/frame/asset-conversion/src/mock.rs b/substrate/frame/asset-conversion/src/mock.rs index 12c8fe2eb42cb4ae0a67dddce9bab40a1b121ebb..dd1d26ff238deeac52d2c8089706bbc688586f14 100644 --- a/substrate/frame/asset-conversion/src/mock.rs +++ b/substrate/frame/asset-conversion/src/mock.rs @@ -95,7 +95,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_assets::Config<Instance1> for Test { diff --git a/substrate/frame/asset-rate/src/mock.rs b/substrate/frame/asset-rate/src/mock.rs index 041f37409528059a2e6b47549b2f263818eaaa87..d6044e09ccd1c821b43bd54708f89cb5fd1e1ac9 100644 --- a/substrate/frame/asset-rate/src/mock.rs +++ b/substrate/frame/asset-rate/src/mock.rs @@ -79,7 +79,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); } diff --git a/substrate/frame/assets/src/mock.rs b/substrate/frame/assets/src/mock.rs index d60f535833673b3a765f1311a01b08d5c40e4df6..6dda08eaff8bb781fb7f29fc514f1672784de372 100644 --- a/substrate/frame/assets/src/mock.rs +++ b/substrate/frame/assets/src/mock.rs @@ -86,7 +86,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = (); type RuntimeFreezeReason = (); type FreezeIdentifier = (); - type MaxHolds = (); type MaxFreezes = (); } diff --git a/substrate/frame/atomic-swap/src/tests.rs b/substrate/frame/atomic-swap/src/tests.rs index 58502aa4f93c2468b0c89e59f5ccd73bcd7dbe67..4a4b96f7aae05a874bc662848135fad1380e49c3 100644 --- a/substrate/frame/atomic-swap/src/tests.rs +++ b/substrate/frame/atomic-swap/src/tests.rs @@ -82,7 +82,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl Config for Test { diff --git a/substrate/frame/babe/src/mock.rs b/substrate/frame/babe/src/mock.rs index 72abbc805db1a742b08aa3feb9b8f9b0b513600e..b693f4fce9bde662c8badee8f0e675648597ea58 100644 --- a/substrate/frame/babe/src/mock.rs +++ b/substrate/frame/babe/src/mock.rs @@ -126,7 +126,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pallet_staking_reward_curve::build! { diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index 39df8b153eb9b465d300d2bf8557169673551b54..7dd087eabd6343df653905856c078d3f6f2a3908 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -206,7 +206,7 @@ pub mod pallet { use super::*; use frame_support::{ pallet_prelude::*, - traits::{fungible::Credit, tokens::Precision, VariantCount}, + traits::{fungible::Credit, tokens::Precision, VariantCount, VariantCountOf}, }; use frame_system::pallet_prelude::*; @@ -242,7 +242,6 @@ pub mod pallet { type MaxLocks = ConstU32<100>; type MaxReserves = ConstU32<100>; type MaxFreezes = ConstU32<100>; - type MaxHolds = ConstU32<100>; type WeightInfo = (); } @@ -316,10 +315,6 @@ pub mod pallet { #[pallet::constant] type MaxReserves: Get<u32>; - /// The maximum number of holds that can exist on an account at any time. - #[pallet::constant] - type MaxHolds: Get<u32>; - /// The maximum number of individual freeze locks that can exist on an account at any time. #[pallet::constant] type MaxFreezes: Get<u32>; @@ -407,7 +402,7 @@ pub mod pallet { DeadAccount, /// Number of named reserves exceed `MaxReserves`. TooManyReserves, - /// Number of holds exceed `MaxHolds`. + /// Number of holds exceed `VariantCountOf<T::RuntimeHoldReason>`. TooManyHolds, /// Number of freezes exceed `MaxFreezes`. TooManyFreezes, @@ -487,7 +482,10 @@ pub mod pallet { _, Blake2_128Concat, T::AccountId, - BoundedVec<IdAmount<T::RuntimeHoldReason, T::Balance>, T::MaxHolds>, + BoundedVec< + IdAmount<T::RuntimeHoldReason, T::Balance>, + VariantCountOf<T::RuntimeHoldReason>, + >, ValueQuery, >; @@ -556,13 +554,6 @@ pub mod pallet { "The existential deposit must be greater than zero!" ); - assert!( - T::MaxHolds::get() >= <T::RuntimeHoldReason as VariantCount>::VARIANT_COUNT, - "MaxHolds should be greater than or equal to the number of hold reasons: {} < {}", - T::MaxHolds::get(), - <T::RuntimeHoldReason as VariantCount>::VARIANT_COUNT - ); - assert!( T::MaxFreezes::get() >= <T::RuntimeFreezeReason as VariantCount>::VARIANT_COUNT, "MaxFreezes should be greater than or equal to the number of freeze reasons: {} < {}", diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index 5ab766fffe74b92f2b7f99ed6a0e8138d965e0fd..91452b292b56f90083c0f82aa3a1b361fb3d7baf 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -142,7 +142,6 @@ impl Config for Test { type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = TestId; type MaxFreezes = ConstU32<2>; - type MaxHolds = ConstU32<3>; } #[derive(Clone)] diff --git a/substrate/frame/beefy/src/mock.rs b/substrate/frame/beefy/src/mock.rs index 8828fa3621853a8f3b5a2b0828fc386859ac45fc..9cce479890a48f7753be76b809f13abc1baa045d 100644 --- a/substrate/frame/beefy/src/mock.rs +++ b/substrate/frame/beefy/src/mock.rs @@ -133,7 +133,6 @@ impl pallet_balances::Config for Test { type WeightInfo = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); type FreezeIdentifier = (); type MaxFreezes = (); } diff --git a/substrate/frame/bounties/src/tests.rs b/substrate/frame/bounties/src/tests.rs index a7177393a44f1eb3eab41fa96afbb8b73f51239c..b0e3c085e65df02413f121fc4c819c823822cfab 100644 --- a/substrate/frame/bounties/src/tests.rs +++ b/substrate/frame/bounties/src/tests.rs @@ -100,7 +100,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/substrate/frame/child-bounties/src/tests.rs b/substrate/frame/child-bounties/src/tests.rs index e57721adad0ca9e10f5936f74533ffc4ff575b8a..d663b8d9961de87d14a202b393a9a4259f5bcdba 100644 --- a/substrate/frame/child-bounties/src/tests.rs +++ b/substrate/frame/child-bounties/src/tests.rs @@ -103,7 +103,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/substrate/frame/contracts/mock-network/src/parachain.rs b/substrate/frame/contracts/mock-network/src/parachain.rs index 03fcef1a56c3144ae641613ccfe31ac905760e01..53839f1fca037e370a598efa490cd2f226ac5b10 100644 --- a/substrate/frame/contracts/mock-network/src/parachain.rs +++ b/substrate/frame/contracts/mock-network/src/parachain.rs @@ -95,7 +95,6 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type FreezeIdentifier = (); type MaxFreezes = ConstU32<0>; - type MaxHolds = ConstU32<1>; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; diff --git a/substrate/frame/contracts/mock-network/src/relay_chain.rs b/substrate/frame/contracts/mock-network/src/relay_chain.rs index 8bb33ff5de8ecf6078bc8f495923a59c3af03cd5..ce7e22dce2f0ccba24a6860408b0fc0c112eb3b9 100644 --- a/substrate/frame/contracts/mock-network/src/relay_chain.rs +++ b/substrate/frame/contracts/mock-network/src/relay_chain.rs @@ -93,7 +93,6 @@ impl pallet_balances::Config for Runtime { type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; diff --git a/substrate/frame/contracts/src/tests.rs b/substrate/frame/contracts/src/tests.rs index 815395910190cd6900c6ab626884506b8662156d..5711d3ccc83a527fae49f4ea6397a5a4b5fe54a9 100644 --- a/substrate/frame/contracts/src/tests.rs +++ b/substrate/frame/contracts/src/tests.rs @@ -373,7 +373,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/conviction-voting/src/tests.rs b/substrate/frame/conviction-voting/src/tests.rs index d7bac505a542066cba3fd51fa63b00b8aba67878..b67290e7fec59d5fcac665a578fec10f7586b4f1 100644 --- a/substrate/frame/conviction-voting/src/tests.rs +++ b/substrate/frame/conviction-voting/src/tests.rs @@ -92,7 +92,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } #[derive(Clone, PartialEq, Eq, Debug)] diff --git a/substrate/frame/democracy/src/tests.rs b/substrate/frame/democracy/src/tests.rs index 888d7e596146fbc100042c4447afe0576de4b6b2..8136fa5c4c97fedd7915ad77fb92e44bd68bb58e 100644 --- a/substrate/frame/democracy/src/tests.rs +++ b/substrate/frame/democracy/src/tests.rs @@ -143,7 +143,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { pub static PreimageByteDeposit: u64 = 0; diff --git a/substrate/frame/election-provider-multi-phase/src/mock.rs b/substrate/frame/election-provider-multi-phase/src/mock.rs index 507e8f2c39bd911d1979215dc2d966db86dd454b..18dcd7061c1fc35c7cc64134c33363b746e9baf8 100644 --- a/substrate/frame/election-provider-multi-phase/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/src/mock.rs @@ -259,7 +259,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } #[derive(Default, Eq, PartialEq, Debug, Clone, Copy)] diff --git a/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs b/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs index 04d218acf8fd14ec82b9e299999273223cae2964..32633a0ed7d348f5ba0b83d047a33106e8b7cb93 100644 --- a/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs +++ b/substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs @@ -111,7 +111,6 @@ impl pallet_balances::Config for Runtime { type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type MaxHolds = ConstU32<1>; type MaxFreezes = traits::ConstU32<1>; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 2b599ab5292bb07de37d42566e70a8c209d9cfae..5d20a3cfcee2e72ace6b70adaee85e0ed1cdd7bf 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -1362,7 +1362,6 @@ mod tests { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } frame_support::parameter_types! { diff --git a/substrate/frame/examples/basic/src/tests.rs b/substrate/frame/examples/basic/src/tests.rs index 2a6fbf0f054ca1ce3b6b0afc5bf72af5ddda1ee8..9434ace35ffe35467a9c513d67f0450e5b6ade6e 100644 --- a/substrate/frame/examples/basic/src/tests.rs +++ b/substrate/frame/examples/basic/src/tests.rs @@ -86,7 +86,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl Config for Test { diff --git a/substrate/frame/examples/dev-mode/src/tests.rs b/substrate/frame/examples/dev-mode/src/tests.rs index c1501a5b4cf7682d39eaa9bfb497404d211deb1f..c13152533fdbb9bbbcf624ae9ed2c8fa9617242d 100644 --- a/substrate/frame/examples/dev-mode/src/tests.rs +++ b/substrate/frame/examples/dev-mode/src/tests.rs @@ -80,7 +80,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = (); } impl Config for Test { diff --git a/substrate/frame/examples/kitchensink/src/tests.rs b/substrate/frame/examples/kitchensink/src/tests.rs index 3b88f68d1c39cb6420c652cda838acc79a7a8710..7f62671893087119a4aff817689f54e5066d7384 100644 --- a/substrate/frame/examples/kitchensink/src/tests.rs +++ b/substrate/frame/examples/kitchensink/src/tests.rs @@ -57,7 +57,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/executive/src/lib.rs b/substrate/frame/executive/src/lib.rs index cfeb585b0fdcb152379022fabd6a7a974e00b37f..48ff675f8082ddd0e7779c946b32dde66b171078 100644 --- a/substrate/frame/executive/src/lib.rs +++ b/substrate/frame/executive/src/lib.rs @@ -959,7 +959,6 @@ mod tests { type MaxFreezes = ConstU32<1>; type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = ConstU32<1>; } parameter_types! { diff --git a/substrate/frame/fast-unstake/src/mock.rs b/substrate/frame/fast-unstake/src/mock.rs index de1772264f16226f6ce1b2da7eeaa42c1fa8598a..78d881965a5531dea8a56a2f94015cf39afa2d90 100644 --- a/substrate/frame/fast-unstake/src/mock.rs +++ b/substrate/frame/fast-unstake/src/mock.rs @@ -77,7 +77,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pallet_staking_reward_curve::build! { diff --git a/substrate/frame/grandpa/src/mock.rs b/substrate/frame/grandpa/src/mock.rs index f1f51e0b118163ec1eee16fb951260306832e6da..990a820d3a94addac60a0d47699064df6470d812 100644 --- a/substrate/frame/grandpa/src/mock.rs +++ b/substrate/frame/grandpa/src/mock.rs @@ -143,7 +143,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/identity/src/tests.rs b/substrate/frame/identity/src/tests.rs index a2b26120254af03d26969c028ef3c700f66660d5..5c9304ca8c13d9eac1ed1f6e8a90d8ba0b5493f1 100644 --- a/substrate/frame/identity/src/tests.rs +++ b/substrate/frame/identity/src/tests.rs @@ -94,7 +94,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/indices/src/mock.rs b/substrate/frame/indices/src/mock.rs index 7ea524a31670a9d553a5adf5371a1ffcd8a2c6a5..5cf82305178d419d0542d283db914eb8dc481aa7 100644 --- a/substrate/frame/indices/src/mock.rs +++ b/substrate/frame/indices/src/mock.rs @@ -79,7 +79,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl Config for Test { diff --git a/substrate/frame/lottery/src/mock.rs b/substrate/frame/lottery/src/mock.rs index 884f003aadafe7ceb35edb8394674380643523c4..0b73bba61355a283785ec95ecfa744174f279af0 100644 --- a/substrate/frame/lottery/src/mock.rs +++ b/substrate/frame/lottery/src/mock.rs @@ -88,7 +88,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/nft-fractionalization/src/mock.rs b/substrate/frame/nft-fractionalization/src/mock.rs index 855109adcbee08d5e7cfc6897370be85582c73e9..40cce96d55073cd70f5368e575e12f3635bcdb24 100644 --- a/substrate/frame/nft-fractionalization/src/mock.rs +++ b/substrate/frame/nft-fractionalization/src/mock.rs @@ -89,7 +89,6 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; type FreezeIdentifier = (); type MaxFreezes = (); } diff --git a/substrate/frame/nfts/src/mock.rs b/substrate/frame/nfts/src/mock.rs index 95443cf41c4e556e15054c6532b8cffba0f2772a..ac6d0d757325d25981910354b58374a24838f3f5 100644 --- a/substrate/frame/nfts/src/mock.rs +++ b/substrate/frame/nfts/src/mock.rs @@ -87,7 +87,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/nis/src/mock.rs b/substrate/frame/nis/src/mock.rs index be6e79ac6f663c89a80cee89556a51093791741c..98b653635caf23b0225df697b8c7629f49447623 100644 --- a/substrate/frame/nis/src/mock.rs +++ b/substrate/frame/nis/src/mock.rs @@ -91,7 +91,6 @@ impl pallet_balances::Config<Instance1> for Test { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; } impl pallet_balances::Config<Instance2> for Test { @@ -112,7 +111,6 @@ impl pallet_balances::Config<Instance2> for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/nomination-pools/benchmarking/src/mock.rs b/substrate/frame/nomination-pools/benchmarking/src/mock.rs index 77124ae388811adc157f612259dc9144c0c19cc9..4e57c00849f2d54a140deb36d7b60109aa59e9c9 100644 --- a/substrate/frame/nomination-pools/benchmarking/src/mock.rs +++ b/substrate/frame/nomination-pools/benchmarking/src/mock.rs @@ -79,7 +79,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<1>; type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pallet_staking_reward_curve::build! { diff --git a/substrate/frame/nomination-pools/src/mock.rs b/substrate/frame/nomination-pools/src/mock.rs index cd91fbb33c1dc5d58aa4e5d92ae8467addd08812..84c41a15b201052cd03b3c67fff4cb0c8980a92f 100644 --- a/substrate/frame/nomination-pools/src/mock.rs +++ b/substrate/frame/nomination-pools/src/mock.rs @@ -254,7 +254,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<1>; type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pub struct BalanceToU256; diff --git a/substrate/frame/nomination-pools/test-staking/src/mock.rs b/substrate/frame/nomination-pools/test-staking/src/mock.rs index cbd7a4d07589af2a68e755caca1be1c588fb28fa..d1b50b9f7aed0573b8351ff34d4f68eecf66c02c 100644 --- a/substrate/frame/nomination-pools/test-staking/src/mock.rs +++ b/substrate/frame/nomination-pools/test-staking/src/mock.rs @@ -90,7 +90,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = ConstU32<1>; type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pallet_staking_reward_curve::build! { diff --git a/substrate/frame/offences/benchmarking/src/mock.rs b/substrate/frame/offences/benchmarking/src/mock.rs index 38c6fb6ea5f6e948dae40c86c83902e460f698d6..01ad8d64f100672dc36929d28af22e41f8a88c60 100644 --- a/substrate/frame/offences/benchmarking/src/mock.rs +++ b/substrate/frame/offences/benchmarking/src/mock.rs @@ -81,7 +81,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/preimage/src/mock.rs b/substrate/frame/preimage/src/mock.rs index 357f088f5ba24ab0f65b720de1887d1bd1a17718..60ffecbb448059a375b0778dbfd3d38a3f88c846 100644 --- a/substrate/frame/preimage/src/mock.rs +++ b/substrate/frame/preimage/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate as pallet_preimage; use frame_support::{ - derive_impl, ord_parameter_types, + derive_impl, ord_parameter_types, parameter_types, traits::{fungible::HoldConsideration, ConstU32, ConstU64, Everything}, weights::constants::RocksDbWeight, }; @@ -82,15 +82,18 @@ impl pallet_balances::Config for Test { type ReserveIdentifier = [u8; 8]; type FreezeIdentifier = (); type MaxFreezes = ConstU32<1>; - type RuntimeHoldReason = (); + type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = (); - type MaxHolds = ConstU32<2>; } ord_parameter_types! { pub const One: u64 = 1; } +parameter_types! { + pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); +} + pub struct ConvertDeposit; impl Convert<Footprint, u64> for ConvertDeposit { fn convert(a: Footprint) -> u64 { @@ -103,7 +106,7 @@ impl Config for Test { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureSignedBy<One, u64>; - type Consideration = HoldConsideration<u64, Balances, (), ConvertDeposit>; + type Consideration = HoldConsideration<u64, Balances, PreimageHoldReason, ConvertDeposit>; } pub fn new_test_ext() -> sp_io::TestExternalities { diff --git a/substrate/frame/preimage/src/tests.rs b/substrate/frame/preimage/src/tests.rs index 7609ec83e9039a66ce22b1fbcd4c49a591c86187..69f6d172ae83acafc0881a055fcc767bec810470 100644 --- a/substrate/frame/preimage/src/tests.rs +++ b/substrate/frame/preimage/src/tests.rs @@ -58,7 +58,7 @@ pub fn make_bounded_values() -> ( fn user_note_preimage_works() { new_test_ext().execute_with(|| { assert_ok!(Preimage::note_preimage(RuntimeOrigin::signed(2), vec![1])); - assert_eq!(Balances::balance_on_hold(&(), &2), 3); + assert_eq!(Balances::balance_on_hold(&PreimageHoldReason::get(), &2), 3); assert_eq!(Balances::free_balance(2), 97); let h = hashed([1]); @@ -255,14 +255,14 @@ fn unrequest_preimage_works() { fn user_noted_then_requested_preimage_is_refunded_once_only() { new_test_ext().execute_with(|| { assert_ok!(Preimage::note_preimage(RuntimeOrigin::signed(2), vec![1; 3])); - assert_eq!(Balances::balance_on_hold(&(), &2), 5); + assert_eq!(Balances::balance_on_hold(&PreimageHoldReason::get(), &2), 5); assert_ok!(Preimage::note_preimage(RuntimeOrigin::signed(2), vec![1])); - assert_eq!(Balances::balance_on_hold(&(), &2), 8); + assert_eq!(Balances::balance_on_hold(&PreimageHoldReason::get(), &2), 8); assert_ok!(Preimage::request_preimage(RuntimeOrigin::signed(1), hashed([1]))); assert_ok!(Preimage::unrequest_preimage(RuntimeOrigin::signed(1), hashed([1]))); assert_ok!(Preimage::unnote_preimage(RuntimeOrigin::signed(2), hashed([1]))); // Still have hold from `vec[1; 3]`. - assert_eq!(Balances::balance_on_hold(&(), &2), 5); + assert_eq!(Balances::balance_on_hold(&PreimageHoldReason::get(), &2), 5); }); } diff --git a/substrate/frame/recovery/src/mock.rs b/substrate/frame/recovery/src/mock.rs index 9adb2b80931a81794923d88baf82bcd63d9b3d6d..ba7958f7dd460af9c6d7f3831c73d41f363268a2 100644 --- a/substrate/frame/recovery/src/mock.rs +++ b/substrate/frame/recovery/src/mock.rs @@ -86,7 +86,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/referenda/src/mock.rs b/substrate/frame/referenda/src/mock.rs index b75558723e9bd36a366c980565faa35ef62ca67e..d9f9042fefc9fd9104feea2637224ad496b04590 100644 --- a/substrate/frame/referenda/src/mock.rs +++ b/substrate/frame/referenda/src/mock.rs @@ -118,7 +118,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { pub static AlarmInterval: u64 = 1; diff --git a/substrate/frame/root-offences/src/mock.rs b/substrate/frame/root-offences/src/mock.rs index 583ba5b92fb0f46895b8e55df4fb0c6d7484087a..b0f346032b95e79fafa189c04fb612a8f7728fa6 100644 --- a/substrate/frame/root-offences/src/mock.rs +++ b/substrate/frame/root-offences/src/mock.rs @@ -125,7 +125,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } pallet_staking_reward_curve::build! { diff --git a/substrate/frame/safe-mode/src/mock.rs b/substrate/frame/safe-mode/src/mock.rs index 7574d64d59ddba40cee17993ad9edb00f66d08d0..b4d7a624ea21751fe0dc88d7059ccecc130036b4 100644 --- a/substrate/frame/safe-mode/src/mock.rs +++ b/substrate/frame/safe-mode/src/mock.rs @@ -82,7 +82,6 @@ impl pallet_balances::Config for Test { type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; type FreezeIdentifier = (); - type MaxHolds = ConstU32<10>; type MaxFreezes = ConstU32<0>; } diff --git a/substrate/frame/scored-pool/src/mock.rs b/substrate/frame/scored-pool/src/mock.rs index 00818f4aad066590b23239b49d9c97d939803c17..e767b49b983a33635ccae9086bc23fd9595f1231 100644 --- a/substrate/frame/scored-pool/src/mock.rs +++ b/substrate/frame/scored-pool/src/mock.rs @@ -92,7 +92,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { diff --git a/substrate/frame/session/benchmarking/src/mock.rs b/substrate/frame/session/benchmarking/src/mock.rs index c305641e185c61ce68c8fff94f10c5fdded6e58e..2ef8989f4b057da5baa34c5b6ec606fd0575861a 100644 --- a/substrate/frame/session/benchmarking/src/mock.rs +++ b/substrate/frame/session/benchmarking/src/mock.rs @@ -86,7 +86,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_timestamp::Config for Test { diff --git a/substrate/frame/staking/src/mock.rs b/substrate/frame/staking/src/mock.rs index 73b6f8ccf27f67e8382a55da2cf58b4b02c0e4a0..40a5be51dedf232c9a89583081f15d31f7ce159e 100644 --- a/substrate/frame/staking/src/mock.rs +++ b/substrate/frame/staking/src/mock.rs @@ -165,7 +165,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } sp_runtime::impl_opaque_keys! { diff --git a/substrate/frame/statement/src/mock.rs b/substrate/frame/statement/src/mock.rs index 192baa1f218602bec663174e965b75c5f4995d92..c5bee2639dcd704acdbec7e6dd6bae1c922e67d2 100644 --- a/substrate/frame/statement/src/mock.rs +++ b/substrate/frame/statement/src/mock.rs @@ -88,7 +88,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = (); } ord_parameter_types! { diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/composite_helper.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/composite_helper.rs index 3c81d2360cb7bec33b7da67de08bc24a34d5ea34..c9ae94c7dcd7bad9c6cd8068f83ad879b10bcbca 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/composite_helper.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/composite_helper.rs @@ -68,3 +68,34 @@ pub(crate) fn expand_variant( } } } + +pub(crate) fn expand_variant_count( + composite_name: &str, + path: &PalletPath, + instance: Option<&Ident>, +) -> TokenStream { + let composite_name = quote::format_ident!("{}", composite_name); + + if let Some(inst) = instance { + quote! { + #path::#composite_name::<#path::#inst>::VARIANT_COUNT + } + } else { + // Wrapped `<`..`>` means: use default type parameter for enum. + // + // This is used for pallets without instance support or pallets with instance support when + // we don't specify instance: + // + // ```nocompile + // pub struct Pallet<T, I = ()>{..} + // + // #[pallet::composite_enum] + // pub enum HoldReason<I: 'static = ()> {..} + // + // Pallet1: pallet_x, // <- default type parameter + // ``` + quote! { + <#path::#composite_name>::VARIANT_COUNT + } + } +} diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs index 55696cc6c6e3c30ef162a05b12992951a652fa2c..f12f995266422e2a6337114d09e193d267885b24 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/freeze_reason.rs @@ -23,6 +23,7 @@ use quote::quote; pub fn expand_outer_freeze_reason(pallet_decls: &[Pallet], scrate: &TokenStream) -> TokenStream { let mut conversion_fns = Vec::new(); let mut freeze_reason_variants = Vec::new(); + let mut freeze_reason_variants_count = Vec::new(); for decl in pallet_decls { if let Some(_) = decl.find_part("FreezeReason") { let variant_name = &decl.name; @@ -44,9 +45,14 @@ pub fn expand_outer_freeze_reason(pallet_decls: &[Pallet], scrate: &TokenStream) instance, variant_name, )); + + freeze_reason_variants_count.push(composite_helper::expand_variant_count( + "FreezeReason", + path, + instance, + )); } } - let freeze_reason_variants_count = freeze_reason_variants.len() as u32; quote! { /// A reason for placing a freeze on funds. @@ -61,7 +67,7 @@ pub fn expand_outer_freeze_reason(pallet_decls: &[Pallet], scrate: &TokenStream) } impl #scrate::traits::VariantCount for RuntimeFreezeReason { - const VARIANT_COUNT: u32 = #freeze_reason_variants_count; + const VARIANT_COUNT: u32 = 0 #( + #freeze_reason_variants_count )*; } #( #conversion_fns )* diff --git a/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs b/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs index 3856c4a2bb945b6b80a102e4bba5de9300836c43..cdab92712fddcadbaee67c48119c7bf8c527e6cc 100644 --- a/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs +++ b/substrate/frame/support/procedural/src/construct_runtime/expand/hold_reason.rs @@ -23,6 +23,7 @@ use quote::quote; pub fn expand_outer_hold_reason(pallet_decls: &[Pallet], scrate: &TokenStream) -> TokenStream { let mut conversion_fns = Vec::new(); let mut hold_reason_variants = Vec::new(); + let mut hold_reason_variants_count = Vec::new(); for decl in pallet_decls { if let Some(_) = decl.find_part("HoldReason") { let variant_name = &decl.name; @@ -44,9 +45,14 @@ pub fn expand_outer_hold_reason(pallet_decls: &[Pallet], scrate: &TokenStream) - instance, variant_name, )); + + hold_reason_variants_count.push(composite_helper::expand_variant_count( + "HoldReason", + path, + instance, + )); } } - let hold_reason_variants_count = hold_reason_variants.len() as u32; quote! { /// A reason for placing a hold on funds. @@ -61,7 +67,7 @@ pub fn expand_outer_hold_reason(pallet_decls: &[Pallet], scrate: &TokenStream) - } impl #scrate::traits::VariantCount for RuntimeHoldReason { - const VARIANT_COUNT: u32 = #hold_reason_variants_count; + const VARIANT_COUNT: u32 = 0 #( + #hold_reason_variants_count )*; } #( #conversion_fns )* diff --git a/substrate/frame/support/procedural/src/lib.rs b/substrate/frame/support/procedural/src/lib.rs index 1c4d03448c47709244168c1c8d127d0032be06f9..a777a576648108f90929add1f26627c038758da4 100644 --- a/substrate/frame/support/procedural/src/lib.rs +++ b/substrate/frame/support/procedural/src/lib.rs @@ -432,10 +432,7 @@ pub fn derive_runtime_debug_no_bound(input: TokenStream) -> TokenStream { if cfg!(any(feature = "std", feature = "try-runtime")) { no_bound::debug::derive_debug_no_bound(input) } else { - let input: syn::DeriveInput = match syn::parse(input) { - Ok(input) => input, - Err(e) => return e.to_compile_error().into(), - }; + let input = syn::parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); @@ -463,10 +460,7 @@ pub fn derive_partial_eq_no_bound(input: TokenStream) -> TokenStream { /// Derive [`Eq`] but do no bound any generic. Docs are at `frame_support::EqNoBound`. #[proc_macro_derive(EqNoBound)] pub fn derive_eq_no_bound(input: TokenStream) -> TokenStream { - let input: syn::DeriveInput = match syn::parse(input) { - Ok(input) => input, - Err(e) => return e.to_compile_error().into(), - }; + let input = syn::parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); @@ -1519,13 +1513,14 @@ pub fn origin(_: TokenStream, _: TokenStream) -> TokenStream { /// /// ```ignore /// Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, MaxEncodedLen, TypeInfo, -/// RuntimeDebug +/// RuntimeDebug, /// ``` /// /// For ease of usage, when no `#[derive]` attributes are found for the enum under /// `#[pallet::composite_enum]`, the aforementioned traits are automatically derived for it. The /// inverse is also true: if there are any `#[derive]` attributes found for the enum, then no traits -/// will automatically be derived for it. +/// will automatically be derived for it (this implies that you need to provide the +/// `frame_support::traits::VariantCount` implementation). #[proc_macro_attribute] pub fn composite_enum(_: TokenStream, _: TokenStream) -> TokenStream { pallet_macro_stub() diff --git a/substrate/frame/support/procedural/src/no_bound/clone.rs b/substrate/frame/support/procedural/src/no_bound/clone.rs index 8e57a10d34c607c0a3d8de29eb6429ce73a4c8b9..346bf450f11c803b03af3c5550a0e7c07f7cdc11 100644 --- a/substrate/frame/support/procedural/src/no_bound/clone.rs +++ b/substrate/frame/support/procedural/src/no_bound/clone.rs @@ -19,10 +19,7 @@ use syn::spanned::Spanned; /// Derive Clone but do not bound any generic. pub fn derive_clone_no_bound(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input: syn::DeriveInput = match syn::parse(input) { - Ok(input) => input, - Err(e) => return e.to_compile_error().into(), - }; + let input = syn::parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); diff --git a/substrate/frame/support/procedural/src/no_bound/debug.rs b/substrate/frame/support/procedural/src/no_bound/debug.rs index dd14b9cd564c9ccce9a8442b3669ae418fc18027..a1b3f4f0d3bbc32af89469527da9b9193ffea329 100644 --- a/substrate/frame/support/procedural/src/no_bound/debug.rs +++ b/substrate/frame/support/procedural/src/no_bound/debug.rs @@ -19,10 +19,7 @@ use syn::spanned::Spanned; /// Derive Debug but do not bound any generics. pub fn derive_debug_no_bound(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input: syn::DeriveInput = match syn::parse(input) { - Ok(input) => input, - Err(e) => return e.to_compile_error().into(), - }; + let input = syn::parse_macro_input!(input as syn::DeriveInput); let input_ident = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); diff --git a/substrate/frame/support/procedural/src/no_bound/partial_eq.rs b/substrate/frame/support/procedural/src/no_bound/partial_eq.rs index 7cf5701b193b8a31143f3f636eaa2ab511536434..a1be71a961333445ab08d1def5c514271a2b7e63 100644 --- a/substrate/frame/support/procedural/src/no_bound/partial_eq.rs +++ b/substrate/frame/support/procedural/src/no_bound/partial_eq.rs @@ -19,10 +19,7 @@ use syn::spanned::Spanned; /// Derive PartialEq but do not bound any generic. pub fn derive_partial_eq_no_bound(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input: syn::DeriveInput = match syn::parse(input) { - Ok(input) => input, - Err(e) => return e.to_compile_error().into(), - }; + let input = syn::parse_macro_input!(input as syn::DeriveInput); let name = &input.ident; let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); diff --git a/substrate/frame/support/procedural/src/pallet/expand/composite.rs b/substrate/frame/support/procedural/src/pallet/expand/composite.rs new file mode 100644 index 0000000000000000000000000000000000000000..acfb21f34e991e30e7c39223ef35b3c174cb4e5e --- /dev/null +++ b/substrate/frame/support/procedural/src/pallet/expand/composite.rs @@ -0,0 +1,40 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::pallet::Def; +use proc_macro2::TokenStream; + +/// Expands `composite_enum` and adds the `VariantCount` implementation for it." +pub fn expand_composites(def: &mut Def) -> TokenStream { + let mut expand = quote::quote!(); + let frame_support = &def.frame_support; + + for composite in &def.composites { + let name = &composite.ident; + let (impl_generics, ty_generics, where_clause) = composite.generics.split_for_impl(); + let variants_count = composite.variant_count; + + // add `VariantCount` implementation for `composite_enum` + expand.extend(quote::quote_spanned!(composite.attr_span => + impl #impl_generics #frame_support::traits::VariantCount for #name #ty_generics #where_clause { + const VARIANT_COUNT: u32 = #variants_count; + } + )); + } + + expand +} diff --git a/substrate/frame/support/procedural/src/pallet/expand/mod.rs b/substrate/frame/support/procedural/src/pallet/expand/mod.rs index db242df781b124f86e14eb6bd084578fda723e73..3da7d9293c7cc1a1676e5cb0e4afe9ab08b25948 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/mod.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/mod.rs @@ -16,6 +16,7 @@ // limitations under the License. mod call; +mod composite; mod config; mod constants; mod doc_only; @@ -76,6 +77,7 @@ pub fn expand(mut def: Def) -> proc_macro2::TokenStream { let validate_unsigned = validate_unsigned::expand_validate_unsigned(&mut def); let tt_default_parts = tt_default_parts::expand_tt_default_parts(&mut def); let doc_only = doc_only::expand_doc_only(&mut def); + let composites = composite::expand_composites(&mut def); def.item.attrs.insert( 0, @@ -117,6 +119,7 @@ storage item. Otherwise, all storage items are listed among [*Type Definitions*] #validate_unsigned #tt_default_parts #doc_only + #composites ); def.item diff --git a/substrate/frame/support/procedural/src/pallet/parse/composite.rs b/substrate/frame/support/procedural/src/pallet/parse/composite.rs index fa5f47dfdfa184d25a15ba05842f14c63fdbede3..601f16971f88e6aebda6b492e01e57486311d8b8 100644 --- a/substrate/frame/support/procedural/src/pallet/parse/composite.rs +++ b/substrate/frame/support/procedural/src/pallet/parse/composite.rs @@ -91,8 +91,16 @@ pub struct CompositeDef { pub index: usize, /// The composite keyword used (contains span). pub composite_keyword: keyword::CompositeKeyword, + + /// Name of the associated type. + pub ident: syn::Ident, + /// Type parameters and where clause attached to a declaration of the pallet::composite_enum. + pub generics: syn::Generics, /// The span of the pallet::composite_enum attribute. pub attr_span: proc_macro2::Span, + + /// Variant count of the pallet::composite_enum. + pub variant_count: u32, } impl CompositeDef { @@ -103,6 +111,19 @@ impl CompositeDef { item: &mut syn::Item, ) -> syn::Result<Self> { let item = if let syn::Item::Enum(item) = item { + // check variants: composite enums support only field-less enum variants. This is + // because fields can introduce too many possibilities, making it challenging to compute + // a fixed variant count. + for variant in &item.variants { + match variant.fields { + syn::Fields::Named(_) | syn::Fields::Unnamed(_) => + return Err(syn::Error::new( + variant.ident.span(), + "The composite enum does not support variants with fields!", + )), + syn::Fields::Unit => (), + } + } item } else { return Err(syn::Error::new( @@ -160,6 +181,13 @@ impl CompositeDef { let composite_keyword = syn::parse2::<keyword::CompositeKeyword>(item.ident.to_token_stream())?; - Ok(CompositeDef { index, composite_keyword, attr_span }) + Ok(CompositeDef { + index, + composite_keyword, + attr_span, + generics: item.generics.clone(), + variant_count: item.variants.len() as u32, + ident: item.ident.clone(), + }) } } diff --git a/substrate/frame/support/src/traits.rs b/substrate/frame/support/src/traits.rs index 9afd9c161303410c5d21903eab6511d02f3569c9..a18faee680596340999cd784597825dee00f3391 100644 --- a/substrate/frame/support/src/traits.rs +++ b/substrate/frame/support/src/traits.rs @@ -61,7 +61,8 @@ pub use misc::{ DefensiveTruncateFrom, EnsureInherentsAreFirst, EqualPrivilegeOnly, EstimateCallFee, ExecuteBlock, ExtrinsicCall, Get, GetBacking, GetDefault, HandleLifetime, IsSubType, IsType, Len, OffchainWorker, OnKilledAccount, OnNewAccount, PrivilegeCmp, SameOrOther, Time, - TryCollect, TryDrop, TypedGet, UnixTime, VariantCount, WrapperKeepOpaque, WrapperOpaque, + TryCollect, TryDrop, TypedGet, UnixTime, VariantCount, VariantCountOf, WrapperKeepOpaque, + WrapperOpaque, }; #[allow(deprecated)] pub use misc::{PreimageProvider, PreimageRecipient}; diff --git a/substrate/frame/support/src/traits/misc.rs b/substrate/frame/support/src/traits/misc.rs index bf3053a3f8f59b6d55acadb208a8731c7f080e41..eafd9c8abdd2dfc4b4174723678d94aa963ad738 100644 --- a/substrate/frame/support/src/traits/misc.rs +++ b/substrate/frame/support/src/traits/misc.rs @@ -37,8 +37,6 @@ pub const DEFENSIVE_OP_PUBLIC_ERROR: &str = "a defensive failure has been trigge pub const DEFENSIVE_OP_INTERNAL_ERROR: &str = "Defensive failure has been triggered!"; /// Trait to get the number of variants in any enum. -/// -/// NOTE: can be removed once <https://doc.rust-lang.org/std/mem/fn.variant_count.html> is stable. pub trait VariantCount { /// Get the number of variants. const VARIANT_COUNT: u32; @@ -48,6 +46,14 @@ impl VariantCount for () { const VARIANT_COUNT: u32 = 0; } +/// Adapter for `Get<u32>` to access `VARIANT_COUNT` from `trait pub trait VariantCount {`. +pub struct VariantCountOf<T: VariantCount>(sp_std::marker::PhantomData<T>); +impl<T: VariantCount> Get<u32> for VariantCountOf<T> { + fn get() -> u32 { + T::VARIANT_COUNT + } +} + /// Generic function to mark an execution path as ONLY defensive. /// /// Similar to mark a match arm or `if/else` branch as `unreachable!`. diff --git a/substrate/frame/support/test/tests/composite_enum.rs b/substrate/frame/support/test/tests/composite_enum.rs new file mode 100644 index 0000000000000000000000000000000000000000..b9e9c23c4bca8ffb1e1a93d4800d040e010bbb13 --- /dev/null +++ b/substrate/frame/support/test/tests/composite_enum.rs @@ -0,0 +1,274 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! General tests for composite_enum macro and its handling, test for: +//! * variant_count works + +#![recursion_limit = "128"] + +use codec::Encode; +use frame_support::{derive_impl, traits::VariantCount}; +use sp_core::sr25519; +use sp_runtime::{ + generic, + traits::{BlakeTwo256, Verify}, +}; + +#[frame_support::pallet(dev_mode)] +mod module_single_instance { + + #[pallet::composite_enum] + pub enum HoldReason { + ModuleSingleInstanceReason1, + ModuleSingleInstanceReason2, + } + + #[pallet::composite_enum] + pub enum FreezeReason { + ModuleSingleInstanceReason1, + ModuleSingleInstanceReason2, + } + + #[pallet::pallet] + pub struct Pallet<T>(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + type RuntimeHoldReason: From<HoldReason>; + type RuntimeFreezeReason: From<FreezeReason>; + } +} + +#[frame_support::pallet(dev_mode)] +mod module_multi_instance { + + #[pallet::composite_enum] + pub enum HoldReason<I: 'static = ()> { + ModuleMultiInstanceReason1, + ModuleMultiInstanceReason2, + ModuleMultiInstanceReason3, + } + + #[pallet::composite_enum] + pub enum FreezeReason<I: 'static = ()> { + ModuleMultiInstanceReason1, + } + + #[pallet::pallet] + pub struct Pallet<T, I = ()>(_); + + #[pallet::config] + pub trait Config<I: 'static = ()>: frame_system::Config { + type RuntimeHoldReason: From<HoldReason<I>>; + type RuntimeFreezeReason: From<FreezeReason<I>>; + } +} + +#[frame_support::pallet(dev_mode)] +mod module_composite_enum_consumer { + use super::*; + + #[pallet::pallet] + pub struct Pallet<T, I = ()>(_); + + #[pallet::config] + pub trait Config<I: 'static = ()>: frame_system::Config { + // consume `HoldReason` `composite_enum` + type RuntimeHoldReason: VariantCount; + // consume `FreezeReason` `composite_enum` + type RuntimeFreezeReason: VariantCount; + } +} + +pub type BlockNumber = u64; +pub type Signature = sr25519::Signature; +pub type AccountId = <Signature as Verify>::Signer; +pub type Header = generic::Header<BlockNumber, BlakeTwo256>; +pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, Signature, ()>; +pub type Block = generic::Block<Header, UncheckedExtrinsic>; + +frame_support::construct_runtime!( + pub enum Runtime + { + System: frame_system, + ModuleSingleInstance: module_single_instance, + ModuleMultiInstance0: module_multi_instance, + ModuleMultiInstance1: module_multi_instance::<Instance1>, + ModuleMultiInstance2: module_multi_instance::<Instance2>, + ModuleMultiInstance3: module_multi_instance::<Instance3>, + ModuleCompositeEnumConsumer: module_composite_enum_consumer, + } +); + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Runtime { + type Block = Block; +} + +impl module_single_instance::Config for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} + +impl module_multi_instance::Config for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} +impl module_multi_instance::Config<module_multi_instance::Instance1> for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} +impl module_multi_instance::Config<module_multi_instance::Instance2> for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} +impl module_multi_instance::Config<module_multi_instance::Instance3> for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} + +impl module_composite_enum_consumer::Config for Runtime { + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} + +fn list_all_hold_reason_variants() -> Vec<RuntimeHoldReason> { + let variants = vec![ + RuntimeHoldReason::ModuleSingleInstance(module_single_instance::HoldReason::ModuleSingleInstanceReason1), + RuntimeHoldReason::ModuleSingleInstance(module_single_instance::HoldReason::ModuleSingleInstanceReason2), + RuntimeHoldReason::ModuleMultiInstance0(<module_multi_instance::HoldReason>::ModuleMultiInstanceReason1), + RuntimeHoldReason::ModuleMultiInstance0(<module_multi_instance::HoldReason>::ModuleMultiInstanceReason2), + RuntimeHoldReason::ModuleMultiInstance0(<module_multi_instance::HoldReason>::ModuleMultiInstanceReason3), + RuntimeHoldReason::ModuleMultiInstance0(<module_multi_instance::HoldReason>::__Ignore(Default::default())), + RuntimeHoldReason::ModuleMultiInstance1(module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason1), + RuntimeHoldReason::ModuleMultiInstance1(module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason2), + RuntimeHoldReason::ModuleMultiInstance1(module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason3), + RuntimeHoldReason::ModuleMultiInstance1(module_multi_instance::HoldReason::<module_multi_instance::Instance1>::__Ignore(Default::default())), + RuntimeHoldReason::ModuleMultiInstance2(module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason1), + RuntimeHoldReason::ModuleMultiInstance2(module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason2), + RuntimeHoldReason::ModuleMultiInstance2(module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason3), + RuntimeHoldReason::ModuleMultiInstance2(module_multi_instance::HoldReason::<module_multi_instance::Instance2>::__Ignore(Default::default())), + RuntimeHoldReason::ModuleMultiInstance3(module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason1), + RuntimeHoldReason::ModuleMultiInstance3(module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason2), + RuntimeHoldReason::ModuleMultiInstance3(module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason3), + RuntimeHoldReason::ModuleMultiInstance3(module_multi_instance::HoldReason::<module_multi_instance::Instance3>::__Ignore(Default::default())), + ]; + // check that we didn't miss any value + for v in &variants { + match v { + RuntimeHoldReason::ModuleSingleInstance(inner) => match inner { + module_single_instance::HoldReason::ModuleSingleInstanceReason1 + | module_single_instance::HoldReason::ModuleSingleInstanceReason2 => (), + } + RuntimeHoldReason::ModuleMultiInstance0(inner) => match inner { + <module_multi_instance::HoldReason>::ModuleMultiInstanceReason1 + | <module_multi_instance::HoldReason>::ModuleMultiInstanceReason2 + | <module_multi_instance::HoldReason>::ModuleMultiInstanceReason3 + | module_multi_instance::HoldReason::<()>::__Ignore(_) => (), + } + RuntimeHoldReason::ModuleMultiInstance1(inner) => match inner { + module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason1 + | module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason2 + | module_multi_instance::HoldReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason3 + | module_multi_instance::HoldReason::<module_multi_instance::Instance1>::__Ignore(_) => (), + } + RuntimeHoldReason::ModuleMultiInstance2(inner) => match inner { + module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason1 + | module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason2 + | module_multi_instance::HoldReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason3 + | module_multi_instance::HoldReason::<module_multi_instance::Instance2>::__Ignore(_) => (), + } + RuntimeHoldReason::ModuleMultiInstance3(inner) => match inner { + module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason1 + | module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason2 + | module_multi_instance::HoldReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason3 + | module_multi_instance::HoldReason::<module_multi_instance::Instance3>::__Ignore(_) => (), + } + } + } + variants +} + +fn list_all_freeze_reason_variants() -> Vec<RuntimeFreezeReason> { + let variants = vec![ + RuntimeFreezeReason::ModuleSingleInstance(module_single_instance::FreezeReason::ModuleSingleInstanceReason1), + RuntimeFreezeReason::ModuleSingleInstance(module_single_instance::FreezeReason::ModuleSingleInstanceReason2), + RuntimeFreezeReason::ModuleMultiInstance0(<module_multi_instance::FreezeReason>::ModuleMultiInstanceReason1), + RuntimeFreezeReason::ModuleMultiInstance0(<module_multi_instance::FreezeReason>::__Ignore(Default::default())), + RuntimeFreezeReason::ModuleMultiInstance1(module_multi_instance::FreezeReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason1), + RuntimeFreezeReason::ModuleMultiInstance1(module_multi_instance::FreezeReason::<module_multi_instance::Instance1>::__Ignore(Default::default())), + RuntimeFreezeReason::ModuleMultiInstance2(module_multi_instance::FreezeReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason1), + RuntimeFreezeReason::ModuleMultiInstance2(module_multi_instance::FreezeReason::<module_multi_instance::Instance2>::__Ignore(Default::default())), + RuntimeFreezeReason::ModuleMultiInstance3(module_multi_instance::FreezeReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason1), + RuntimeFreezeReason::ModuleMultiInstance3(module_multi_instance::FreezeReason::<module_multi_instance::Instance3>::__Ignore(Default::default())), + ]; + // check that we didn't miss any value + for v in &variants { + match v { + RuntimeFreezeReason::ModuleSingleInstance(inner) => match inner { + module_single_instance::FreezeReason::ModuleSingleInstanceReason1 + | module_single_instance::FreezeReason::ModuleSingleInstanceReason2 => (), + } + RuntimeFreezeReason::ModuleMultiInstance0(inner) => match inner { + <module_multi_instance::FreezeReason>::ModuleMultiInstanceReason1 + | module_multi_instance::FreezeReason::<()>::__Ignore(_) => (), + } + RuntimeFreezeReason::ModuleMultiInstance1(inner) => match inner { + module_multi_instance::FreezeReason::<module_multi_instance::Instance1>::ModuleMultiInstanceReason1 + | module_multi_instance::FreezeReason::<module_multi_instance::Instance1>::__Ignore(_) => (), + } + RuntimeFreezeReason::ModuleMultiInstance2(inner) => match inner { + module_multi_instance::FreezeReason::<module_multi_instance::Instance2>::ModuleMultiInstanceReason1 + | module_multi_instance::FreezeReason::<module_multi_instance::Instance2>::__Ignore(_) => (), + } + RuntimeFreezeReason::ModuleMultiInstance3(inner) => match inner { + module_multi_instance::FreezeReason::<module_multi_instance::Instance3>::ModuleMultiInstanceReason1 + | module_multi_instance::FreezeReason::<module_multi_instance::Instance3>::__Ignore(_) => (), + } + } + } + variants +} + +#[test] +fn runtime_hold_reason_variant_count_works() { + assert_eq!(RuntimeHoldReason::VARIANT_COUNT as usize, list_all_hold_reason_variants().len()); +} + +#[test] +fn runtime_freeze_reason_variant_count_works() { + assert_eq!( + RuntimeFreezeReason::VARIANT_COUNT as usize, + list_all_freeze_reason_variants().len() + ); +} + +#[test] +fn check_unique_encodings_for_hold_reason() { + let variants = list_all_hold_reason_variants(); + let unique_encoded_variants = + variants.iter().map(|v| v.encode()).collect::<std::collections::HashSet<_>>(); + assert_eq!(unique_encoded_variants.len(), variants.len()); +} + +#[test] +fn check_unique_encodings_for_freeze_reason() { + let variants = list_all_freeze_reason_variants(); + let unique_encoded_variants = + variants.iter().map(|v| v.encode()).collect::<std::collections::HashSet<_>>(); + assert_eq!(unique_encoded_variants.len(), variants.len()); +} diff --git a/substrate/frame/tips/src/tests.rs b/substrate/frame/tips/src/tests.rs index b8e528bbe7ab435100f3ac212cedf3f08b10978c..9d4047cd80eabb3c7c2b36382c8ec1020fc2bd6b 100644 --- a/substrate/frame/tips/src/tests.rs +++ b/substrate/frame/tips/src/tests.rs @@ -98,7 +98,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { static TenToFourteenTestValue: Vec<u128> = vec![10,11,12,13,14]; diff --git a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs index 52ff3eb990575ff92f44738f3479728039c39bfd..c8bf2eb8f440fd1203796fd89d9265403b3fdad0 100644 --- a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/mock.rs @@ -129,7 +129,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl WeightToFeeT for WeightToFee { diff --git a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs index 03142d6ae3766eeb00b297ed369b6fccb6352a2c..1f335b4f6c4ab5cc59a4815a2160328aa7f584df 100644 --- a/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/asset-tx-payment/src/mock.rs @@ -116,7 +116,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl WeightToFeeT for WeightToFee { diff --git a/substrate/frame/transaction-payment/src/mock.rs b/substrate/frame/transaction-payment/src/mock.rs index 2f025ae81d2561e7024af7d9b062002effd72c7d..1ca2e3d734720455f8a2fdc9453c712d1f199796 100644 --- a/substrate/frame/transaction-payment/src/mock.rs +++ b/substrate/frame/transaction-payment/src/mock.rs @@ -111,7 +111,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl WeightToFeeT for WeightToFee { diff --git a/substrate/frame/treasury/src/tests.rs b/substrate/frame/treasury/src/tests.rs index 602159262e46598823a8d581213196517646fede..e35d50e23a3424ddb17c03acc89d42baf7429bb4 100644 --- a/substrate/frame/treasury/src/tests.rs +++ b/substrate/frame/treasury/src/tests.rs @@ -94,7 +94,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_utility::Config for Test { diff --git a/substrate/frame/tx-pause/src/mock.rs b/substrate/frame/tx-pause/src/mock.rs index 4f1c981abc6f6281850c28b2ef925baceb97623b..8ccdc43a46cdb1b2865c768a81dc69453820d9d3 100644 --- a/substrate/frame/tx-pause/src/mock.rs +++ b/substrate/frame/tx-pause/src/mock.rs @@ -80,7 +80,6 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; } diff --git a/substrate/frame/uniques/src/mock.rs b/substrate/frame/uniques/src/mock.rs index 9120108e0d4327625a088c030aebaefd99cccf35..16da2b2a2e285af87d1fb392f5b17b1022ad4ef2 100644 --- a/substrate/frame/uniques/src/mock.rs +++ b/substrate/frame/uniques/src/mock.rs @@ -82,7 +82,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl Config for Test { diff --git a/substrate/frame/utility/src/tests.rs b/substrate/frame/utility/src/tests.rs index cfdbd6faf0dc4250f2ece5e9773977ac739012d7..1a1196cb4c0669c279b47c48e309101e9d27e3d9 100644 --- a/substrate/frame/utility/src/tests.rs +++ b/substrate/frame/utility/src/tests.rs @@ -185,7 +185,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_root_testing::Config for Test { diff --git a/substrate/frame/vesting/src/mock.rs b/substrate/frame/vesting/src/mock.rs index 420edd5e17a2c34e9e8e81cb3654e1f725aede91..befe8cd3b760eddce92f7de73893df753b71546b 100644 --- a/substrate/frame/vesting/src/mock.rs +++ b/substrate/frame/vesting/src/mock.rs @@ -80,7 +80,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } parameter_types! { pub const MinVestedTransfer: u64 = 256 * 2; diff --git a/substrate/frame/whitelist/src/mock.rs b/substrate/frame/whitelist/src/mock.rs index 200e589c6aa91a3b2bf2bd269d2abf36e059cc92..c0c38075f298909e7f918de1d74514ee0f86e16d 100644 --- a/substrate/frame/whitelist/src/mock.rs +++ b/substrate/frame/whitelist/src/mock.rs @@ -85,7 +85,6 @@ impl pallet_balances::Config for Test { type MaxFreezes = (); type RuntimeHoldReason = (); type RuntimeFreezeReason = (); - type MaxHolds = (); } impl pallet_preimage::Config for Test { diff --git a/substrate/test-utils/runtime/src/lib.rs b/substrate/test-utils/runtime/src/lib.rs index ea237649396a131ea77900f8d4a1b41b26b4cad0..8bc6f72a82ec2d0690c24565e841931bada92f05 100644 --- a/substrate/test-utils/runtime/src/lib.rs +++ b/substrate/test-utils/runtime/src/lib.rs @@ -398,7 +398,6 @@ impl pallet_balances::Config for Runtime { type MaxFreezes = (); type RuntimeHoldReason = RuntimeHoldReason; type RuntimeFreezeReason = RuntimeFreezeReason; - type MaxHolds = ConstU32<1>; } impl substrate_test_pallet::Config for Runtime {}