Add an INDEX to the Instance trait (#8555)

* Add an index to the Instance trait

* Update frame/support/procedural/src/storage/instance_trait.rs
This commit is contained in:
Shawn Tabrizi authored and GitHub committed 2021-04-07 12:58:23 +00:00
1 parent 1cb3590f49
commit d8c1a1d12b
5 files changed
+23 -8

No files matched your search

+4 -4
View File
@@ -31,10 +31,6 @@
//! NOTE: [`frame_support::pallet`] will reexport them inside the module, in order to make them
//! accessible to [`frame_support::construct_runtime`].
/// Instance0 to be used for instantiable pallet define with `pallet` macro.
#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
pub struct Instance0;
/// Instance1 to be used for instantiable pallet define with `pallet` macro.
#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
pub struct Instance1;
@@ -94,3 +90,7 @@ pub struct Instance14;
/// Instance15 to be used for instantiable pallet define with `pallet` macro.
#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
pub struct Instance15;
/// Instance16 to be used for instantiable pallet define with `pallet` macro.
#[derive(Clone, Copy, PartialEq, Eq, crate::RuntimeDebugNoBound)]
pub struct Instance16;
@@ -26,6 +26,8 @@
pub trait Instance: 'static {
/// Unique module prefix. E.g. "InstanceNMyModule" or "MyModule"
const PREFIX: &'static str;
/// Unique numerical identifier for an instance.
const INDEX: u8;
}
/// An instance of a storage in a pallet.