-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
bot merge |
Waiting for commit status. |
note that pallet macro doesn't make use of instance trait anymore, instance trait was created in order to give different prefix to each instances, now that prefix is given by PalletInfo, the instance trait had no purpose so it was removed. In order to have a INDEX identifier in pallet defines with pallet macro I think ppl should add it to the Config trait or we can add one in PalletInfo. (actually adding one in PalletInfo seems the best strategy to me). |
🤦 |
* Add an index to the Instance trait * Update frame/support/procedural/src/storage/instance_trait.rs
FYI this is moving to the next polkadot release very soon, didn't we decide to revert this? |
(It doesn't have a big impact and we can remove it any point anyhow, but I just saw it in the release notes and thought better do it soon than later.) |
The So for me it doesn't matter, we are not creating code debt here. |
Then I am also neutral, whatever @shawntabrizi prefers. |
i dont think it matters if we keep it. |
This PR introduces a simple
const INDEX: u8;
to the Instance trait used for Pallets.This is useful for getting a minimal unique identifier for different instances, for example using it as a seed to some unique account generation.
The
DefaultInstance
usesindex == 0
, so we deprecateInstance0
(which wasn't used anywhere) and instead use instances1 ..= 16
.