Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Replace 'Module' with 'Pallet' in construct_runtime macro #8372

Merged
16 commits merged into from
Mar 18, 2021

Conversation

shaunxw
Copy link
Contributor

@shaunxw shaunxw commented Mar 16, 2021

Part of #8287 .

Changes in this PR:

  • Replace Module with Pallet as pallet keyword in construct_runtime macro.
  • Rename module related types/fns in construct_runtime impl.
  • Add Pallet type alias in decl_module, to make it compatible with new Pallet keyword in construct_runtime.
  • Updated construct_runtime usage in mocks, runtimes.
  • Deprecated Module type alias in pallet macro. Additionally replace all deprecated usage.

cc @shawntabrizi @thiolliere

Polkadot companion: paritytech/polkadot#2629

@gui1117 gui1117 added A5-grumble C1-low PR touches the given topic and has a low impact on builders. labels Mar 16, 2021
@gui1117
Copy link
Contributor

gui1117 commented Mar 16, 2021

This will needs a companion, and there is remainings usage of deprecated Modle type alias, you can see in the CI continuous-integration/gitlab-test-linux-stable

We should deprecate AllModule and AllModuleWithSystem instead of removing them IMHO.

Then the only breaking change of this PR is the construct_runtime macro which requires Pallet instead of Module.

Copy link
Contributor

@gui1117 gui1117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, needs ui tests to be fixed.

To fix them you can run them with stable toolchain and TRYBUILD=overwrite:
TRYBUILD=overwrite cargo +stable test -p frame-support-test

@gui1117 gui1117 added the D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. label Mar 17, 2021
@shawntabrizi
Copy link
Member

gonna be honest, did not look at every line of code, but scrolled through quickly

@shawntabrizi shawntabrizi added D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit and removed D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Mar 18, 2021
@gui1117
Copy link
Contributor

gui1117 commented Mar 18, 2021

bot merge

@ghost
Copy link

ghost commented Mar 18, 2021

Trying merge.

@ghost ghost merged commit cc24950 into paritytech:master Mar 18, 2021
@shaunxw shaunxw deleted the sw/construct-runtime-pallet branch March 18, 2021 09:07
@AurevoirXavier
Copy link
Contributor

AurevoirXavier commented Mar 25, 2021

I think a lot of thing need to be changed.

decl_module, ModuleId...

Otherwise, this make people feel so confusing.

@gui1117
Copy link
Contributor

gui1117 commented Mar 25, 2021

decl_module is deprecated in favor of pallet macro.

I agree ModuleId should be changed too.

@AurevoirXavier
Copy link
Contributor

decl_module is deprecated in favor of pallet macro.

I agree ModuleId should be changed too.

Well.

Can you assign that to me? : )

@gui1117
Copy link
Contributor

gui1117 commented Mar 25, 2021

Yes a PR is welcome, I don't think ppl are working on it, you can ping me on the PR if you open it

AurevoirXavier added a commit to darwinia-network/substrate that referenced this pull request Mar 29, 2021
HCastano added a commit to paritytech/parity-bridges-common that referenced this pull request Apr 6, 2021
HCastano added a commit to paritytech/parity-bridges-common that referenced this pull request Apr 7, 2021
* Bump Substrate

* Change usage of "Module" to "Pallet"

Related Substrate PR: paritytech/substrate#8372

* Add `OnSetCode` config param

Related Substrate PR: paritytech/substrate#8496

* Update Aura Slot duration time type

Related Substrate PR: paritytech/substrate#8386

* Add `OnSetCode` to mock runtimes

* Add support for multiple justifications

Related Substrate PR: paritytech/substrate#7640

* Use updated justification type in more places

* Make GenesisConfig type non-optional

Related Substrate PR: paritytech/substrate#8275

* Update service to use updated telemetry

Related Substrate PR: paritytech/substrate#8143

* Appease Clippy
ghost pushed a commit that referenced this pull request Apr 9, 2021
* `ModuleId` to `PalletId` - part of #8372

* fix doc

* move `PalletId` to `frame-support`

* fix compile

* fix tests

* `ModuleId` to `PalletId`

* subcommand `moduleid` to `palletid`
hirschenberger pushed a commit to hirschenberger/substrate that referenced this pull request Apr 14, 2021
…#8372)

* Use 'Pallet' struct in construct_runtime.

* Fix genesis and metadata macro.

* Fix 'Pallet' type alias.

* Replace 'Module' with 'Pallet' for all construct_runtime use cases.

* Replace more deprecated 'Module' struct.

* Bring back AllModules and AllPalletsWithSystem type, but deprecate them.

* Replace deprecated 'Module' struct from merge master.

* Minor fix.

* Fix UI tests.

* Revert UI override in derive_no_bound.

* Fix more deprecated 'Module' use from master branch.

* Fix more deprecated 'Module' use from master branch.
hirschenberger pushed a commit to hirschenberger/substrate that referenced this pull request Apr 14, 2021
* `ModuleId` to `PalletId` - part of paritytech#8372

* fix doc

* move `PalletId` to `frame-support`

* fix compile

* fix tests

* `ModuleId` to `PalletId`

* subcommand `moduleid` to `palletid`
jordy25519 pushed a commit to cennznet/substrate that referenced this pull request Sep 20, 2021
* `ModuleId` to `PalletId` - part of paritytech#8372

* fix doc

* move `PalletId` to `frame-support`

* fix compile

* fix tests

* `ModuleId` to `PalletId`

* subcommand `moduleid` to `palletid`
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants