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:
2025-12-16 09:57:23 +03:00
parent eea003e14d
commit 3139ffa25e
3022 changed files with 42157 additions and 23579 deletions
+2 -2
View File
@@ -38,8 +38,8 @@
- ☁️ It is based on the
[Pezcumulus](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/pezcumulus/index.html) framework.
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
such as a [Balances pallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
- 🔧 Its runtime is configured with a single custom pezpallet as a starting point, and a handful of ready-made pallets
such as a [Balances pezpallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
- 👉 Learn more about teyrchains [here](https://wiki.network.pezkuwichain.io/docs/learn-parachains)
+2 -2
View File
@@ -38,8 +38,8 @@
- ☁️ It is based on the
[Pezcumulus](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/pezcumulus/index.html) framework.
- 🔧 Its runtime is configured with a single custom pallet as a starting point, and a handful of ready-made pallets
such as a [Balances pallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
- 🔧 Its runtime is configured with a single custom pezpallet as a starting point, and a handful of ready-made pallets
such as a [Balances pezpallet](https://docs.pezkuwichain.io/sdk/master/pallet_balances/index.html).
- 👉 Learn more about teyrchains [here](https://wiki.network.pezkuwichain.io/docs/learn-parachains)
+1 -1
View File
@@ -44,7 +44,7 @@ pub enum Subcommand {
ExportGenesisWasm(pezcumulus_client_cli::ExportGenesisWasmCommand),
/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
/// The pezpallet benchmarking moved to the `pezpallet` sub-command.
#[command(subcommand)]
Benchmark(pezframe_benchmarking_cli::BenchmarkCmd),
}
+1 -1
View File
@@ -185,7 +185,7 @@ pub fn run() -> Result<()> {
let runner = cli.create_runner(cmd)?;
// Switch on the concrete benchmark sub-command-
match cmd {
BenchmarkCmd::Pallet(cmd) =>
BenchmarkCmd::Pezpallet(cmd) =>
if cfg!(feature = "runtime-benchmarks") {
runner.sync_run(|config| cmd.run_with_spec::<pezsp_runtime::traits::HashingFor<Block>, ReclaimHostFunctions>(Some(config.chain_spec)))
} else {
+3 -3
View File
@@ -1,13 +1,13 @@
# Pallets
️ A pallet is a unit of encapsulated logic, with a clearly defined responsibility. A pallet is analogous to a
️ A pezpallet is a unit of encapsulated logic, with a clearly defined responsibility. A pezpallet is analogous to a
module in the runtime.
💁 In this template, there is a simple custom pallet based on the FRAME framework.
💁 In this template, there is a simple custom pezpallet based on the FRAME framework.
👉 Learn more about FRAME
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
🧑‍🏫 Please refer to
[this guide](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html)
to learn how to write a basic pallet.
to learn how to write a basic pezpallet.
@@ -1,6 +1,6 @@
[package]
name = "pezpallet-teyrchain-template"
description = "FRAME pallet template for defining custom runtime logic."
description = "FRAME pezpallet template for defining custom runtime logic."
version = "0.0.0"
license = "Unlicense"
authors.workspace = true
@@ -7,7 +7,7 @@ use frame::{deps::pezframe_benchmarking::v2::*, prelude::*};
mod benchmarks {
use super::*;
#[cfg(test)]
use crate::pallet::Pallet as Template;
use crate::pezpallet::Pezpallet as Template;
use pezframe_system::RawOrigin;
#[benchmark]
@@ -1,12 +1,12 @@
//! # Template Pallet
//! # Template Pezpallet
//!
//! A pallet with minimal functionality to help developers understand the essential components of
//! writing a FRAME pallet. It is typically used in beginner tutorials or in Pezkuwi SDK template
//! as a starting point for creating a new pallet and **not meant to be used in production**.
//! A pezpallet with minimal functionality to help developers understand the essential components of
//! writing a FRAME pezpallet. It is typically used in beginner tutorials or in Pezkuwi SDK template
//! as a starting point for creating a new pezpallet and **not meant to be used in production**.
//!
//! ## Overview
//!
//! This template pallet contains basic examples of:
//! This template pezpallet contains basic examples of:
//! - declaring a storage item that stores a single block-number
//! - declaring and using events
//! - declaring and using errors
@@ -14,10 +14,10 @@
//! upon success
//! - another dispatchable function that causes a custom error to be thrown
//!
//! Each pallet section is annotated with an attribute using the `#[pallet::...]` procedural macro.
//! This macro generates the necessary code for a pallet to be aggregated into a FRAME runtime.
//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural macro.
//! This macro generates the necessary code for a pezpallet to be aggregated into a FRAME runtime.
//!
//! To get started with pallet development, consider using this tutorial:
//! To get started with pezpallet development, consider using this tutorial:
//!
//! <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
//!
@@ -26,28 +26,28 @@
//! <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html>
//!
//! And looking at the frame [`kitchen-sink`](https://docs.pezkuwichain.io/sdk/master/pezpallet_example_kitchensink/index.html)
//! pallet, a showcase of all pallet macros.
//! pezpallet, a showcase of all pezpallet macros.
//!
//! ### Pallet Sections
//! ### Pezpallet Sections
//!
//! The pallet sections in this template are:
//! The pezpallet sections in this template are:
//!
//! - A **configuration trait** that defines the types and parameters which the pallet depends on
//! (denoted by the `#[pallet::config]` attribute). See: [`Config`].
//! - A **means to store pezpallet-specific data** (denoted by the `#[pallet::storage]` attribute).
//! - A **configuration trait** that defines the types and parameters which the pezpallet depends on
//! (denoted by the `#[pezpallet::config]` attribute). See: [`Config`].
//! - A **means to store pezpallet-specific data** (denoted by the `#[pezpallet::storage]` attribute).
//! See: [`storage_types`].
//! - A **declaration of the events** this pallet emits (denoted by the `#[pallet::event]`
//! - A **declaration of the events** this pezpallet emits (denoted by the `#[pezpallet::event]`
//! attribute). See: [`Event`].
//! - A **declaration of the errors** that this pallet can throw (denoted by the `#[pallet::error]`
//! - A **declaration of the errors** that this pezpallet can throw (denoted by the `#[pezpallet::error]`
//! attribute). See: [`Error`].
//! - A **set of dispatchable functions** that define the pallet's functionality (denoted by the
//! `#[pallet::call]` attribute). See: [`dispatchables`].
//! - A **set of dispatchable functions** that define the pezpallet's functionality (denoted by the
//! `#[pezpallet::call]` attribute). See: [`dispatchables`].
//!
//! Run `cargo doc --package pezpallet-template --open` to view this pallet's documentation.
//! Run `cargo doc --package pezpallet-template --open` to view this pezpallet's documentation.
#![cfg_attr(not(feature = "std"), no_std)]
pub use pallet::*;
pub use pezpallet::*;
#[cfg(test)]
mod mock;
@@ -63,25 +63,25 @@ mod benchmarking;
// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html>
// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
//
// To see a full list of `pallet` macros and their use cases, see:
// To see a full list of `pezpallet` macros and their use cases, see:
// <https://docs.pezkuwichain.io/sdk/master/pezpallet_example_kitchensink/index.html>
// <https://docs.pezkuwichain.io/sdk/master/pezframe_support/pezpallet_macros/index.html>
#[frame::pallet]
pub mod pallet {
#[frame::pezpallet]
pub mod pezpallet {
use frame::prelude::*;
/// Configure the pallet by specifying the parameters and types on which it depends.
#[pallet::config]
/// Configure the pezpallet by specifying the parameters and types on which it depends.
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
/// A type representing the weights required by the dispatchables of this pallet.
/// A type representing the weights required by the dispatchables of this pezpallet.
type WeightInfo: crate::weights::WeightInfo;
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
/// A struct to store a single block-number. Has all the right derives to store it in storage.
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/reference_docs/frame_storage_derives/index.html>
@@ -94,16 +94,16 @@ pub mod pallet {
pub(crate) block_number: BlockNumberFor<T>,
}
/// The pallet's storage items.
/// The pezpallet's storage items.
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#storage>
/// <https://docs.pezkuwichain.io/sdk/master/pezframe_support/pezpallet_macros/attr.storage.html>
#[pallet::storage]
#[pezpallet::storage]
pub type Something<T: Config> = StorageValue<_, CompositeStruct<T>>;
/// Pallets use events to inform users when important changes are made.
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#event-and-error>
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pezpallet::event]
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// We usually use passive tense for events.
SomethingStored { block_number: BlockNumberFor<T>, who: T::AccountId },
@@ -111,7 +111,7 @@ pub mod pallet {
/// Errors inform users that something went wrong.
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#event-and-error>
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
/// Error names should be descriptive.
NoneValue,
@@ -119,19 +119,19 @@ pub mod pallet {
StorageOverflow,
}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {}
/// Dispatchable functions allows users to interact with the pallet and invoke state changes.
/// Dispatchable functions allows users to interact with the pezpallet and invoke state changes.
/// These functions materialize as "extrinsics", which are often compared to transactions.
/// Dispatchable functions must be annotated with a weight and must return a DispatchResult.
/// <https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html#dispatchables>
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
/// An example dispatchable that takes a singles value as a parameter, writes the value to
/// storage and emits an event. This function must be dispatched by a signed extrinsic.
#[pallet::call_index(0)]
#[pallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().writes(1))]
#[pezpallet::call_index(0)]
#[pezpallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().writes(1))]
pub fn do_something(origin: OriginFor<T>, bn: u32) -> DispatchResultWithPostInfo {
// Check that the extrinsic was signed and get the signer.
// This function will return an error if the extrinsic is not signed.
@@ -153,8 +153,8 @@ pub mod pallet {
}
/// An example dispatchable that may throw a custom error.
#[pallet::call_index(1)]
#[pallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().reads_writes(1,1))]
#[pezpallet::call_index(1)]
#[pezpallet::weight(Weight::from_parts(10_000, 0) + T::DbWeight::get().reads_writes(1,1))]
pub fn cause_error(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let _who = ensure_signed(origin)?;
@@ -5,7 +5,7 @@ use frame::{
testing_prelude::*,
};
// Configure a mock runtime to test the pallet.
// Configure a mock runtime to test the pezpallet.
#[frame_construct_runtime]
mod test_runtime {
#[runtime::runtime]
@@ -6,7 +6,7 @@ fn it_works_for_default_value() {
new_test_ext().execute_with(|| {
// Dispatch a signed extrinsic.
assert_ok!(Template::do_something(RuntimeOrigin::signed(1), 42));
// Read pallet storage and assert an expected result.
// Read pezpallet storage and assert an expected result.
assert_eq!(Something::<Test>::get().map(|v| v.block_number), Some(42));
});
}
@@ -10,10 +10,10 @@
// Executed Command:
// ../../target/release/node-template
// benchmark
// pallet
// pezpallet
// --chain
// dev
// --pallet
// --pezpallet
// pezpallet_template
// --extrinsic
// *
+1 -1
View File
@@ -4,7 +4,7 @@
responsible for validating blocks and executing the state changes they define.
💁 The runtime in this template is constructed using ready-made FRAME pallets that ship with
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pallet](../pallets/README.md).
[Pezkuwi SDK](https://github.com/pezkuwichain/pezkuwi-sdk), and a [template for a custom pezpallet](../pallets/README.md).
👉 Learn more about FRAME
[here](https://docs.pezkuwichain.io/sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html).
+6 -6
View File
@@ -261,8 +261,8 @@ impl_runtime_apis! {
) {
use pezframe_benchmarking::BenchmarkList;
use pezkuwi_sdk::pezframe_support::traits::StorageInfoTrait;
use pezframe_system_benchmarking::Pallet as SystemBench;
use pezcumulus_pezpallet_session_benchmarking::Pallet as SessionBench;
use pezframe_system_benchmarking::Pezpallet as SystemBench;
use pezcumulus_pezpallet_session_benchmarking::Pezpallet as SessionBench;
use super::*;
let mut list = Vec::<BenchmarkList>::new();
@@ -279,7 +279,7 @@ impl_runtime_apis! {
use pezframe_benchmarking::{BenchmarkError, BenchmarkBatch};
use super::*;
use pezframe_system_benchmarking::Pallet as SystemBench;
use pezframe_system_benchmarking::Pezpallet as SystemBench;
impl pezframe_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &Vec<u8>) -> Result<(), BenchmarkError> {
TeyrchainSystem::initialize_for_set_code_benchmark(code.len() as u32);
@@ -291,7 +291,7 @@ impl_runtime_apis! {
}
}
use pezcumulus_pezpallet_session_benchmarking::Pallet as SessionBench;
use pezcumulus_pezpallet_session_benchmarking::Pezpallet as SessionBench;
impl pezcumulus_pezpallet_session_benchmarking::Config for Runtime {}
use pezkuwi_sdk::pezframe_support::traits::WhitelistedStorageKeys;
@@ -301,7 +301,7 @@ impl_runtime_apis! {
let params = (&config, &whitelist);
add_benchmarks!(params, batches);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
if batches.is_empty() { return Err("Benchmark not found for this pezpallet.".into()) }
Ok(batches)
}
}
@@ -322,7 +322,7 @@ impl_runtime_apis! {
impl pezcumulus_primitives_core::GetTeyrchainInfo<Block> for Runtime {
fn teyrchain_id() -> ParaId {
teyrchain_info::Pallet::<Runtime>::teyrchain_id()
teyrchain_info::Pezpallet::<Runtime>::teyrchain_id()
}
}
}
@@ -208,7 +208,7 @@ impl pezcumulus_pezpallet_teyrchain_system::Config for Runtime {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type OnSystemEvent = ();
type SelfParaId = teyrchain_info::Pallet<Runtime>;
type SelfParaId = teyrchain_info::Pezpallet<Runtime>;
type OutboundXcmpMessageSource = XcmpQueue;
type DmpQueue = pezframe_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type ReservedDmpWeight = ReservedDmpWeight;
@@ -239,7 +239,7 @@ impl pezpallet_message_queue::Config for Runtime {
RuntimeCall,
>;
type Size = u32;
// The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin:
// The XCMP queue pezpallet is only ever able to handle the `Sibling(ParaId)` origin:
type QueueChangeHandler = NarrowOriginToSibling<XcmpQueue>;
type QueuePausedQuery = NarrowOriginToSibling<XcmpQueue>;
type HeapSize = pezsp_core::ConstU32<{ 103 * 1024 }>;
@@ -341,7 +341,7 @@ impl pezpallet_collator_selection::Config for Runtime {
type WeightInfo = ();
}
/// Configure the pallet template in pallets/template.
/// Configure the pezpallet template in pallets/template.
impl pezpallet_teyrchain_template::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = pezpallet_teyrchain_template::weights::BizinikiwiWeight<Runtime>;
@@ -84,7 +84,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
// Native signed account converter; this just converts an `AccountId32` origin into a normal
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
// Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
// Xcm origins can be represented natively under the Xcm pezpallet's Xcm origin.
XcmPassthrough<RuntimeOrigin>,
);
@@ -175,7 +175,7 @@ impl pezpallet_xcm::Config for Runtime {
type XcmRouter = XcmRouter;
type ExecuteXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmExecuteFilter = Nothing;
// ^ Disable dispatchable execute on the XCM pallet.
// ^ Disable dispatchable execute on the XCM pezpallet.
// Needs to be `Everything` for local testing.
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;