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
+18 -18
View File
@@ -35,7 +35,7 @@ use xcm_executor::traits::ConvertLocation;
pub type AccountIdOf<T> = <T as pezframe_system::Config>::AccountId;
/// Type alias to conveniently refer to the `Currency::NegativeImbalance` associated type.
pub type NegativeImbalance<T> = <pezpallet_balances::Pallet<T> as Currency<
pub type NegativeImbalance<T> = <pezpallet_balances::Pezpallet<T> as Currency<
<T as pezframe_system::Config>::AccountId,
>>::NegativeImbalance;
@@ -52,16 +52,16 @@ where
<R as pezframe_system::Config>::RuntimeEvent: From<pezpallet_balances::Event<R>>,
{
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
let staking_pot = <pezpallet_collator_selection::Pallet<R>>::account_id();
let staking_pot = <pezpallet_collator_selection::Pezpallet<R>>::account_id();
// In case of error: Will drop the result triggering the `OnDrop` of the imbalance.
<pezpallet_balances::Pallet<R>>::resolve_creating(&staking_pot, amount);
<pezpallet_balances::Pezpallet<R>>::resolve_creating(&staking_pot, amount);
}
}
/// Fungible implementation of `OnUnbalanced` that deals with the fees by combining tip and fee and
/// passing the result on to `ToStakingPot`.
pub struct DealWithFees<R>(PhantomData<R>);
impl<R> OnUnbalanced<fungible::Credit<R::AccountId, pezpallet_balances::Pallet<R>>> for DealWithFees<R>
impl<R> OnUnbalanced<fungible::Credit<R::AccountId, pezpallet_balances::Pezpallet<R>>> for DealWithFees<R>
where
R: pezpallet_balances::Config + pezpallet_collator_selection::Config,
AccountIdOf<R>: From<pezkuwi_primitives::AccountId> + Into<pezkuwi_primitives::AccountId>,
@@ -69,14 +69,14 @@ where
{
fn on_unbalanceds(
mut fees_then_tips: impl Iterator<
Item = fungible::Credit<R::AccountId, pezpallet_balances::Pallet<R>>,
Item = fungible::Credit<R::AccountId, pezpallet_balances::Pezpallet<R>>,
>,
) {
if let Some(mut fees) = fees_then_tips.next() {
if let Some(tips) = fees_then_tips.next() {
tips.merge_into(&mut fees);
}
ResolveTo::<StakingPotAccountId<R>, pezpallet_balances::Pallet<R>>::on_unbalanced(fees)
ResolveTo::<StakingPotAccountId<R>, pezpallet_balances::Pezpallet<R>>::on_unbalanced(fees)
}
}
}
@@ -84,17 +84,17 @@ where
/// A `HandleCredit` implementation that naively transfers the fees to the block author.
/// Will drop and burn the assets in case the transfer fails.
pub struct AssetsToBlockAuthor<R, I>(PhantomData<(R, I)>);
impl<R, I> HandleCredit<AccountIdOf<R>, pezpallet_assets::Pallet<R, I>> for AssetsToBlockAuthor<R, I>
impl<R, I> HandleCredit<AccountIdOf<R>, pezpallet_assets::Pezpallet<R, I>> for AssetsToBlockAuthor<R, I>
where
I: 'static,
R: pezpallet_authorship::Config + pezpallet_assets::Config<I>,
AccountIdOf<R>: From<pezkuwi_primitives::AccountId> + Into<pezkuwi_primitives::AccountId>,
{
fn handle_credit(credit: fungibles::Credit<AccountIdOf<R>, pezpallet_assets::Pallet<R, I>>) {
fn handle_credit(credit: fungibles::Credit<AccountIdOf<R>, pezpallet_assets::Pezpallet<R, I>>) {
use pezframe_support::traits::fungibles::Balanced;
if let Some(author) = pezpallet_authorship::Pallet::<R>::author() {
if let Some(author) = pezpallet_authorship::Pezpallet::<R>::author() {
// In case of error: Will drop the result triggering the `OnDrop` of the imbalance.
let _ = pezpallet_assets::Pallet::<R, I>::resolve(&author, credit).defensive();
let _ = pezpallet_assets::Pezpallet::<R, I>::resolve(&author, credit).defensive();
}
}
}
@@ -136,7 +136,7 @@ impl<T: Get<Location>> ContainsPair<Asset, Location> for AssetsFrom<T> {
/// Type alias to conveniently refer to the `Currency::Balance` associated type.
pub type BalanceOf<T> =
<pezpallet_balances::Pallet<T> as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
<pezpallet_balances::Pezpallet<T> as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
/// Implements `OnUnbalanced::on_unbalanced` to teleport slashed assets to relay chain treasury
/// account.
@@ -171,9 +171,9 @@ where
};
let treasury_account: AccountIdOf<T> = TreasuryAccount::get();
<pezpallet_balances::Pallet<T>>::resolve_creating(&root_account, amount);
<pezpallet_balances::Pezpallet<T>>::resolve_creating(&root_account, amount);
let result = <pezpallet_xcm::Pallet<T>>::limited_teleport_assets(
let result = <pezpallet_xcm::Pezpallet<T>>::limited_teleport_assets(
<<T as pezframe_system::Config>::RuntimeOrigin>::root(),
Box::new(Parent.into()),
Box::new(
@@ -216,9 +216,9 @@ mod tests {
pezframe_support::construct_runtime!(
pub enum Test
{
System: pezframe_system::{Pallet, Call, Config<T>, Storage, Event<T>},
Balances: pezpallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
CollatorSelection: pezpallet_collator_selection::{Pallet, Call, Storage, Event<T>},
System: pezframe_system::{Pezpallet, Call, Config<T>, Storage, Event<T>},
Balances: pezpallet_balances::{Pezpallet, Call, Storage, Config<T>, Event<T>},
CollatorSelection: pezpallet_collator_selection::{Pezpallet, Call, Storage, Event<T>},
}
);
@@ -312,11 +312,11 @@ mod tests {
fn test_fees_and_tip_split() {
new_test_ext().execute_with(|| {
let fee =
<pezpallet_balances::Pallet<Test> as pezframe_support::traits::fungible::Balanced<
<pezpallet_balances::Pezpallet<Test> as pezframe_support::traits::fungible::Balanced<
AccountId,
>>::issue(10);
let tip =
<pezpallet_balances::Pallet<Test> as pezframe_support::traits::fungible::Balanced<
<pezpallet_balances::Pezpallet<Test> as pezframe_support::traits::fungible::Balanced<
AccountId,
>>::issue(20);
+1 -1
View File
@@ -117,7 +117,7 @@ mod constants {
pezkuwi_primitives::MAX_POV_SIZE as u64,
);
/// Treasury pallet id of the local chain, used to convert into AccountId
/// Treasury pezpallet id of the local chain, used to convert into AccountId
pub const TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry");
}
+1 -1
View File
@@ -132,7 +132,7 @@ pub mod benchmarks {
/// the payout made by [`LocalPay`].
///
/// ### Parameters:
/// - `PalletId`: The ID of the assets registry pallet.
/// - `PalletId`: The ID of the assets registry pezpallet.
/// - `AssetId`: The ID of the asset that will be created for the benchmark within `PalletId`.
pub struct LocalPayArguments<PalletId = ConstU8<0>>(PhantomData<PalletId>);
impl<PalletId: Get<u8>>
@@ -35,7 +35,7 @@ pub struct AssetFeeAsExistentialDepositMultiplier<
impl<CurrencyBalance, Runtime, WeightToFee, BalanceConverter, AssetInstance>
pezcumulus_primitives_utility::ChargeWeightInFungibles<
AccountIdOf<Runtime>,
pezpallet_assets::Pallet<Runtime, AssetInstance>,
pezpallet_assets::Pezpallet<Runtime, AssetInstance>,
> for AssetFeeAsExistentialDepositMultiplier<Runtime, WeightToFee, BalanceConverter, AssetInstance>
where
Runtime: pezpallet_assets::Config<AssetInstance>,
@@ -52,12 +52,12 @@ where
>>::Error: core::fmt::Debug,
{
fn charge_weight_in_fungibles(
asset_id: <pezpallet_assets::Pallet<Runtime, AssetInstance> as Inspect<
asset_id: <pezpallet_assets::Pezpallet<Runtime, AssetInstance> as Inspect<
AccountIdOf<Runtime>,
>>::AssetId,
weight: Weight,
) -> Result<
<pezpallet_assets::Pallet<Runtime, AssetInstance> as Inspect<AccountIdOf<Runtime>>>::Balance,
<pezpallet_assets::Pezpallet<Runtime, AssetInstance> as Inspect<AccountIdOf<Runtime>>>::Balance,
XcmError,
> {
let amount = WeightToFee::weight_to_fee(&weight);
@@ -97,7 +97,7 @@ impl<SystemTeyrchainMatcher: Contains<Location>, Runtime: teyrchain_info::Config
for RelayOrOtherSystemTeyrchains<SystemTeyrchainMatcher, Runtime>
{
fn contains(l: &Location) -> bool {
let self_para_id: u32 = teyrchain_info::Pallet::<Runtime>::get().into();
let self_para_id: u32 = teyrchain_info::Pezpallet::<Runtime>::get().into();
if let (0, [Teyrchain(para_id)]) = l.unpack() {
if *para_id == self_para_id {
return false;