-
Notifications
You must be signed in to change notification settings - Fork 984
Open
Labels
C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.A task where a mentor is available. Please indicate in the issue who the mentor could be.D0-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder.Can be fixed primarily by duplicating and adapting code by an intermediate coder.D2-substantialCan be fixed by an experienced coder with a working knowledge of the codebase.Can be fixed by an experienced coder with a working knowledge of the codebase.I5-enhancementAn additional feature request.An additional feature request.
Description
When adding a pallet to construct_runtime!
, an index for this pallet can be passed:
polkadot-sdk/polkadot/runtime/westend/src/lib.rs
Line 1418 in 814b938
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 8, |
In this case it would be 8
. It would be nice to declare this 8
as a const value. Because I have seen requests like this more often recently. We will probably first need to fix parity-scale-codec
to be able to accept a const value
there. The main blocker will probably be the check for duplicate indices. However, we can probably work around this by creating some const function that is evaluating all the indices and panics in case of an error. We should check on the UX of this solution.
So the final solution would look the following:
const MY_PALLET_INDEX: usize = 10;
---
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = MY_PALLET_INDEX,
Metadata
Metadata
Assignees
Labels
C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.A task where a mentor is available. Please indicate in the issue who the mentor could be.D0-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder.Can be fixed primarily by duplicating and adapting code by an intermediate coder.D2-substantialCan be fixed by an experienced coder with a working knowledge of the codebase.Can be fixed by an experienced coder with a working knowledge of the codebase.I5-enhancementAn additional feature request.An additional feature request.
Type
Projects
Status
Backlog