-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[frame] #[pallet::composite_enum] improved variant count handling + removed pallet_balances's MaxHolds config
#2657
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
Merged
Merged
Changes from 43 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
746732c
Test for MaxHolds
bkontur d1dba07
wip
bkontur 535a883
Dedicated test for `composite_enum` and variant count
bkontur 2e8a925
Fix `HoldReason` and `FreezeReason` variant count
bkontur b752f74
Fix macro for no composite enums
bkontur 80c685c
impl `Get<u32>` for RuntimeFreezeReason/RuntimeHoldReason
bkontur a2b272a
Set all `MaxHolds = RuntimeHoldReason` and `MaxFreezes = RuntimeFreez…
bkontur 694d230
".git/.scripts/commands/fmt/fmt.sh"
a0dd0a8
Docs fix
bkontur 71156bb
Update substrate/frame/support/procedural/src/lib.rs
bkontur 2f3c31c
Fix other places with Basti's suggestion
bkontur 6d6e75c
Update substrate/frame/support/procedural/src/lib.rs
bkontur b84cc1b
Update substrate/frame/support/procedural/src/lib.rs
bkontur 4f5c9c8
Update substrate/frame/support/procedural/src/lib.rs
bkontur b30e17e
fix
bkontur b38ddb2
Update substrate/frame/support/procedural/src/construct_runtime/expan…
bkontur 8d9bdf0
Update substrate/frame/support/procedural/src/construct_runtime/expan…
bkontur 9bde28f
`pallet::balances` replace `MaxHolds` with `VariantCountOf<T::Runtime…
bkontur f759563
Removed unnecessery `impl #scrate::traits::Get<u32> for Runtime*Reason`
bkontur 635724e
Removed `MaxHolds` from everywhere
bkontur a32b0b0
Fix after removed `Get` impl
bkontur f43412c
Removed derive macro `CompositeEnumVariantCount` and replace with exp…
bkontur 248790a
fmt
bkontur 9faefd8
One more revert for `MaxFreezes`
bkontur 3c81275
Add additional check for composite enums
bkontur 9b8aa8e
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur 32cf3ff
Fix for multi-instance pallets when `InstanceXYZ` is not specified in…
bkontur 3a4a1ce
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur bccc074
Fix preimage tests
bkontur ba7df0b
prdoc
bkontur 6778282
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur 0959bea
prdoc - change audience
bkontur c637145
prdoc one more time
bkontur 9eca694
removed empty line
bkontur 44b0827
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur f4cfc2c
Hit me, baby, one more time...
bkontur 5a1b161
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur d557601
Update substrate/frame/support/procedural/src/pallet/expand/mod.rs
bkontur 48c3d37
Update substrate/frame/support/procedural/src/pallet/expand/mod.rs
bkontur 442f3fd
Update prdoc/pr_2657.prdoc
bkontur abaf487
Update substrate/frame/support/test/tests/composite_enum.rs
bkontur 2358636
Merge remote-tracking branch 'origin/bko-max-holds-integrity-test' in…
bkontur 7d113e9
Removed unnecessary indexes from `construct_runtime`
bkontur 6a0289a
".git/.scripts/commands/fmt/fmt.sh"
0cb363a
Fmt? struct vs enum?
bkontur 83e64fe
".git/.scripts/commands/bench/bench.sh" --subcommand=pallet --runtime…
4342247
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
71c55c7
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
5af90e7
Merge branch 'master' into bko-max-holds-integrity-test
bkontur 464af0c
Update prdoc/pr_2657.prdoc
bkontur 4015ea0
PR review fixes
bkontur c869313
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur 77066c8
Merge branch 'master' into bko-max-holds-integrity-test
bkontur 5380371
Merge branch 'master' into bko-max-holds-integrity-test
bkontur 01c39bf
Merge remote-tracking branch 'origin/master' into bko-max-holds-integ…
bkontur 0ce9eca
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
3aeb0f8
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
998ed0f
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
53b2f44
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
e6552cc
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
2d6a3c4
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
27a5723
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
adbcace
".git/.scripts/commands/bench-all/bench-all.sh" --pallet=pallet_balances
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # 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 `VariantCount` trait for the result composite enums | ||
| like `RuntimeHoldReason` and `RuntimeFreezeReason` was fixed | ||
| and is now calculated as the sum of the `VariantCount::VARIANT_COUNT` of all corresponding `#[pallet::composite_enum]`s. | ||
| The Balances pallet's `Config` item `type MaxHolds` was removed | ||
| and `type Holds` are now bounded to the composite enum `RuntimeHoldReason` variant count, | ||
| so the runtime does not need to consider setting correct value for `MaxHolds`. | ||
|
|
||
| The implementation of the `VariantCount` trait for resulting composite enums, | ||
bkontur marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.