Skip to content

Commit 35eb133

Browse files
kianenigmaggwpez
andauthored
Ensure correct variant count in Runtime[Hold/Freeze]Reason (#1900)
closes #1882 ## Breaking Changes This PR introduces a new item to `pallet_balances::Config`: ```diff trait Config { ++ type RuntimeFreezeReasons; } ``` This value is only used to check it against `type MaxFreeze`. A similar check has been added for `MaxHolds` against `RuntimeHoldReasons`, which is already given to `pallet_balances`. In all contexts, you should pass the real `RuntimeFreezeReasons` generated by `construct_runtime` to `type RuntimeFreezeReasons`. Passing `()` would also work, but it would imply that the runtime uses no freezes at all. --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]>
1 parent a5a2432 commit 35eb133

File tree

102 files changed

+154
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+154
-10
lines changed

bridges/bin/runtime-common/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ impl pallet_balances::Config for TestRuntime {
190190
type MaxReserves = ConstU32<50>;
191191
type ReserveIdentifier = [u8; 8];
192192
type RuntimeHoldReason = RuntimeHoldReason;
193+
type RuntimeFreezeReason = RuntimeFreezeReason;
193194
type FreezeIdentifier = ();
194195
type MaxHolds = ConstU32<0>;
195196
type MaxFreezes = ConstU32<0>;

bridges/modules/messages/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ impl pallet_balances::Config for TestRuntime {
130130
type MaxReserves = ();
131131
type ReserveIdentifier = ();
132132
type RuntimeHoldReason = RuntimeHoldReason;
133+
type RuntimeFreezeReason = RuntimeFreezeReason;
133134
type FreezeIdentifier = ();
134135
type MaxHolds = ConstU32<0>;
135136
type MaxFreezes = ConstU32<0>;

bridges/modules/relayers/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ impl pallet_balances::Config for TestRuntime {
9898
type MaxReserves = ConstU32<1>;
9999
type ReserveIdentifier = [u8; 8];
100100
type RuntimeHoldReason = RuntimeHoldReason;
101+
type RuntimeFreezeReason = RuntimeFreezeReason;
101102
type FreezeIdentifier = ();
102103
type MaxHolds = ConstU32<0>;
103104
type MaxFreezes = ConstU32<0>;

cumulus/pallets/collator-selection/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ impl pallet_balances::Config for Test {
9292
type MaxReserves = MaxReserves;
9393
type ReserveIdentifier = [u8; 8];
9494
type RuntimeHoldReason = RuntimeHoldReason;
95+
type RuntimeFreezeReason = RuntimeFreezeReason;
9596
type FreezeIdentifier = ();
9697
type MaxHolds = ConstU32<0>;
9798
type MaxFreezes = ConstU32<0>;

cumulus/pallets/xcmp-queue/src/mock.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ impl pallet_balances::Config for Test {
9898
type MaxReserves = MaxReserves;
9999
type ReserveIdentifier = [u8; 8];
100100
type RuntimeHoldReason = RuntimeHoldReason;
101+
type RuntimeFreezeReason = RuntimeFreezeReason;
101102
type FreezeIdentifier = ();
102103
type MaxHolds = ConstU32<0>;
103104
type MaxFreezes = ConstU32<0>;

cumulus/parachain-template/runtime/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ impl pallet_balances::Config for Runtime {
353353
type MaxReserves = ConstU32<50>;
354354
type ReserveIdentifier = [u8; 8];
355355
type RuntimeHoldReason = RuntimeHoldReason;
356+
type RuntimeFreezeReason = RuntimeFreezeReason;
356357
type FreezeIdentifier = ();
357358
type MaxHolds = ConstU32<0>;
358359
type MaxFreezes = ConstU32<0>;

cumulus/parachains/common/src/impls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ mod tests {
192192
type MaxReserves = MaxReserves;
193193
type ReserveIdentifier = [u8; 8];
194194
type RuntimeHoldReason = RuntimeHoldReason;
195+
type RuntimeFreezeReason = RuntimeFreezeReason;
195196
type FreezeIdentifier = ();
196197
type MaxHolds = ConstU32<1>;
197198
type MaxFreezes = ConstU32<1>;

cumulus/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ impl pallet_balances::Config for Runtime {
225225
type MaxReserves = ConstU32<50>;
226226
type ReserveIdentifier = [u8; 8];
227227
type RuntimeHoldReason = RuntimeHoldReason;
228+
type RuntimeFreezeReason = RuntimeFreezeReason;
228229
type FreezeIdentifier = ();
229230
// We allow each account to have holds on it from:
230231
// - `NftFractionalization`: 1

cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ impl pallet_balances::Config for Runtime {
235235
type MaxReserves = ConstU32<50>;
236236
type ReserveIdentifier = [u8; 8];
237237
type RuntimeHoldReason = RuntimeHoldReason;
238+
type RuntimeFreezeReason = RuntimeFreezeReason;
238239
type FreezeIdentifier = ();
239240
type MaxHolds = ConstU32<0>;
240241
type MaxFreezes = ConstU32<0>;

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ impl pallet_balances::Config for Runtime {
231231
type MaxReserves = ConstU32<50>;
232232
type ReserveIdentifier = [u8; 8];
233233
type RuntimeHoldReason = RuntimeHoldReason;
234+
type RuntimeFreezeReason = RuntimeFreezeReason;
234235
type FreezeIdentifier = ();
235236
// We allow each account to have holds on it from:
236237
// - `NftFractionalization`: 1

0 commit comments

Comments
 (0)