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:
@@ -6,7 +6,7 @@ edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Example FRAME pallet for multi-block migrations"
|
||||
description = "Example FRAME pezpallet for multi-block migrations"
|
||||
publish = false
|
||||
documentation = "https://docs.rs/pezpallet-example-mbm"
|
||||
|
||||
|
||||
@@ -17,21 +17,21 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
//! # Multi-Block Migrations Example Pallet
|
||||
//! # Multi-Block Migrations Example Pezpallet
|
||||
//!
|
||||
//! This pallet serves as a minimal example of a pallet that uses the [Multi-Block Migrations
|
||||
//! This pezpallet serves as a minimal example of a pezpallet that uses the [Multi-Block Migrations
|
||||
//! Framework](pezframe_support::migrations). You can observe how to configure it in a runtime in the
|
||||
//! `pez-kitchensink-runtime` crate.
|
||||
//!
|
||||
//! ## Introduction and Purpose
|
||||
//!
|
||||
//! The primary purpose of this pallet is to demonstrate the concept of Multi-Block Migrations in
|
||||
//! The primary purpose of this pezpallet is to demonstrate the concept of Multi-Block Migrations in
|
||||
//! Bizinikiwi. It showcases the migration of values from in the
|
||||
//! [`MyMap`](`pallet::MyMap`) storage map a `u32` to a `u64` data type using the
|
||||
//! [`MyMap`](`pezpallet::MyMap`) storage map a `u32` to a `u64` data type using the
|
||||
//! [`SteppedMigration`](`pezframe_support::migrations::SteppedMigration`) implementation from the
|
||||
//! [`migrations::v1`] module.
|
||||
//!
|
||||
//! The [`MyMap`](`pallet::MyMap`) storage item is defined in this `pallet`, and is
|
||||
//! The [`MyMap`](`pezpallet::MyMap`) storage item is defined in this `pezpallet`, and is
|
||||
//! aliased to [`v0::MyMap`](`migrations::v1::v0::MyMap`) in the [`migrations::v1`]
|
||||
//! module.
|
||||
//!
|
||||
@@ -41,22 +41,22 @@
|
||||
//!
|
||||
//! - `cargo doc --package pezpallet-example-mbm --open`
|
||||
//!
|
||||
//! This documentation is organized to help you understand the pallet's components, features, and
|
||||
//! This documentation is organized to help you understand the pezpallet's components, features, and
|
||||
//! migration process.
|
||||
//!
|
||||
//! ## Example Usage
|
||||
//!
|
||||
//! To use this pallet and understand multi-block migrations, you can refer to the
|
||||
//! To use this pezpallet and understand multi-block migrations, you can refer to the
|
||||
//! [`migrations::v1`] module, which contains a step-by-step migration example.
|
||||
//!
|
||||
//! ## Pallet Structure
|
||||
//! ## Pezpallet Structure
|
||||
//!
|
||||
//! The pallet is structured as follows:
|
||||
//! The pezpallet is structured as follows:
|
||||
//!
|
||||
//! - [`migrations`]: Contains migration-related modules and migration logic.
|
||||
//! - [`v1`](`migrations::v1`): Demonstrates the migration process for changing the data type in
|
||||
//! the storage map.
|
||||
//! - [`pallet`]: Defines the pallet configuration and storage items.
|
||||
//! - [`pezpallet`]: Defines the pezpallet configuration and storage items.
|
||||
//!
|
||||
//! ## Migration Safety
|
||||
//!
|
||||
@@ -69,19 +69,19 @@
|
||||
pub mod migrations;
|
||||
mod mock;
|
||||
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use pezframe_support::{pezpallet_prelude::StorageMap, Blake2_128Concat};
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config {}
|
||||
|
||||
/// Define a storage item to illustrate multi-block migrations.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub type MyMap<T: Config> = StorageMap<_, Blake2_128Concat, u32, u64>;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ pub mod v1;
|
||||
|
||||
/// A unique identifier across all pallets.
|
||||
///
|
||||
/// This constant represents a unique identifier for the migrations of this pallet.
|
||||
/// It helps differentiate migrations for this pallet from those of others. Note that we don't
|
||||
/// This constant represents a unique identifier for the migrations of this pezpallet.
|
||||
/// It helps differentiate migrations for this pezpallet from those of others. Note that we don't
|
||||
/// directly pull the crate name from the environment, since that would change if the crate were
|
||||
/// ever to be renamed and could cause historic migrations to run again.
|
||||
pub const PALLET_MIGRATIONS_ID: &[u8; 21] = b"pezpallet-example-mbm";
|
||||
|
||||
@@ -24,7 +24,7 @@ use crate::{
|
||||
v1,
|
||||
v1::{weights, weights::WeightInfo},
|
||||
},
|
||||
Config, Pallet,
|
||||
Config, Pezpallet,
|
||||
};
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_support::{migrations::SteppedMigration, weights::WeightMeter};
|
||||
@@ -50,5 +50,5 @@ mod benches {
|
||||
assert_eq!(meter.consumed(), weights::BizinikiwiWeight::<T>::step() * 2);
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Runtime);
|
||||
impl_benchmark_test_suite!(Pezpallet, crate::mock::new_test_ext(), crate::mock::Runtime);
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
//!
|
||||
//! This module showcases a simple migration that iterates over the values in the
|
||||
//! [`v0::MyMap`](`crate::migrations::v1::v0::MyMap`) storage map, transforms them,
|
||||
//! and inserts them into the [`MyMap`](`crate::pallet::MyMap`) storage map.
|
||||
//! and inserts them into the [`MyMap`](`crate::pezpallet::MyMap`) storage map.
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use super::PALLET_MIGRATIONS_ID;
|
||||
use crate::pallet::{Config, MyMap};
|
||||
use crate::pezpallet::{Config, MyMap};
|
||||
use pezframe_support::{
|
||||
migrations::{MigrationId, SteppedMigration, SteppedMigrationError},
|
||||
pezpallet_prelude::PhantomData,
|
||||
@@ -49,12 +49,12 @@ pub mod weights;
|
||||
// intended to be used by any other code.
|
||||
pub mod v0 {
|
||||
use super::Config;
|
||||
use crate::pallet::Pallet;
|
||||
use crate::pezpallet::Pezpallet;
|
||||
use pezframe_support::{storage_alias, Blake2_128Concat};
|
||||
|
||||
#[storage_alias]
|
||||
/// The storage item that is being migrated from.
|
||||
pub type MyMap<T: Config> = StorageMap<Pallet<T>, Blake2_128Concat, u32, u32>;
|
||||
pub type MyMap<T: Config> = StorageMap<Pezpallet<T>, Blake2_128Concat, u32, u32>;
|
||||
}
|
||||
|
||||
/// Migrates the items of the [`crate::MyMap`] map from `u32` to `u64`.
|
||||
|
||||
@@ -42,7 +42,7 @@ fn lazy_migration_works() {
|
||||
|
||||
// Give it enough weight do do exactly 16 iterations:
|
||||
let limit = <T as pezpallet_migrations::Config>::WeightInfo::progress_mbms_none() +
|
||||
pezpallet_migrations::Pallet::<T>::exec_migration_max_weight() +
|
||||
pezpallet_migrations::Pezpallet::<T>::exec_migration_max_weight() +
|
||||
weights::BizinikiwiWeight::<T>::step() * 16;
|
||||
MigratorServiceWeight::set(&limit);
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
// pezkuwi-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --runtime
|
||||
// target/release/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.compact.compressed.wasm
|
||||
// --pallet
|
||||
// --pezpallet
|
||||
// pezpallet_example_mbm
|
||||
// --extrinsic
|
||||
//
|
||||
|
||||
@@ -67,7 +67,7 @@ construct_runtime! {
|
||||
pub struct Runtime
|
||||
{
|
||||
System: pezframe_system,
|
||||
Pallet: crate,
|
||||
Pezpallet: crate,
|
||||
Migrator: pezpallet_migrations,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// pezpallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_example_mbm
|
||||
// --pezpallet=pezpallet_example_mbm
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/examples/multi-block-migrations/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
|
||||
Reference in New Issue
Block a user