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
@@ -6,7 +6,7 @@ edition.workspace = true
license = "MIT-0"
homepage.workspace = true
repository.workspace = true
description = "FRAME example authorization transaction extension pallet"
description = "FRAME example authorization transaction extension pezpallet"
publish = false
documentation = "https://docs.rs/pezpallet-example-authorization-tx-extension"
@@ -126,7 +126,7 @@ where
let local_origin = Origin::Coowners(first_account, second_account);
// Turn it into a local `PalletsOrigin`.
let local_origin = <T as Config>::PalletsOrigin::from(local_origin);
// Then finally into a pallet `RuntimeOrigin`.
// Then finally into a pezpallet `RuntimeOrigin`.
let local_origin = <T as Config>::RuntimeOrigin::from(local_origin);
// Which the `set_caller_from` function will convert into the overarching `RuntimeOrigin`
// created by `construct_runtime!`.
@@ -21,9 +21,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//! # Authorization Transaction Extension Example Pallet
//! # Authorization Transaction Extension Example Pezpallet
//!
//! **This pallet serves as an example and is not meant to be used in production.**
//! **This pezpallet serves as an example and is not meant to be used in production.**
//!
//! FRAME Transaction Extension reference implementation, origin mutation, origin authorization and
//! integration in a `TransactionExtension` pipeline.
@@ -31,7 +31,7 @@
//! The [TransactionExtension](pezsp_runtime::traits::TransactionExtension) used in this example is
//! [AuthorizeCoownership](extensions::AuthorizeCoownership). If activated, the extension will
//! authorize 2 signers as coowners, with a [coowner origin](pezpallet_coownership::Origin) specific to
//! the [coownership example pallet](pezpallet_coownership), by validating a signature of the rest of
//! the [coownership example pezpallet](pezpallet_coownership), by validating a signature of the rest of
//! the transaction from each party. This means any extensions after ours in the pipeline, their
//! implicits and the actual call. The extension pipeline used in our example checks the genesis
//! hash, transaction version and mortality of the transaction after the `AuthorizeCoownership` runs
@@ -41,7 +41,7 @@
//! In this example, aside from the [AuthorizeCoownership](extensions::AuthorizeCoownership)
//! extension, we use the following pallets:
//! - [pezpallet_coownership] - provides a coowner origin and the functionality to authorize it.
//! - [pezpallet_assets] - a dummy asset pallet that tracks assets, identified by an
//! - [pezpallet_assets] - a dummy asset pezpallet that tracks assets, identified by an
//! [AssetId](pezpallet_assets::AssetId), and their respective owners, which can be either an
//! [account](pezpallet_assets::Owner::Single) or a [pair of owners](pezpallet_assets::Owner::Double).
//!
@@ -56,7 +56,7 @@
//! ### Example usage
#![doc = docify::embed!("src/tests.rs", create_coowned_asset_works)]
//!
//! This example does not focus on any pallet logic or syntax, but rather on `TransactionExtension`
//! This example does not focus on any pezpallet logic or syntax, but rather on `TransactionExtension`
//! functionality. The pallets used are just skeletons to provide storage state and custom origin
//! choices and requirements, as shown in the examples. Any weight and/or
//! transaction fee is out of scope for this example.
@@ -75,12 +75,12 @@ extern crate alloc;
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
pub mod pezpallet_coownership {
use super::*;
use pezframe_support::traits::OriginTrait;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
/// The aggregated origin which the dispatch will take.
type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin>
@@ -91,12 +91,12 @@ pub mod pezpallet_coownership {
type PalletsOrigin: From<Origin<Self>> + TryInto<Origin<Self>, Error = Self::PalletsOrigin>;
}
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
/// Origin that this pallet can authorize. For the purposes of this example, it's just two
/// Origin that this pezpallet can authorize. For the purposes of this example, it's just two
/// accounts that own something together.
#[pallet::origin]
#[pezpallet::origin]
#[derive(
Clone,
PartialEq,
@@ -113,7 +113,7 @@ pub mod pezpallet_coownership {
}
}
#[pezframe_support::pallet(dev_mode)]
#[pezframe_support::pezpallet(dev_mode)]
pub mod pezpallet_assets {
use super::*;
@@ -126,7 +126,7 @@ pub mod pezpallet_assets {
Double(AccountId, AccountId),
}
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
/// Type that can authorize an account pair coowner origin.
type CoownerOrigin: EnsureOrigin<
@@ -136,26 +136,26 @@ pub mod pezpallet_assets {
}
/// Map that holds the owner information for each asset it manages.
#[pallet::storage]
#[pezpallet::storage]
pub type AssetOwners<T> =
StorageMap<_, Blake2_128Concat, AssetId, Owner<<T as pezframe_system::Config>::AccountId>>;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::error]
#[pezpallet::error]
pub enum Error<T> {
/// Asset already exists.
AlreadyExists,
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
/// Simple call that just creates an asset with a specific `AssetId`. This call will fail if
/// there is already an asset with the same `AssetId`.
///
/// The origin is either a single account (traditionally signed origin) or a coowner origin.
#[pallet::call_index(0)]
#[pezpallet::call_index(0)]
pub fn create_asset(origin: OriginFor<T>, asset_id: AssetId) -> DispatchResult {
let owner: Owner<T::AccountId> = match T::CoownerOrigin::try_origin(origin) {
Ok((first, second)) => Owner::Double(first, second),
@@ -65,7 +65,7 @@ mod example_runtime {
pub type Signature = MultiSignature;
pub type BlockNumber = u32;
// For testing the pallet, we construct a mock runtime.
// For testing the pezpallet, we construct a mock runtime.
pezframe_support::construct_runtime!(
pub enum Runtime
{
@@ -92,7 +92,7 @@ mod example_runtime {
type BenchmarkHelper = ();
}
/// Type that enables any pallet to ask for a coowner origin.
/// Type that enables any pezpallet to ask for a coowner origin.
pub struct EnsureCoowner;
impl EnsureOrigin<RuntimeOrigin> for EnsureCoowner {
type Success = (AccountId, AccountId);