fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
@@ -53,7 +53,7 @@ pub trait StorageDoubleMap<K1: FullEncode, K2: FullEncode, V: FullCodec> {
|
||||
/// Hasher for the second key.
|
||||
type Hasher2: StorageHasher;
|
||||
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8];
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
|
||||
@@ -41,7 +41,7 @@ pub trait StorageMap<K: FullEncode, V: FullCodec> {
|
||||
/// Hasher. Used for generating final key.
|
||||
type Hasher: StorageHasher;
|
||||
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8];
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
|
||||
@@ -46,18 +46,18 @@ mod tests {
|
||||
storage::{generator::StorageValue, unhashed},
|
||||
};
|
||||
|
||||
#[crate::pallet]
|
||||
#[crate::pezpallet]
|
||||
pub mod pezframe_system {
|
||||
#[allow(unused)]
|
||||
use super::{pezframe_system, pezframe_system::pezpallet_prelude::*};
|
||||
pub use crate::dispatch::RawOrigin;
|
||||
use crate::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pallet::disable_pezframe_system_supertrait_check]
|
||||
#[pezpallet::config]
|
||||
#[pezpallet::disable_pezframe_system_supertrait_check]
|
||||
pub trait Config: 'static {
|
||||
type Block: pezsp_runtime::traits::Block;
|
||||
type AccountId;
|
||||
@@ -69,32 +69,32 @@ mod tests {
|
||||
type DbWeight: Get<crate::weights::RuntimeDbWeight>;
|
||||
}
|
||||
|
||||
#[pallet::origin]
|
||||
#[pezpallet::origin]
|
||||
pub type Origin<T> = RawOrigin<<T as Config>::AccountId>;
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Required by construct_runtime
|
||||
CallFiltered,
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {}
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {}
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Value<T> = StorageValue<_, (u64, u64), ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type Map<T> = StorageMap<_, Blake2_128Concat, u16, u64, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NumberMap<T> = StorageMap<_, Identity, u32, u64, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type DoubleMap<T> =
|
||||
StorageDoubleMap<_, Blake2_128Concat, u16, Twox64Concat, u32, u64, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type NMap<T> = StorageNMap<
|
||||
_,
|
||||
(storage::Key<Blake2_128Concat, u16>, storage::Key<Twox64Concat, u32>),
|
||||
|
||||
@@ -60,7 +60,7 @@ pub trait StorageNMap<K: KeyGenerator, V: FullCodec> {
|
||||
/// The type that get/take returns.
|
||||
type Query;
|
||||
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8];
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
|
||||
@@ -31,7 +31,7 @@ pub trait StorageValue<T: FullCodec> {
|
||||
/// The type that get/take returns.
|
||||
type Query;
|
||||
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8];
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
|
||||
@@ -300,9 +300,9 @@ pub fn take_storage_item<K: Encode + Sized, T: Decode + Sized, H: StorageHasher>
|
||||
take_storage_value(module, item, key.using_encoded(H::hash).as_ref())
|
||||
}
|
||||
|
||||
/// Move a storage from a pallet prefix to another pallet prefix.
|
||||
/// Move a storage from a pezpallet prefix to another pezpallet prefix.
|
||||
///
|
||||
/// Keys used in pallet storages always start with:
|
||||
/// Keys used in pezpallet storages always start with:
|
||||
/// `concat(twox_128(pezpallet_name), twox_128(storage_name))`.
|
||||
///
|
||||
/// This function will remove all value for which the key start with
|
||||
@@ -311,7 +311,7 @@ pub fn take_storage_item<K: Encode + Sized, T: Decode + Sized, H: StorageHasher>
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// If a pallet named "my_example" has 2 storages named "Foo" and "Bar" and the pallet is renamed
|
||||
/// If a pezpallet named "my_example" has 2 storages named "Foo" and "Bar" and the pezpallet is renamed
|
||||
/// "my_new_example_name", a migration can be:
|
||||
/// ```
|
||||
/// # use pezframe_support::storage::migration::move_storage_from_pallet;
|
||||
@@ -336,9 +336,9 @@ pub fn move_storage_from_pallet(
|
||||
}
|
||||
}
|
||||
|
||||
/// Move all storages from a pallet prefix to another pallet prefix.
|
||||
/// Move all storages from a pezpallet prefix to another pezpallet prefix.
|
||||
///
|
||||
/// Keys used in pallet storages always start with:
|
||||
/// Keys used in pezpallet storages always start with:
|
||||
/// `concat(twox_128(pezpallet_name), twox_128(storage_name))`.
|
||||
///
|
||||
/// This function will remove all value for which the key start with `twox_128(old_pallet_name)`
|
||||
@@ -348,7 +348,7 @@ pub fn move_storage_from_pallet(
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// If a pallet named "my_example" has some storages and the pallet is renamed
|
||||
/// If a pezpallet named "my_example" has some storages and the pezpallet is renamed
|
||||
/// "my_new_example_name", a migration can be:
|
||||
/// ```
|
||||
/// # use pezframe_support::storage::migration::move_pallet;
|
||||
|
||||
@@ -1343,7 +1343,7 @@ impl<T> Iterator for ChildTriePrefixIterator<T> {
|
||||
|
||||
/// Trait for storage types that store all its value after a unique prefix.
|
||||
pub trait StoragePrefixedContainer {
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8];
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
@@ -1362,7 +1362,7 @@ pub trait StoragePrefixedContainer {
|
||||
/// Twox128(pezpallet_prefix) ++ Twox128(storage_prefix)
|
||||
/// ```
|
||||
pub trait StoragePrefixedMap<Value: FullCodec> {
|
||||
/// Pallet prefix. Used for generating final key.
|
||||
/// Pezpallet prefix. Used for generating final key.
|
||||
fn pezpallet_prefix() -> &'static [u8]; // TODO move to StoragePrefixedContainer
|
||||
|
||||
/// Storage prefix. Used for generating final key.
|
||||
@@ -1733,7 +1733,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the storage prefix for a specific pallet name and storage name.
|
||||
/// Returns the storage prefix for a specific pezpallet name and storage name.
|
||||
///
|
||||
/// The storage prefix is `concat(twox_128(pezpallet_name), twox_128(storage_name))`.
|
||||
pub fn storage_prefix(pezpallet_name: &[u8], storage_name: &[u8]) -> [u8; 32] {
|
||||
|
||||
@@ -51,7 +51,7 @@ use pezsp_runtime::traits::Saturating;
|
||||
/// The total number of items currently stored in the map can be retrieved with the
|
||||
/// [`CountedStorageMap::count`] method.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Examples
|
||||
@@ -59,18 +59,18 @@ use pezsp_runtime::traits::Saturating;
|
||||
/// Declaring a counted map:
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink CountedStorageMap, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = CountedStorageMap<
|
||||
/// _,
|
||||
/// Blake2_128Concat,
|
||||
@@ -80,7 +80,7 @@ use pezsp_runtime::traits::Saturating;
|
||||
/// >;
|
||||
///
|
||||
/// /// Alternative named syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = CountedStorageMap<
|
||||
/// Hasher = Blake2_128Concat,
|
||||
/// Key = u32,
|
||||
|
||||
@@ -46,24 +46,24 @@ use pezsp_runtime::traits::Saturating;
|
||||
/// Whenever the counter needs to be updated, an additional read and write occurs to update that
|
||||
/// counter.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink CountedStorageNMap, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = CountedStorageNMap<
|
||||
/// _,
|
||||
/// (
|
||||
@@ -76,7 +76,7 @@ use pezsp_runtime::traits::Saturating;
|
||||
/// >;
|
||||
///
|
||||
/// /// Alternative named syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = CountedStorageNMap<
|
||||
/// Key = (
|
||||
/// NMapKey<Blake2_128Concat, u8>,
|
||||
|
||||
@@ -43,7 +43,7 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// Also, conceptually, a double map is a special case of a
|
||||
/// [`StorageNMap`](pezframe_support::storage::types::StorageNMap) using two keys.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Examples
|
||||
@@ -51,18 +51,18 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// ### Kitchen-sink
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink StorageDoubleMap, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = StorageDoubleMap<
|
||||
/// _,
|
||||
/// Blake2_128Concat,
|
||||
@@ -74,7 +74,7 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// >;
|
||||
///
|
||||
/// /// Alternative named syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = StorageDoubleMap<
|
||||
/// Hasher1 = Blake2_128Concat,
|
||||
/// Key1 = u8,
|
||||
@@ -138,7 +138,7 @@ where
|
||||
Key2: MaxEncodedLen,
|
||||
{
|
||||
fn get() -> u32 {
|
||||
// The `max_len` of both key hashes plus the pallet prefix and storage prefix (which both
|
||||
// The `max_len` of both key hashes plus the pezpallet prefix and storage prefix (which both
|
||||
// are hashed with `Twox128`).
|
||||
let z =
|
||||
Hasher1::max_len::<Key1>() + Hasher2::max_len::<Key2>() + Twox128::max_len::<()>() * 2;
|
||||
|
||||
@@ -35,24 +35,24 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// A type representing a *map* in storage. A *storage map* is a mapping of keys to values of a
|
||||
/// given type stored on-chain.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink StorageMap, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = StorageMap<
|
||||
/// _,
|
||||
/// Blake2_128Concat,
|
||||
@@ -62,7 +62,7 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// >;
|
||||
///
|
||||
/// /// Alternative named syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = StorageMap<
|
||||
/// Hasher = Blake2_128Concat,
|
||||
/// Key = u32,
|
||||
@@ -89,7 +89,7 @@ where
|
||||
Key: FullCodec + MaxEncodedLen,
|
||||
{
|
||||
fn get() -> u32 {
|
||||
// The `max_len` of the key hash plus the pallet prefix and storage prefix (which both are
|
||||
// The `max_len` of the key hash plus the pezpallet prefix and storage prefix (which both are
|
||||
// hashed with `Twox128`).
|
||||
let z = Hasher::max_len::<Key>() + Twox128::max_len::<()>() * 2;
|
||||
z as u32
|
||||
|
||||
@@ -40,24 +40,24 @@ use pezsp_runtime::SaturatedConversion;
|
||||
/// For example, [`StorageDoubleMap`](pezframe_support::storage::types::StorageDoubleMap) is a special
|
||||
/// case of an *NMap* with N = 2.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink StorageNMap, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = StorageNMap<
|
||||
/// _,
|
||||
/// (
|
||||
@@ -70,7 +70,7 @@ use pezsp_runtime::SaturatedConversion;
|
||||
/// >;
|
||||
///
|
||||
/// /// Named alternative syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = StorageNMap<
|
||||
/// Key = (
|
||||
/// NMapKey<Blake2_128Concat, u8>,
|
||||
|
||||
@@ -34,28 +34,28 @@ use pezsp_metadata_ir::{StorageEntryMetadataIR, StorageEntryTypeIR};
|
||||
/// A type representing a *value* in storage. A *storage value* is a single value of a given type
|
||||
/// stored on-chain.
|
||||
///
|
||||
/// For general information regarding the `#[pallet::storage]` attribute, refer to
|
||||
/// For general information regarding the `#[pezpallet::storage]` attribute, refer to
|
||||
/// [`crate::pezpallet_macros::storage`].
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
/// #[pezframe_support::pallet]
|
||||
/// mod pallet {
|
||||
/// #[pezframe_support::pezpallet]
|
||||
/// mod pezpallet {
|
||||
/// # use pezframe_support::pezpallet_prelude::*;
|
||||
/// # #[pallet::config]
|
||||
/// # #[pezpallet::config]
|
||||
/// # pub trait Config: pezframe_system::Config {}
|
||||
/// # #[pallet::pallet]
|
||||
/// # pub struct Pallet<T>(_);
|
||||
/// # #[pezpallet::pezpallet]
|
||||
/// # pub struct Pezpallet<T>(_);
|
||||
/// /// A kitchen-sink StorageValue, with all possible additional attributes.
|
||||
/// #[pallet::storage]
|
||||
/// #[pallet::getter(fn foo)]
|
||||
/// #[pallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pallet::unbounded]
|
||||
/// #[pezpallet::storage]
|
||||
/// #[pezpallet::getter(fn foo)]
|
||||
/// #[pezpallet::storage_prefix = "OtherFoo"]
|
||||
/// #[pezpallet::unbounded]
|
||||
/// pub type Foo<T> = StorageValue<_, u32,ValueQuery>;
|
||||
///
|
||||
/// /// Named alternative syntax.
|
||||
/// #[pallet::storage]
|
||||
/// #[pezpallet::storage]
|
||||
/// pub type Bar<T> = StorageValue<
|
||||
/// Value = u32,
|
||||
/// QueryKind = ValueQuery
|
||||
|
||||
Reference in New Issue
Block a user