Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frame] #[pallet::composite_enum] improved variant count handling + removed pallet_balances's MaxHolds config #2657

Merged
merged 63 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
746732c
Test for MaxHolds
bkontur Dec 7, 2023
d1dba07
wip
bkontur Dec 13, 2023
535a883
Dedicated test for `composite_enum` and variant count
bkontur Dec 22, 2023
2e8a925
Fix `HoldReason` and `FreezeReason` variant count
bkontur Jan 4, 2024
b752f74
Fix macro for no composite enums
bkontur Jan 5, 2024
80c685c
impl `Get<u32>` for RuntimeFreezeReason/RuntimeHoldReason
bkontur Jan 5, 2024
a2b272a
Set all `MaxHolds = RuntimeHoldReason` and `MaxFreezes = RuntimeFreez…
bkontur Jan 5, 2024
694d230
".git/.scripts/commands/fmt/fmt.sh"
Jan 5, 2024
a0dd0a8
Docs fix
bkontur Jan 5, 2024
71156bb
Update substrate/frame/support/procedural/src/lib.rs
bkontur Jan 8, 2024
2f3c31c
Fix other places with Basti's suggestion
bkontur Jan 8, 2024
6d6e75c
Update substrate/frame/support/procedural/src/lib.rs
bkontur Jan 8, 2024
b84cc1b
Update substrate/frame/support/procedural/src/lib.rs
bkontur Jan 8, 2024
4f5c9c8
Update substrate/frame/support/procedural/src/lib.rs
bkontur Jan 8, 2024
b30e17e
fix
bkontur Jan 8, 2024
b38ddb2
Update substrate/frame/support/procedural/src/construct_runtime/expan…
bkontur Jan 8, 2024
8d9bdf0
Update substrate/frame/support/procedural/src/construct_runtime/expan…
bkontur Jan 8, 2024
9bde28f
`pallet::balances` replace `MaxHolds` with `VariantCountOf<T::Runtime…
bkontur Jan 8, 2024
f759563
Removed unnecessery `impl #scrate::traits::Get<u32> for Runtime*Reason`
bkontur Jan 16, 2024
635724e
Removed `MaxHolds` from everywhere
bkontur Jan 17, 2024
a32b0b0
Fix after removed `Get` impl
bkontur Jan 17, 2024
f43412c
Removed derive macro `CompositeEnumVariantCount` and replace with exp…
bkontur Jan 17, 2024
248790a
fmt
bkontur Jan 17, 2024
9faefd8
One more revert for `MaxFreezes`
bkontur Jan 17, 2024
3c81275
Add additional check for composite enums
bkontur Jan 17, 2024
9b8aa8e
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 17, 2024
32cf3ff
Fix for multi-instance pallets when `InstanceXYZ` is not specified in…
bkontur Jan 18, 2024
3a4a1ce
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 18, 2024
bccc074
Fix preimage tests
bkontur Jan 18, 2024
ba7df0b
prdoc
bkontur Jan 19, 2024
6778282
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 19, 2024
0959bea
prdoc - change audience
bkontur Jan 19, 2024
c637145
prdoc one more time
bkontur Jan 19, 2024
9eca694
removed empty line
bkontur Jan 19, 2024
44b0827
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 19, 2024
f4cfc2c
Hit me, baby, one more time...
bkontur Jan 19, 2024
5a1b161
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 24, 2024
d557601
Update substrate/frame/support/procedural/src/pallet/expand/mod.rs
bkontur Jan 24, 2024
48c3d37
Update substrate/frame/support/procedural/src/pallet/expand/mod.rs
bkontur Jan 24, 2024
442f3fd
Update prdoc/pr_2657.prdoc
bkontur Jan 24, 2024
abaf487
Update substrate/frame/support/test/tests/composite_enum.rs
bkontur Jan 24, 2024
2358636
Merge remote-tracking branch 'origin/bko-max-holds-integrity-test' in…
bkontur Jan 24, 2024
7d113e9
Removed unnecessary indexes from `construct_runtime`
bkontur Jan 24, 2024
6a0289a
".git/.scripts/commands/fmt/fmt.sh"
Jan 24, 2024
0cb363a
Fmt? struct vs enum?
bkontur Jan 24, 2024
83e64fe
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
Jan 24, 2024
4342247
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
Jan 24, 2024
71c55c7
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
Jan 24, 2024
5af90e7
Merge branch 'master' into bko-max-holds-integrity-test
bkontur Jan 24, 2024
464af0c
Update prdoc/pr_2657.prdoc
bkontur Jan 26, 2024
4015ea0
PR review fixes
bkontur Jan 26, 2024
c869313
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 26, 2024
77066c8
Merge branch 'master' into bko-max-holds-integrity-test
bkontur Jan 30, 2024
5380371
Merge branch 'master' into bko-max-holds-integrity-test
bkontur Jan 30, 2024
01c39bf
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur Jan 30, 2024
0ce9eca
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
3aeb0f8
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
Jan 31, 2024
998ed0f
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
53b2f44
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
e6552cc
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
2d6a3c4
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
27a5723
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
adbcace
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
Jan 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ impl pallet_balances::Config for Test {
type MaxFreezes = ();
type RuntimeHoldReason = ();
type RuntimeFreezeReason = ();
type MaxHolds = ();
}

parameter_types! {
Expand Down
1 change: 0 additions & 1 deletion bridges/snowbridge/parachain/pallets/system/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion cumulus/pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion cumulus/pallets/xcmp-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion cumulus/parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion cumulus/parachains/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<0>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<0>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion cumulus/test/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/assigned_slots/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/auctions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/crowdloan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/paras_registrar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/purchase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/common/src/slots/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ mod tests {
type RuntimeHoldReason = RuntimeHoldReason;
type RuntimeFreezeReason = RuntimeFreezeReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
}

Expand Down
1 change: 0 additions & 1 deletion polkadot/runtime/parachains/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
6 changes: 2 additions & 4 deletions polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,11 @@ impl pallet_balances::Config for Runtime {
type MaxLocks = MaxLocks;
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type WeightInfo = weights::pallet_balances::WeightInfo<Runtime>;
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! {
Expand Down Expand Up @@ -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>;
}

Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/rococo/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

pub mod frame_system;
pub mod pallet_asset_rate;
pub mod pallet_balances;
pub mod pallet_balances_balances;
pub mod pallet_balances_nis_counterpart_balances;
pub mod pallet_bounties;
pub mod pallet_child_bounties;
Expand Down
99 changes: 0 additions & 99 deletions polkadot/runtime/rococo/src/weights/pallet_balances.rs

This file was deleted.

Loading
Loading