feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "pallet-xcm"
|
||||
name = "pezpallet-xcm"
|
||||
version = "7.0.0"
|
||||
description = "A pallet for handling XCM programs."
|
||||
authors.workspace = true
|
||||
@@ -20,11 +20,11 @@ serde = { optional = true, features = [
|
||||
], workspace = true, default-features = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
frame-support = { workspace = true }
|
||||
frame-system = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
pezframe-support = { workspace = true }
|
||||
pezframe-system = { workspace = true }
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
|
||||
xcm = { workspace = true }
|
||||
xcm-builder = { workspace = true }
|
||||
@@ -32,15 +32,15 @@ xcm-executor = { workspace = true }
|
||||
xcm-runtime-apis = { workspace = true }
|
||||
|
||||
# marked optional, used in benchmarking
|
||||
frame-benchmarking = { optional = true, workspace = true }
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
hex-literal = { workspace = true, default-features = false }
|
||||
pallet-balances = { optional = true, workspace = true }
|
||||
pezpallet-balances = { optional = true, workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pallet-assets = { workspace = true, default-features = true }
|
||||
pezpallet-assets = { workspace = true, default-features = true }
|
||||
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
|
||||
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
xcm-simulator = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
@@ -48,15 +48,15 @@ default = ["std"]
|
||||
std = [
|
||||
"bounded-collections/std",
|
||||
"codec/std",
|
||||
"frame-benchmarking?/std",
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"pallet-balances/std",
|
||||
"pezframe-benchmarking?/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"pezpallet-balances/std",
|
||||
"scale-info/std",
|
||||
"serde",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"tracing/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
@@ -64,15 +64,15 @@ std = [
|
||||
"xcm/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-assets/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-assets/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezkuwi-runtime-teyrchains/runtime-benchmarks",
|
||||
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
|
||||
"sp-io/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
"xcm-executor/runtime-benchmarks",
|
||||
"xcm-runtime-apis/runtime-benchmarks",
|
||||
@@ -81,10 +81,10 @@ runtime-benchmarks = [
|
||||
]
|
||||
test-utils = ["std"]
|
||||
try-runtime = [
|
||||
"frame-support/try-runtime",
|
||||
"frame-system/try-runtime",
|
||||
"pallet-assets/try-runtime",
|
||||
"pallet-balances/try-runtime",
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezpallet-assets/try-runtime",
|
||||
"pezpallet-balances/try-runtime",
|
||||
"pezkuwi-runtime-teyrchains/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "pallet-xcm-precompiles"
|
||||
name = "pezpallet-xcm-precompiles"
|
||||
version = "0.1.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Provides precompiles for `pallet-xcm`"
|
||||
description = "Provides precompiles for `pezpallet-xcm`"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -18,22 +18,22 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
codec = { features = ["derive"], workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
frame-support = { workspace = true }
|
||||
pallet-revive = { workspace = true }
|
||||
pallet-xcm = { workspace = true }
|
||||
pezframe-support = { workspace = true }
|
||||
pezpallet-revive = { workspace = true }
|
||||
pezpallet-xcm = { workspace = true }
|
||||
|
||||
xcm = { workspace = true }
|
||||
xcm-executor = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
frame-system = { workspace = true, default-features = true }
|
||||
pallet-assets = { workspace = true, default-features = true }
|
||||
pallet-balances = { workspace = true, default-features = true }
|
||||
pallet-timestamp = { workspace = true, default-features = true }
|
||||
pezframe-system = { workspace = true, default-features = true }
|
||||
pezpallet-assets = { workspace = true, default-features = true }
|
||||
pezpallet-balances = { workspace = true, default-features = true }
|
||||
pezpallet-timestamp = { workspace = true, default-features = true }
|
||||
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
|
||||
scale-info = { workspace = true, default-features = true }
|
||||
sp-io = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
xcm-builder = { workspace = true, default-features = true }
|
||||
xcm-simulator = { workspace = true, default-features = true }
|
||||
|
||||
@@ -41,45 +41,45 @@ xcm-simulator = { workspace = true, default-features = true }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"pallet-assets/std",
|
||||
"pallet-balances/std",
|
||||
"pallet-revive/std",
|
||||
"pallet-timestamp/std",
|
||||
"pallet-xcm/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"pezpallet-assets/std",
|
||||
"pezpallet-balances/std",
|
||||
"pezpallet-revive/std",
|
||||
"pezpallet-timestamp/std",
|
||||
"pezpallet-xcm/std",
|
||||
"pezkuwi-teyrchain-primitives/std",
|
||||
"scale-info/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"tracing/std",
|
||||
"xcm-builder/std",
|
||||
"xcm-executor/std",
|
||||
"xcm/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-assets/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-revive/runtime-benchmarks",
|
||||
"pallet-timestamp/runtime-benchmarks",
|
||||
"pallet-xcm/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-assets/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-revive/runtime-benchmarks",
|
||||
"pezpallet-timestamp/runtime-benchmarks",
|
||||
"pezpallet-xcm/runtime-benchmarks",
|
||||
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
|
||||
"sp-io/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
"xcm-executor/runtime-benchmarks",
|
||||
"xcm-simulator/runtime-benchmarks",
|
||||
"xcm/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"frame-support/try-runtime",
|
||||
"frame-system/try-runtime",
|
||||
"pallet-assets/try-runtime",
|
||||
"pallet-balances/try-runtime",
|
||||
"pallet-revive/try-runtime",
|
||||
"pallet-timestamp/try-runtime",
|
||||
"pallet-xcm/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezpallet-assets/try-runtime",
|
||||
"pezpallet-balances/try-runtime",
|
||||
"pezpallet-revive/try-runtime",
|
||||
"pezpallet-timestamp/try-runtime",
|
||||
"pezpallet-xcm/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
|
||||
@@ -22,15 +22,15 @@ extern crate alloc;
|
||||
use alloc::vec::Vec;
|
||||
use codec::{DecodeAll, DecodeLimit};
|
||||
use core::{fmt, marker::PhantomData, num::NonZero};
|
||||
use frame_support::dispatch::RawOrigin;
|
||||
use pallet_revive::{
|
||||
use pezframe_support::dispatch::RawOrigin;
|
||||
use pezpallet_revive::{
|
||||
precompiles::{
|
||||
alloy::{self, sol_types::SolValue},
|
||||
AddressMatcher, Error, Ext, Precompile,
|
||||
},
|
||||
DispatchInfo, ExecOrigin as Origin, Weight,
|
||||
};
|
||||
use pallet_xcm::{Config, WeightInfo};
|
||||
use pezpallet_xcm::{Config, WeightInfo};
|
||||
use tracing::error;
|
||||
use xcm::{v5, IdentifyVersion, VersionedLocation, VersionedXcm, MAX_XCM_DECODE_DEPTH};
|
||||
use xcm_executor::traits::WeightBounds;
|
||||
@@ -63,7 +63,7 @@ pub struct XcmPrecompile<T>(PhantomData<T>);
|
||||
|
||||
impl<Runtime> Precompile for XcmPrecompile<Runtime>
|
||||
where
|
||||
Runtime: crate::Config + pallet_revive::Config,
|
||||
Runtime: crate::Config + pezpallet_revive::Config,
|
||||
{
|
||||
type T = Runtime;
|
||||
const MATCHER: AddressMatcher = AddressMatcher::Fixed(NonZero::new(10).unwrap());
|
||||
@@ -83,7 +83,7 @@ where
|
||||
|
||||
match input {
|
||||
IXcmCalls::send(_) | IXcmCalls::execute(_) if env.is_read_only() =>
|
||||
Err(Error::Error(pallet_revive::Error::<Self::T>::StateChangeDenied.into())),
|
||||
Err(Error::Error(pezpallet_revive::Error::<Self::T>::StateChangeDenied.into())),
|
||||
IXcmCalls::send(IXcm::sendCall { destination, message }) => {
|
||||
let _ = env.charge(<Runtime as Config>::WeightInfo::send())?;
|
||||
|
||||
@@ -102,7 +102,7 @@ where
|
||||
|
||||
ensure_xcm_version(&final_message)?;
|
||||
|
||||
pallet_xcm::Pallet::<Runtime>::send(
|
||||
pezpallet_xcm::Pallet::<Runtime>::send(
|
||||
frame_origin,
|
||||
final_destination.into(),
|
||||
final_message.into(),
|
||||
@@ -129,7 +129,7 @@ where
|
||||
|
||||
ensure_xcm_version(&final_message)?;
|
||||
|
||||
let result = pallet_xcm::Pallet::<Runtime>::execute(
|
||||
let result = pezpallet_xcm::Pallet::<Runtime>::execute(
|
||||
frame_origin,
|
||||
final_message.into(),
|
||||
max_weight,
|
||||
@@ -142,7 +142,7 @@ where
|
||||
};
|
||||
|
||||
// Adjust gas using actual weight or fallback to initially charged weight
|
||||
let actual_weight = frame_support::dispatch::extract_actual_weight(&result, &pre);
|
||||
let actual_weight = pezframe_support::dispatch::extract_actual_weight(&result, &pre);
|
||||
env.adjust_gas(charged_amount, actual_weight);
|
||||
|
||||
result.map(|_| Vec::new()).map_err(|error| {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
pub use core::cell::RefCell;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
derive_impl, parameter_types,
|
||||
traits::{
|
||||
fungible::HoldConsideration, AsEnsureOriginWithArg, ConstU32, Equals, Everything,
|
||||
@@ -23,9 +23,9 @@ use frame_support::{
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{Convert, IdentityLookup},
|
||||
AccountId32, BuildStorage,
|
||||
};
|
||||
@@ -46,7 +46,7 @@ use crate::XcmPrecompile;
|
||||
|
||||
pub type AccountId = AccountId32;
|
||||
pub type Balance = u128;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
pub const ALICE: AccountId32 = AccountId::new([0u8; 32]);
|
||||
|
||||
@@ -54,22 +54,22 @@ parameter_types! {
|
||||
pub const MinimumPeriod: u64 = 1;
|
||||
}
|
||||
|
||||
impl pallet_timestamp::Config for Test {
|
||||
impl pezpallet_timestamp::Config for Test {
|
||||
type Moment = u64;
|
||||
type OnTimestampSet = ();
|
||||
type MinimumPeriod = MinimumPeriod;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
frame_support::construct_runtime!(
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
System: frame_system,
|
||||
AssetsPallet: pallet_assets,
|
||||
Balances: pallet_balances,
|
||||
XcmPallet: pallet_xcm,
|
||||
Revive: pallet_revive,
|
||||
Timestamp: pallet_timestamp,
|
||||
System: pezframe_system,
|
||||
AssetsPallet: pezpallet_assets,
|
||||
Balances: pezpallet_balances,
|
||||
XcmPallet: pezpallet_xcm,
|
||||
Revive: pezpallet_revive,
|
||||
Timestamp: pezpallet_timestamp,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -129,20 +129,20 @@ impl SendXcm for TestSendXcmErrX8 {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Test {
|
||||
type AccountId = AccountId;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Block = Block;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
type AccountData = pezpallet_balances::AccountData<Balance>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub ExistentialDeposit: Balance = 1;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_balances::Config for Test {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Test {
|
||||
type Balance = Balance;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = System;
|
||||
@@ -152,20 +152,20 @@ impl pallet_balances::Config for Test {
|
||||
/// Simple conversion of `u32` into an `AssetId` for use in benchmarking.
|
||||
pub struct XcmBenchmarkHelper;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl pallet_assets::BenchmarkHelper<Location, ()> for XcmBenchmarkHelper {
|
||||
impl pezpallet_assets::BenchmarkHelper<Location, ()> for XcmBenchmarkHelper {
|
||||
fn create_asset_id_parameter(id: u32) -> Location {
|
||||
Location::new(1, [Teyrchain(id)])
|
||||
}
|
||||
fn create_reserve_id_parameter(_: u32) {}
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_assets::Config for Test {
|
||||
#[derive_impl(pezpallet_assets::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_assets::Config for Test {
|
||||
type Balance = Balance;
|
||||
type AssetId = Location;
|
||||
type AssetIdParameter = Location;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<pezframe_system::EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = EnsureRoot<AccountId>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type BenchmarkHelper = XcmBenchmarkHelper;
|
||||
@@ -258,7 +258,7 @@ pub type LocalOriginToLocation = xcm_builder::SignedToAccountId32<RuntimeOrigin,
|
||||
|
||||
parameter_types! {
|
||||
pub static AdvertisedXcmVersion: xcm::prelude::XcmVersion = 4;
|
||||
pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::XcmPallet(pallet_xcm::HoldReason::AuthorizeAlias);
|
||||
pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::XcmPallet(pezpallet_xcm::HoldReason::AuthorizeAlias);
|
||||
}
|
||||
|
||||
pub struct ConvertDeposit;
|
||||
@@ -268,7 +268,7 @@ impl Convert<Footprint, u128> for ConvertDeposit {
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_xcm::Config for Test {
|
||||
impl pezpallet_xcm::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -290,21 +290,21 @@ impl pallet_xcm::Config for Test {
|
||||
type MaxLockers = ConstU32<8>;
|
||||
type MaxRemoteLockConsumers = ConstU32<0>;
|
||||
type RemoteLockConsumerIdentifier = ();
|
||||
type WeightInfo = pallet_xcm::TestWeightInfo;
|
||||
type WeightInfo = pezpallet_xcm::TestWeightInfo;
|
||||
type AdminOrigin = EnsureRoot<AccountId>;
|
||||
type AuthorizedAliasConsideration =
|
||||
HoldConsideration<AccountId, Balances, AuthorizeAliasHoldReason, ConvertDeposit>;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_revive::Config for Test {
|
||||
type AddressMapper = pallet_revive::AccountId32Mapper<Self>;
|
||||
#[derive_impl(pezpallet_revive::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_revive::Config for Test {
|
||||
type AddressMapper = pezpallet_revive::AccountId32Mapper<Self>;
|
||||
type Balance = Balance;
|
||||
type Currency = Balances;
|
||||
type Precompiles = (XcmPrecompile<Self>,);
|
||||
type Time = Timestamp;
|
||||
type UploadOrigin = frame_system::EnsureSigned<AccountId>;
|
||||
type InstantiateOrigin = frame_system::EnsureSigned<AccountId>;
|
||||
type UploadOrigin = pezframe_system::EnsureSigned<AccountId>;
|
||||
type InstantiateOrigin = pezframe_system::EnsureSigned<AccountId>;
|
||||
}
|
||||
|
||||
pub(crate) fn buy_execution<C>(fees: impl Into<Asset>) -> Instruction<C> {
|
||||
@@ -314,7 +314,7 @@ pub(crate) fn buy_execution<C>(fees: impl Into<Asset>) -> Instruction<C> {
|
||||
|
||||
pub(crate) fn new_test_ext_with_balances(
|
||||
balances: Vec<(AccountId, Balance)>,
|
||||
) -> sp_io::TestExternalities {
|
||||
) -> pezsp_io::TestExternalities {
|
||||
new_test_ext_with_balances_and_xcm_version(balances, Some(XCM_VERSION), vec![])
|
||||
}
|
||||
|
||||
@@ -322,22 +322,22 @@ pub fn new_test_ext_with_balances_and_xcm_version(
|
||||
balances: Vec<(AccountId, Balance)>,
|
||||
safe_xcm_version: Option<XcmVersion>,
|
||||
supported_version: Vec<(Location, XcmVersion)>,
|
||||
) -> sp_io::TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
) -> pezsp_io::TestExternalities {
|
||||
let mut t = pezframe_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
|
||||
pallet_balances::GenesisConfig::<Test> { balances, ..Default::default() }
|
||||
pezpallet_balances::GenesisConfig::<Test> { balances, ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
pallet_xcm::GenesisConfig::<Test> { safe_xcm_version, supported_version, ..Default::default() }
|
||||
pezpallet_xcm::GenesisConfig::<Test> { safe_xcm_version, supported_version, ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
pallet_revive::GenesisConfig::<Test> { mapped_accounts: vec![ALICE], ..Default::default() }
|
||||
pezpallet_revive::GenesisConfig::<Test> { mapped_accounts: vec![ALICE], ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
let mut ext = sp_io::TestExternalities::new(t);
|
||||
let mut ext = pezsp_io::TestExternalities::new(t);
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ use crate::{
|
||||
IXcm::{self, weighMessageCall},
|
||||
VersionedLocation, VersionedXcm,
|
||||
};
|
||||
use frame_support::traits::Currency;
|
||||
use pallet_revive::{
|
||||
use pezframe_support::traits::Currency;
|
||||
use pezpallet_revive::{
|
||||
precompiles::{
|
||||
alloy::{
|
||||
hex,
|
||||
@@ -32,7 +32,7 @@ use pallet_revive::{
|
||||
ExecConfig, U256,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use xcm::{prelude::*, v3, v4};
|
||||
|
||||
const BOB: AccountId = AccountId::new([1u8; 32]);
|
||||
@@ -71,14 +71,14 @@ fn test_xcm_send_precompile_works() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
assert!(result.result.is_ok());
|
||||
let sent_message = Xcm(Some(DescendOrigin(sender.clone().try_into().unwrap()))
|
||||
@@ -120,14 +120,14 @@ fn test_xcm_send_precompile_to_teyrchain() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
assert!(result.result.is_ok());
|
||||
@@ -169,14 +169,14 @@ fn test_xcm_send_precompile_fails() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -219,14 +219,14 @@ fn send_fails_on_old_location_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -246,14 +246,14 @@ fn send_fails_on_old_location_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -296,14 +296,14 @@ fn send_fails_on_old_xcm_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -324,14 +324,14 @@ fn send_fails_on_old_xcm_version() {
|
||||
let call = IXcm::IXcmCalls::send(xcm_send_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -367,14 +367,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let weight_result = match xcm_weight_results.result {
|
||||
@@ -389,14 +389,14 @@ fn test_xcm_execute_precompile_works() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
assert!(result.result.is_ok());
|
||||
@@ -428,14 +428,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let weight_result = match xcm_weight_results.result {
|
||||
@@ -450,14 +450,14 @@ fn test_xcm_execute_precompile_different_beneficiary() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let return_value = match result.result {
|
||||
@@ -497,14 +497,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let weight_result = match xcm_weight_results.result {
|
||||
@@ -519,14 +519,14 @@ fn test_xcm_execute_precompile_fails() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
let return_value = match result.result {
|
||||
Ok(value) => value,
|
||||
@@ -565,14 +565,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let weight_result = match xcm_weight_results.result {
|
||||
@@ -594,14 +594,14 @@ fn execute_fails_on_old_version() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let return_value = match result.result {
|
||||
@@ -621,14 +621,14 @@ fn execute_fails_on_old_version() {
|
||||
let call = IXcm::IXcmCalls::execute(xcm_execute_params);
|
||||
let encoded_call = call.abi_encode();
|
||||
|
||||
let result = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let result = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let return_value = match result.result {
|
||||
@@ -670,14 +670,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let result = match xcm_weight_results.result {
|
||||
@@ -694,14 +694,14 @@ 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 = pallet_revive::Pallet::<Test>::bare_call(
|
||||
let xcm_weight_results = pezpallet_revive::Pallet::<Test>::bare_call(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
xcm_precompile_addr,
|
||||
U256::zero(),
|
||||
Weight::MAX,
|
||||
u128::MAX,
|
||||
encoded_weight_call,
|
||||
ExecConfig::new_substrate_tx(),
|
||||
ExecConfig::new_bizinikiwi_tx(),
|
||||
);
|
||||
|
||||
let result = match xcm_weight_results.result {
|
||||
|
||||
@@ -15,20 +15,20 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use super::*;
|
||||
use frame_benchmarking::v2::*;
|
||||
use frame_support::{assert_ok, weights::Weight};
|
||||
use frame_system::RawOrigin;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_support::{assert_ok, weights::Weight};
|
||||
use pezframe_system::RawOrigin;
|
||||
use xcm::{latest::prelude::*, MAX_INSTRUCTIONS_TO_DECODE};
|
||||
use xcm_builder::EnsureDelivery;
|
||||
use xcm_executor::traits::FeeReason;
|
||||
|
||||
type RuntimeOrigin<T> = <T as frame_system::Config>::RuntimeOrigin;
|
||||
type RuntimeOrigin<T> = <T as pezframe_system::Config>::RuntimeOrigin;
|
||||
|
||||
/// Pallet we're benchmarking here.
|
||||
pub struct Pallet<T: Config>(crate::Pallet<T>);
|
||||
|
||||
/// Trait that must be implemented by runtime to be able to benchmark pallet properly.
|
||||
pub trait Config: crate::Config + pallet_balances::Config {
|
||||
pub trait Config: crate::Config + pezpallet_balances::Config {
|
||||
/// Helper that ensures successful delivery for extrinsics/benchmarks which need `SendXcm`.
|
||||
type DeliveryHelper: EnsureDelivery;
|
||||
|
||||
@@ -607,7 +607,7 @@ mod benchmarks {
|
||||
T::ExecuteXcmOrigin::try_origin(origin.clone().into())
|
||||
.map_err(|_| {
|
||||
tracing::error!(
|
||||
target: "xcm::benchmarking::pallet_xcm::add_authorized_alias",
|
||||
target: "xcm::benchmarking::pezpallet_xcm::add_authorized_alias",
|
||||
?origin,
|
||||
"try_origin failed",
|
||||
);
|
||||
@@ -618,7 +618,7 @@ mod benchmarks {
|
||||
// Give some multiple of ED
|
||||
let balance = T::ExistentialDeposit::get() * 1000000u32.into();
|
||||
let _ =
|
||||
<pallet_balances::Pallet::<T> as frame_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pallet::<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
|
||||
@@ -632,7 +632,7 @@ mod benchmarks {
|
||||
let footprint = aliasers_footprint(existing_aliases.len());
|
||||
let ticket = TicketOf::<T>::new(&who, footprint).map_err(|e| {
|
||||
tracing::error!(
|
||||
target: "xcm::benchmarking::pallet_xcm::add_authorized_alias",
|
||||
target: "xcm::benchmarking::pezpallet_xcm::add_authorized_alias",
|
||||
?who,
|
||||
?footprint,
|
||||
error=?e,
|
||||
@@ -662,7 +662,7 @@ mod benchmarks {
|
||||
let origin_location =
|
||||
T::ExecuteXcmOrigin::try_origin(origin.clone().into()).map_err(|_| {
|
||||
tracing::error!(
|
||||
target: "xcm::benchmarking::pallet_xcm::remove_authorized_alias",
|
||||
target: "xcm::benchmarking::pezpallet_xcm::remove_authorized_alias",
|
||||
?origin,
|
||||
"try_origin failed",
|
||||
);
|
||||
@@ -675,7 +675,7 @@ mod benchmarks {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]).into(),
|
||||
_ => {
|
||||
tracing::error!(
|
||||
target: "xcm::benchmarking::pallet_xcm::remove_authorized_alias",
|
||||
target: "xcm::benchmarking::pezpallet_xcm::remove_authorized_alias",
|
||||
?origin_location,
|
||||
"unexpected origin failed",
|
||||
);
|
||||
@@ -686,7 +686,7 @@ mod benchmarks {
|
||||
// Give some multiple of ED
|
||||
let balance = T::ExistentialDeposit::get() * 1000000u32.into();
|
||||
let _ =
|
||||
<pallet_balances::Pallet::<T> as frame_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pallet::<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
|
||||
@@ -700,7 +700,7 @@ mod benchmarks {
|
||||
let footprint = aliasers_footprint(existing_aliases.len());
|
||||
let ticket = TicketOf::<T>::new(&who, footprint).map_err(|e| {
|
||||
tracing::error!(
|
||||
target: "xcm::benchmarking::pallet_xcm::remove_authorized_alias",
|
||||
target: "xcm::benchmarking::pezpallet_xcm::remove_authorized_alias",
|
||||
?who,
|
||||
?footprint,
|
||||
error=?e,
|
||||
@@ -749,8 +749,8 @@ pub mod helpers {
|
||||
destination: Location,
|
||||
) -> Option<(Assets, AssetId, Location, Box<dyn FnOnce()>)>
|
||||
where
|
||||
T: Config + pallet_balances::Config,
|
||||
u128: From<<T as pallet_balances::Config>::Balance>,
|
||||
T: Config + pezpallet_balances::Config,
|
||||
u128: From<<T as pezpallet_balances::Config>::Balance>,
|
||||
{
|
||||
// Relay/native token can be teleported to/from AH.
|
||||
let amount = T::ExistentialDeposit::get() * 100u32.into();
|
||||
@@ -763,14 +763,14 @@ pub mod helpers {
|
||||
let balance = amount * 10u32.into();
|
||||
let who = whitelisted_caller();
|
||||
let _ =
|
||||
<pallet_balances::Pallet::<T> as frame_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
<pezpallet_balances::Pallet::<T> as pezframe_support::traits::Currency<_>>::make_free_balance_be(&who, balance);
|
||||
// verify initial balance
|
||||
assert_eq!(pallet_balances::Pallet::<T>::free_balance(&who), balance);
|
||||
assert_eq!(pezpallet_balances::Pallet::<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!(pallet_balances::Pallet::<T>::free_balance(&who) <= balance - amount);
|
||||
assert!(pezpallet_balances::Pallet::<T>::free_balance(&who) <= balance - amount);
|
||||
});
|
||||
Some((assets, fee_asset_id, destination, verify))
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Errors for the XCM pallet.
|
||||
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use frame_support::PalletError;
|
||||
use pezframe_support::PalletError;
|
||||
use scale_info::TypeInfo;
|
||||
use xcm::latest::Error as XcmError;
|
||||
|
||||
|
||||
+134
-134
@@ -35,22 +35,22 @@ extern crate alloc;
|
||||
use alloc::{boxed::Box, vec, vec::Vec};
|
||||
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
|
||||
use core::{marker::PhantomData, result::Result};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
dispatch::{
|
||||
DispatchErrorWithPostInfo, GetDispatchInfo, PostDispatchInfo, WithPostDispatchInfo,
|
||||
},
|
||||
pallet_prelude::*,
|
||||
pezpallet_prelude::*,
|
||||
traits::{
|
||||
Consideration, Contains, ContainsPair, Currency, Defensive, EnsureOrigin, Footprint, Get,
|
||||
LockableCurrency, OriginTrait, WithdrawReasons,
|
||||
},
|
||||
PalletId,
|
||||
};
|
||||
use frame_system::pallet_prelude::{BlockNumberFor, *};
|
||||
use pezframe_system::pezpallet_prelude::{BlockNumberFor, *};
|
||||
pub use pallet::*;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::{
|
||||
traits::{
|
||||
AccountIdConversion, BadOrigin, BlakeTwo256, BlockNumberProvider, Dispatchable, Hash,
|
||||
Saturating, Zero,
|
||||
@@ -83,7 +83,7 @@ mod errors;
|
||||
pub use errors::ExecutionError;
|
||||
|
||||
#[cfg(any(feature = "try-runtime", test))]
|
||||
use sp_runtime::TryRuntimeError;
|
||||
use pezsp_runtime::TryRuntimeError;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn send() -> Weight;
|
||||
@@ -218,15 +218,15 @@ pub fn aliasers_footprint(aliasers_count: usize) -> Footprint {
|
||||
Footprint::from_parts(aliasers_count, OriginAliaser::max_encoded_len())
|
||||
}
|
||||
|
||||
#[frame_support::pallet]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
dispatch::{GetDispatchInfo, PostDispatchInfo},
|
||||
parameter_types,
|
||||
};
|
||||
use frame_system::Config as SysConfig;
|
||||
use sp_runtime::traits::Dispatchable;
|
||||
use pezframe_system::Config as SysConfig;
|
||||
use pezsp_runtime::traits::Dispatchable;
|
||||
use xcm_executor::traits::{MatchesFungible, WeightBounds};
|
||||
|
||||
parameter_types! {
|
||||
@@ -247,15 +247,15 @@ pub mod pallet {
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
pub type BalanceOf<T> =
|
||||
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
|
||||
<<T as Config>::Currency as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
|
||||
pub type TicketOf<T> = <T as Config>::AuthorizedAliasConsideration;
|
||||
|
||||
#[pallet::config]
|
||||
/// The module configuration trait.
|
||||
pub trait Config: frame_system::Config {
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// A lockable currency.
|
||||
// TODO: We should really use a trait which can handle multiple currencies.
|
||||
@@ -313,7 +313,7 @@ pub mod pallet {
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32;
|
||||
|
||||
/// The latest supported version that we advertise. Generally just set it to
|
||||
/// `pallet_xcm::CurrentXcmVersion`.
|
||||
/// `pezpallet_xcm::CurrentXcmVersion`.
|
||||
#[pallet::constant]
|
||||
type AdvertisedXcmVersion: Get<XcmVersion>;
|
||||
|
||||
@@ -355,13 +355,13 @@ pub mod pallet {
|
||||
message: Box<VersionedXcm<<T as Config>::RuntimeCall>>,
|
||||
max_weight: Weight,
|
||||
) -> Result<Weight, DispatchErrorWithPostInfo> {
|
||||
tracing::trace!(target: "xcm::pallet_xcm::execute", ?message, ?max_weight);
|
||||
tracing::trace!(target: "xcm::pezpallet_xcm::execute", ?message, ?max_weight);
|
||||
let outcome = (|| {
|
||||
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let mut hash = message.using_encoded(sp_io::hashing::blake2_256);
|
||||
let mut hash = message.using_encoded(pezsp_io::hashing::blake2_256);
|
||||
let message = (*message).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::execute", id=?hash,
|
||||
target: "xcm::pezpallet_xcm::execute", id=?hash,
|
||||
"Failed to convert VersionedXcm to Xcm",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -379,7 +379,7 @@ pub mod pallet {
|
||||
})()
|
||||
.map_err(|e: DispatchError| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::execute", error=?e,
|
||||
target: "xcm::pezpallet_xcm::execute", error=?e,
|
||||
"Failed XCM pre-execution validation or filter",
|
||||
);
|
||||
e.with_weight(<Self::WeightInfo as ExecuteControllerWeightInfo>::execute())
|
||||
@@ -388,7 +388,7 @@ pub mod pallet {
|
||||
Self::deposit_event(Event::Attempted { outcome: outcome.clone() });
|
||||
let weight_used = outcome.weight_used();
|
||||
outcome.ensure_complete().map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::execute", ?error, "XCM execution failed with error");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::execute", ?error, "XCM execution failed with error");
|
||||
Error::<T>::LocalExecutionIncompleteWithError {
|
||||
index: error.index,
|
||||
error: error.error.into(),
|
||||
@@ -419,21 +419,21 @@ pub mod pallet {
|
||||
let origin_location = T::SendXcmOrigin::ensure_origin(origin)?;
|
||||
let interior: Junctions = origin_location.clone().try_into().map_err(|_| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::send",
|
||||
target: "xcm::pezpallet_xcm::send",
|
||||
"Failed to convert origin_location to interior Junctions",
|
||||
);
|
||||
Error::<T>::InvalidOrigin
|
||||
})?;
|
||||
let dest = Location::try_from(*dest).map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::send",
|
||||
target: "xcm::pezpallet_xcm::send",
|
||||
"Failed to convert destination VersionedLocation to Location",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let message: Xcm<()> = (*message).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::send",
|
||||
target: "xcm::pezpallet_xcm::send",
|
||||
"Failed to convert VersionedXcm message to Xcm",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -441,7 +441,7 @@ pub mod pallet {
|
||||
|
||||
let message_id = Self::send_xcm(interior, dest.clone(), message.clone())
|
||||
.map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::send", ?error, ?dest, ?message, "XCM send failed with error");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::send", ?error, ?dest, ?message, "XCM send failed with error");
|
||||
Error::<T>::from(error)
|
||||
})?;
|
||||
let e = Event::Sent { origin: origin_location, destination: dest, message, message_id };
|
||||
@@ -473,7 +473,7 @@ pub mod pallet {
|
||||
timeout,
|
||||
Location::try_from(match_querier).map_err(|_| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::query",
|
||||
target: "xcm::pezpallet_xcm::query",
|
||||
"Failed to convert VersionedLocation for match_querier",
|
||||
);
|
||||
Into::<DispatchError>::into(Error::<T>::BadVersion)
|
||||
@@ -538,24 +538,24 @@ pub mod pallet {
|
||||
ResponseReady { query_id: QueryId, response: Response },
|
||||
/// Query response has been received and query is removed. The registered notification has
|
||||
/// been dispatched and executed successfully.
|
||||
Notified { query_id: QueryId, pallet_index: u8, call_index: u8 },
|
||||
Notified { query_id: QueryId, pezpallet_index: u8, call_index: u8 },
|
||||
/// Query response has been received and query is removed. The registered notification
|
||||
/// could not be dispatched because the dispatch weight is greater than the maximum weight
|
||||
/// originally budgeted by this runtime for the query result.
|
||||
NotifyOverweight {
|
||||
query_id: QueryId,
|
||||
pallet_index: u8,
|
||||
pezpallet_index: u8,
|
||||
call_index: u8,
|
||||
actual_weight: Weight,
|
||||
max_budgeted_weight: Weight,
|
||||
},
|
||||
/// Query response has been received and query is removed. There was a general error with
|
||||
/// dispatching the notification call.
|
||||
NotifyDispatchError { query_id: QueryId, pallet_index: u8, call_index: u8 },
|
||||
NotifyDispatchError { query_id: QueryId, pezpallet_index: u8, call_index: u8 },
|
||||
/// Query response has been received and query is removed. The dispatch was unable to be
|
||||
/// decoded into a `Call`; this might be due to dispatch function having a signature which
|
||||
/// is not `(origin, QueryId, Response)`.
|
||||
NotifyDecodeFailed { query_id: QueryId, pallet_index: u8, call_index: u8 },
|
||||
NotifyDecodeFailed { query_id: QueryId, pezpallet_index: u8, call_index: u8 },
|
||||
/// Expected query response has been received but the origin location of the response does
|
||||
/// not match that expected. The query remains registered for a later, valid, response to
|
||||
/// be received and acted upon.
|
||||
@@ -1046,7 +1046,7 @@ pub mod pallet {
|
||||
|
||||
pub mod migrations {
|
||||
use super::*;
|
||||
use frame_support::traits::{PalletInfoAccess, StorageVersion};
|
||||
use pezframe_support::traits::{PalletInfoAccess, StorageVersion};
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Encode, Decode, RuntimeDebug, TypeInfo)]
|
||||
enum QueryStatusV0<BlockNumber> {
|
||||
@@ -1082,7 +1082,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
pub fn migrate_to_v1<T: Config, P: GetStorageVersion + PalletInfoAccess>(
|
||||
) -> frame_support::weights::Weight {
|
||||
) -> pezframe_support::weights::Weight {
|
||||
let on_chain_storage_version = <P as GetStorageVersion>::on_chain_storage_version();
|
||||
tracing::info!(
|
||||
target: "runtime::xcm",
|
||||
@@ -1276,14 +1276,14 @@ pub mod pallet {
|
||||
T::AdminOrigin::ensure_origin(origin)?;
|
||||
let location: Location = (*location).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::force_subscribe_version_notify",
|
||||
target: "xcm::pezpallet_xcm::force_subscribe_version_notify",
|
||||
"Failed to convert VersionedLocation for subscription target"
|
||||
);
|
||||
Error::<T>::BadLocation
|
||||
})?;
|
||||
Self::request_version_notify(location).map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::force_subscribe_version_notify", error=?e,
|
||||
target: "xcm::pezpallet_xcm::force_subscribe_version_notify", error=?e,
|
||||
"Failed to subscribe for version notifications for location"
|
||||
);
|
||||
match e {
|
||||
@@ -1308,14 +1308,14 @@ pub mod pallet {
|
||||
T::AdminOrigin::ensure_origin(origin)?;
|
||||
let location: Location = (*location).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::force_unsubscribe_version_notify",
|
||||
target: "xcm::pezpallet_xcm::force_unsubscribe_version_notify",
|
||||
"Failed to convert VersionedLocation for unsubscription target"
|
||||
);
|
||||
Error::<T>::BadLocation
|
||||
})?;
|
||||
Self::unrequest_version_notify(location).map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::force_unsubscribe_version_notify", error=?e,
|
||||
target: "xcm::pezpallet_xcm::force_unsubscribe_version_notify", error=?e,
|
||||
"Failed to unsubscribe from version notifications for location"
|
||||
);
|
||||
match e {
|
||||
@@ -1460,34 +1460,34 @@ pub mod pallet {
|
||||
let origin = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let dest = (*dest).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
"Failed to convert destination VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let beneficiary: Location = (*beneficiary).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
"Failed to convert beneficiary VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let assets: Assets = (*assets).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
"Failed to convert VersionedAssets",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let fee_asset_id: AssetId = (*fee_asset_id).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
"Failed to convert VersionedAssetId",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
?origin, ?dest, ?beneficiary, ?assets, ?fee_asset_id, ?weight_limit,
|
||||
);
|
||||
|
||||
@@ -1532,12 +1532,12 @@ pub mod pallet {
|
||||
beneficiary: Box<VersionedLocation>,
|
||||
) -> DispatchResult {
|
||||
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
tracing::debug!(target: "xcm::pallet_xcm::claim_assets", ?origin_location, ?assets, ?beneficiary);
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::claim_assets", ?origin_location, ?assets, ?beneficiary);
|
||||
// Extract version from `assets`.
|
||||
let assets_version = assets.identify_version();
|
||||
let assets: Assets = (*assets).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::claim_assets",
|
||||
target: "xcm::pezpallet_xcm::claim_assets",
|
||||
"Failed to convert input VersionedAssets",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -1545,7 +1545,7 @@ pub mod pallet {
|
||||
let number_of_assets = assets.len() as u32;
|
||||
let beneficiary: Location = (*beneficiary).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::claim_assets",
|
||||
target: "xcm::pezpallet_xcm::claim_assets",
|
||||
"Failed to convert beneficiary VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -1556,10 +1556,10 @@ pub mod pallet {
|
||||
DepositAsset { assets: AllCounted(number_of_assets).into(), beneficiary },
|
||||
]);
|
||||
let weight = T::Weigher::weight(&mut message, Weight::MAX).map_err(|error| {
|
||||
tracing::debug!(target: "xcm::pallet_xcm::claim_assets", ?error, "Failed to calculate weight");
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::claim_assets", ?error, "Failed to calculate weight");
|
||||
Error::<T>::UnweighableMessage
|
||||
})?;
|
||||
let mut hash = message.using_encoded(sp_io::hashing::blake2_256);
|
||||
let mut hash = message.using_encoded(pezsp_io::hashing::blake2_256);
|
||||
let outcome = T::XcmExecutor::prepare_and_execute(
|
||||
origin_location,
|
||||
message,
|
||||
@@ -1568,7 +1568,7 @@ pub mod pallet {
|
||||
weight,
|
||||
);
|
||||
outcome.ensure_complete().map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::claim_assets", ?error, "XCM execution failed with error");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::claim_assets", ?error, "XCM execution failed with error");
|
||||
Error::<T>::LocalExecutionIncompleteWithError { index: error.index, error: error.error.into()}
|
||||
})?;
|
||||
Ok(())
|
||||
@@ -1637,34 +1637,34 @@ pub mod pallet {
|
||||
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let dest: Location = (*dest).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets_using_type_and_then",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets_using_type_and_then",
|
||||
"Failed to convert destination VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let assets: Assets = (*assets).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets_using_type_and_then",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets_using_type_and_then",
|
||||
"Failed to convert VersionedAssets",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let fees_id: AssetId = (*remote_fees_id).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets_using_type_and_then",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets_using_type_and_then",
|
||||
"Failed to convert remote_fees_id VersionedAssetId",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let remote_xcm: Xcm<()> = (*custom_xcm_on_dest).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets_using_type_and_then",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets_using_type_and_then",
|
||||
"Failed to convert custom_xcm_on_dest VersionedXcm",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets_using_type_and_then",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets_using_type_and_then",
|
||||
?origin_location, ?dest, ?assets, ?assets_transfer_type, ?fees_id, ?fees_transfer_type,
|
||||
?remote_xcm, ?weight_limit,
|
||||
);
|
||||
@@ -1705,7 +1705,7 @@ pub mod pallet {
|
||||
let origin_location: Location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let new_aliaser: Location = (*aliaser).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::add_authorized_alias",
|
||||
target: "xcm::pezpallet_xcm::add_authorized_alias",
|
||||
"Failed to convert aliaser VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -1717,12 +1717,12 @@ pub mod pallet {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pallet_xcm::add_authorized_alias", ?origin_location, ?new_aliaser, ?expires);
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::add_authorized_alias", ?origin_location, ?new_aliaser, ?expires);
|
||||
ensure!(origin_location != new_aliaser, Error::<T>::BadLocation);
|
||||
if let Some(expiry) = expires {
|
||||
ensure!(
|
||||
expiry >
|
||||
frame_system::Pallet::<T>::current_block_number().saturated_into::<u64>(),
|
||||
pezframe_system::Pallet::<T>::current_block_number().saturated_into::<u64>(),
|
||||
Error::<T>::ExpiresInPast
|
||||
);
|
||||
}
|
||||
@@ -1742,7 +1742,7 @@ pub mod pallet {
|
||||
OriginAliaser { location: versioned_aliaser.clone(), expiry: expires };
|
||||
aliasers.try_push(aliaser).map_err(|_| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::add_authorized_alias",
|
||||
target: "xcm::pezpallet_xcm::add_authorized_alias",
|
||||
"Failed to add new aliaser to existing entry",
|
||||
);
|
||||
Error::<T>::TooManyAuthorizedAliases
|
||||
@@ -1759,7 +1759,7 @@ pub mod pallet {
|
||||
let mut aliasers = BoundedVec::<OriginAliaser, MaxAuthorizedAliases>::new();
|
||||
aliasers.try_push(aliaser).map_err(|error| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::add_authorized_alias", ?error,
|
||||
target: "xcm::pezpallet_xcm::add_authorized_alias", ?error,
|
||||
"Failed to add first aliaser to new entry",
|
||||
);
|
||||
Error::<T>::TooManyAuthorizedAliases
|
||||
@@ -1787,7 +1787,7 @@ pub mod pallet {
|
||||
let origin_location: Location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let to_remove: Location = (*aliaser).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::remove_authorized_alias",
|
||||
target: "xcm::pezpallet_xcm::remove_authorized_alias",
|
||||
"Failed to convert aliaser VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -1799,7 +1799,7 @@ pub mod pallet {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pallet_xcm::remove_authorized_alias", ?origin_location, ?to_remove);
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::remove_authorized_alias", ?origin_location, ?to_remove);
|
||||
ensure!(origin_location != to_remove, Error::<T>::BadLocation);
|
||||
// convert to latest versioned
|
||||
let versioned_origin = VersionedLocation::from(origin_location.clone());
|
||||
@@ -1849,7 +1849,7 @@ pub mod pallet {
|
||||
Location::new(0, [AccountId32 { network: None, id: *id }]),
|
||||
_ => return Err(Error::<T>::InvalidOrigin.into()),
|
||||
};
|
||||
tracing::debug!(target: "xcm::pallet_xcm::remove_all_authorized_aliases", ?origin_location);
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::remove_all_authorized_aliases", ?origin_location);
|
||||
// convert to latest versioned
|
||||
let versioned_origin = VersionedLocation::from(origin_location.clone());
|
||||
if let Some(entry) = AuthorizedAliases::<T>::get(&versioned_origin) {
|
||||
@@ -1861,7 +1861,7 @@ pub mod pallet {
|
||||
});
|
||||
Ok(())
|
||||
} else {
|
||||
tracing::debug!(target: "xcm::pallet_xcm::remove_all_authorized_aliases", "No authorized alias entry found for the origin");
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::remove_all_authorized_aliases", "No authorized alias entry found for the origin");
|
||||
Err(Error::<T>::AliasNotFound.into())
|
||||
}
|
||||
}
|
||||
@@ -1918,7 +1918,7 @@ impl<T: Config> QueryHandler for Pallet<T> {
|
||||
let destination =
|
||||
Self::UniversalLocation::get().invert_target(&responder).map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::report_outcome",
|
||||
target: "xcm::pezpallet_xcm::report_outcome",
|
||||
"Failed to invert responder Location",
|
||||
);
|
||||
XcmError::LocationNotInvertible
|
||||
@@ -1941,7 +1941,7 @@ impl<T: Config> QueryHandler for Pallet<T> {
|
||||
},
|
||||
Err(_) => {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::take_response", ?query_id,
|
||||
target: "xcm::pezpallet_xcm::take_response", ?query_id,
|
||||
"Failed to convert VersionedResponse to Response for query",
|
||||
);
|
||||
QueryResponseStatus::UnexpectedVersion
|
||||
@@ -1950,14 +1950,14 @@ impl<T: Config> QueryHandler for Pallet<T> {
|
||||
Some(QueryStatus::Pending { timeout, .. }) => QueryResponseStatus::Pending { timeout },
|
||||
Some(_) => {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::take_response", ?query_id,
|
||||
target: "xcm::pezpallet_xcm::take_response", ?query_id,
|
||||
"Unexpected QueryStatus variant for query",
|
||||
);
|
||||
QueryResponseStatus::UnexpectedVersion
|
||||
},
|
||||
None => {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::take_response", ?query_id,
|
||||
target: "xcm::pezpallet_xcm::take_response", ?query_id,
|
||||
"Query ID not found`",
|
||||
);
|
||||
QueryResponseStatus::NotFound
|
||||
@@ -1970,7 +1970,7 @@ impl<T: Config> QueryHandler for Pallet<T> {
|
||||
let response = response.into();
|
||||
Queries::<T>::insert(
|
||||
id,
|
||||
QueryStatus::Ready { response, at: frame_system::Pallet::<T>::current_block_number() },
|
||||
QueryStatus::Ready { response, at: pezframe_system::Pallet::<T>::current_block_number() },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2042,34 +2042,34 @@ impl<T: Config> Pallet<T> {
|
||||
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let dest = (*dest).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_reserve_transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::do_reserve_transfer_assets",
|
||||
"Failed to convert destination VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let beneficiary: Location = (*beneficiary).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_reserve_transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::do_reserve_transfer_assets",
|
||||
"Failed to convert beneficiary VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let assets: Assets = (*assets).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_reserve_transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::do_reserve_transfer_assets",
|
||||
"Failed to convert VersionedAssets",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let fee_asset_id: AssetId = (*fee_asset_id).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_reserve_transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::do_reserve_transfer_assets",
|
||||
"Failed to convert VersionedAssetId",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_reserve_transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::do_reserve_transfer_assets",
|
||||
?origin_location, ?dest, ?beneficiary, ?assets, ?fee_asset_id,
|
||||
);
|
||||
|
||||
@@ -2121,35 +2121,35 @@ impl<T: Config> Pallet<T> {
|
||||
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
|
||||
let dest = (*dest).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_teleport_assets",
|
||||
target: "xcm::pezpallet_xcm::do_teleport_assets",
|
||||
"Failed to convert destination VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let beneficiary: Location = (*beneficiary).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_teleport_assets",
|
||||
target: "xcm::pezpallet_xcm::do_teleport_assets",
|
||||
"Failed to convert beneficiary VersionedLocation",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let assets: Assets = (*assets).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_teleport_assets",
|
||||
target: "xcm::pezpallet_xcm::do_teleport_assets",
|
||||
"Failed to convert VersionedAssets",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
let fee_asset_id: AssetId = (*fee_asset_id).try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_teleport_assets",
|
||||
target: "xcm::pezpallet_xcm::do_teleport_assets",
|
||||
"Failed to convert VersionedAssetId",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
})?;
|
||||
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::do_teleport_assets",
|
||||
target: "xcm::pezpallet_xcm::do_teleport_assets",
|
||||
?origin_location, ?dest, ?beneficiary, ?assets, ?fee_asset_id, ?weight_limit,
|
||||
);
|
||||
|
||||
@@ -2259,7 +2259,7 @@ impl<T: Config> Pallet<T> {
|
||||
weight_limit: WeightLimit,
|
||||
) -> Result<(Xcm<<T as Config>::RuntimeCall>, Option<Xcm<()>>), Error<T>> {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::build_xcm_transfer_type",
|
||||
target: "xcm::pezpallet_xcm::build_xcm_transfer_type",
|
||||
?origin, ?dest, ?beneficiary, ?assets, ?transfer_type, ?fees, ?weight_limit,
|
||||
);
|
||||
match transfer_type {
|
||||
@@ -2290,7 +2290,7 @@ impl<T: Config> Pallet<T> {
|
||||
origin.clone(),
|
||||
reserve.try_into().map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::build_xcm_transfer_type",
|
||||
target: "xcm::pezpallet_xcm::build_xcm_transfer_type",
|
||||
"Failed to convert remote reserve location",
|
||||
);
|
||||
Error::<T>::BadVersion
|
||||
@@ -2322,16 +2322,16 @@ impl<T: Config> Pallet<T> {
|
||||
remote_xcm: Option<Xcm<()>>,
|
||||
) -> DispatchResult {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::execute_xcm_transfer",
|
||||
target: "xcm::pezpallet_xcm::execute_xcm_transfer",
|
||||
?origin, ?dest, ?local_xcm, ?remote_xcm,
|
||||
);
|
||||
|
||||
let weight =
|
||||
T::Weigher::weight(&mut local_xcm, Weight::MAX).map_err(|error| {
|
||||
tracing::debug!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, "Failed to calculate weight");
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::execute_xcm_transfer", ?error, "Failed to calculate weight");
|
||||
Error::<T>::UnweighableMessage
|
||||
})?;
|
||||
let mut hash = local_xcm.using_encoded(sp_io::hashing::blake2_256);
|
||||
let mut hash = local_xcm.using_encoded(pezsp_io::hashing::blake2_256);
|
||||
let outcome = T::XcmExecutor::prepare_and_execute(
|
||||
origin.clone(),
|
||||
local_xcm,
|
||||
@@ -2342,7 +2342,7 @@ impl<T: Config> Pallet<T> {
|
||||
Self::deposit_event(Event::Attempted { outcome: outcome.clone() });
|
||||
outcome.clone().ensure_complete().map_err(|error| {
|
||||
tracing::error!(
|
||||
target: "xcm::pallet_xcm::execute_xcm_transfer",
|
||||
target: "xcm::pezpallet_xcm::execute_xcm_transfer",
|
||||
?error, "XCM execution failed with error with outcome: {:?}", outcome
|
||||
);
|
||||
Error::<T>::LocalExecutionIncompleteWithError {
|
||||
@@ -2354,13 +2354,13 @@ impl<T: Config> Pallet<T> {
|
||||
if let Some(remote_xcm) = remote_xcm {
|
||||
let (ticket, price) = validate_send::<T::XcmRouter>(dest.clone(), remote_xcm.clone())
|
||||
.map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM validate_send failed with error");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM validate_send failed with error");
|
||||
Error::<T>::from(error)
|
||||
})?;
|
||||
if origin != Here.into_location() {
|
||||
Self::charge_fees(origin.clone(), price.clone()).map_err(|error| {
|
||||
tracing::error!(
|
||||
target: "xcm::pallet_xcm::execute_xcm_transfer",
|
||||
target: "xcm::pezpallet_xcm::execute_xcm_transfer",
|
||||
?error, ?price, ?origin, "Unable to charge fee",
|
||||
);
|
||||
Error::<T>::FeesNotMet
|
||||
@@ -2368,7 +2368,7 @@ impl<T: Config> Pallet<T> {
|
||||
}
|
||||
let message_id = T::XcmRouter::deliver(ticket)
|
||||
.map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM deliver failed with error");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::execute_xcm_transfer", ?error, ?dest, ?remote_xcm, "XCM deliver failed with error");
|
||||
Error::<T>::from(error)
|
||||
})?;
|
||||
|
||||
@@ -2392,7 +2392,7 @@ impl<T: Config> Pallet<T> {
|
||||
// BuyExecution happens after receiving all `assets`
|
||||
let reanchored_fees =
|
||||
fees.reanchored(&dest, &context).map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::add_fees_to_xcm", ?e, ?dest, ?context, "Failed to re-anchor fees");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::add_fees_to_xcm", ?e, ?dest, ?context, "Failed to re-anchor fees");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
// buy execution using `fees` batched together with above `reanchored_assets`
|
||||
@@ -2423,7 +2423,7 @@ impl<T: Config> Pallet<T> {
|
||||
let context = T::UniversalLocation::get();
|
||||
let reanchored_fees = fees.clone().reanchored(&dest, &context).map_err(|_| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::local_reserve_fees_instructions",
|
||||
target: "xcm::pezpallet_xcm::local_reserve_fees_instructions",
|
||||
"Failed to re-anchor fees",
|
||||
);
|
||||
Error::<T>::CannotReanchor
|
||||
@@ -2463,7 +2463,7 @@ impl<T: Config> Pallet<T> {
|
||||
reanchored_assets
|
||||
.reanchor(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::local_reserve_transfer_programs", ?e, ?dest, ?context, "Failed to re-anchor assets");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::local_reserve_transfer_programs", ?e, ?dest, ?context, "Failed to re-anchor assets");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
|
||||
@@ -2513,7 +2513,7 @@ impl<T: Config> Pallet<T> {
|
||||
.clone()
|
||||
.reanchored(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::destination_reserve_fees_instructions", ?e, ?dest,?context, "Failed to re-anchor fees");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::destination_reserve_fees_instructions", ?e, ?dest,?context, "Failed to re-anchor fees");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
let fees: Assets = fees.into();
|
||||
@@ -2560,7 +2560,7 @@ impl<T: Config> Pallet<T> {
|
||||
reanchored_assets
|
||||
.reanchor(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::destination_reserve_transfer_programs", ?e, ?dest, ?context, "Failed to re-anchor assets");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::destination_reserve_transfer_programs", ?e, ?dest, ?context, "Failed to re-anchor assets");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
|
||||
@@ -2617,19 +2617,19 @@ impl<T: Config> Pallet<T> {
|
||||
let reserve_fees = fees_half_1
|
||||
.reanchored(&reserve, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::remote_reserve_transfer_program", ?e, ?reserve, ?context, "Failed to re-anchor reserve_fees");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::remote_reserve_transfer_program", ?e, ?reserve, ?context, "Failed to re-anchor reserve_fees");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
// identifies fee item as seen by `dest` - to be used at destination chain
|
||||
let dest_fees = fees_half_2
|
||||
.reanchored(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::remote_reserve_transfer_program", ?e, ?dest, ?context, "Failed to re-anchor dest_fees");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::remote_reserve_transfer_program", ?e, ?dest, ?context, "Failed to re-anchor dest_fees");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
// identifies `dest` as seen by `reserve`
|
||||
let dest = dest.reanchored(&reserve, &context).map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::remote_reserve_transfer_program", ?e, ?reserve, ?context, "Failed to re-anchor dest");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::remote_reserve_transfer_program", ?e, ?reserve, ?context, "Failed to re-anchor dest");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
// xcm to be executed at dest
|
||||
@@ -2678,7 +2678,7 @@ impl<T: Config> Pallet<T> {
|
||||
.clone()
|
||||
.reanchored(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::teleport_fees_instructions", ?e, ?dest, ?context, "Failed to re-anchor fees");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::teleport_fees_instructions", ?e, ?dest, ?context, "Failed to re-anchor fees");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
|
||||
@@ -2695,7 +2695,7 @@ impl<T: Config> Pallet<T> {
|
||||
&dummy_context,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::teleport_fees_instructions", ?e, ?fees, ?dest, "Failed can_check_out");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::teleport_fees_instructions", ?e, ?fees, ?dest, "Failed can_check_out");
|
||||
Error::<T>::CannotCheckOutTeleport
|
||||
})?;
|
||||
// safe to do this here, we're in a transactional call that will be reverted on any
|
||||
@@ -2749,7 +2749,7 @@ impl<T: Config> Pallet<T> {
|
||||
reanchored_assets
|
||||
.reanchor(&dest, &context)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::teleport_assets_program", ?e, ?dest, ?context, "Failed to re-anchor asset");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::teleport_assets_program", ?e, ?dest, ?context, "Failed to re-anchor asset");
|
||||
Error::<T>::CannotReanchor
|
||||
})?;
|
||||
|
||||
@@ -2767,7 +2767,7 @@ impl<T: Config> Pallet<T> {
|
||||
&dummy_context,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::teleport_assets_program", ?e, ?asset, ?dest, "Failed can_check_out asset");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::teleport_assets_program", ?e, ?asset, ?dest, "Failed can_check_out asset");
|
||||
Error::<T>::CannotCheckOutTeleport
|
||||
})?;
|
||||
}
|
||||
@@ -3044,7 +3044,7 @@ impl<T: Config> Pallet<T> {
|
||||
if !is_waived {
|
||||
Self::charge_fees(local_origin, price).map_err(|e| {
|
||||
tracing::error!(
|
||||
target: "xcm::pallet_xcm::send_xcm",
|
||||
target: "xcm::pezpallet_xcm::send_xcm",
|
||||
?e,
|
||||
"Charging fees failed with error",
|
||||
);
|
||||
@@ -3068,7 +3068,7 @@ impl<T: Config> Pallet<T> {
|
||||
origin: OriginCaller,
|
||||
call: RuntimeCall,
|
||||
result_xcms_version: XcmVersion,
|
||||
) -> Result<CallDryRunEffects<<Runtime as frame_system::Config>::RuntimeEvent>, XcmDryRunApiError>
|
||||
) -> Result<CallDryRunEffects<<Runtime as pezframe_system::Config>::RuntimeEvent>, XcmDryRunApiError>
|
||||
where
|
||||
Runtime: crate::Config,
|
||||
Router: InspectMessageQueues,
|
||||
@@ -3079,7 +3079,7 @@ impl<T: Config> Pallet<T> {
|
||||
// Clear other messages in queues...
|
||||
Router::clear_messages();
|
||||
// ...and reset events to make sure we only record events from current call.
|
||||
frame_system::Pallet::<Runtime>::reset_events();
|
||||
pezframe_system::Pallet::<Runtime>::reset_events();
|
||||
let result = call.dispatch(origin.into());
|
||||
crate::Pallet::<Runtime>::set_record_xcm(false);
|
||||
let local_xcm = crate::Pallet::<Runtime>::recorded_xcm()
|
||||
@@ -3104,8 +3104,8 @@ impl<T: Config> Pallet<T> {
|
||||
);
|
||||
},
|
||||
)?;
|
||||
let events: Vec<<Runtime as frame_system::Config>::RuntimeEvent> =
|
||||
frame_system::Pallet::<Runtime>::read_events_no_consensus()
|
||||
let events: Vec<<Runtime as pezframe_system::Config>::RuntimeEvent> =
|
||||
pezframe_system::Pallet::<Runtime>::read_events_no_consensus()
|
||||
.map(|record| record.event.clone())
|
||||
.collect();
|
||||
Ok(CallDryRunEffects {
|
||||
@@ -3123,7 +3123,7 @@ impl<T: Config> Pallet<T> {
|
||||
pub fn dry_run_xcm<Router>(
|
||||
origin_location: VersionedLocation,
|
||||
xcm: VersionedXcm<<T as Config>::RuntimeCall>,
|
||||
) -> Result<XcmDryRunEffects<<T as frame_system::Config>::RuntimeEvent>, XcmDryRunApiError>
|
||||
) -> Result<XcmDryRunEffects<<T as pezframe_system::Config>::RuntimeEvent>, XcmDryRunApiError>
|
||||
where
|
||||
Router: InspectMessageQueues,
|
||||
{
|
||||
@@ -3142,11 +3142,11 @@ impl<T: Config> Pallet<T> {
|
||||
);
|
||||
XcmDryRunApiError::VersionedConversionFailed
|
||||
})?;
|
||||
let mut hash = xcm.using_encoded(sp_io::hashing::blake2_256);
|
||||
let mut hash = xcm.using_encoded(pezsp_io::hashing::blake2_256);
|
||||
|
||||
// To make sure we only record events from current call.
|
||||
Router::clear_messages();
|
||||
frame_system::Pallet::<T>::reset_events();
|
||||
pezframe_system::Pallet::<T>::reset_events();
|
||||
|
||||
let result = <T as Config>::XcmExecutor::prepare_and_execute(
|
||||
origin_location,
|
||||
@@ -3162,8 +3162,8 @@ impl<T: Config> Pallet<T> {
|
||||
?error, "Forwarded xcms version conversion failed with error"
|
||||
);
|
||||
})?;
|
||||
let events: Vec<<T as frame_system::Config>::RuntimeEvent> =
|
||||
frame_system::Pallet::<T>::read_events_no_consensus()
|
||||
let events: Vec<<T as pezframe_system::Config>::RuntimeEvent> =
|
||||
pezframe_system::Pallet::<T>::read_events_no_consensus()
|
||||
.map(|record| record.event.clone())
|
||||
.collect();
|
||||
Ok(XcmDryRunEffects { forwarded_xcms, emitted_events: events, execution_result: result })
|
||||
@@ -3193,7 +3193,7 @@ impl<T: Config> Pallet<T> {
|
||||
.collect::<Result<Vec<_>, ()>>()
|
||||
.map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::convert_forwarded_xcms",
|
||||
target: "xcm::pezpallet_xcm::convert_forwarded_xcms",
|
||||
"Failed to convert VersionedLocation to requested version",
|
||||
);
|
||||
XcmDryRunApiError::VersionedConversionFailed
|
||||
@@ -3218,12 +3218,12 @@ impl<T: Config> Pallet<T> {
|
||||
pub fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, XcmPaymentApiError> {
|
||||
let message = Xcm::<()>::try_from(message.clone())
|
||||
.map_err(|e| {
|
||||
tracing::debug!(target: "xcm::pallet_xcm::query_xcm_weight", ?e, ?message, "Failed to convert versioned message");
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::query_xcm_weight", ?e, ?message, "Failed to convert versioned message");
|
||||
XcmPaymentApiError::VersionedConversionFailed
|
||||
})?;
|
||||
|
||||
T::Weigher::weight(&mut message.clone().into(), Weight::MAX).map_err(|error| {
|
||||
tracing::debug!(target: "xcm::pallet_xcm::query_xcm_weight", ?error, ?message, "Error when querying XCM weight");
|
||||
tracing::debug!(target: "xcm::pezpallet_xcm::query_xcm_weight", ?error, ?message, "Error when querying XCM weight");
|
||||
XcmPaymentApiError::WeightNotComputable
|
||||
})
|
||||
}
|
||||
@@ -3302,18 +3302,18 @@ impl<T: Config> Pallet<T> {
|
||||
.clone()
|
||||
.try_into()
|
||||
.map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::query_delivery_fees", ?e, ?destination, "Failed to convert versioned destination");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::query_delivery_fees", ?e, ?destination, "Failed to convert versioned destination");
|
||||
XcmPaymentApiError::VersionedConversionFailed
|
||||
})?;
|
||||
|
||||
let message: Xcm<()> =
|
||||
message.clone().try_into().map_err(|e| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::query_delivery_fees", ?e, ?message, "Failed to convert versioned message");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::query_delivery_fees", ?e, ?message, "Failed to convert versioned message");
|
||||
XcmPaymentApiError::VersionedConversionFailed
|
||||
})?;
|
||||
|
||||
let (_, fees) = validate_send::<T::XcmRouter>(destination.clone(), message.clone()).map_err(|error| {
|
||||
tracing::error!(target: "xcm::pallet_xcm::query_delivery_fees", ?error, ?destination, ?message, "Failed to validate send to destination");
|
||||
tracing::error!(target: "xcm::pezpallet_xcm::query_delivery_fees", ?error, ?destination, ?message, "Failed to validate send to destination");
|
||||
XcmPaymentApiError::Unroutable
|
||||
})?;
|
||||
|
||||
@@ -3347,7 +3347,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
VersionedAssets::from(assets_to_pay).into_version(result_version).map_err(|e| {
|
||||
tracing::trace!(
|
||||
target: "xcm::pallet_xcm::query_delivery_fees",
|
||||
target: "xcm::pezpallet_xcm::query_delivery_fees",
|
||||
?e,
|
||||
?result_version,
|
||||
"Failed to convert fees into desired version"
|
||||
@@ -3364,7 +3364,7 @@ impl<T: Config> Pallet<T> {
|
||||
) -> Result<bool, TrustedQueryApiError> {
|
||||
let location: Location = location.try_into().map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::is_trusted_reserve",
|
||||
target: "xcm::pezpallet_xcm::is_trusted_reserve",
|
||||
?e, "Failed to convert versioned location",
|
||||
);
|
||||
TrustedQueryApiError::VersionedLocationConversionFailed
|
||||
@@ -3372,7 +3372,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
let a: Asset = asset.try_into().map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::is_trusted_reserve",
|
||||
target: "xcm::pezpallet_xcm::is_trusted_reserve",
|
||||
?e, "Failed to convert versioned asset",
|
||||
);
|
||||
TrustedQueryApiError::VersionedAssetConversionFailed
|
||||
@@ -3388,14 +3388,14 @@ impl<T: Config> Pallet<T> {
|
||||
) -> Result<bool, TrustedQueryApiError> {
|
||||
let location: Location = location.try_into().map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::is_trusted_teleporter",
|
||||
target: "xcm::pezpallet_xcm::is_trusted_teleporter",
|
||||
?e, "Failed to convert versioned location",
|
||||
);
|
||||
TrustedQueryApiError::VersionedLocationConversionFailed
|
||||
})?;
|
||||
let a: Asset = asset.try_into().map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::is_trusted_teleporter",
|
||||
target: "xcm::pezpallet_xcm::is_trusted_teleporter",
|
||||
?e, "Failed to convert versioned asset",
|
||||
);
|
||||
TrustedQueryApiError::VersionedAssetConversionFailed
|
||||
@@ -3411,7 +3411,7 @@ impl<T: Config> Pallet<T> {
|
||||
// storage entries are always latest version
|
||||
let target: VersionedLocation = target.into_version(XCM_VERSION).map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::authorized_aliasers",
|
||||
target: "xcm::pezpallet_xcm::authorized_aliasers",
|
||||
?e, "Failed to convert versioned location",
|
||||
);
|
||||
AuthorizedAliasersApiError::LocationVersionConversionFailed
|
||||
@@ -3444,7 +3444,7 @@ impl<T: Config> Pallet<T> {
|
||||
let desired_version = target.identify_version();
|
||||
let origin = origin.into_version(desired_version).map_err(|e| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::is_authorized_alias",
|
||||
target: "xcm::pezpallet_xcm::is_authorized_alias",
|
||||
?e, "mismatching origin and target versions",
|
||||
);
|
||||
AuthorizedAliasersApiError::LocationVersionConversionFailed
|
||||
@@ -3456,7 +3456,7 @@ impl<T: Config> Pallet<T> {
|
||||
aliaser
|
||||
.expiry
|
||||
.map(|expiry| {
|
||||
frame_system::Pallet::<T>::current_block_number().saturated_into::<u64>() <
|
||||
pezframe_system::Pallet::<T>::current_block_number().saturated_into::<u64>() <
|
||||
expiry
|
||||
})
|
||||
.unwrap_or(true)
|
||||
@@ -3517,7 +3517,7 @@ impl<T: Config> Pallet<T> {
|
||||
let responder = responder.into();
|
||||
let destination = T::UniversalLocation::get().invert_target(&responder).map_err(|()| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::report_outcome_notify",
|
||||
target: "xcm::pezpallet_xcm::report_outcome_notify",
|
||||
"Failed to invert responder location to universal location",
|
||||
);
|
||||
XcmError::LocationNotInvertible
|
||||
@@ -3549,7 +3549,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// and queue it for version discovery.
|
||||
fn note_unknown_version(dest: &Location) {
|
||||
tracing::trace!(
|
||||
target: "xcm::pallet_xcm::note_unknown_version",
|
||||
target: "xcm::pezpallet_xcm::note_unknown_version",
|
||||
?dest, "XCM version is unknown for destination"
|
||||
);
|
||||
let versioned_dest = VersionedLocation::from(dest.clone());
|
||||
@@ -3571,7 +3571,7 @@ impl<T: Config> Pallet<T> {
|
||||
fn charge_fees(location: Location, assets: Assets) -> DispatchResult {
|
||||
T::XcmExecutor::charge_fees(location.clone(), assets.clone()).map_err(|error| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::charge_fees", ?error,
|
||||
target: "xcm::pezpallet_xcm::charge_fees", ?error,
|
||||
"Failed to charge fees for location with assets",
|
||||
);
|
||||
Error::<T>::FeesNotMet
|
||||
@@ -3682,7 +3682,7 @@ impl<T: Config> xcm_executor::traits::Enact for LockTicket<T> {
|
||||
locks.try_push((self.amount, self.unlocker.into())).map_err(
|
||||
|(balance, location)| {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::enact", ?balance, ?location,
|
||||
target: "xcm::pezpallet_xcm::enact", ?balance, ?location,
|
||||
"Failed to lock fungibles",
|
||||
);
|
||||
UnexpectedState
|
||||
@@ -3867,7 +3867,7 @@ impl<T: Config> WrapVersion for Pallet<T> {
|
||||
})
|
||||
.ok_or_else(|| {
|
||||
tracing::trace!(
|
||||
target: "xcm::pallet_xcm::wrap_version",
|
||||
target: "xcm::pezpallet_xcm::wrap_version",
|
||||
?dest, "Could not determine a version to wrap XCM for destination",
|
||||
);
|
||||
()
|
||||
@@ -4096,11 +4096,11 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
return Weight::zero();
|
||||
}
|
||||
match maybe_notify {
|
||||
Some((pallet_index, call_index)) => {
|
||||
Some((pezpallet_index, call_index)) => {
|
||||
// This is a bit horrible, but we happen to know that the `Call` will
|
||||
// be built by `(pallet_index: u8, call_index: u8, QueryId, Response)`.
|
||||
// be built by `(pezpallet_index: u8, call_index: u8, QueryId, Response)`.
|
||||
// So we just encode that and then re-encode to a real Call.
|
||||
let bare = (pallet_index, call_index, query_id, response);
|
||||
let bare = (pezpallet_index, call_index, query_id, response);
|
||||
if let Ok(call) = bare.using_encoded(|mut bytes| {
|
||||
<T as Config>::RuntimeCall::decode(&mut bytes)
|
||||
}) {
|
||||
@@ -4109,7 +4109,7 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
if weight.any_gt(max_weight) {
|
||||
let e = Event::NotifyOverweight {
|
||||
query_id,
|
||||
pallet_index,
|
||||
pezpallet_index,
|
||||
call_index,
|
||||
actual_weight: weight,
|
||||
max_budgeted_weight: max_weight,
|
||||
@@ -4120,14 +4120,14 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
let dispatch_origin = Origin::Response(origin.clone()).into();
|
||||
match call.dispatch(dispatch_origin) {
|
||||
Ok(post_info) => {
|
||||
let e = Event::Notified { query_id, pallet_index, call_index };
|
||||
let e = Event::Notified { query_id, pezpallet_index, call_index };
|
||||
Self::deposit_event(e);
|
||||
post_info.actual_weight
|
||||
},
|
||||
Err(error_and_info) => {
|
||||
let e = Event::NotifyDispatchError {
|
||||
query_id,
|
||||
pallet_index,
|
||||
pezpallet_index,
|
||||
call_index,
|
||||
};
|
||||
Self::deposit_event(e);
|
||||
@@ -4139,7 +4139,7 @@ impl<T: Config> OnResponse for Pallet<T> {
|
||||
.unwrap_or(weight)
|
||||
} else {
|
||||
let e =
|
||||
Event::NotifyDecodeFailed { query_id, pallet_index, call_index };
|
||||
Event::NotifyDecodeFailed { query_id, pezpallet_index, call_index };
|
||||
Self::deposit_event(e);
|
||||
Weight::zero()
|
||||
}
|
||||
@@ -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 = frame_system::Pallet::<T>::current_block_number();
|
||||
let at = pezframe_system::Pallet::<T>::current_block_number();
|
||||
let response = response.into();
|
||||
Queries::<T>::insert(query_id, QueryStatus::Ready { response, at });
|
||||
Weight::zero()
|
||||
@@ -4222,13 +4222,13 @@ where
|
||||
/// authorized `origin` to alias it.
|
||||
///
|
||||
/// Note: users can authorize other locations to alias them by using
|
||||
/// `pallet_xcm::add_authorized_alias()`.
|
||||
/// `pezpallet_xcm::add_authorized_alias()`.
|
||||
pub struct AuthorizedAliasers<T>(PhantomData<T>);
|
||||
impl<L: Into<VersionedLocation> + Clone, T: Config> ContainsPair<L, L> for AuthorizedAliasers<T> {
|
||||
fn contains(origin: &L, target: &L) -> bool {
|
||||
let origin: VersionedLocation = origin.clone().into();
|
||||
let target: VersionedLocation = target.clone().into();
|
||||
tracing::trace!(target: "xcm::pallet_xcm::AuthorizedAliasers::contains", ?origin, ?target);
|
||||
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)
|
||||
|
||||
@@ -18,8 +18,8 @@ use crate::{
|
||||
pallet::CurrentMigration, Config, CurrentXcmVersion, Pallet, VersionMigrationStage,
|
||||
VersionNotifyTargets,
|
||||
};
|
||||
use frame_support::{
|
||||
pallet_prelude::*,
|
||||
use pezframe_support::{
|
||||
pezpallet_prelude::*,
|
||||
traits::{OnRuntimeUpgrade, StorageVersion, UncheckedOnRuntimeUpgrade},
|
||||
weights::Weight,
|
||||
};
|
||||
@@ -221,7 +221,7 @@ pub mod data {
|
||||
weight: &mut Weight,
|
||||
required_xcm_version: XcmVersion,
|
||||
) {
|
||||
const LOG_TARGET: &str = "runtime::xcm::pallet_xcm::migrate_data_to_xcm_version";
|
||||
const LOG_TARGET: &str = "runtime::xcm::pezpallet_xcm::migrate_data_to_xcm_version";
|
||||
|
||||
// check and migrate `Queries`
|
||||
let queries_to_migrate = Queries::<T>::iter().filter_map(|(id, data)| {
|
||||
@@ -444,18 +444,18 @@ pub mod v1 {
|
||||
|
||||
/// Version checked migration to v1.
|
||||
///
|
||||
/// Wrapped in [`frame_support::migrations::VersionedMigration`] so the pre/post checks don't
|
||||
/// Wrapped in [`pezframe_support::migrations::VersionedMigration`] so the pre/post checks don't
|
||||
/// begin failing after the upgrade is enacted on-chain.
|
||||
pub type MigrateToV1<T> = frame_support::migrations::VersionedMigration<
|
||||
pub type MigrateToV1<T> = pezframe_support::migrations::VersionedMigration<
|
||||
0,
|
||||
1,
|
||||
VersionUncheckedMigrateToV1<T>,
|
||||
crate::pallet::Pallet<T>,
|
||||
<T as frame_system::Config>::DbWeight,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
|
||||
/// When adding a new XCM version, we need to run this migration for `pallet_xcm` to ensure that all
|
||||
/// When adding a new XCM version, we need to run this migration for `pezpallet_xcm` to ensure that all
|
||||
/// previously stored data with subkey prefix `XCM_VERSION-1` (and below) are migrated to the
|
||||
/// `XCM_VERSION`.
|
||||
///
|
||||
@@ -477,9 +477,9 @@ impl<T: Config> OnRuntimeUpgrade for MigrateToLatestXcmVersion<T> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(_: alloc::vec::Vec<u8>) -> Result<(), sp_runtime::TryRuntimeError> {
|
||||
fn post_upgrade(_: alloc::vec::Vec<u8>) -> Result<(), pezsp_runtime::TryRuntimeError> {
|
||||
use data::NeedsMigration;
|
||||
const LOG_TARGET: &str = "runtime::xcm::pallet_xcm::migrate_to_latest";
|
||||
const LOG_TARGET: &str = "runtime::xcm::pezpallet_xcm::migrate_to_latest";
|
||||
|
||||
let latest = CurrentXcmVersion::get();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pub use core::cell::RefCell;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{
|
||||
fungible::HoldConsideration, AsEnsureOriginWithArg, ConstU128, ConstU32, Contains, Equals,
|
||||
@@ -23,11 +23,11 @@ use frame_support::{
|
||||
},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezkuwi_runtime_teyrchains::origin;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::{
|
||||
traits::{Convert, IdentityLookup},
|
||||
AccountId32, BuildStorage,
|
||||
};
|
||||
@@ -47,18 +47,18 @@ use xcm_executor::{
|
||||
};
|
||||
use xcm_simulator::helpers::derive_topic_id;
|
||||
|
||||
use crate::{self as pallet_xcm, TestWeightInfo};
|
||||
use crate::{self as pezpallet_xcm, TestWeightInfo};
|
||||
|
||||
pub type AccountId = AccountId32;
|
||||
pub type Balance = u128;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet_test_notifier {
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pezpallet_test_notifier {
|
||||
use crate::{ensure_response, QueryId};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
use sp_runtime::DispatchResult;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
use pezsp_runtime::DispatchResult;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_executor::traits::QueryHandler;
|
||||
|
||||
@@ -66,10 +66,10 @@ pub mod pallet_test_notifier {
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config + crate::Config {
|
||||
pub trait Config: pezframe_system::Config + crate::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: IsType<<Self as frame_system::Config>::RuntimeEvent> + From<Event<Self>>;
|
||||
type RuntimeOrigin: IsType<<Self as frame_system::Config>::RuntimeOrigin>
|
||||
type RuntimeEvent: IsType<<Self as pezframe_system::Config>::RuntimeEvent> + From<Event<Self>>;
|
||||
type RuntimeOrigin: IsType<<Self as pezframe_system::Config>::RuntimeOrigin>
|
||||
+ Into<Result<crate::Origin, <Self as Config>::RuntimeOrigin>>;
|
||||
type RuntimeCall: IsType<<Self as crate::Config>::RuntimeCall> + From<Call<Self>>;
|
||||
}
|
||||
@@ -142,12 +142,12 @@ pub mod pallet_test_notifier {
|
||||
construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
AssetsPallet: pallet_assets,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
AssetsPallet: pezpallet_assets,
|
||||
ParasOrigin: origin,
|
||||
XcmPallet: pallet_xcm,
|
||||
TestNotifier: pallet_test_notifier,
|
||||
XcmPallet: pezpallet_xcm,
|
||||
TestNotifier: pezpallet_test_notifier,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -249,13 +249,13 @@ impl SendXcm for TestPaidForPara3000SendXcm {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Test {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Nonce = u64;
|
||||
type Hash = H256;
|
||||
type Hashing = ::sp_runtime::traits::BlakeTwo256;
|
||||
type Hashing = ::pezsp_runtime::traits::BlakeTwo256;
|
||||
type AccountId = AccountId;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Block = Block;
|
||||
@@ -264,7 +264,7 @@ impl frame_system::Config for Test {
|
||||
type BlockLength = ();
|
||||
type Version = ();
|
||||
type PalletInfo = PalletInfo;
|
||||
type AccountData = pallet_balances::AccountData<Balance>;
|
||||
type AccountData = pezpallet_balances::AccountData<Balance>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type DbWeight = ();
|
||||
@@ -272,15 +272,15 @@ impl frame_system::Config for Test {
|
||||
type SystemWeightInfo = ();
|
||||
type SS58Prefix = ();
|
||||
type OnSetCode = ();
|
||||
type MaxConsumers = frame_support::traits::ConstU32<16>;
|
||||
type MaxConsumers = pezframe_support::traits::ConstU32<16>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub ExistentialDeposit: Balance = 1;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_balances::Config for Test {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Test {
|
||||
type Balance = Balance;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = System;
|
||||
@@ -290,21 +290,21 @@ impl pallet_balances::Config for Test {
|
||||
/// Simple conversion of `u32` into an `AssetId` for use in benchmarking.
|
||||
pub struct XcmBenchmarkHelper;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl pallet_assets::BenchmarkHelper<Location, ()> for XcmBenchmarkHelper {
|
||||
impl pezpallet_assets::BenchmarkHelper<Location, ()> for XcmBenchmarkHelper {
|
||||
fn create_asset_id_parameter(id: u32) -> Location {
|
||||
Location::new(1, [Teyrchain(id)])
|
||||
}
|
||||
fn create_reserve_id_parameter(_: u32) {}
|
||||
}
|
||||
|
||||
impl pallet_assets::Config for Test {
|
||||
impl pezpallet_assets::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = Balance;
|
||||
type AssetId = Location;
|
||||
type AssetIdParameter = Location;
|
||||
type ReserveData = ();
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<pezframe_system::EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = EnsureRoot<AccountId>;
|
||||
type AssetDeposit = ConstU128<1>;
|
||||
type AssetAccountDeposit = ConstU128<10>;
|
||||
@@ -540,8 +540,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, AnyNetwork>;
|
||||
|
||||
parameter_types! {
|
||||
pub static AdvertisedXcmVersion: pallet_xcm::XcmVersion = 4;
|
||||
pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::XcmPallet(pallet_xcm::HoldReason::AuthorizeAlias);
|
||||
pub static AdvertisedXcmVersion: pezpallet_xcm::XcmVersion = 4;
|
||||
pub const AuthorizeAliasHoldReason: RuntimeHoldReason = RuntimeHoldReason::XcmPallet(pezpallet_xcm::HoldReason::AuthorizeAlias);
|
||||
}
|
||||
|
||||
pub struct ConvertDeposit;
|
||||
@@ -559,7 +559,7 @@ impl Contains<(Location, Vec<Asset>)> for XcmTeleportFiltered {
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_xcm::Config for Test {
|
||||
impl pezpallet_xcm::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -579,8 +579,8 @@ impl pallet_xcm::Config for Test {
|
||||
type SovereignAccountOf = AccountId32Aliases<(), AccountId32>;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = IsConcrete<RelayLocation>;
|
||||
type MaxLockers = frame_support::traits::ConstU32<8>;
|
||||
type MaxRemoteLockConsumers = frame_support::traits::ConstU32<0>;
|
||||
type MaxLockers = pezframe_support::traits::ConstU32<8>;
|
||||
type MaxRemoteLockConsumers = pezframe_support::traits::ConstU32<0>;
|
||||
type RemoteLockConsumerIdentifier = ();
|
||||
type WeightInfo = TestWeightInfo;
|
||||
type AuthorizedAliasConsideration =
|
||||
@@ -589,7 +589,7 @@ impl pallet_xcm::Config for Test {
|
||||
|
||||
impl origin::Config for Test {}
|
||||
|
||||
impl pallet_test_notifier::Config for Test {
|
||||
impl pezpallet_test_notifier::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
@@ -608,7 +608,7 @@ impl xcm_builder::EnsureDelivery for TestDeliveryHelper {
|
||||
let account = SovereignAccountOf::convert_location(origin_ref).expect("Valid location");
|
||||
// Give the existential deposit at least
|
||||
let balance = ExistentialDeposit::get();
|
||||
let _ = <Balances as frame_support::traits::Currency<_>>::make_free_balance_be(
|
||||
let _ = <Balances as pezframe_support::traits::Currency<_>>::make_free_balance_be(
|
||||
&account, balance,
|
||||
);
|
||||
(None, None)
|
||||
@@ -643,11 +643,11 @@ impl super::benchmarking::Config for Test {
|
||||
let fee_amount = 2u128;
|
||||
|
||||
let existential_deposit = ExistentialDeposit::get();
|
||||
let caller = frame_benchmarking::whitelisted_caller();
|
||||
let caller = pezframe_benchmarking::whitelisted_caller();
|
||||
|
||||
// Give some multiple of the existential deposit
|
||||
let balance = asset_amount + existential_deposit * 1000;
|
||||
let _ = <Balances as frame_support::traits::Currency<_>>::make_free_balance_be(
|
||||
let _ = <Balances as pezframe_support::traits::Currency<_>>::make_free_balance_be(
|
||||
&caller, balance,
|
||||
);
|
||||
// create sufficient foreign asset USDT
|
||||
@@ -721,7 +721,7 @@ pub(crate) fn buy_limited_execution<C>(
|
||||
|
||||
pub(crate) fn new_test_ext_with_balances(
|
||||
balances: Vec<(AccountId, Balance)>,
|
||||
) -> sp_io::TestExternalities {
|
||||
) -> pezsp_io::TestExternalities {
|
||||
new_test_ext_with_balances_and_xcm_version(
|
||||
balances,
|
||||
// By default set actual latest XCM version
|
||||
@@ -734,18 +734,18 @@ pub(crate) fn new_test_ext_with_balances_and_xcm_version(
|
||||
balances: Vec<(AccountId, Balance)>,
|
||||
safe_xcm_version: Option<XcmVersion>,
|
||||
supported_version: Vec<(Location, XcmVersion)>,
|
||||
) -> sp_io::TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
) -> pezsp_io::TestExternalities {
|
||||
let mut t = pezframe_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
|
||||
pallet_balances::GenesisConfig::<Test> { balances, ..Default::default() }
|
||||
pezpallet_balances::GenesisConfig::<Test> { balances, ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
pallet_xcm::GenesisConfig::<Test> { safe_xcm_version, supported_version, ..Default::default() }
|
||||
pezpallet_xcm::GenesisConfig::<Test> { safe_xcm_version, supported_version, ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
let mut ext = sp_io::TestExternalities::new(t);
|
||||
let mut ext = pezsp_io::TestExternalities::new(t);
|
||||
ext.execute_with(|| System::set_block_number(1));
|
||||
ext
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ use crate::{
|
||||
xcm_helpers::find_xcm_sent_message_id,
|
||||
DispatchResult, OriginFor,
|
||||
};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
assert_err, assert_ok,
|
||||
traits::{tokens::fungibles::Inspect, Currency},
|
||||
weights::Weight,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
|
||||
@@ -2032,7 +2032,7 @@ fn transfer_assets_with_filtered_teleported_fee_disallowed() {
|
||||
/// burn) effects are reverted.
|
||||
#[test]
|
||||
fn intermediary_error_reverts_side_effects() {
|
||||
use sp_tracing::{
|
||||
use pezsp_tracing::{
|
||||
test_log_capture::init_log_capture,
|
||||
tracing::{subscriber, Level},
|
||||
};
|
||||
|
||||
@@ -30,13 +30,13 @@ use crate::{
|
||||
VersionNotifiers, VersionNotifyTargets, WeightInfo,
|
||||
};
|
||||
use bounded_collections::BoundedVec;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
assert_err_ignore_postinfo, assert_noop, assert_ok, assert_storage_noop,
|
||||
traits::{ContainsPair, Currency, Hooks},
|
||||
weights::Weight,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{AccountIdConversion, BlakeTwo256, BlockNumberProvider, Hash},
|
||||
SaturatedConversion, TokenError,
|
||||
};
|
||||
@@ -65,7 +65,7 @@ fn report_outcome_notify_works() {
|
||||
assets: (Here, SEND_AMOUNT).into(),
|
||||
beneficiary: sender.clone(),
|
||||
}]);
|
||||
let call = pallet_test_notifier::Call::notification_received {
|
||||
let call = pezpallet_test_notifier::Call::notification_received {
|
||||
query_id: 0,
|
||||
response: Default::default(),
|
||||
};
|
||||
@@ -116,14 +116,14 @@ fn report_outcome_notify_works() {
|
||||
assert_eq!(
|
||||
last_events(2),
|
||||
vec![
|
||||
RuntimeEvent::TestNotifier(pallet_test_notifier::Event::ResponseReceived(
|
||||
RuntimeEvent::TestNotifier(pezpallet_test_notifier::Event::ResponseReceived(
|
||||
Teyrchain(OTHER_PARA_ID).into(),
|
||||
0,
|
||||
Response::ExecutionResult(None),
|
||||
)),
|
||||
RuntimeEvent::XcmPallet(crate::Event::Notified {
|
||||
query_id: 0,
|
||||
pallet_index: 5,
|
||||
pezpallet_index: 5,
|
||||
call_index: 2
|
||||
}),
|
||||
]
|
||||
@@ -345,7 +345,7 @@ fn send_works() {
|
||||
/// Asserts that `send` fails with `Error::SendFailure`
|
||||
#[test]
|
||||
fn send_fails_when_xcm_router_blocks() {
|
||||
use sp_tracing::{
|
||||
use pezsp_tracing::{
|
||||
test_log_capture::init_log_capture,
|
||||
tracing::{subscriber, Level},
|
||||
};
|
||||
@@ -370,7 +370,7 @@ fn send_fails_when_xcm_router_blocks() {
|
||||
);
|
||||
assert_noop!(result, Error::<Test>::SendFailure);
|
||||
assert!(log_capture
|
||||
.contains("xcm::pallet_xcm::send: XCM send failed with error error=Transport(\"Destination location full\")"));
|
||||
.contains("xcm::pezpallet_xcm::send: XCM send failed with error error=Transport(\"Destination location full\")"));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -444,7 +444,7 @@ fn authorized_aliases_work() {
|
||||
Box::new(alias.clone().into()),
|
||||
None
|
||||
),
|
||||
Err(sp_runtime::DispatchError::Token(TokenError::FundsUnavailable))
|
||||
Err(pezsp_runtime::DispatchError::Token(TokenError::FundsUnavailable))
|
||||
);
|
||||
|
||||
// --- setting single alias works
|
||||
@@ -750,14 +750,14 @@ fn incomplete_execute_reverts_side_effects() {
|
||||
|
||||
assert_eq!(
|
||||
result,
|
||||
Err(sp_runtime::DispatchErrorWithPostInfo {
|
||||
post_info: frame_support::dispatch::PostDispatchInfo {
|
||||
Err(pezsp_runtime::DispatchErrorWithPostInfo {
|
||||
post_info: pezframe_support::dispatch::PostDispatchInfo {
|
||||
actual_weight: Some(
|
||||
<Pallet<Test> as ExecuteControllerWeightInfo>::execute() + weight
|
||||
),
|
||||
pays_fee: frame_support::dispatch::Pays::Yes,
|
||||
pays_fee: pezframe_support::dispatch::Pays::Yes,
|
||||
},
|
||||
error: sp_runtime::DispatchError::from(
|
||||
error: pezsp_runtime::DispatchError::from(
|
||||
Error::<Test>::LocalExecutionIncompleteWithError {
|
||||
index: 3,
|
||||
error: XcmError::FailedToTransactAsset("").into()
|
||||
@@ -1678,7 +1678,7 @@ fn record_xcm_works() {
|
||||
#[test]
|
||||
fn execute_initiate_transfer_and_check_sent_event() {
|
||||
use crate::Event;
|
||||
use sp_tracing::{
|
||||
use pezsp_tracing::{
|
||||
test_log_capture::init_log_capture,
|
||||
tracing::{subscriber, Level},
|
||||
};
|
||||
@@ -1739,7 +1739,7 @@ fn execute_initiate_transfer_and_check_sent_event() {
|
||||
|
||||
#[test]
|
||||
fn deliver_failure_with_expect_error() {
|
||||
use sp_tracing::{
|
||||
use pezsp_tracing::{
|
||||
test_log_capture::init_log_capture,
|
||||
tracing::{subscriber, Level},
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
use crate::{Config, Error, Pallet};
|
||||
use alloc::vec::Vec;
|
||||
use hex_literal::hex;
|
||||
use sp_core::Get;
|
||||
use pezsp_core::Get;
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::TransferType;
|
||||
|
||||
@@ -91,7 +91,7 @@ impl<T: Config> Pallet<T> {
|
||||
for asset in assets {
|
||||
if Self::is_network_native_asset(&asset.id) {
|
||||
tracing::debug!(
|
||||
target: "xcm::pallet_xcm::transfer_assets",
|
||||
target: "xcm::pezpallet_xcm::transfer_assets",
|
||||
asset_id = ?asset.id, ?transfer_type,
|
||||
"Network native asset reserve transfer blocked in preparation for the Asset Hub Migration. Use `transfer_assets_using_type_and_then` instead and explicitly mention the reserve."
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user