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
+1 -1
View File
@@ -6,7 +6,7 @@ edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "FRAME pallet for manage vesting"
description = "FRAME pezpallet for manage vesting"
readme = "README.md"
documentation = "https://docs.rs/pezpallet-vesting"
+2 -2
View File
@@ -1,7 +1,7 @@
# Vesting Module
- [`Config`](https://docs.rs/pezpallet-vesting/latest/pallet_vesting/pallet/trait.Config.html)
- [`Call`](https://docs.rs/pezpallet-vesting/latest/pallet_vesting/pallet/enum.Call.html)
- [`Config`](https://docs.rs/pezpallet-vesting/latest/pallet_vesting/pezpallet/trait.Config.html)
- [`Call`](https://docs.rs/pezpallet-vesting/latest/pallet_vesting/pezpallet/enum.Call.html)
## Overview
+20 -20
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Vesting pallet benchmarking.
//! Vesting pezpallet benchmarking.
#![cfg(feature = "runtime-benchmarks")]
@@ -60,7 +60,7 @@ fn add_vesting_schedules<T: Config>(
total_locked += locked;
let schedule = VestingInfo::new(locked, per_block, starting_block.into());
assert_ok!(Pallet::<T>::do_vested_transfer(&source, target, schedule));
assert_ok!(Pezpallet::<T>::do_vested_transfer(&source, target, schedule));
// Top up to guarantee we can always transfer another schedule.
T::Currency::make_free_balance_be(&source, BalanceOf::<T>::max_value());
@@ -85,9 +85,9 @@ mod benchmarks {
let expected_balance = add_vesting_schedules::<T>(&caller, s)?;
// At block zero, everything is vested.
assert_eq!(pezframe_system::Pallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(pezframe_system::Pezpallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting schedule not added",
);
@@ -97,7 +97,7 @@ mod benchmarks {
// Nothing happened since everything is still vested.
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting schedule was removed",
);
@@ -119,7 +119,7 @@ mod benchmarks {
// At block 21, everything is unlocked.
T::BlockNumberProvider::set_block_number(21_u32.into());
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(BalanceOf::<T>::zero()),
"Vesting schedule still active",
);
@@ -128,7 +128,7 @@ mod benchmarks {
vest(RawOrigin::Signed(caller.clone()));
// Vesting schedule is removed!
assert_eq!(Pallet::<T>::vesting_balance(&caller), None, "Vesting schedule was not removed",);
assert_eq!(Pezpallet::<T>::vesting_balance(&caller), None, "Vesting schedule was not removed",);
Ok(())
}
@@ -146,9 +146,9 @@ mod benchmarks {
let expected_balance = add_vesting_schedules::<T>(&other, s)?;
// At block zero, everything is vested.
assert_eq!(pezframe_system::Pallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(pezframe_system::Pezpallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(
Pallet::<T>::vesting_balance(&other),
Pezpallet::<T>::vesting_balance(&other),
Some(expected_balance),
"Vesting schedule not added",
);
@@ -160,7 +160,7 @@ mod benchmarks {
// Nothing happened since everything is still vested.
assert_eq!(
Pallet::<T>::vesting_balance(&other),
Pezpallet::<T>::vesting_balance(&other),
Some(expected_balance),
"Vesting schedule was removed",
);
@@ -183,7 +183,7 @@ mod benchmarks {
T::BlockNumberProvider::set_block_number(21_u32.into());
assert_eq!(
Pallet::<T>::vesting_balance(&other),
Pezpallet::<T>::vesting_balance(&other),
Some(BalanceOf::<T>::zero()),
"Vesting schedule still active",
);
@@ -194,7 +194,7 @@ mod benchmarks {
vest_other(RawOrigin::Signed(caller.clone()), other_lookup);
// Vesting schedule is removed.
assert_eq!(Pallet::<T>::vesting_balance(&other), None, "Vesting schedule was not removed",);
assert_eq!(Pezpallet::<T>::vesting_balance(&other), None, "Vesting schedule was not removed",);
Ok(())
}
@@ -231,7 +231,7 @@ mod benchmarks {
"Transfer didn't happen",
);
assert_eq!(
Pallet::<T>::vesting_balance(&target),
Pezpallet::<T>::vesting_balance(&target),
Some(expected_balance),
"Lock not correctly updated",
);
@@ -272,7 +272,7 @@ mod benchmarks {
"Transfer didn't happen",
);
assert_eq!(
Pallet::<T>::vesting_balance(&target),
Pezpallet::<T>::vesting_balance(&target),
Some(expected_balance),
"Lock not correctly updated",
);
@@ -293,9 +293,9 @@ mod benchmarks {
let expected_balance = add_vesting_schedules::<T>(&caller, s)?;
// Schedules are not vesting at block 0.
assert_eq!(pezframe_system::Pallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(pezframe_system::Pezpallet::<T>::block_number(), BlockNumberFor::<T>::zero());
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting balance should equal sum locked of all schedules",
);
@@ -316,7 +316,7 @@ mod benchmarks {
let expected_index = (s - 2) as usize;
assert_eq!(Vesting::<T>::get(&caller).unwrap()[expected_index], expected_schedule);
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting balance should equal total locked of all schedules",
);
@@ -351,7 +351,7 @@ mod benchmarks {
// block).
let expected_balance = total_transferred / 2_u32.into();
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting balance should reflect that we are half way through all schedules duration",
);
@@ -384,7 +384,7 @@ mod benchmarks {
"New schedule is properly created and placed"
);
assert_eq!(
Pallet::<T>::vesting_balance(&caller),
Pezpallet::<T>::vesting_balance(&caller),
Some(expected_balance),
"Vesting balance should equal half total locked of all schedules",
);
@@ -436,7 +436,7 @@ mod benchmarks {
}
impl_benchmark_test_suite! {
Pallet,
Pezpallet,
mock::ExtBuilder::default().existential_deposit(256).build(),
mock::Test
}
+54 -54
View File
@@ -15,15 +15,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! # Vesting Pallet
//! # Vesting Pezpallet
//!
//! - [`Config`]
//! - [`Call`]
//!
//! ## Overview
//!
//! A simple pallet providing a means of placing a linear curve on an account's locked balance. This
//! pallet ensures that there is a lock in place preventing the balance to drop below the *unvested*
//! A simple pezpallet providing a means of placing a linear curve on an account's locked balance. This
//! pezpallet ensures that there is a lock in place preventing the balance to drop below the *unvested*
//! amount for any reason other than the ones specified in `UnvestedFundsAllowedWithdrawReasons`
//! configuration value.
//!
@@ -35,7 +35,7 @@
//!
//! ## Interface
//!
//! This pallet implements the `VestingSchedule` trait.
//! This pezpallet implements the `VestingSchedule` trait.
//!
//! ### Dispatchable Functions
//!
@@ -81,7 +81,7 @@ use pezsp_runtime::{
DispatchError, RuntimeDebug,
};
pub use pallet::*;
pub use pezpallet::*;
pub use vesting_info::*;
pub use weights::WeightInfo;
@@ -151,13 +151,13 @@ impl<T: Config> Get<u32> for MaxVestingSchedulesGet<T> {
}
}
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config]
#[pezpallet::config]
pub trait Config: pezframe_system::Config {
/// The overarching event type.
#[allow(deprecated)]
@@ -170,10 +170,10 @@ pub mod pallet {
type BlockNumberToBalance: Convert<BlockNumberFor<Self>, BalanceOf<Self>>;
/// The minimum amount transferred to call `vested_transfer`.
#[pallet::constant]
#[pezpallet::constant]
type MinVestedTransfer: Get<BalanceOf<Self>>;
/// Weight information for extrinsics in this pallet.
/// Weight information for extrinsics in this pezpallet.
type WeightInfo: WeightInfo;
/// Reasons that determine under which conditions the balance may drop below
@@ -184,22 +184,22 @@ pub mod pallet {
///
/// Must return monotonically increasing values when called from consecutive blocks.
/// Can be configured to return either:
/// - the local block number of the runtime via `pezframe_system::Pallet`
/// - the local block number of the runtime via `pezframe_system::Pezpallet`
/// - a remote block number, eg from the relay chain through `RelaychainDataProvider`
/// - an arbitrary value through a custom implementation of the trait
///
/// There is currently no migration provided to "hot-swap" block number providers and it may
/// result in undefined behavior when doing so. Teyrchains are therefore best off setting
/// this to their local block number provider if they have the pallet already deployed.
/// this to their local block number provider if they have the pezpallet already deployed.
///
/// Suggested values:
/// - Solo- and Relay-chains: `pezframe_system::Pallet`
/// - Solo- and Relay-chains: `pezframe_system::Pezpallet`
/// - Teyrchains that may produce blocks sparingly or only when needed (on-demand):
/// - already have the pallet deployed: `pezframe_system::Pallet`
/// - are freshly deploying this pallet: `RelaychainDataProvider`
/// - already have the pezpallet deployed: `pezframe_system::Pezpallet`
/// - are freshly deploying this pezpallet: `RelaychainDataProvider`
/// - Teyrchains with a reliably block production rate (PLO or bulk-coretime):
/// - already have the pallet deployed: `pezframe_system::Pallet`
/// - are freshly deploying this pallet: no strong recommendation. Both local and remote
/// - already have the pezpallet deployed: `pezframe_system::Pezpallet`
/// - are freshly deploying this pezpallet: no strong recommendation. Both local and remote
/// providers can be used. Relay provider can be a bit better in cases where the
/// teyrchain is lagging its block production to avoid clock skew.
type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;
@@ -208,23 +208,23 @@ pub mod pallet {
const MAX_VESTING_SCHEDULES: u32;
}
#[pallet::extra_constants]
impl<T: Config> Pallet<T> {
#[pallet::constant_name(MaxVestingSchedules)]
#[pezpallet::extra_constants]
impl<T: Config> Pezpallet<T> {
#[pezpallet::constant_name(MaxVestingSchedules)]
fn max_vesting_schedules() -> u32 {
T::MAX_VESTING_SCHEDULES
}
}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
#[pezpallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
fn integrity_test() {
assert!(T::MAX_VESTING_SCHEDULES > 0, "`MaxVestingSchedules` must be greater than 0");
}
}
/// Information regarding the vesting of a given account.
#[pallet::storage]
#[pezpallet::storage]
pub type Vesting<T: Config> = StorageMap<
_,
Blake2_128Concat,
@@ -232,22 +232,22 @@ pub mod pallet {
BoundedVec<VestingInfo<BalanceOf<T>, BlockNumberFor<T>>, MaxVestingSchedulesGet<T>>,
>;
/// Storage version of the pallet.
/// Storage version of the pezpallet.
///
/// New networks start with latest version, as determined by the genesis build.
#[pallet::storage]
#[pezpallet::storage]
pub type StorageVersion<T: Config> = StorageValue<_, Releases, ValueQuery>;
#[pallet::pallet]
pub struct Pallet<T>(_);
#[pezpallet::pezpallet]
pub struct Pezpallet<T>(_);
#[pallet::genesis_config]
#[pezpallet::genesis_config]
#[derive(pezframe_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
pub vesting: Vec<(T::AccountId, BlockNumberFor<T>, BlockNumberFor<T>, BalanceOf<T>)>,
}
#[pallet::genesis_build]
#[pezpallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {
use pezsp_runtime::traits::Saturating;
@@ -283,8 +283,8 @@ pub mod pallet {
}
}
#[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> {
/// A vesting schedule has been created.
VestingCreated { account: T::AccountId, schedule_index: u32 },
@@ -295,8 +295,8 @@ pub mod pallet {
VestingCompleted { account: T::AccountId },
}
/// Error for the vesting pallet.
#[pallet::error]
/// Error for the vesting pezpallet.
#[pezpallet::error]
pub enum Error<T> {
/// The account given is not vesting.
NotVesting,
@@ -311,19 +311,19 @@ pub mod pallet {
InvalidScheduleParams,
}
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pezpallet::call]
impl<T: Config> Pezpallet<T> {
/// Unlock any vested funds of the sender account.
///
/// The dispatch origin for this call must be _Signed_ and the sender must have funds still
/// locked under this pallet.
/// locked under this pezpallet.
///
/// Emits either `VestingCompleted` or `VestingUpdated`.
///
/// ## Complexity
/// - `O(1)`.
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::vest_locked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
#[pezpallet::call_index(0)]
#[pezpallet::weight(T::WeightInfo::vest_locked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
.max(T::WeightInfo::vest_unlocked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES))
)]
pub fn vest(origin: OriginFor<T>) -> DispatchResult {
@@ -336,14 +336,14 @@ pub mod pallet {
/// The dispatch origin for this call must be _Signed_.
///
/// - `target`: The account whose vested funds should be unlocked. Must have funds still
/// locked under this pallet.
/// locked under this pezpallet.
///
/// Emits either `VestingCompleted` or `VestingUpdated`.
///
/// ## Complexity
/// - `O(1)`.
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::vest_other_locked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
#[pezpallet::call_index(1)]
#[pezpallet::weight(T::WeightInfo::vest_other_locked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
.max(T::WeightInfo::vest_other_unlocked(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES))
)]
pub fn vest_other(origin: OriginFor<T>, target: AccountIdLookupOf<T>) -> DispatchResult {
@@ -365,8 +365,8 @@ pub mod pallet {
///
/// ## Complexity
/// - `O(1)`.
#[pallet::call_index(2)]
#[pallet::weight(
#[pezpallet::call_index(2)]
#[pezpallet::weight(
T::WeightInfo::vested_transfer(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
)]
pub fn vested_transfer(
@@ -393,8 +393,8 @@ pub mod pallet {
///
/// ## Complexity
/// - `O(1)`.
#[pallet::call_index(3)]
#[pallet::weight(
#[pezpallet::call_index(3)]
#[pezpallet::weight(
T::WeightInfo::force_vested_transfer(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
)]
pub fn force_vested_transfer(
@@ -430,8 +430,8 @@ pub mod pallet {
///
/// - `schedule1_index`: index of the first schedule to merge.
/// - `schedule2_index`: index of the second schedule to merge.
#[pallet::call_index(4)]
#[pallet::weight(
#[pezpallet::call_index(4)]
#[pezpallet::weight(
T::WeightInfo::not_unlocking_merge_schedules(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
.max(T::WeightInfo::unlocking_merge_schedules(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES))
)]
@@ -465,8 +465,8 @@ pub mod pallet {
///
/// - `target`: An account that has a vesting schedule
/// - `schedule_index`: The vesting schedule index that should be removed
#[pallet::call_index(5)]
#[pallet::weight(
#[pezpallet::call_index(5)]
#[pezpallet::weight(
T::WeightInfo::force_remove_vesting_schedule(MaxLocksOf::<T>::get(), T::MAX_VESTING_SCHEDULES)
)]
pub fn force_remove_vesting_schedule(
@@ -491,7 +491,7 @@ pub mod pallet {
}
}
impl<T: Config> Pallet<T> {
impl<T: Config> Pezpallet<T> {
// Public function for accessing vesting storage
pub fn vesting(
account: T::AccountId,
@@ -709,7 +709,7 @@ impl<T: Config> Pallet<T> {
}
}
impl<T: Config> VestingSchedule<T::AccountId> for Pallet<T>
impl<T: Config> VestingSchedule<T::AccountId> for Pezpallet<T>
where
BalanceOf<T>: MaybeSerializeDeserialize + Debug,
{
@@ -813,9 +813,9 @@ where
}
}
/// An implementation that allows the Vesting Pallet to handle a vested transfer
/// on behalf of another Pallet.
impl<T: Config> VestedTransfer<T::AccountId> for Pallet<T>
/// An implementation that allows the Vesting Pezpallet to handle a vested transfer
/// on behalf of another Pezpallet.
impl<T: Config> VestedTransfer<T::AccountId> for Pezpallet<T>
where
BalanceOf<T>: MaybeSerializeDeserialize + Debug,
{
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Storage migrations for the vesting pallet.
//! Storage migrations for the vesting pezpallet.
use super::*;
use alloc::vec;
+1 -1
View File
@@ -34,7 +34,7 @@ const ED: u64 = 256;
fn vest_and_assert_no_vesting<T>(account: u64)
where
u64: EncodeLike<<T as pezframe_system::Config>::AccountId>,
T: pallet::Config,
T: pezpallet::Config,
{
// Its ok for this to fail because the user may already have no schedules.
let _result = Vesting::vest(Some(account).into());
+2 -2
View File
@@ -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_vesting
// --pezpallet=pezpallet_vesting
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/vesting/src/weights.rs
// --wasm-execution=compiled