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

Migrate pallet-tips to the new pallet attribute macro #9711

Merged
3 commits merged into from
Sep 14, 2021
Merged

Migrate pallet-tips to the new pallet attribute macro #9711

3 commits merged into from
Sep 14, 2021

Conversation

koushiro
Copy link
Contributor

@koushiro koushiro commented Sep 7, 2021

Part of #7882

Migrate the pallet-tips to the new pallet attribute macro

⚠️ Breaking Change ⚠️

From https://crates.parity.io/frame_support/attr.pallet.html#checking-upgrade-guidelines

storages now use PalletInfo for module_prefix instead of the one given to decl_storage: Thus any use of this pallet in construct_runtime! should be careful to update name in order not to break storage or to upgrade storage (moreover for instantiable pallet). If pallet is published, make sure to warn about this breaking change.

So users of the pallet must be careful about the name they used in construct_runtime!. Hence the runtime-migration label, which might not be needed depending on the configuration of the pallet.

polkadot and kusama use Tips as pallet name (but the current module_prefix is Treasury), thus need to migrate the storages.


polkadot companion: paritytech/polkadot#3801

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
@koushiro koushiro marked this pull request as ready for review September 7, 2021 03:20
@gui1117 gui1117 added A0-please_review Pull request needs code review. B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Sep 7, 2021
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 to me, I'll do the try-runtime on polkadot/kusama when reviewing the companion

use frame_system::pallet_prelude::*;

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
Copy link
Contributor

Choose a reason for hiding this comment

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

when not specified the storage version is 0, so we can use 1 here instead of 4. but 4 is fine too

@shawntabrizi
Copy link
Member

bot merge

@ghost
Copy link

ghost commented Sep 14, 2021

Trying merge.

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. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants