-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Migrate substrate pallets to use pallet!
#7882
Comments
Is this a mistake?
I wouldn't migrate this one until an external team or someone asks for it tbh. It is not really maintained. |
Part of #7882. Converts the `Proxy` pallet to the new pallet attribute macro introduced in #6877. [Upgrade guidelines used](https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#upgrade-guidelines). ##⚠️ Breaking Change⚠️ From [checking upgrade guidelines](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`: use of this pallet in `construct_runtime!` needs careful updating of the name in order to not 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 `Assets` 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 `Assets` pallet. ### Notes There are some changes to the docs in metadata for the constants. The docs in the metadata for constants are now more complete.
* Migrate pallet-proxy to pallet attribute macro Part of #7882. Converts the `Proxy` pallet to the new pallet attribute macro introduced in #6877. [Upgrade guidelines used](https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#upgrade-guidelines). ##⚠️ Breaking Change⚠️ From [checking upgrade guidelines](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`: use of this pallet in `construct_runtime!` needs careful updating of the name in order to not 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 `Assets` 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 `Assets` pallet. ### Notes There are some changes to the docs in metadata for the constants. The docs in the metadata for constants are now more complete.
@thiolliere Some mistakes here, it should be: |
Here is an issue for migrating the Polkadot pallets: paritytech/polkadot#2882 |
* Migrate pallet-proxy to pallet attribute macro Part of paritytech#7882. Converts the `Proxy` pallet to the new pallet attribute macro introduced in paritytech#6877. [Upgrade guidelines used](https://substrate.dev/rustdocs/v3.0.0/frame_support/attr.pallet.html#upgrade-guidelines). ##⚠️ Breaking Change⚠️ From [checking upgrade guidelines](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`: use of this pallet in `construct_runtime!` needs careful updating of the name in order to not 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 `Assets` 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 `Assets` pallet. ### Notes There are some changes to the docs in metadata for the constants. The docs in the metadata for constants are now more complete.
These pallets migration are merged and can be ticked now:
|
I plan to continue migrating BTW, it seems that
|
I put your name, nobody is working on it AFAIK |
Just a note that we want to mark the extrinsics as |
@shawntabrizi I found a issue in the process of migrating metadata generated by old macro{
"name": "TechnicalMembership",
"storage": {
"prefix": "Instance1Membership",
"entries": [
{
"name": "Members",
"modifier": "Default",
"ty": {
"Plain": "Vec<T::AccountId>"
},
"default": [
0
],
"documentation": [
" The current membership, stored as an ordered Vec."
]
},
{
"name": "Prime",
"modifier": "Optional",
"ty": {
"Plain": "T::AccountId"
},
"default": [
0
],
"documentation": [
" The current prime member, if one exists."
]
}
]
},
"calls": [
{
"name": "add_member",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Add a member `who` to the set.",
"",
" May only be called from `T::AddOrigin`."
]
},
{
"name": "remove_member",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Remove a member `who` from the set.",
"",
" May only be called from `T::RemoveOrigin`."
]
},
{
"name": "swap_member",
"arguments": [
{
"name": "remove",
"ty": "T::AccountId"
},
{
"name": "add",
"ty": "T::AccountId"
}
],
"documentation": [
" Swap out one member `remove` for another `add`.",
"",
" May only be called from `T::SwapOrigin`.",
"",
" Prime membership is *not* passed from `remove` to `add`, if extant."
]
},
{
"name": "reset_members",
"arguments": [
{
"name": "members",
"ty": "Vec<T::AccountId>"
}
],
"documentation": [
" Change the membership to a new set, disregarding the existing membership. Be nice and",
" pass `members` pre-sorted.",
"",
" May only be called from `T::ResetOrigin`."
]
},
{
"name": "change_key",
"arguments": [
{
"name": "new",
"ty": "T::AccountId"
}
],
"documentation": [
" Swap out the sending member for some other key `new`.",
"",
" May only be called from `Signed` origin of a current member.",
"",
" Prime membership is passed from the origin account to `new`, if extant."
]
},
{
"name": "set_prime",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Set the prime member. Must be a current member.",
"",
" May only be called from `T::PrimeOrigin`."
]
},
{
"name": "clear_prime",
"arguments": [],
"documentation": [
" Remove the prime member if it exists.",
"",
" May only be called from `T::PrimeOrigin`."
]
}
],
"event": [
{
"name": "MemberAdded",
"arguments": [],
"documentation": [
" The given member was added; see the transaction for who."
]
},
{
"name": "MemberRemoved",
"arguments": [],
"documentation": [
" The given member was removed; see the transaction for who."
]
},
{
"name": "MembersSwapped",
"arguments": [],
"documentation": [
" Two members were swapped; see the transaction for who."
]
},
{
"name": "MembersReset",
"arguments": [],
"documentation": [
" The membership was reset; see the transaction for who the new set is."
]
},
{
"name": "KeyChanged",
"arguments": [],
"documentation": [
" One of the members' keys changed."
]
},
{
"name": "Dummy",
"arguments": [
"sp_std::marker::PhantomData<(AccountId, Event)>"
],
"documentation": [
" Phantom member, never used."
]
}
],
"constants": [],
"errors": [
{
"name": "AlreadyMember",
"documentation": [
" Already a member."
]
},
{
"name": "NotMember",
"documentation": [
" Not a member."
]
}
],
"index": 15
} metadata generated by new macro{
"name": "TechnicalMembership",
"storage": {
"prefix": "TechnicalMembership",
"entries": [
{
"name": "Members",
"modifier": "Default",
"ty": {
"Plain": "Vec<T::AccountId>"
},
"default": [
0
],
"documentation": [
" The current membership, stored as an ordered Vec."
]
},
{
"name": "Prime",
"modifier": "Optional",
"ty": {
"Plain": "T::AccountId"
},
"default": [
0
],
"documentation": [
" The current prime member, if one exists."
]
}
]
},
"calls": [
{
"name": "add_member",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Add a member `who` to the set.",
"",
" May only be called from `T::AddOrigin`."
]
},
{
"name": "remove_member",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Remove a member `who` from the set.",
"",
" May only be called from `T::RemoveOrigin`."
]
},
{
"name": "swap_member",
"arguments": [
{
"name": "remove",
"ty": "T::AccountId"
},
{
"name": "add",
"ty": "T::AccountId"
}
],
"documentation": [
" Swap out one member `remove` for another `add`.",
"",
" May only be called from `T::SwapOrigin`.",
"",
" Prime membership is *not* passed from `remove` to `add`, if extant."
]
},
{
"name": "reset_members",
"arguments": [
{
"name": "members",
"ty": "Vec<T::AccountId>"
}
],
"documentation": [
" Change the membership to a new set, disregarding the existing membership. Be nice and",
" pass `members` pre-sorted.",
"",
" May only be called from `T::ResetOrigin`."
]
},
{
"name": "change_key",
"arguments": [
{
"name": "new",
"ty": "T::AccountId"
}
],
"documentation": [
" Swap out the sending member for some other key `new`.",
"",
" May only be called from `Signed` origin of a current member.",
"",
" Prime membership is passed from the origin account to `new`, if extant."
]
},
{
"name": "set_prime",
"arguments": [
{
"name": "who",
"ty": "T::AccountId"
}
],
"documentation": [
" Set the prime member. Must be a current member.",
"",
" May only be called from `T::PrimeOrigin`."
]
},
{
"name": "clear_prime",
"arguments": [],
"documentation": [
" Remove the prime member if it exists.",
"",
" May only be called from `T::PrimeOrigin`."
]
}
],
"event": [
{
"name": "MemberAdded",
"arguments": [],
"documentation": [
" The given member was added; see the transaction for who."
]
},
{
"name": "MemberRemoved",
"arguments": [],
"documentation": [
" The given member was removed; see the transaction for who."
]
},
{
"name": "MembersSwapped",
"arguments": [],
"documentation": [
" Two members were swapped; see the transaction for who."
]
},
{
"name": "MembersReset",
"arguments": [],
"documentation": [
" The membership was reset; see the transaction for who the new set is."
]
},
{
"name": "KeyChanged",
"arguments": [],
"documentation": [
" One of the members' keys changed."
]
},
{
"name": "Dummy",
"arguments": [
"PhantomData<(T::AccountId,<T as Config<I>>::Event)>"
],
"documentation": [
" Phantom member, never used."
]
}
],
"constants": [],
"errors": [
{
"name": "AlreadyMember",
"documentation": [
" Already a member."
]
},
{
"name": "NotMember",
"documentation": [
" Not a member."
]
}
],
"index": 15
} diff:
|
the solution is to migrate the storages, in order to use their new pallet prefix. |
@thiolliere |
What more is there to contribute to here, people? |
I plan to migrate pallet-society. Is anyone else working on it? |
good, I'm not aware of anybody working on it yet |
Okay then. I have picked it |
finally finished for substrate pallets, thanks for all contributions |
Big thank you to everyone for this! |
Here is the list of pallet and their status, if you want to migrate one you can put your name after it to avoid duplicated work.
some help guidelines to do migration: https://crates.parity.io/frame_support/attr.pallet.html#upgrade-guidelines
some help guidelines to review a migration: https://crates.parity.io/frame_support/attr.pallet.html#checking-upgrade-guidelines
pallet-indices
topallet!
#8465pallet-session
to the new pallet macro #9796pallet-sudo
topallet!
#8448The text was updated successfully, but these errors were encountered: