Attribute Macro frame_support_procedural::storage_prefix
source · #[storage_prefix]
Expand description
The optional attribute #[pallet::storage_prefix = "SomeName"]
allows you to define the
storage prefix to use. This is helpful if you wish to rename the storage field but don’t
want to perform a migration.
E.g:
ⓘ
#[pallet::storage]
#[pallet::storage_prefix = "foo"]
#[pallet::getter(fn my_storage)]
pub(super) type MyStorage<T> = StorageMap<Hasher = Blake2_128Concat, Key = u32, Value = u32>;
or
ⓘ
#[pallet::storage]
#[pallet::getter(fn my_storage)]
pub(super) type MyStorage<T> = StorageMap<_, Blake2_128Concat, u32, u32>;