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:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "pezpallet-xcm"
|
||||
version = "7.0.0"
|
||||
description = "A pallet for handling XCM programs."
|
||||
description = "A pezpallet for handling XCM programs."
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
@@ -102,7 +102,7 @@ where
|
||||
|
||||
ensure_xcm_version(&final_message)?;
|
||||
|
||||
pezpallet_xcm::Pallet::<Runtime>::send(
|
||||
pezpallet_xcm::Pezpallet::<Runtime>::send(
|
||||
frame_origin,
|
||||
final_destination.into(),
|
||||
final_message.into(),
|
||||
@@ -129,7 +129,7 @@ where
|
||||
|
||||
ensure_xcm_version(&final_message)?;
|
||||
|
||||
let result = pezpallet_xcm::Pallet::<Runtime>::execute(
|
||||
let result = pezpallet_xcm::Pezpallet::<Runtime>::execute(
|
||||
frame_origin,
|
||||
final_message.into(),
|
||||
max_weight,
|
||||
|
||||
@@ -71,7 +71,7 @@ fn test_xcm_send_precompile_works() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -120,7 +120,7 @@ fn test_xcm_send_precompile_to_teyrchain() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -169,7 +169,7 @@ fn test_xcm_send_precompile_fails() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -219,7 +219,7 @@ fn send_fails_on_old_location_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -246,7 +246,7 @@ fn send_fails_on_old_location_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -296,7 +296,7 @@ fn send_fails_on_old_xcm_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -324,7 +324,7 @@ fn send_fails_on_old_xcm_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -367,7 +367,7 @@ fn test_xcm_execute_precompile_works() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -389,7 +389,7 @@ fn test_xcm_execute_precompile_works() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -428,7 +428,7 @@ fn test_xcm_execute_precompile_different_beneficiary() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -450,7 +450,7 @@ fn test_xcm_execute_precompile_different_beneficiary() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -497,7 +497,7 @@ fn test_xcm_execute_precompile_fails() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -519,7 +519,7 @@ fn test_xcm_execute_precompile_fails() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -565,7 +565,7 @@ fn execute_fails_on_old_version() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -594,7 +594,7 @@ fn execute_fails_on_old_version() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -621,7 +621,7 @@ fn execute_fails_on_old_version() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -670,7 +670,7 @@ fn weight_fails_on_old_version() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
@@ -694,7 +694,7 @@ fn weight_fails_on_old_version() {
|
||||
let weight_call = IXcm::IXcmCalls::weighMessage(weight_params);
|
||||
let encoded_weight_call = weight_call.abi_encode();
|
||||
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pezpallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
|
||||
@@ -24,10 +24,10 @@ use xcm_executor::traits::FeeReason;
|
||||
|
||||
type RuntimeOrigin<T> = <T as pezframe_system::Config>::RuntimeOrigin;
|
||||
|
||||
/// Pallet we're benchmarking here.
|
||||
pub struct Pallet<T: Config>(crate::Pallet<T>);
|
||||
/// Pezpallet we're benchmarking here.
|
||||
pub struct Pezpallet<T: Config>(crate::Pezpallet<T>);
|
||||
|
||||
/// Trait that must be implemented by runtime to be able to benchmark pallet properly.
|
||||
/// Trait that must be implemented by runtime to be able to benchmark pezpallet properly.
|
||||
pub trait Config: crate::Config + pezpallet_balances::Config {
|
||||
/// Helper that ensures successful delivery for extrinsics/benchmarks which need `SendXcm`.
|
||||
type DeliveryHelper: EnsureDelivery;
|
||||
@@ -376,7 +376,7 @@ mod benchmarks {
|
||||
FeeReason::ChargeFees,
|
||||
);
|
||||
|
||||
let _ = crate::Pallet::<T>::request_version_notify(loc);
|
||||
let _ = crate::Pezpallet::<T>::request_version_notify(loc);
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, Box::new(versioned_loc));
|
||||
@@ -398,7 +398,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::MigrateSupportedVersion,
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -413,7 +413,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::MigrateVersionNotifiers,
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -435,7 +435,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::NotifyCurrentTargets(None),
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -456,7 +456,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::NotifyCurrentTargets(None),
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -482,7 +482,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::MigrateAndNotifyOldTargets,
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -498,7 +498,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::MigrateAndNotifyOldTargets,
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -516,7 +516,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::lazy_migration(
|
||||
crate::Pezpallet::<T>::lazy_migration(
|
||||
VersionMigrationStage::MigrateAndNotifyOldTargets,
|
||||
Weight::zero(),
|
||||
);
|
||||
@@ -533,7 +533,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::new_query(responder, timeout, match_querier);
|
||||
crate::Pezpallet::<T>::new_query(responder, timeout, match_querier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,7 +542,7 @@ mod benchmarks {
|
||||
let responder = Location::from(Parent);
|
||||
let timeout = 1u32.into();
|
||||
let match_querier = Location::from(Here);
|
||||
let query_id = crate::Pallet::<T>::new_query(responder, timeout, match_querier);
|
||||
let query_id = crate::Pezpallet::<T>::new_query(responder, timeout, match_querier);
|
||||
let infos = (0..xcm::v3::MaxPalletsInfo::get())
|
||||
.map(|_| {
|
||||
PalletInfo::new(
|
||||
@@ -564,14 +564,14 @@ mod benchmarks {
|
||||
.unwrap()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
crate::Pallet::<T>::expect_response(
|
||||
crate::Pezpallet::<T>::expect_response(
|
||||
query_id,
|
||||
Response::PalletsInfo(infos.try_into().unwrap()),
|
||||
);
|
||||
|
||||
#[block]
|
||||
{
|
||||
<crate::Pallet<T> as QueryHandler>::take_response(query_id);
|
||||
<crate::Pezpallet<T> as QueryHandler>::take_response(query_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ mod benchmarks {
|
||||
.map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?;
|
||||
let asset: Asset = T::get_asset();
|
||||
// Trap assets for claiming later
|
||||
crate::Pallet::<T>::drop_assets(
|
||||
crate::Pezpallet::<T>::drop_assets(
|
||||
&claim_location,
|
||||
asset.clone().into(),
|
||||
&XcmContext { origin: None, message_id: [0u8; 32], topic: None },
|
||||
@@ -618,7 +618,7 @@ mod benchmarks {
|
||||
// Give some multiple of ED
|
||||
let balance = T::ExistentialDeposit::get() * 1000000u32.into();
|
||||
let _ =
|
||||
<pezpallet_balances::Pallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pezpallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
|
||||
let mut existing_aliases = BoundedVec::<OriginAliaser, MaxAuthorizedAliases>::new();
|
||||
// prepopulate list with `max-1` aliases to benchmark worst case
|
||||
@@ -686,7 +686,7 @@ mod benchmarks {
|
||||
// Give some multiple of ED
|
||||
let balance = T::ExistentialDeposit::get() * 1000000u32.into();
|
||||
let _ =
|
||||
<pezpallet_balances::Pallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pezpallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
|
||||
let mut existing_aliases = BoundedVec::<OriginAliaser, MaxAuthorizedAliases>::new();
|
||||
// prepopulate list with `max` aliases to benchmark worst case
|
||||
@@ -728,7 +728,7 @@ mod benchmarks {
|
||||
|
||||
#[block]
|
||||
{
|
||||
crate::Pallet::<T>::query_xcm_weight(versioned_msg)
|
||||
crate::Pezpallet::<T>::query_xcm_weight(versioned_msg)
|
||||
.map_err(|_| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?;
|
||||
}
|
||||
|
||||
@@ -736,7 +736,7 @@ mod benchmarks {
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Pallet,
|
||||
Pezpallet,
|
||||
crate::mock::new_test_ext_with_balances(Vec::new()),
|
||||
crate::mock::Test
|
||||
);
|
||||
@@ -763,14 +763,14 @@ pub mod helpers {
|
||||
let balance = amount * 10u32.into();
|
||||
let who = whitelisted_caller();
|
||||
let _ =
|
||||
<pezpallet_balances::Pallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pezpallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
// verify initial balance
|
||||
assert_eq!(pezpallet_balances::Pallet::<T>::free_balance(&who), balance);
|
||||
assert_eq!(pezpallet_balances::Pezpallet::<T>::free_balance(&who), balance);
|
||||
|
||||
// verify transferred successfully
|
||||
let verify = Box::new(move || {
|
||||
// verify balance after transfer, decreased by transferred amount (and delivery fees)
|
||||
assert!(pezpallet_balances::Pallet::<T>::free_balance(&who) <= balance - amount);
|
||||
assert!(pezpallet_balances::Pezpallet::<T>::free_balance(&who) <= balance - amount);
|
||||
});
|
||||
Some((assets, fee_asset_id, destination, verify))
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Errors for the XCM pallet.
|
||||
//! Errors for the XCM pezpallet.
|
||||
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use pezframe_support::PalletError;
|
||||
@@ -97,13 +97,13 @@ pub enum ExecutionError {
|
||||
/// Used by `ExpectAsset`, `ExpectError` and `ExpectOrigin` when the expectation was not true.
|
||||
#[codec(index = 22)]
|
||||
ExpectationFalse,
|
||||
/// The provided pallet index was not found.
|
||||
/// The provided pezpallet index was not found.
|
||||
#[codec(index = 23)]
|
||||
PalletNotFound,
|
||||
/// The given pallet's name is different to that expected.
|
||||
/// The given pezpallet's name is different to that expected.
|
||||
#[codec(index = 24)]
|
||||
NameMismatch,
|
||||
/// The given pallet's version has an incompatible version to that expected.
|
||||
/// The given pezpallet's version has an incompatible version to that expected.
|
||||
#[codec(index = 25)]
|
||||
VersionIncompatible,
|
||||
/// The given operation would lead to an overflow of the Holding Register.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Pallet to handle XCM messages.
|
||||
//! Pezpallet to handle XCM messages.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
@@ -47,7 +47,7 @@ use pezframe_support::{
|
||||
PalletId,
|
||||
};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, *};
|
||||
pub use pallet::*;
|
||||
pub use pezpallet::*;
|
||||
use scale_info::TypeInfo;
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::{
|
||||
@@ -218,8 +218,8 @@ pub fn aliasers_footprint(aliasers_count: usize) -> Footprint {
|
||||
Footprint::from_parts(aliasers_count, OriginAliaser::max_encoded_len())
|
||||
}
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet {
|
||||
use super::*;
|
||||
use pezframe_support::{
|
||||
dispatch::{GetDispatchInfo, PostDispatchInfo},
|
||||
@@ -241,16 +241,16 @@ pub mod pallet {
|
||||
|
||||
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::storage_version(STORAGE_VERSION)]
|
||||
#[pallet::without_storage_info]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
#[pezpallet::storage_version(STORAGE_VERSION)]
|
||||
#[pezpallet::without_storage_info]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
pub type BalanceOf<T> =
|
||||
<<T as Config>::Currency as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
|
||||
pub type TicketOf<T> = <T as Config>::AuthorizedAliasConsideration;
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
/// The module configuration trait.
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
@@ -296,7 +296,7 @@ pub mod pallet {
|
||||
type Weigher: WeightBounds<<Self as Config>::RuntimeCall>;
|
||||
|
||||
/// This chain's Universal Location.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type UniversalLocation: Get<InteriorLocation>;
|
||||
|
||||
/// The runtime `Origin` type.
|
||||
@@ -314,10 +314,10 @@ pub mod pallet {
|
||||
|
||||
/// The latest supported version that we advertise. Generally just set it to
|
||||
/// `pezpallet_xcm::CurrentXcmVersion`.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type AdvertisedXcmVersion: Get<XcmVersion>;
|
||||
|
||||
/// The origin that is allowed to call privileged operations on the XCM pallet
|
||||
/// The origin that is allowed to call privileged operations on the XCM pezpallet
|
||||
type AdminOrigin: EnsureOrigin<<Self as SysConfig>::RuntimeOrigin>;
|
||||
|
||||
/// The assets which we consider a given origin is trusted if they claim to have placed a
|
||||
@@ -328,27 +328,27 @@ pub mod pallet {
|
||||
type SovereignAccountOf: ConvertLocation<Self::AccountId>;
|
||||
|
||||
/// The maximum number of local XCM locks that a single account may have.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxLockers: Get<u32>;
|
||||
|
||||
/// The maximum number of consumers a single remote lock may have.
|
||||
#[pallet::constant]
|
||||
#[pezpallet::constant]
|
||||
type MaxRemoteLockConsumers: Get<u32>;
|
||||
|
||||
/// The ID type for local consumers of remote locks.
|
||||
type RemoteLockConsumerIdentifier: Parameter + Member + MaxEncodedLen + Ord + Copy;
|
||||
|
||||
/// Weight information for extrinsics in this pallet.
|
||||
/// Weight information for extrinsics in this pezpallet.
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
impl<T: Config> ExecuteControllerWeightInfo for Pallet<T> {
|
||||
impl<T: Config> ExecuteControllerWeightInfo for Pezpallet<T> {
|
||||
fn execute() -> Weight {
|
||||
T::WeightInfo::execute()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> ExecuteController<OriginFor<T>, <T as Config>::RuntimeCall> for Pallet<T> {
|
||||
impl<T: Config> ExecuteController<OriginFor<T>, <T as Config>::RuntimeCall> for Pezpallet<T> {
|
||||
type WeightInfo = Self;
|
||||
fn execute(
|
||||
origin: OriginFor<T>,
|
||||
@@ -403,13 +403,13 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> SendControllerWeightInfo for Pallet<T> {
|
||||
impl<T: Config> SendControllerWeightInfo for Pezpallet<T> {
|
||||
fn send() -> Weight {
|
||||
T::WeightInfo::send()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> SendController<OriginFor<T>> for Pallet<T> {
|
||||
impl<T: Config> SendController<OriginFor<T>> for Pezpallet<T> {
|
||||
type WeightInfo = Self;
|
||||
fn send(
|
||||
origin: OriginFor<T>,
|
||||
@@ -450,7 +450,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> QueryControllerWeightInfo for Pallet<T> {
|
||||
impl<T: Config> QueryControllerWeightInfo for Pezpallet<T> {
|
||||
fn query() -> Weight {
|
||||
T::WeightInfo::new_query()
|
||||
}
|
||||
@@ -459,7 +459,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> QueryController<OriginFor<T>, BlockNumberFor<T>> for Pallet<T> {
|
||||
impl<T: Config> QueryController<OriginFor<T>, BlockNumberFor<T>> for Pezpallet<T> {
|
||||
type WeightInfo = Self;
|
||||
|
||||
fn query(
|
||||
@@ -484,7 +484,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> EventEmitter for Pallet<T> {
|
||||
impl<T: Config> EventEmitter for Pezpallet<T> {
|
||||
fn emit_sent_event(
|
||||
origin: Location,
|
||||
destination: Location,
|
||||
@@ -513,8 +513,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> {
|
||||
/// Execution of an XCM message was attempted.
|
||||
Attempted { outcome: xcm::latest::Outcome },
|
||||
@@ -634,7 +634,7 @@ pub mod pallet {
|
||||
AliasesAuthorizationsRemoved { target: Location },
|
||||
}
|
||||
|
||||
#[pallet::origin]
|
||||
#[pezpallet::origin]
|
||||
#[derive(
|
||||
PartialEq,
|
||||
Eq,
|
||||
@@ -658,14 +658,14 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
/// A reason for this pallet placing a hold on funds.
|
||||
#[pallet::composite_enum]
|
||||
/// A reason for this pezpallet placing a hold on funds.
|
||||
#[pezpallet::composite_enum]
|
||||
pub enum HoldReason {
|
||||
/// The funds are held as storage deposit for an authorized alias.
|
||||
AuthorizeAlias,
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The desired destination was unreachable, generally because there is a no way of routing
|
||||
/// to it.
|
||||
@@ -803,11 +803,11 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// The latest available query index.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type QueryCounter<T: Config> = StorageValue<_, QueryId, ValueQuery>;
|
||||
|
||||
/// The ongoing queries.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type Queries<T: Config> =
|
||||
StorageMap<_, Blake2_128Concat, QueryId, QueryStatus<BlockNumberFor<T>>, OptionQuery>;
|
||||
|
||||
@@ -815,17 +815,17 @@ pub mod pallet {
|
||||
///
|
||||
/// Key is the blake2 256 hash of (origin, versioned `Assets`) pair. Value is the number of
|
||||
/// times this pair has been trapped (usually just 1 if it exists at all).
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type AssetTraps<T: Config> = StorageMap<_, Identity, H256, u32, ValueQuery>;
|
||||
|
||||
/// Default version to encode XCM when latest version of destination is unknown. If `None`,
|
||||
/// then the destinations whose XCM version is unknown are considered unreachable.
|
||||
#[pallet::storage]
|
||||
#[pallet::whitelist_storage]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::whitelist_storage]
|
||||
pub(super) type SafeXcmVersion<T: Config> = StorageValue<_, XcmVersion, OptionQuery>;
|
||||
|
||||
/// The Latest versions that we know various locations support.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type SupportedVersion<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -837,7 +837,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// All locations that we have requested version notifications from.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type VersionNotifiers<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -850,7 +850,7 @@ pub mod pallet {
|
||||
|
||||
/// The target locations that are subscribed to our version changes, as well as the most recent
|
||||
/// of our versions we informed them of.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type VersionNotifyTargets<T: Config> = StorageDoubleMap<
|
||||
_,
|
||||
Twox64Concat,
|
||||
@@ -871,8 +871,8 @@ pub mod pallet {
|
||||
/// Destinations whose latest XCM version we would like to know. Duplicates not allowed, and
|
||||
/// the `u32` counter is the number of times that a send to the destination has been attempted,
|
||||
/// which is used as a prioritization.
|
||||
#[pallet::storage]
|
||||
#[pallet::whitelist_storage]
|
||||
#[pezpallet::storage]
|
||||
#[pezpallet::whitelist_storage]
|
||||
pub(super) type VersionDiscoveryQueue<T: Config> = StorageValue<
|
||||
_,
|
||||
BoundedVec<(VersionedLocation, u32), VersionDiscoveryQueueSize<T>>,
|
||||
@@ -880,7 +880,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// The current migration's stage, if any.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type CurrentMigration<T: Config> =
|
||||
StorageValue<_, VersionMigrationStage, OptionQuery>;
|
||||
|
||||
@@ -908,7 +908,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
/// Fungible assets which we know are locked on a remote chain.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type RemoteLockedFungibles<T: Config> = StorageNMap<
|
||||
_,
|
||||
(
|
||||
@@ -921,7 +921,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// Fungible assets which we know are locked on this chain.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type LockedFungibles<T: Config> = StorageMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -931,7 +931,7 @@ pub mod pallet {
|
||||
>;
|
||||
|
||||
/// Global suspension state of the XCM executor.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type XcmExecutionSuspended<T: Config> = StorageValue<_, bool, ValueQuery>;
|
||||
|
||||
/// Whether or not incoming XCMs (both executed locally and received) should be recorded.
|
||||
@@ -939,24 +939,24 @@ pub mod pallet {
|
||||
/// This is meant to be used in runtime APIs, and it's advised it stays false
|
||||
/// for all other use cases, so as to not degrade regular performance.
|
||||
///
|
||||
/// Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]
|
||||
/// Only relevant if this pezpallet is being used as the [`xcm_executor::traits::RecordXcm`]
|
||||
/// implementation in the XCM executor configuration.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type ShouldRecordXcm<T: Config> = StorageValue<_, bool, ValueQuery>;
|
||||
|
||||
/// If [`ShouldRecordXcm`] is set to true, then the last XCM program executed locally
|
||||
/// will be stored here.
|
||||
/// Runtime APIs can fetch the XCM that was executed by accessing this value.
|
||||
///
|
||||
/// Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]
|
||||
/// Only relevant if this pezpallet is being used as the [`xcm_executor::traits::RecordXcm`]
|
||||
/// implementation in the XCM executor configuration.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(crate) type RecordedXcm<T: Config> = StorageValue<_, Xcm<()>>;
|
||||
|
||||
/// Map of authorized aliasers of local origins. Each local location can authorize a list of
|
||||
/// other locations to alias into it. Each aliaser is only valid until its inner `expiry`
|
||||
/// block number.
|
||||
#[pallet::storage]
|
||||
#[pezpallet::storage]
|
||||
pub(super) type AuthorizedAliases<T: Config> = StorageMap<
|
||||
_,
|
||||
Blake2_128Concat,
|
||||
@@ -965,7 +965,7 @@ pub mod pallet {
|
||||
OptionQuery,
|
||||
>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
#[pezpallet::genesis_config]
|
||||
pub struct GenesisConfig<T: Config> {
|
||||
#[serde(skip)]
|
||||
pub _config: core::marker::PhantomData<T>,
|
||||
@@ -985,7 +985,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
#[pezpallet::genesis_build]
|
||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
||||
fn build(&self) {
|
||||
SafeXcmVersion::<T>::set(self.safe_xcm_version);
|
||||
@@ -1000,8 +1000,8 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[pezpallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pezpallet<T> {
|
||||
fn on_initialize(_n: BlockNumberFor<T>) -> Weight {
|
||||
let mut weight_used = Weight::zero();
|
||||
if let Some(migration) = CurrentMigration::<T>::get() {
|
||||
@@ -1115,9 +1115,9 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::call(weight(<T as Config>::WeightInfo))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pezpallet::call(weight(<T as Config>::WeightInfo))]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
#[pezpallet::call_index(0)]
|
||||
pub fn send(
|
||||
origin: OriginFor<T>,
|
||||
dest: Box<VersionedLocation>,
|
||||
@@ -1144,7 +1144,7 @@ pub mod pallet {
|
||||
/// - `assets`: The assets to be withdrawn. This should include the assets used to pay the
|
||||
/// fee on the `dest` chain.
|
||||
/// - `fee_asset_id`: Id of the asset from `assets` which should be used to pay fees.
|
||||
#[pallet::call_index(1)]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[allow(deprecated)]
|
||||
#[deprecated(
|
||||
note = "This extrinsic uses `WeightLimit::Unlimited`, please migrate to `limited_teleport_assets` or `transfer_assets`"
|
||||
@@ -1188,7 +1188,7 @@ pub mod pallet {
|
||||
/// - `assets`: The assets to be withdrawn. This should include the assets used to pay the
|
||||
/// fee on the `dest` (and possibly reserve) chains.
|
||||
/// - `fee_asset_id`: Id of the asset from `assets` which should be used to pay fees.
|
||||
#[pallet::call_index(2)]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[allow(deprecated)]
|
||||
#[deprecated(
|
||||
note = "This extrinsic uses `WeightLimit::Unlimited`, please migrate to `limited_reserve_transfer_assets` or `transfer_assets`"
|
||||
@@ -1218,8 +1218,8 @@ pub mod pallet {
|
||||
/// No more than `max_weight` will be used in its attempted execution. If this is less than
|
||||
/// the maximum amount of weight that the message could take to be executed, then no
|
||||
/// execution attempt will be made.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight(max_weight.saturating_add(T::WeightInfo::execute()))]
|
||||
#[pezpallet::call_index(3)]
|
||||
#[pezpallet::weight(max_weight.saturating_add(T::WeightInfo::execute()))]
|
||||
pub fn execute(
|
||||
origin: OriginFor<T>,
|
||||
message: Box<VersionedXcm<<T as Config>::RuntimeCall>>,
|
||||
@@ -1236,7 +1236,7 @@ pub mod pallet {
|
||||
/// - `origin`: Must be an origin specified by AdminOrigin.
|
||||
/// - `location`: The destination that is being described.
|
||||
/// - `xcm_version`: The latest version of XCM that `location` supports.
|
||||
#[pallet::call_index(4)]
|
||||
#[pezpallet::call_index(4)]
|
||||
pub fn force_xcm_version(
|
||||
origin: OriginFor<T>,
|
||||
location: Box<Location>,
|
||||
@@ -1254,7 +1254,7 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must be an origin specified by AdminOrigin.
|
||||
/// - `maybe_xcm_version`: The default XCM encoding version, or `None` to disable.
|
||||
#[pallet::call_index(5)]
|
||||
#[pezpallet::call_index(5)]
|
||||
pub fn force_default_xcm_version(
|
||||
origin: OriginFor<T>,
|
||||
maybe_xcm_version: Option<XcmVersion>,
|
||||
@@ -1268,7 +1268,7 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must be an origin specified by AdminOrigin.
|
||||
/// - `location`: The location to which we should subscribe for XCM version notifications.
|
||||
#[pallet::call_index(6)]
|
||||
#[pezpallet::call_index(6)]
|
||||
pub fn force_subscribe_version_notify(
|
||||
origin: OriginFor<T>,
|
||||
location: Box<VersionedLocation>,
|
||||
@@ -1300,7 +1300,7 @@ pub mod pallet {
|
||||
/// - `origin`: Must be an origin specified by AdminOrigin.
|
||||
/// - `location`: The location to which we are currently subscribed for XCM version
|
||||
/// notifications which we no longer desire.
|
||||
#[pallet::call_index(7)]
|
||||
#[pezpallet::call_index(7)]
|
||||
pub fn force_unsubscribe_version_notify(
|
||||
origin: OriginFor<T>,
|
||||
location: Box<VersionedLocation>,
|
||||
@@ -1355,8 +1355,8 @@ pub mod pallet {
|
||||
/// fee on the `dest` (and possibly reserve) chains.
|
||||
/// - `fee_asset_id`: Id of the asset from `assets` which should be used to pay fees.
|
||||
/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
|
||||
#[pallet::call_index(8)]
|
||||
#[pallet::weight(T::WeightInfo::reserve_transfer_assets())]
|
||||
#[pezpallet::call_index(8)]
|
||||
#[pezpallet::weight(T::WeightInfo::reserve_transfer_assets())]
|
||||
pub fn limited_reserve_transfer_assets(
|
||||
origin: OriginFor<T>,
|
||||
dest: Box<VersionedLocation>,
|
||||
@@ -1392,8 +1392,8 @@ pub mod pallet {
|
||||
/// fee on the `dest` chain.
|
||||
/// - `fee_asset_id`: Id of the asset from `assets` which should be used to pay fees.
|
||||
/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
|
||||
#[pallet::call_index(9)]
|
||||
#[pallet::weight(T::WeightInfo::teleport_assets())]
|
||||
#[pezpallet::call_index(9)]
|
||||
#[pezpallet::weight(T::WeightInfo::teleport_assets())]
|
||||
pub fn limited_teleport_assets(
|
||||
origin: OriginFor<T>,
|
||||
dest: Box<VersionedLocation>,
|
||||
@@ -1409,7 +1409,7 @@ pub mod pallet {
|
||||
///
|
||||
/// - `origin`: Must be an origin specified by AdminOrigin.
|
||||
/// - `suspended`: `true` to suspend, `false` to resume.
|
||||
#[pallet::call_index(10)]
|
||||
#[pezpallet::call_index(10)]
|
||||
pub fn force_suspension(origin: OriginFor<T>, suspended: bool) -> DispatchResult {
|
||||
T::AdminOrigin::ensure_origin(origin)?;
|
||||
XcmExecutionSuspended::<T>::set(suspended);
|
||||
@@ -1448,7 +1448,7 @@ pub mod pallet {
|
||||
/// fee on the `dest` (and possibly reserve) chains.
|
||||
/// - `fee_asset_id`: Id of the asset from `assets` which should be used to pay fees.
|
||||
/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
|
||||
#[pallet::call_index(11)]
|
||||
#[pezpallet::call_index(11)]
|
||||
pub fn transfer_assets(
|
||||
origin: OriginFor<T>,
|
||||
dest: Box<VersionedLocation>,
|
||||
@@ -1519,13 +1519,13 @@ pub mod pallet {
|
||||
)
|
||||
}
|
||||
|
||||
/// Claims assets trapped on this pallet because of leftover assets during XCM execution.
|
||||
/// Claims assets trapped on this pezpallet because of leftover assets during XCM execution.
|
||||
///
|
||||
/// - `origin`: Anyone can call this extrinsic.
|
||||
/// - `assets`: The exact assets that were trapped. Use the version to specify what version
|
||||
/// was the latest when they were trapped.
|
||||
/// - `beneficiary`: The location/account where the claimed assets will be deposited.
|
||||
#[pallet::call_index(12)]
|
||||
#[pezpallet::call_index(12)]
|
||||
pub fn claim_assets(
|
||||
origin: OriginFor<T>,
|
||||
assets: Box<VersionedAssets>,
|
||||
@@ -1622,8 +1622,8 @@ pub mod pallet {
|
||||
/// - `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the
|
||||
/// transfer, which also determines what happens to the assets on the destination chain.
|
||||
/// - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
|
||||
#[pallet::call_index(13)]
|
||||
#[pallet::weight(T::WeightInfo::transfer_assets())]
|
||||
#[pezpallet::call_index(13)]
|
||||
#[pezpallet::weight(T::WeightInfo::transfer_assets())]
|
||||
pub fn transfer_assets_using_type_and_then(
|
||||
origin: OriginFor<T>,
|
||||
dest: Box<VersionedLocation>,
|
||||
@@ -1695,7 +1695,7 @@ pub mod pallet {
|
||||
/// WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in
|
||||
/// their/your name. Once authorized using this call, the `aliaser` can freely impersonate
|
||||
/// `origin` in XCM programs executed on the local chain.
|
||||
#[pallet::call_index(14)]
|
||||
#[pezpallet::call_index(14)]
|
||||
pub fn add_authorized_alias(
|
||||
origin: OriginFor<T>,
|
||||
aliaser: Box<VersionedLocation>,
|
||||
@@ -1722,7 +1722,7 @@ pub mod pallet {
|
||||
if let Some(expiry) = expires {
|
||||
ensure!(
|
||||
expiry >
|
||||
pezframe_system::Pallet::<T>::current_block_number().saturated_into::<u64>(),
|
||||
pezframe_system::Pezpallet::<T>::current_block_number().saturated_into::<u64>(),
|
||||
Error::<T>::ExpiresInPast
|
||||
);
|
||||
}
|
||||
@@ -1778,7 +1778,7 @@ pub mod pallet {
|
||||
|
||||
/// Remove a previously authorized `aliaser` from the list of locations that can alias into
|
||||
/// the local `origin` making this call.
|
||||
#[pallet::call_index(15)]
|
||||
#[pezpallet::call_index(15)]
|
||||
pub fn remove_authorized_alias(
|
||||
origin: OriginFor<T>,
|
||||
aliaser: Box<VersionedLocation>,
|
||||
@@ -1838,8 +1838,8 @@ pub mod pallet {
|
||||
|
||||
/// Remove all previously authorized `aliaser`s that can alias into the local `origin`
|
||||
/// making this call.
|
||||
#[pallet::call_index(16)]
|
||||
#[pallet::weight(T::WeightInfo::remove_authorized_alias())]
|
||||
#[pezpallet::call_index(16)]
|
||||
#[pezpallet::weight(T::WeightInfo::remove_authorized_alias())]
|
||||
pub fn remove_all_authorized_aliases(origin: OriginFor<T>) -> DispatchResult {
|
||||
let signed_origin = ensure_signed(origin.clone())?;
|
||||
let origin_location: Location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
@@ -1893,7 +1893,7 @@ impl<T: Config> core::fmt::Debug for FeesHandling<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> QueryHandler for Pallet<T> {
|
||||
impl<T: Config> QueryHandler for Pezpallet<T> {
|
||||
type BlockNumber = BlockNumberFor<T>;
|
||||
type Error = XcmError;
|
||||
type UniversalLocation = T::UniversalLocation;
|
||||
@@ -1970,12 +1970,12 @@ impl<T: Config> QueryHandler for Pallet<T> {
|
||||
let response = response.into();
|
||||
Queries::<T>::insert(
|
||||
id,
|
||||
QueryStatus::Ready { response, at: pezframe_system::Pallet::<T>::current_block_number() },
|
||||
QueryStatus::Ready { response, at: pezframe_system::Pezpallet::<T>::current_block_number() },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// The ongoing queries.
|
||||
pub fn query(query_id: &QueryId) -> Option<QueryStatus<BlockNumberFor<T>>> {
|
||||
Queries::<T>::get(query_id)
|
||||
@@ -3075,14 +3075,14 @@ impl<T: Config> Pallet<T> {
|
||||
RuntimeCall: Dispatchable<PostInfo = PostDispatchInfo>,
|
||||
<RuntimeCall as Dispatchable>::RuntimeOrigin: From<OriginCaller>,
|
||||
{
|
||||
crate::Pallet::<Runtime>::set_record_xcm(true);
|
||||
crate::Pezpallet::<Runtime>::set_record_xcm(true);
|
||||
// Clear other messages in queues...
|
||||
Router::clear_messages();
|
||||
// ...and reset events to make sure we only record events from current call.
|
||||
pezframe_system::Pallet::<Runtime>::reset_events();
|
||||
pezframe_system::Pezpallet::<Runtime>::reset_events();
|
||||
let result = call.dispatch(origin.into());
|
||||
crate::Pallet::<Runtime>::set_record_xcm(false);
|
||||
let local_xcm = crate::Pallet::<Runtime>::recorded_xcm()
|
||||
crate::Pezpallet::<Runtime>::set_record_xcm(false);
|
||||
let local_xcm = crate::Pezpallet::<Runtime>::recorded_xcm()
|
||||
.map(|xcm| VersionedXcm::<()>::from(xcm).into_version(result_xcms_version))
|
||||
.transpose()
|
||||
.map_err(|()| {
|
||||
@@ -3105,7 +3105,7 @@ impl<T: Config> Pallet<T> {
|
||||
},
|
||||
)?;
|
||||
let events: Vec<<Runtime as pezframe_system::Config>::RuntimeEvent> =
|
||||
pezframe_system::Pallet::<Runtime>::read_events_no_consensus()
|
||||
pezframe_system::Pezpallet::<Runtime>::read_events_no_consensus()
|
||||
.map(|record| record.event.clone())
|
||||
.collect();
|
||||
Ok(CallDryRunEffects {
|
||||
@@ -3146,7 +3146,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
// To make sure we only record events from current call.
|
||||
Router::clear_messages();
|
||||
pezframe_system::Pallet::<T>::reset_events();
|
||||
pezframe_system::Pezpallet::<T>::reset_events();
|
||||
|
||||
let result = <T as Config>::XcmExecutor::prepare_and_execute(
|
||||
origin_location,
|
||||
@@ -3163,7 +3163,7 @@ impl<T: Config> Pallet<T> {
|
||||
);
|
||||
})?;
|
||||
let events: Vec<<T as pezframe_system::Config>::RuntimeEvent> =
|
||||
pezframe_system::Pallet::<T>::read_events_no_consensus()
|
||||
pezframe_system::Pezpallet::<T>::read_events_no_consensus()
|
||||
.map(|record| record.event.clone())
|
||||
.collect();
|
||||
Ok(XcmDryRunEffects { forwarded_xcms, emitted_events: events, execution_result: result })
|
||||
@@ -3250,7 +3250,7 @@ impl<T: Config> Pallet<T> {
|
||||
) -> Result<u128, XcmPaymentApiError> {
|
||||
let asset: AssetId = asset.clone().try_into()
|
||||
.map_err(|e| {
|
||||
tracing::debug!(target: "xcm::pallet::query_weight_to_asset_fee", ?e, ?asset, "Failed to convert versioned asset");
|
||||
tracing::debug!(target: "xcm::pezpallet::query_weight_to_asset_fee", ?e, ?asset, "Failed to convert versioned asset");
|
||||
XcmPaymentApiError::VersionedConversionFailed
|
||||
})?;
|
||||
|
||||
@@ -3264,7 +3264,7 @@ impl<T: Config> Pallet<T> {
|
||||
let mut trader = Trader::new();
|
||||
let result = trader.buy_weight(weight, max_payment.into(), &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet::query_weight_to_asset_fee", ?e, ?asset, "Failed to buy weight");
|
||||
tracing::error!(target: "xcm::pezpallet::query_weight_to_asset_fee", ?e, ?asset, "Failed to buy weight");
|
||||
|
||||
// Return something convertible to `DispatchError` as required by the `with_transaction` fn.
|
||||
DispatchError::Other("Failed to buy weight")
|
||||
@@ -3272,12 +3272,12 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
TransactionOutcome::Rollback(result)
|
||||
}).map_err(|error| {
|
||||
tracing::debug!(target: "xcm::pallet::query_weight_to_asset_fee", ?error, "Failed to execute transaction");
|
||||
tracing::debug!(target: "xcm::pezpallet::query_weight_to_asset_fee", ?error, "Failed to execute transaction");
|
||||
XcmPaymentApiError::AssetNotFound
|
||||
})?;
|
||||
|
||||
let Some(unspent) = unspent.fungible.get(&asset) else {
|
||||
tracing::error!(target: "xcm::pallet::query_weight_to_asset_fee", ?asset, "The trader didn't return the needed fungible asset");
|
||||
tracing::error!(target: "xcm::pezpallet::query_weight_to_asset_fee", ?asset, "The trader didn't return the needed fungible asset");
|
||||
return Err(XcmPaymentApiError::AssetNotFound);
|
||||
};
|
||||
|
||||
@@ -3456,7 +3456,7 @@ impl<T: Config> Pallet<T> {
|
||||
aliaser
|
||||
.expiry
|
||||
.map(|expiry| {
|
||||
pezframe_system::Pallet::<T>::current_block_number().saturated_into::<u64>() <
|
||||
pezframe_system::Pezpallet::<T>::current_block_number().saturated_into::<u64>() <
|
||||
expiry
|
||||
})
|
||||
.unwrap_or(true)
|
||||
@@ -3492,7 +3492,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// - `message`: The message whose outcome should be reported.
|
||||
/// - `responder`: The origin from which a response should be expected.
|
||||
/// - `notify`: A dispatchable function which will be called once the outcome of `message` is
|
||||
/// known. It may be a dispatchable in any pallet of the local chain, but other than the usual
|
||||
/// known. It may be a dispatchable in any pezpallet of the local chain, but other than the usual
|
||||
/// origin, it must accept exactly two arguments: `query_id: QueryId` and `outcome: Response`,
|
||||
/// and in that order. It should expect that the origin is `Origin::Response` and will contain
|
||||
/// the responder's location.
|
||||
@@ -3580,9 +3580,9 @@ impl<T: Config> Pallet<T> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Ensure the correctness of the state of this pallet.
|
||||
/// Ensure the correctness of the state of this pezpallet.
|
||||
///
|
||||
/// This should be valid before and after each state transition of this pallet.
|
||||
/// This should be valid before and after each state transition of this pezpallet.
|
||||
///
|
||||
/// ## Invariants
|
||||
///
|
||||
@@ -3762,7 +3762,7 @@ impl<T: Config> xcm_executor::traits::Enact for ReduceTicket<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> xcm_executor::traits::AssetLock for Pallet<T> {
|
||||
impl<T: Config> xcm_executor::traits::AssetLock for Pezpallet<T> {
|
||||
type LockTicket = LockTicket<T>;
|
||||
type UnlockTicket = UnlockTicket<T>;
|
||||
type ReduceTicket = ReduceTicket<T>;
|
||||
@@ -3855,7 +3855,7 @@ impl<T: Config> xcm_executor::traits::AssetLock for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> WrapVersion for Pallet<T> {
|
||||
impl<T: Config> WrapVersion for Pezpallet<T> {
|
||||
fn wrap_version<RuntimeCall: Decode + GetDispatchInfo>(
|
||||
dest: &Location,
|
||||
xcm: impl Into<VersionedXcm<RuntimeCall>>,
|
||||
@@ -3876,13 +3876,13 @@ impl<T: Config> WrapVersion for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> GetVersion for Pallet<T> {
|
||||
impl<T: Config> GetVersion for Pezpallet<T> {
|
||||
fn get_version_for(dest: &Location) -> Option<XcmVersion> {
|
||||
SupportedVersion::<T>::get(XCM_VERSION, LatestVersionedLocation(dest))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> VersionChangeNotifier for Pallet<T> {
|
||||
impl<T: Config> VersionChangeNotifier for Pezpallet<T> {
|
||||
/// Start notifying `location` should the XCM version of this chain change.
|
||||
///
|
||||
/// When it does, this type should ensure a `QueryResponse` message is sent with the given
|
||||
@@ -3930,7 +3930,7 @@ impl<T: Config> VersionChangeNotifier for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> DropAssets for Pallet<T> {
|
||||
impl<T: Config> DropAssets for Pezpallet<T> {
|
||||
fn drop_assets(origin: &Location, assets: AssetsInHolding, _context: &XcmContext) -> Weight {
|
||||
if assets.is_empty() {
|
||||
return Weight::zero();
|
||||
@@ -3948,7 +3948,7 @@ impl<T: Config> DropAssets for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> ClaimAssets for Pallet<T> {
|
||||
impl<T: Config> ClaimAssets for Pezpallet<T> {
|
||||
fn claim_assets(
|
||||
origin: &Location,
|
||||
ticket: &Location,
|
||||
@@ -3980,7 +3980,7 @@ impl<T: Config> ClaimAssets for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> OnResponse for Pallet<T> {
|
||||
impl<T: Config> OnResponse for Pezpallet<T> {
|
||||
fn expecting_response(
|
||||
origin: &Location,
|
||||
query_id: QueryId,
|
||||
@@ -4147,7 +4147,7 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
None => {
|
||||
let e = Event::ResponseReady { query_id, response: response.clone() };
|
||||
Self::deposit_event(e);
|
||||
let at = pezframe_system::Pallet::<T>::current_block_number();
|
||||
let at = pezframe_system::Pezpallet::<T>::current_block_number();
|
||||
let response = response.into();
|
||||
Queries::<T>::insert(query_id, QueryStatus::Ready { response, at });
|
||||
Weight::zero()
|
||||
@@ -4163,7 +4163,7 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> CheckSuspension for Pallet<T> {
|
||||
impl<T: Config> CheckSuspension for Pezpallet<T> {
|
||||
fn is_suspended<Call>(
|
||||
_origin: &Location,
|
||||
_instructions: &mut [Instruction<Call>],
|
||||
@@ -4174,7 +4174,7 @@ impl<T: Config> CheckSuspension for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> RecordXcm for Pallet<T> {
|
||||
impl<T: Config> RecordXcm for Pezpallet<T> {
|
||||
fn should_record() -> bool {
|
||||
ShouldRecordXcm::<T>::get()
|
||||
}
|
||||
@@ -4231,7 +4231,7 @@ impl<L: Into<VersionedLocation> + Clone, T: Config> ContainsPair<L, L> for Autho
|
||||
tracing::trace!(target: "xcm::pezpallet_xcm::AuthorizedAliasers::contains", ?origin, ?target);
|
||||
// return true if the `origin` has been explicitly authorized by `target` as aliaser, and
|
||||
// the authorization has not expired
|
||||
Pallet::<T>::is_authorized_alias(origin, target).unwrap_or(false)
|
||||
Pezpallet::<T>::is_authorized_alias(origin, target).unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{
|
||||
pallet::CurrentMigration, Config, CurrentXcmVersion, Pallet, VersionMigrationStage,
|
||||
pezpallet::CurrentMigration, Config, CurrentXcmVersion, Pezpallet, VersionMigrationStage,
|
||||
VersionNotifyTargets,
|
||||
};
|
||||
use pezframe_support::{
|
||||
@@ -215,7 +215,7 @@ pub mod data {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Migrates relevant data to the `required_xcm_version`.
|
||||
pub(crate) fn migrate_data_to_xcm_version(
|
||||
weight: &mut Weight,
|
||||
@@ -418,7 +418,7 @@ pub mod v1 {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let mut weight = T::DbWeight::get().reads(1);
|
||||
|
||||
if StorageVersion::get::<Pallet<T>>() != 0 {
|
||||
if StorageVersion::get::<Pezpallet<T>>() != 0 {
|
||||
tracing::warn!("skipping v1, should be removed");
|
||||
return weight;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ pub mod v1 {
|
||||
|
||||
tracing::info!("v1 applied successfully");
|
||||
weight.saturating_accrue(T::DbWeight::get().writes(1));
|
||||
StorageVersion::new(1).put::<Pallet<T>>();
|
||||
StorageVersion::new(1).put::<Pezpallet<T>>();
|
||||
weight
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ pub mod v1 {
|
||||
0,
|
||||
1,
|
||||
VersionUncheckedMigrateToV1<T>,
|
||||
crate::pallet::Pallet<T>,
|
||||
crate::pezpallet::Pezpallet<T>,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ impl<T: Config> OnRuntimeUpgrade for MigrateToLatestXcmVersion<T> {
|
||||
|
||||
// migrate other operational data to the latest XCM version in-place
|
||||
let latest = CurrentXcmVersion::get();
|
||||
Pallet::<T>::migrate_data_to_xcm_version(&mut weight, latest);
|
||||
Pezpallet::<T>::migrate_data_to_xcm_version(&mut weight, latest);
|
||||
|
||||
weight
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ pub type AccountId = AccountId32;
|
||||
pub type Balance = u128;
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
#[pezframe_support::pallet]
|
||||
#[pezframe_support::pezpallet]
|
||||
pub mod pezpallet_test_notifier {
|
||||
use crate::{ensure_response, QueryId};
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
@@ -62,10 +62,10 @@ pub mod pezpallet_test_notifier {
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_executor::traits::QueryHandler;
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
#[pezpallet::pezpallet]
|
||||
pub struct Pezpallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
#[pezpallet::config]
|
||||
pub trait Config: pezframe_system::Config + crate::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: IsType<<Self as pezframe_system::Config>::RuntimeEvent> + From<Event<Self>>;
|
||||
@@ -74,30 +74,30 @@ pub mod pezpallet_test_notifier {
|
||||
type RuntimeCall: IsType<<Self as crate::Config>::RuntimeCall> + From<Call<Self>>;
|
||||
}
|
||||
|
||||
#[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> {
|
||||
QueryPrepared(QueryId),
|
||||
NotifyQueryPrepared(QueryId),
|
||||
ResponseReceived(Location, QueryId, Response),
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
#[pezpallet::error]
|
||||
pub enum Error<T> {
|
||||
UnexpectedId,
|
||||
BadAccountFormat,
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T> {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
#[pezpallet::call]
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
#[pezpallet::call_index(0)]
|
||||
#[pezpallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
pub fn prepare_new_query(origin: OriginFor<T>, querier: Location) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let id = who
|
||||
.using_encoded(|mut d| <[u8; 32]>::decode(&mut d))
|
||||
.map_err(|_| Error::<T>::BadAccountFormat)?;
|
||||
let qid = <crate::Pallet<T> as QueryHandler>::new_query(
|
||||
let qid = <crate::Pezpallet<T> as QueryHandler>::new_query(
|
||||
Junction::AccountId32 { network: None, id },
|
||||
100u32.into(),
|
||||
querier,
|
||||
@@ -106,8 +106,8 @@ pub mod pezpallet_test_notifier {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
#[pezpallet::call_index(1)]
|
||||
#[pezpallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
pub fn prepare_new_notify_query(origin: OriginFor<T>, querier: Location) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
let id = who
|
||||
@@ -115,7 +115,7 @@ pub mod pezpallet_test_notifier {
|
||||
.map_err(|_| Error::<T>::BadAccountFormat)?;
|
||||
let call =
|
||||
Call::<T>::notification_received { query_id: 0, response: Default::default() };
|
||||
let qid = crate::Pallet::<T>::new_notify_query(
|
||||
let qid = crate::Pezpallet::<T>::new_notify_query(
|
||||
Junction::AccountId32 { network: None, id },
|
||||
<T as Config>::RuntimeCall::from(call),
|
||||
100u32.into(),
|
||||
@@ -125,8 +125,8 @@ pub mod pezpallet_test_notifier {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
#[pezpallet::call_index(2)]
|
||||
#[pezpallet::weight(Weight::from_parts(1_000_000, 1_000_000))]
|
||||
pub fn notification_received(
|
||||
origin: OriginFor<T>,
|
||||
query_id: QueryId,
|
||||
|
||||
@@ -22,10 +22,10 @@ use crate::{
|
||||
aliasers_footprint,
|
||||
migration::data::NeedsMigration,
|
||||
mock::*,
|
||||
pallet::{LockedFungibles, RemoteLockedFungibles, SupportedVersion},
|
||||
pezpallet::{LockedFungibles, RemoteLockedFungibles, SupportedVersion},
|
||||
xcm_helpers::find_xcm_sent_message_id,
|
||||
AssetTraps, AuthorizedAliasers, Config, CurrentMigration, Error, ExecuteControllerWeightInfo,
|
||||
LatestVersionedLocation, MaxAuthorizedAliases, Pallet, Queries, QueryStatus, RecordedXcm,
|
||||
LatestVersionedLocation, MaxAuthorizedAliases, Pezpallet, Queries, QueryStatus, RecordedXcm,
|
||||
RemoteLockedFungibleRecord, ShouldRecordXcm, VersionDiscoveryQueue, VersionMigrationStage,
|
||||
VersionNotifiers, VersionNotifyTargets, WeightInfo,
|
||||
};
|
||||
@@ -753,7 +753,7 @@ fn incomplete_execute_reverts_side_effects() {
|
||||
Err(pezsp_runtime::DispatchErrorWithPostInfo {
|
||||
post_info: pezframe_support::dispatch::PostDispatchInfo {
|
||||
actual_weight: Some(
|
||||
<Pallet<Test> as ExecuteControllerWeightInfo>::execute() + weight
|
||||
<Pezpallet<Test> as ExecuteControllerWeightInfo>::execute() + weight
|
||||
),
|
||||
pays_fee: pezframe_support::dispatch::Pays::Yes,
|
||||
},
|
||||
@@ -1417,7 +1417,7 @@ fn multistage_migration_works() {
|
||||
AdvertisedXcmVersion::set(4);
|
||||
|
||||
// check `try-state`
|
||||
assert!(Pallet::<Test>::do_try_state().is_err());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_err());
|
||||
|
||||
// closure simulates a multistage migration process
|
||||
let migrate = |expected_cycle_count| {
|
||||
@@ -1476,7 +1476,7 @@ fn multistage_migration_works() {
|
||||
assert_eq!(take_sent_xcm(), vec![]);
|
||||
|
||||
// check `try-state`
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1484,7 +1484,7 @@ fn multistage_migration_works() {
|
||||
fn migrate_data_to_xcm_version_works() {
|
||||
new_test_ext_with_balances(vec![]).execute_with(|| {
|
||||
// check `try-state`
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
|
||||
let latest_version = XCM_VERSION;
|
||||
let previous_version = XCM_VERSION - 1;
|
||||
@@ -1509,16 +1509,16 @@ fn migrate_data_to_xcm_version_works() {
|
||||
// store two queries: migrated and not migrated
|
||||
Queries::<Test>::insert(query_id1, query_as_latest.clone());
|
||||
Queries::<Test>::insert(query_id2, query_as_previous);
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
|
||||
// trigger migration
|
||||
Pallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
Pezpallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
|
||||
// no change for query_id1
|
||||
assert_eq!(Queries::<Test>::get(query_id1), Some(query_as_latest.clone()));
|
||||
// change for query_id2
|
||||
assert_eq!(Queries::<Test>::get(query_id2), Some(query_as_latest));
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
}
|
||||
|
||||
// `LockedFungibles` migration
|
||||
@@ -1540,16 +1540,16 @@ fn migrate_data_to_xcm_version_works() {
|
||||
// store two lockeds: migrated and not migrated
|
||||
LockedFungibles::<Test>::insert(&account1, lockeds_as_latest.clone());
|
||||
LockedFungibles::<Test>::insert(&account2, lockeds_as_previous);
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
|
||||
// trigger migration
|
||||
Pallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
Pezpallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
|
||||
// no change for account1
|
||||
assert_eq!(LockedFungibles::<Test>::get(&account1), Some(lockeds_as_latest.clone()));
|
||||
// change for account2
|
||||
assert_eq!(LockedFungibles::<Test>::get(&account2), Some(lockeds_as_latest));
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
}
|
||||
|
||||
// `RemoteLockedFungibles` migration
|
||||
@@ -1602,10 +1602,10 @@ fn migrate_data_to_xcm_version_works() {
|
||||
RemoteLockedFungibles::<Test>::insert(&key2_as_latest, data_as_previous.clone());
|
||||
// neither key nor data migrated
|
||||
RemoteLockedFungibles::<Test>::insert(&key3_as_previous, data_as_previous);
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
|
||||
// trigger migration
|
||||
Pallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
Pezpallet::<Test>::migrate_data_to_xcm_version(&mut Weight::zero(), latest_version);
|
||||
|
||||
let assert_locked_eq =
|
||||
|left: Option<RemoteLockedFungibleRecord<_, _>>,
|
||||
@@ -1638,7 +1638,7 @@ fn migrate_data_to_xcm_version_works() {
|
||||
RemoteLockedFungibles::<Test>::get(&expected_key3_as_latest),
|
||||
Some(data_as_latest.clone()),
|
||||
);
|
||||
assert!(Pallet::<Test>::do_try_state().is_ok());
|
||||
assert!(Pezpallet::<Test>::do_try_state().is_ok());
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//! reserve location will be adjusted accordingly to be Asset Hub.
|
||||
//! For more information, see <https://github.com/pezkuwichain/pezkuwi-sdk/issues/158>.
|
||||
|
||||
use crate::{Config, Error, Pallet};
|
||||
use crate::{Config, Error, Pezpallet};
|
||||
use alloc::vec::Vec;
|
||||
use hex_literal::hex;
|
||||
use pezsp_core::Get;
|
||||
@@ -31,7 +31,7 @@ use xcm_executor::traits::TransferType;
|
||||
const PASEO_GENESIS_HASH: [u8; 32] =
|
||||
hex!["77afd6190f1554ad45fd0d31aee62aacc33c6db0ea801129acb813f913e0764f"];
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
impl<T: Config> Pezpallet<T> {
|
||||
/// Check if network native asset reserve transfers should be blocked during Asset Hub
|
||||
/// Migration.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user