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
@@ -65,7 +65,7 @@ use bp_messages::{
MessageKey, OutboundLaneData,
};
pub use bp_xcm_bridge_hub::XcmBridgeHubCall;
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LaneIdOf, OutboundLanes, Pallet};
use pezpallet_bridge_messages::{Config as BridgeMessagesConfig, LaneIdOf, OutboundLanes, Pezpallet};
pub use pezpallet_bridge_messages::{
Instance1 as BridgeMessagesInstance1, Instance2 as BridgeMessagesInstance2,
Instance3 as BridgeMessagesInstance3,
@@ -112,7 +112,7 @@ where
OutboundLanes::<S, SI>::get(lane).unwrap().latest_received_nonce;
(latest_received_nonce + 1..=latest_generated_nonce).for_each(|nonce| {
let encoded_payload: Vec<u8> = Pallet::<S, SI>::outbound_message_data(lane, nonce)
let encoded_payload: Vec<u8> = Pezpallet::<S, SI>::outbound_message_data(lane, nonce)
.expect("Bridge message does not exist")
.into();
let payload = Vec::<u8>::decode(&mut &encoded_payload[..])
@@ -371,7 +371,7 @@ macro_rules! impl_send_transact_helpers_for_relay_chain {
let destination: $crate::impls::Location = <Self as RelayChain>::child_location_of(recipient);
let xcm = $crate::impls::xcm_transact_unpaid_execution(call, $crate::impls::OriginKind::Superuser);
$crate::impls::dmp::Pallet::<<Self as $crate::impls::Chain>::Runtime>::make_teyrchain_reachable(recipient);
$crate::impls::dmp::Pezpallet::<<Self as $crate::impls::Chain>::Runtime>::make_teyrchain_reachable(recipient);
// Send XCM `Transact`
$crate::impls::assert_ok!(<Self as [<$chain RelayPallet>]>::XcmPallet::send(
@@ -600,7 +600,7 @@ macro_rules! impl_assets_helpers_for_system_teyrchain {
( $chain:ident, $relay_chain:ident ) => {
$crate::impls::paste::paste! {
impl<N: $crate::impls::Network> $chain<N> {
/// Returns the encoded call for `force_create` from the assets pallet
/// Returns the encoded call for `force_create` from the assets pezpallet
pub fn force_create_asset_call(
asset_id: u32,
owner: $crate::impls::AccountId,
@@ -622,7 +622,7 @@ macro_rules! impl_assets_helpers_for_system_teyrchain {
.into()
}
/// Returns a `VersionedXcm` for `force_create` from the assets pallet
/// Returns a `VersionedXcm` for `force_create` from the assets pezpallet
pub fn force_create_asset_xcm(
origin_kind: $crate::impls::OriginKind,
asset_id: u32,
@@ -634,7 +634,7 @@ macro_rules! impl_assets_helpers_for_system_teyrchain {
$crate::impls::xcm_transact_unpaid_execution(call, origin_kind)
}
/// Force create and mint assets making use of the assets pallet
/// Force create and mint assets making use of the assets pezpallet
pub fn force_create_and_mint_asset(
id: u32,
min_balance: u128,
@@ -744,7 +744,7 @@ macro_rules! impl_assets_helpers_for_teyrchain {
}
}
/// Mint assets making use of the assets pallet
/// Mint assets making use of the assets pezpallet
pub fn mint_asset(
signed_origin: <Self as $crate::impls::Chain>::RuntimeOrigin,
id: u32,
@@ -776,7 +776,7 @@ macro_rules! impl_assets_helpers_for_teyrchain {
});
}
/// Returns the encoded call for `create` from the assets pallet
/// Returns the encoded call for `create` from the assets pezpallet
pub fn create_asset_call(
asset_id: u32,
min_balance: $crate::impls::Balance,
@@ -898,7 +898,7 @@ macro_rules! impl_foreign_assets_helpers_for_teyrchain {
});
}
/// Returns the encoded call for `create` from the foreign assets pallet
/// Returns the encoded call for `create` from the foreign assets pezpallet
pub fn create_foreign_asset_call(
asset_id: $asset_id_type,
min_balance: $crate::impls::Balance,
@@ -954,7 +954,7 @@ macro_rules! impl_xcm_helpers_for_teyrchain {
#[macro_export]
macro_rules! impl_bridge_helpers_for_chain {
( $chain:ident, $pallet:ident, $pezpallet_xcm:ident, $runtime_call_wrapper:path ) => {
( $chain:ident, $pezpallet:ident, $pezpallet_xcm:ident, $runtime_call_wrapper:path ) => {
$crate::impls::paste::paste! {
impl<N: $crate::impls::Network> $chain<N> {
/// Open bridge with `dest`.
@@ -985,7 +985,7 @@ macro_rules! impl_bridge_helpers_for_chain {
};
// Send XCM `Transact` with `open_bridge` call
$crate::impls::assert_ok!(<Self as [<$chain $pallet>]>::$pezpallet_xcm::send(
$crate::impls::assert_ok!(<Self as [<$chain $pezpallet>]>::$pezpallet_xcm::send(
root_origin,
bx!(bridge_location.into()),
bx!(xcm),
@@ -27,7 +27,7 @@ pub use pezpallet_xcm;
pub use pezframe_support::assert_ok;
// Pezkuwi
pub use pezkuwi_runtime_teyrchains::dmp::Pallet as Dmp;
pub use pezkuwi_runtime_teyrchains::dmp::Pezpallet as Dmp;
pub use xcm::{
latest::AssetTransferFilter,
prelude::{
@@ -354,7 +354,7 @@ macro_rules! test_teyrchain_is_trusted_teleporter_for_relay {
let sender = [<$sender_para Sender>]::get();
// Mint assets to `$sender_para` to succeed with teleport.
<$sender_para as $crate::macros::TestExt>::execute_with(|| {
$crate::macros::assert_ok!(<<$sender_para as [<$sender_para Pallet>]>::Balances
$crate::macros::assert_ok!(<<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Mutate<_>>::mint_into(&sender, $amount + 10_000_000_000));
});
@@ -370,8 +370,8 @@ macro_rules! test_teyrchain_is_trusted_teleporter_for_relay {
// Else we'd get a `NotWithdrawable` error since it tries to reduce the check account balance, which
// would be 0.
<$receiver_relay as $crate::macros::TestExt>::execute_with(|| {
let check_account = <$receiver_relay as [<$receiver_relay Pallet>]>::XcmPallet::check_account();
$crate::macros::assert_ok!(<<$receiver_relay as [<$receiver_relay Pallet>]>::Balances
let check_account = <$receiver_relay as [<$receiver_relay Pezpallet>]>::XcmPallet::check_account();
$crate::macros::assert_ok!(<<$receiver_relay as [<$receiver_relay Pezpallet>]>::Balances
as $crate::macros::Mutate<_>>::mint_into(&check_account, $amount));
});
@@ -443,14 +443,14 @@ macro_rules! test_teyrchain_is_trusted_teleporter_for_relay {
<$receiver_relay as $crate::macros::TestExt>::reset_ext();
// Mint assets to `$sender_para` to succeed with teleport.
<$sender_para as $crate::macros::TestExt>::execute_with(|| {
$crate::macros::assert_ok!(<<$sender_para as [<$sender_para Pallet>]>::Balances
$crate::macros::assert_ok!(<<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Mutate<_>>::mint_into(&sender, $amount + 10_000_000_000));
});
// Since we reset everything, we need to mint funds into the checking account again.
<$receiver_relay as $crate::macros::TestExt>::execute_with(|| {
let check_account = <$receiver_relay as [<$receiver_relay Pallet>]>::XcmPallet::check_account();
$crate::macros::assert_ok!(<<$receiver_relay as [<$receiver_relay Pallet>]>::Balances
let check_account = <$receiver_relay as [<$receiver_relay Pezpallet>]>::XcmPallet::check_account();
$crate::macros::assert_ok!(<<$receiver_relay as [<$receiver_relay Pezpallet>]>::Balances
as $crate::macros::Mutate<_>>::mint_into(&check_account, $amount));
});
@@ -523,7 +523,7 @@ macro_rules! test_chain_can_claim_assets {
<$sender_para as $crate::macros::TestExt>::execute_with(|| {
// Assets are trapped for whatever reason.
// The possible reasons for this might differ from runtime to runtime, so here we just drop them directly.
<<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm as $crate::macros::DropAssets>::drop_assets(
<<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm as $crate::macros::DropAssets>::drop_assets(
&beneficiary,
$assets.clone().into(),
&$crate::macros::XcmContext { origin: None, message_id: [0u8; 32], topic: None },
@@ -539,25 +539,25 @@ macro_rules! test_chain_can_claim_assets {
]
);
let balance_before = <<$sender_para as [<$sender_para Pallet>]>::Balances
let balance_before = <<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Currency<_>>::free_balance(&sender);
// Different origin or different assets won't work.
let other_origin = <$sender_para as $crate::macros::Chain>::RuntimeOrigin::signed([<$sender_para Receiver>]::get());
assert!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::claim_assets(
assert!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::claim_assets(
other_origin,
Box::new(versioned_assets.clone().into()),
Box::new(beneficiary.clone().into()),
).is_err());
let other_versioned_assets: $crate::macros::VersionedAssets = $crate::macros::Assets::new().into();
assert!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::claim_assets(
assert!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::claim_assets(
origin.clone(),
Box::new(other_versioned_assets.into()),
Box::new(beneficiary.clone().into()),
).is_err());
// Assets will be claimed to `beneficiary`, which is the same as `sender`.
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::claim_assets(
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::claim_assets(
origin.clone(),
Box::new(versioned_assets.clone().into()),
Box::new(beneficiary.clone().into()),
@@ -573,23 +573,23 @@ macro_rules! test_chain_can_claim_assets {
);
// After claiming the assets, the balance has increased.
let balance_after = <<$sender_para as [<$sender_para Pallet>]>::Balances
let balance_after = <<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Currency<_>>::free_balance(&sender);
assert_eq!(balance_after, balance_before + $amount);
// Claiming the assets again doesn't work.
assert!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::claim_assets(
assert!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::claim_assets(
origin.clone(),
Box::new(versioned_assets.clone().into()),
Box::new(beneficiary.clone().into()),
).is_err());
let balance = <<$sender_para as [<$sender_para Pallet>]>::Balances
let balance = <<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Currency<_>>::free_balance(&sender);
assert_eq!(balance, balance_after);
// You can also claim assets and send them to a different account.
<<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm as $crate::macros::DropAssets>::drop_assets(
<<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm as $crate::macros::DropAssets>::drop_assets(
&beneficiary,
$assets.clone().into(),
&$crate::macros::XcmContext { origin: None, message_id: [0u8; 32], topic: None },
@@ -597,14 +597,14 @@ macro_rules! test_chain_can_claim_assets {
let receiver = [<$sender_para Receiver>]::get();
let other_beneficiary: $crate::macros::Location =
$crate::macros::Junction::AccountId32 { network: Some($network_id), id: receiver.clone().into() }.into();
let balance_before = <<$sender_para as [<$sender_para Pallet>]>::Balances
let balance_before = <<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Currency<_>>::free_balance(&receiver);
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::claim_assets(
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::claim_assets(
origin.clone(),
Box::new(versioned_assets.clone().into()),
Box::new(other_beneficiary.clone().into()),
));
let balance_after = <<$sender_para as [<$sender_para Pallet>]>::Balances
let balance_after = <<$sender_para as [<$sender_para Pezpallet>]>::Balances
as $crate::macros::Currency<_>>::free_balance(&receiver);
assert_eq!(balance_after, balance_before + $amount);
});
@@ -811,11 +811,11 @@ macro_rules! test_can_estimate_and_pay_exact_fees {
// Actually run the extrinsic.
let sender_assets_before = <$sender_para as $crate::macros::TestExt>::execute_with(|| {
type ForeignAssets = <$sender_para as [<$sender_para Pallet>]>::ForeignAssets;
type ForeignAssets = <$sender_para as [<$sender_para Pezpallet>]>::ForeignAssets;
<ForeignAssets as $crate::macros::Inspect<_>>::balance($asset_id.clone().into(), &sender)
});
let receiver_assets_before = <$receiver_para as $crate::macros::TestExt>::execute_with(|| {
type ForeignAssets = <$receiver_para as [<$receiver_para Pallet>]>::ForeignAssets;
type ForeignAssets = <$receiver_para as [<$receiver_para Pezpallet>]>::ForeignAssets;
<ForeignAssets as $crate::macros::Inspect<_>>::balance($asset_id.clone().into(), &beneficiary_id)
});
@@ -831,11 +831,11 @@ macro_rules! test_can_estimate_and_pay_exact_fees {
test.assert();
let sender_assets_after = <$sender_para as $crate::macros::TestExt>::execute_with(|| {
type ForeignAssets = <$sender_para as [<$sender_para Pallet>]>::ForeignAssets;
type ForeignAssets = <$sender_para as [<$sender_para Pezpallet>]>::ForeignAssets;
<ForeignAssets as $crate::macros::Inspect<_>>::balance($asset_id.clone().into(), &sender)
});
let receiver_assets_after = <$receiver_para as $crate::macros::TestExt>::execute_with(|| {
type ForeignAssets = <$receiver_para as [<$receiver_para Pallet>]>::ForeignAssets;
type ForeignAssets = <$receiver_para as [<$receiver_para Pezpallet>]>::ForeignAssets;
<ForeignAssets as $crate::macros::Inspect<_>>::balance($asset_id.into(), &beneficiary_id)
});
@@ -870,7 +870,7 @@ macro_rules! test_dry_run_transfer_across_pk_bridge {
type Runtime = <$sender_asset_hub as $crate::macros::Chain>::Runtime;
type RuntimeCall = <$sender_asset_hub as $crate::macros::Chain>::RuntimeCall;
type OriginCaller = <$sender_asset_hub as $crate::macros::Chain>::OriginCaller;
type Balances = <$sender_asset_hub as [<$sender_asset_hub Pallet>]>::Balances;
type Balances = <$sender_asset_hub as [<$sender_asset_hub Pezpallet>]>::Balances;
// Give some initial funds.
<Balances as $crate::macros::Mutate<_>>::set_balance(&who, initial_balance);
@@ -914,8 +914,8 @@ macro_rules! test_xcm_fee_querying_apis_work_for_asset_hub {
<$asset_hub as $crate::macros::TestExt>::execute_with(|| {
// Setup a pool between USDT and ZGR.
type RuntimeOrigin = <$asset_hub as $crate::macros::Chain>::RuntimeOrigin;
type Assets = <$asset_hub as [<$asset_hub Pallet>]>::Assets;
type AssetConversion = <$asset_hub as [<$asset_hub Pallet>]>::AssetConversion;
type Assets = <$asset_hub as [<$asset_hub Pezpallet>]>::Assets;
type AssetConversion = <$asset_hub as [<$asset_hub Pezpallet>]>::AssetConversion;
let wnd = $crate::macros::Location::new(1, []);
let usdt = $crate::macros::Location::new(0, [$crate::macros::PalletInstance($crate::macros::ASSETS_PALLET_ID),
$crate::macros::GeneralIndex($crate::macros::USDT_ID.into())]);
@@ -1036,7 +1036,7 @@ macro_rules! test_cross_chain_alias {
]);
let signed_origin = <$sender_para as $crate::macros::Chain>::RuntimeOrigin::signed(account.into());
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pallet>]>::PezkuwiXcm::execute(
$crate::macros::assert_ok!(<$sender_para as [<$sender_para Pezpallet>]>::PezkuwiXcm::execute(
signed_origin,
Box::new($crate::macros::VersionedXcm::from(xcm_message.into())),
$crate::macros::Weight::MAX
@@ -1089,7 +1089,7 @@ macro_rules! create_pool_with_native_on {
let native_asset: $crate::macros::Location = $crate::macros::Parent.into();
if $is_foreign {
$crate::macros::assert_ok!(<$chain as [<$chain Pallet>]>::ForeignAssets::mint(
$crate::macros::assert_ok!(<$chain as [<$chain Pezpallet>]>::ForeignAssets::mint(
signed_owner.clone(),
$asset.clone().into(),
owner.clone().into(),
@@ -1100,7 +1100,7 @@ macro_rules! create_pool_with_native_on {
Some($crate::macros::GeneralIndex(id)) => *id as u32,
_ => unreachable!(),
};
$crate::macros::assert_ok!(<$chain as [<$chain Pallet>]>::Assets::mint(
$crate::macros::assert_ok!(<$chain as [<$chain Pezpallet>]>::Assets::mint(
signed_owner.clone(),
asset_id.into(),
owner.clone().into(),
@@ -1108,7 +1108,7 @@ macro_rules! create_pool_with_native_on {
));
}
$crate::macros::assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::create_pool(
$crate::macros::assert_ok!(<$chain as [<$chain Pezpallet>]>::AssetConversion::create_pool(
signed_owner.clone(),
Box::new(native_asset.clone()),
Box::new($asset.clone()),
@@ -1121,7 +1121,7 @@ macro_rules! create_pool_with_native_on {
]
);
$crate::macros::assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::add_liquidity(
$crate::macros::assert_ok!(<$chain as [<$chain Pezpallet>]>::AssetConversion::add_liquidity(
signed_owner,
Box::new(native_asset),
Box::new($asset),