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:
2025-12-14 00:04:10 +03:00
parent 286de54384
commit 1c0e57d984
9084 changed files with 997839 additions and 997557 deletions
+12 -12
View File
@@ -1,5 +1,5 @@
[package]
name = "staging-xcm"
name = "pezstaging-xcm"
description = "The basic XCM datastructures."
version = "7.0.1"
authors.workspace = true
@@ -17,19 +17,19 @@ bounded-collections = { features = ["serde"], workspace = true }
codec = { features = ["derive", "max-encoded-len"], workspace = true }
derive-where = { workspace = true }
environmental = { workspace = true }
frame-support = { workspace = true }
pezframe-support = { workspace = true }
hex-literal = { workspace = true, default-features = true }
impl-trait-for-tuples = { workspace = true }
scale-info = { features = ["derive", "serde"], workspace = true }
schemars = { default-features = true, optional = true, workspace = true }
serde = { features = ["alloc", "derive", "rc"], workspace = true }
sp-runtime = { workspace = true }
sp-weights = { features = ["serde"], workspace = true }
pezsp-runtime = { workspace = true }
pezsp-weights = { features = ["serde"], workspace = true }
tracing = { workspace = true }
xcm-procedural = { workspace = true, default-features = true }
[dev-dependencies]
sp-io = { workspace = true, default-features = true }
pezsp-io = { workspace = true, default-features = true }
[features]
default = ["std"]
@@ -38,21 +38,21 @@ std = [
"bounded-collections/std",
"codec/std",
"environmental/std",
"frame-support/std",
"pezframe-support/std",
"scale-info/std",
"serde/std",
"sp-runtime/std",
"sp-weights/std",
"pezsp-runtime/std",
"pezsp-weights/std",
"tracing/std",
]
json-schema = [
"bounded-collections/json-schema",
"dep:schemars",
"sp-weights/json-schema",
"pezsp-weights/json-schema",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"sp-io/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"xcm-procedural/runtime-benchmarks",
]
+10 -10
View File
@@ -10,7 +10,7 @@ publish = false
[dependencies]
# For XCM stuff
pallet-xcm = { workspace = true, default-features = true }
pezpallet-xcm = { workspace = true, default-features = true }
xcm = { workspace = true, default-features = true }
xcm-builder = { workspace = true, default-features = true }
xcm-executor = { workspace = true, default-features = true }
@@ -21,12 +21,12 @@ codec = { workspace = true, default-features = true }
frame = { features = ["runtime"], workspace = true, default-features = true }
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
scale-info = { workspace = 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 }
# Some pallets
pallet-balances = { workspace = true, default-features = true }
pallet-message-queue = { workspace = true, default-features = true }
pezpallet-balances = { workspace = true, default-features = true }
pezpallet-message-queue = { workspace = true, default-features = true }
# For building docs
docify = { workspace = true }
@@ -38,12 +38,12 @@ test-log = { workspace = true }
[features]
runtime-benchmarks = [
"frame/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pezpallet-balances/runtime-benchmarks",
"pezpallet-message-queue/runtime-benchmarks",
"pezpallet-xcm/runtime-benchmarks",
"pezkuwi-runtime-teyrchains/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",
@@ -18,9 +18,9 @@
//! Mock network
use frame::deps::{
frame_system,
sp_io::TestExternalities,
sp_runtime::{AccountId32, BuildStorage},
pezframe_system,
pezsp_io::TestExternalities,
pezsp_runtime::{AccountId32, BuildStorage},
};
use xcm_simulator::{decl_test_network, decl_test_relay_chain, decl_test_teyrchain, TestExt};
@@ -65,8 +65,8 @@ decl_test_network! {
pub fn para_ext() -> TestExternalities {
use teyrchain::{MessageQueue, Runtime, System};
let t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
let mut ext = frame::deps::sp_io::TestExternalities::new(t);
let t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
let mut ext = frame::deps::pezsp_io::TestExternalities::new(t);
ext.execute_with(|| {
System::set_block_number(1);
MessageQueue::set_para_id(2222.into());
@@ -77,9 +77,9 @@ pub fn para_ext() -> TestExternalities {
pub fn relay_ext() -> TestExternalities {
use relay_chain::{Runtime, System};
let mut t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
let mut t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
pallet_balances::GenesisConfig::<Runtime> {
pezpallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, INITIAL_BALANCE)],
..Default::default()
}
@@ -18,7 +18,7 @@
//! Relay chain runtime mock.
use frame::{
deps::{frame_support::weights::WeightMeter, sp_runtime::AccountId32},
deps::{pezframe_support::weights::WeightMeter, pezsp_runtime::AccountId32},
prelude::*,
runtime::prelude::*,
traits::{IdentityLookup, ProcessMessage, ProcessMessageError},
@@ -37,20 +37,20 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Block = Block;
type AccountData = pallet_balances::AccountData<Balance>;
type AccountData = pezpallet_balances::AccountData<Balance>;
}
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime {
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for Runtime {
type AccountStore = System;
}
type Block = frame_system::mocking::MockBlock<Runtime>;
type Block = pezframe_system::mocking::MockBlock<Runtime>;
parameter_types! {
/// Amount of weight that can be spent per block to service messages.
@@ -81,7 +81,7 @@ impl ProcessMessage for MessageProcessor {
}
}
impl pallet_message_queue::Config for Runtime {
impl pezpallet_message_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Size = u32;
type HeapSize = MessageQueueHeapSize;
@@ -96,9 +96,9 @@ impl pallet_message_queue::Config for Runtime {
construct_runtime! {
pub struct Runtime {
System: frame_system,
Balances: pallet_balances,
MessageQueue: pallet_message_queue,
XcmPallet: pallet_xcm,
System: pezframe_system,
Balances: pezpallet_balances,
MessageQueue: pezpallet_message_queue,
XcmPallet: pezpallet_xcm,
}
}
@@ -18,7 +18,7 @@
//! Relay chain XCM configuration
use frame::{
deps::frame_system,
deps::pezframe_system,
runtime::prelude::*,
traits::{Disabled, Everything, Nothing},
};
@@ -125,7 +125,7 @@ impl xcm_executor::Config for XcmConfig {
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>;
impl pallet_xcm::Config for Runtime {
impl pezpallet_xcm::Config for Runtime {
// No one can call `send`
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = super::super::network::RelayChainXcmRouter; // Provided by xcm-simulator
@@ -146,8 +146,8 @@ impl pallet_xcm::Config for Runtime {
type UniversalLocation = UniversalLocation;
// No version discovery needed
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 0;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
type AdminOrigin = pezframe_system::EnsureRoot<AccountId>;
// No locking
type TrustedLockers = ();
type MaxLockers = frame::traits::ConstU32<0>;
@@ -159,7 +159,7 @@ impl pallet_xcm::Config for Runtime {
type Currency = Balances;
type CurrencyMatcher = IsConcrete<HereLocation>;
// Pallet benchmarks, no need for this example
type WeightInfo = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
// Runtime types
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
@@ -17,32 +17,32 @@
//! # Runtime
use frame::{deps::frame_system, runtime::prelude::*, traits::IdentityLookup};
use frame::{deps::pezframe_system, runtime::prelude::*, traits::IdentityLookup};
use xcm_executor::XcmExecutor;
use xcm_simulator::mock_message_queue;
mod xcm_config;
use xcm_config::XcmConfig;
pub type Block = frame_system::mocking::MockBlock<Runtime>;
pub type AccountId = frame::deps::sp_runtime::AccountId32;
pub type Block = pezframe_system::mocking::MockBlock<Runtime>;
pub type AccountId = frame::deps::pezsp_runtime::AccountId32;
pub type Balance = u64;
construct_runtime! {
pub struct Runtime {
System: frame_system,
System: pezframe_system,
MessageQueue: mock_message_queue,
Balances: pallet_balances,
XcmPallet: pallet_xcm,
Balances: pezpallet_balances,
XcmPallet: pezpallet_xcm,
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
type Block = Block;
type AccountId = AccountId;
type Lookup = IdentityLookup<AccountId>;
type AccountData = pallet_balances::AccountData<Balance>;
type AccountData = pezpallet_balances::AccountData<Balance>;
}
impl mock_message_queue::Config for Runtime {
@@ -50,7 +50,7 @@ impl mock_message_queue::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
}
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime {
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for Runtime {
type AccountStore = System;
}
@@ -18,7 +18,7 @@
//! # XCM Configuration
use frame::{
deps::frame_system,
deps::pezframe_system,
runtime::prelude::*,
traits::{Disabled, Everything, Nothing},
};
@@ -152,7 +152,7 @@ impl xcm_executor::Config for XcmConfig {
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>;
impl pallet_xcm::Config for Runtime {
impl pezpallet_xcm::Config for Runtime {
// We turn off sending for these tests
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = super::super::network::TeyrchainXcmRouter<MessageQueue>; // Provided by xcm-simulator
@@ -172,8 +172,8 @@ impl pallet_xcm::Config for Runtime {
type UniversalLocation = UniversalLocation;
// No version discovery needed
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 0;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
type AdminOrigin = pezframe_system::EnsureRoot<AccountId>;
// No locking
type TrustedLockers = ();
type MaxLockers = frame::traits::ConstU32<0>;
@@ -185,7 +185,7 @@ impl pallet_xcm::Config for Runtime {
type Currency = Balances;
type CurrencyMatcher = IsConcrete<RelayLocation>;
// Pallet benchmarks, no need for this recipe
type WeightInfo = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
// Runtime types
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
+1 -1
View File
@@ -46,7 +46,7 @@
//! - [`Executor`](xcm_executor): Implements the XCVM, capable of executing XCMs. Highly
//! configurable.
//! - [`Builder`](xcm_builder): A collection of types used to configure the executor.
//! - [`XCM Pallet`](pallet_xcm): A FRAME pallet for interacting with the executor.
//! - [`XCM Pallet`](pezpallet_xcm): A FRAME pallet for interacting with the executor.
//! - [`Simulator`](xcm_simulator): A playground to tinker with different XCM programs and executor
//! configurations.
//!
+19 -19
View File
@@ -1,5 +1,5 @@
[package]
name = "pallet-xcm-benchmarks"
name = "pezpallet-xcm-benchmarks"
authors.workspace = true
edition.workspace = true
license.workspace = true
@@ -16,41 +16,41 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { workspace = true }
frame-benchmarking = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pezframe-benchmarking = { workspace = true }
pezframe-support = { workspace = true }
pezframe-system = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
pezsp-io = { workspace = true }
pezsp-runtime = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
[dev-dependencies]
pallet-balances = { workspace = true, default-features = true }
sp-tracing = { workspace = true, default-features = true }
pezpallet-balances = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true, default-features = true }
xcm = { workspace = true, default-features = true }
[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"pezframe-benchmarking/std",
"pezframe-support/std",
"pezframe-system/std",
"scale-info/std",
"sp-io/std",
"sp-runtime/std",
"pezsp-io/std",
"pezsp-runtime/std",
"xcm-builder/std",
"xcm-executor/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"sp-io/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezframe-benchmarking/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"pezpallet-balances/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
@@ -17,14 +17,14 @@
use super::*;
use crate::{account_and_location, new_executor, AssetTransactorOf, EnsureDelivery, XcmCallOf};
use alloc::{vec, vec::Vec};
use frame_benchmarking::{benchmarks_instance_pallet, BenchmarkError, BenchmarkResult};
use frame_support::{
pallet_prelude::Get,
use pezframe_benchmarking::{benchmarks_instance_pallet, BenchmarkError, BenchmarkResult};
use pezframe_support::{
pezpallet_prelude::Get,
traits::fungible::{Inspect, Mutate},
weights::Weight,
BoundedVec,
};
use sp_runtime::traits::Bounded;
use pezsp_runtime::traits::Bounded;
use xcm::latest::{prelude::*, AssetTransferFilter, MAX_ITEMS_IN_ASSETS};
use xcm_executor::traits::{ConvertLocation, FeeReason, TransactAsset};
@@ -17,8 +17,8 @@
//! A mock runtime for XCM benchmarking.
use crate::{fungible as xcm_balances_benchmark, generate_holding_assets, mock::*};
use frame_benchmarking::BenchmarkError;
use frame_support::{
use pezframe_benchmarking::BenchmarkError;
use pezframe_support::{
derive_impl, parameter_types,
traits::{Everything, Nothing},
};
@@ -27,30 +27,30 @@ use xcm_builder::{
AllowUnpaidExecutionFrom, EnsureDecodableXcm, FrameTransactionalProcessor, MintLocation,
};
type Block = frame_system::mocking::MockBlock<Test>;
type Block = pezframe_system::mocking::MockBlock<Test>;
// For testing the pallet, we construct a mock runtime.
frame_support::construct_runtime!(
pezframe_support::construct_runtime!(
pub enum Test
{
System: frame_system,
Balances: pallet_balances,
System: pezframe_system,
Balances: pezpallet_balances,
XcmBalancesBenchmark: xcm_balances_benchmark,
}
);
#[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 Block = Block;
type AccountData = pallet_balances::AccountData<u64>;
type AccountData = pezpallet_balances::AccountData<u64>;
}
parameter_types! {
pub const ExistentialDeposit: u64 = 7;
}
#[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 ReserveIdentifier = [u8; 8];
type AccountStore = System;
}
@@ -66,7 +66,7 @@ parameter_types! {
pub struct MatchAnyFungible;
impl xcm_executor::traits::MatchesFungible<u64> for MatchAnyFungible {
fn matches_fungible(m: &Asset) -> Option<u64> {
use sp_runtime::traits::SaturatedConversion;
use pezsp_runtime::traits::SaturatedConversion;
match m {
Asset { fun: Fungible(amount), .. } => Some((*amount).saturated_into::<u64>()),
_ => None,
@@ -173,9 +173,9 @@ impl xcm_balances_benchmark::Config for Test {
}
#[cfg(feature = "runtime-benchmarks")]
pub fn new_test_ext() -> sp_io::TestExternalities {
use sp_runtime::BuildStorage;
pub fn new_test_ext() -> pezsp_io::TestExternalities {
use pezsp_runtime::BuildStorage;
let t = RuntimeGenesisConfig { ..Default::default() }.build_storage().unwrap();
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
t.into()
}
@@ -23,15 +23,15 @@ pub mod benchmarking;
#[cfg(test)]
mod mock;
#[frame_support::pallet]
#[pezframe_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::Get;
use pezframe_support::pezpallet_prelude::Get;
#[pallet::config]
pub trait Config<I: 'static = ()>: frame_system::Config + crate::Config {
pub trait Config<I: 'static = ()>: pezframe_system::Config + crate::Config {
/// The type of `fungible` that is being used under the hood.
///
/// This is useful for testing and checking.
type TransactAsset: frame_support::traits::fungible::Mutate<Self::AccountId>;
type TransactAsset: pezframe_support::traits::fungible::Mutate<Self::AccountId>;
/// The account used to check assets being teleported.
type CheckedAccount: Get<Option<(Self::AccountId, xcm_builder::MintLocation)>>;
@@ -19,8 +19,8 @@ use super::*;
use crate::{account_and_location, new_executor, EnsureDelivery, XcmCallOf};
use alloc::{vec, vec::Vec};
use codec::Encode;
use frame_benchmarking::v2::*;
use frame_support::{traits::fungible::Inspect, BoundedVec};
use pezframe_benchmarking::v2::*;
use pezframe_support::{traits::fungible::Inspect, BoundedVec};
use xcm::{
latest::{prelude::*, MaxDispatchErrorLen, MaybeErrorCode, Weight, MAX_ITEMS_IN_ASSETS},
DoubleEncoded,
@@ -727,7 +727,7 @@ mod benchmarks {
{
executor.bench_process(xcm)?;
}
use frame_support::traits::Get;
use pezframe_support::traits::Get;
let universal_location = <T::XcmConfig as xcm_executor::Config>::UniversalLocation::get();
assert_eq!(
executor.origin(),
@@ -18,11 +18,11 @@
use crate::{generic, mock::*, *};
use codec::Decode;
use frame_support::{
use pezframe_support::{
derive_impl, parameter_types,
traits::{Contains, Everything, OriginTrait},
};
use sp_runtime::traits::TrailingZeroInput;
use pezsp_runtime::traits::TrailingZeroInput;
use xcm_builder::{
test_utils::{
AssetsInHolding, TestAssetExchanger, TestAssetLocker, TestAssetTrap,
@@ -33,21 +33,21 @@ use xcm_builder::{
};
use xcm_executor::traits::ConvertOrigin;
type Block = frame_system::mocking::MockBlock<Test>;
type Block = pezframe_system::mocking::MockBlock<Test>;
frame_support::construct_runtime!(
pezframe_support::construct_runtime!(
pub enum Test
{
System: frame_system,
Balances: pallet_balances,
System: pezframe_system,
Balances: pezpallet_balances,
XcmGenericBenchmarks: generic,
}
);
#[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 Block = Block;
type AccountData = pallet_balances::AccountData<u64>;
type AccountData = pezpallet_balances::AccountData<u64>;
}
/// The benchmarks in this pallet should never need an asset transactor to begin with.
@@ -118,8 +118,8 @@ parameter_types! {
pub const ExistentialDeposit: u64 = 7;
}
#[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 ReserveIdentifier = [u8; 8];
type AccountStore = System;
}
@@ -160,7 +160,7 @@ impl generic::Config for Test {
fn transact_origin_and_runtime_call(
) -> Result<(Location, <Self as generic::Config>::RuntimeCall), BenchmarkError> {
Ok((Default::default(), frame_system::Call::remark_with_event { remark: vec![] }.into()))
Ok((Default::default(), pezframe_system::Call::remark_with_event { remark: vec![] }.into()))
}
fn subscribe_origin() -> Result<Location, BenchmarkError> {
@@ -196,10 +196,10 @@ impl generic::Config for Test {
}
#[cfg(feature = "runtime-benchmarks")]
pub fn new_test_ext() -> sp_io::TestExternalities {
use sp_runtime::BuildStorage;
pub fn new_test_ext() -> pezsp_io::TestExternalities {
use pezsp_runtime::BuildStorage;
let t = RuntimeGenesisConfig { ..Default::default() }.build_storage().unwrap();
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
t.into()
}
@@ -21,26 +21,26 @@ pub mod benchmarking;
#[cfg(test)]
mod mock;
#[frame_support::pallet]
#[pezframe_support::pallet]
pub mod pallet {
use frame_benchmarking::BenchmarkError;
use frame_support::{dispatch::GetDispatchInfo, pallet_prelude::Encode};
use sp_runtime::traits::Dispatchable;
use pezframe_benchmarking::BenchmarkError;
use pezframe_support::{dispatch::GetDispatchInfo, pezpallet_prelude::Encode};
use pezsp_runtime::traits::Dispatchable;
use xcm::latest::{
Asset, Assets, InteriorLocation, Junction, Location, NetworkId, Response, WeightLimit,
};
#[pallet::config]
pub trait Config<I: 'static = ()>: frame_system::Config + crate::Config {
pub trait Config<I: 'static = ()>: pezframe_system::Config + crate::Config {
type RuntimeCall: Dispatchable<RuntimeOrigin = Self::RuntimeOrigin>
+ GetDispatchInfo
+ From<frame_system::Call<Self>>
+ From<pezframe_system::Call<Self>>
+ Encode;
/// The type of `fungible` that is being used under the hood.
///
/// This is useful for testing and checking.
type TransactAsset: frame_support::traits::fungible::Mutate<Self::AccountId>;
type TransactAsset: pezframe_support::traits::fungible::Mutate<Self::AccountId>;
/// The response which causes the most runtime weight.
fn worst_case_response() -> (u64, Response);
@@ -99,13 +99,13 @@ pub mod pallet {
/// Returns a valid pallet info for `ExpectPallet` or `QueryPallet` benchmark.
///
/// By default returns `frame_system::Pallet` info with expected pallet index `0`.
fn valid_pallet() -> frame_support::traits::PalletInfoData {
frame_support::traits::PalletInfoData {
index: <frame_system::Pallet<Self> as frame_support::traits::PalletInfoAccess>::index(),
name: <frame_system::Pallet<Self> as frame_support::traits::PalletInfoAccess>::name(),
module_name: <frame_system::Pallet<Self> as frame_support::traits::PalletInfoAccess>::module_name(),
crate_version: <frame_system::Pallet<Self> as frame_support::traits::PalletInfoAccess>::crate_version(),
/// By default returns `pezframe_system::Pallet` info with expected pallet index `0`.
fn valid_pallet() -> pezframe_support::traits::PalletInfoData {
pezframe_support::traits::PalletInfoData {
index: <pezframe_system::Pallet<Self> as pezframe_support::traits::PalletInfoAccess>::index(),
name: <pezframe_system::Pallet<Self> as pezframe_support::traits::PalletInfoAccess>::name(),
module_name: <pezframe_system::Pallet<Self> as pezframe_support::traits::PalletInfoAccess>::module_name(),
crate_version: <pezframe_system::Pallet<Self> as pezframe_support::traits::PalletInfoAccess>::crate_version(),
}
}
}
+4 -4
View File
@@ -22,7 +22,7 @@ extern crate alloc;
use alloc::vec::Vec;
use codec::Encode;
use frame_benchmarking::{account, BenchmarkError};
use pezframe_benchmarking::{account, BenchmarkError};
use xcm::latest::prelude::*;
use xcm_builder::EnsureDelivery;
use xcm_executor::{traits::ConvertLocation, Config as XcmConfig};
@@ -34,7 +34,7 @@ pub mod generic;
mod mock;
/// A base trait for all individual pallets
pub trait Config: frame_system::Config {
pub trait Config: pezframe_system::Config {
/// The XCM configurations.
///
/// These might affect the execution of XCM messages, such as defining how the
@@ -62,7 +62,7 @@ const SEED: u32 = 0;
/// The XCM executor to use for doing stuff.
pub type ExecutorOf<T> = xcm_executor::XcmExecutor<<T as Config>::XcmConfig>;
/// The overarching call type.
pub type RuntimeCallOf<T> = <T as frame_system::Config>::RuntimeCall;
pub type RuntimeCallOf<T> = <T as pezframe_system::Config>::RuntimeCall;
/// The asset transactor of our executor
pub type AssetTransactorOf<T> = <<T as Config>::XcmConfig as XcmConfig>::AssetTransactor;
/// The call type of executor's config. Should eventually resolve to the same overarching call type.
@@ -104,7 +104,7 @@ pub fn new_executor<T: Config>(origin: Location) -> ExecutorOf<T> {
}
/// Build a location from an account id.
fn account_id_junction<T: frame_system::Config>(index: u32) -> Junction {
fn account_id_junction<T: pezframe_system::Config>(index: u32) -> Junction {
let account: T::AccountId = account("account", index, SEED);
let mut encoded = account.encode();
encoded.resize(32, 0u8);
@@ -15,7 +15,7 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use crate::*;
use frame_support::{parameter_types, traits::ContainsPair};
use pezframe_support::{parameter_types, traits::ContainsPair};
use xcm::latest::Weight;
// An xcm sender/receiver akin to > /dev/null
@@ -1,7 +1,7 @@
{{header}}
//! Autogenerated weights for `{{pallet}}`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}`
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
+29 -29
View File
@@ -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",
]
+37 -37
View File
@@ -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| {
+36 -36
View File
@@ -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
}
+39 -39
View File
@@ -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 {
+17 -17
View File
@@ -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))
}
+1 -1
View File
@@ -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
View File
@@ -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)
+9 -9
View File
@@ -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();
+44 -44
View File
@@ -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},
};
+14 -14
View File
@@ -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."
);
+2 -3
View File
@@ -24,13 +24,12 @@ syn = { workspace = true }
[dev-dependencies]
trybuild = { features = ["diff"], workspace = true }
# NOTE: we have to explicitly specify `std` because of trybuild
# https://github.com/paritytech/polkadot-sdk/pull/5167
xcm = { workspace = true, default-features = true, features = ["std"] }
# For testing macros.
frame-support = { workspace = true }
pezframe-support = { workspace = true }
[features]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
+1 -1
View File
@@ -29,7 +29,7 @@ pub fn derive(input: DeriveInput) -> Result<TokenStream2> {
let number_of_variants: usize = data_enum.variants.iter().count();
Ok(quote! {
pub struct #ident;
impl ::frame_support::traits::Get<u32> for #ident {
impl ::pezframe_support::traits::Get<u32> for #ident {
fn get() -> u32 {
#number_of_variants as u32
}
@@ -17,7 +17,7 @@
//! Test the methods generated by the Builder derive macro.
//! Tests directly on the actual Xcm struct and Instruction enum.
use frame_support::BoundedVec;
use pezframe_support::BoundedVec;
use xcm::latest::prelude::*;
#[test]
@@ -16,7 +16,7 @@
//! Test the struct generated by the `NumVariants` derive macro.
use frame_support::traits::Get;
use pezframe_support::traits::Get;
use xcm_procedural::NumVariants;
#[allow(dead_code)]
+1 -1
View File
@@ -24,7 +24,7 @@ use codec::{Decode, DecodeLimit, DecodeWithMemTracking, Encode};
#[codec(encode_bound())]
#[codec(decode_bound())]
#[scale_info(bounds(), skip_type_params(T))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub struct DoubleEncoded<T> {
encoded: Vec<u8>,
+4 -4
View File
@@ -17,7 +17,7 @@
//! Cross-Consensus Message format data structures.
// NOTE, this crate is meant to be used in many different environments, notably wasm, but not
// necessarily related to FRAME or even Substrate.
// necessarily related to FRAME or even Bizinikiwi.
//
// Hence, `no_std` rather than sp-runtime.
#![cfg_attr(not(feature = "std"), no_std)]
@@ -28,7 +28,7 @@ use codec::{
Decode, DecodeLimit, DecodeWithMemTracking, Encode, Error as CodecError, Input, MaxEncodedLen,
};
use derive_where::derive_where;
use frame_support::dispatch::GetDispatchInfo;
use pezframe_support::dispatch::GetDispatchInfo;
use scale_info::TypeInfo;
pub mod v3;
@@ -99,7 +99,7 @@ macro_rules! versioned_type {
#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode, DecodeWithMemTracking, TypeInfo)]
#[codec(encode_bound())]
#[codec(decode_bound())]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
$(#[$attr])*
pub enum $n {
$(#[$index3])*
@@ -323,7 +323,7 @@ versioned_type! {
#[codec(encode_bound())]
#[codec(decode_bound())]
#[scale_info(bounds(), skip_type_params(RuntimeCall))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum VersionedXcm<RuntimeCall> {
#[codec(index = 3)]
V3(v3::Xcm<RuntimeCall>),
+1 -1
View File
@@ -255,7 +255,7 @@ fn encode_decode_versioned_xcm_v5() {
assert_eq!(xcm, decoded);
}
// With the renaming of the crate to `staging-xcm` the naming in the metadata changed as well and
// With the renaming of the crate to `pezstaging-xcm` the naming in the metadata changed as well and
// this broke downstream users. This test ensures that the name in the metadata isn't changed.
#[test]
fn ensure_type_info_is_correct() {
+5 -5
View File
@@ -47,7 +47,7 @@ use serde::{Deserialize, Serialize};
Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum NetworkId {
/// Network specified by the first 32 bytes of its genesis block.
ByGenesis([u8; 32]),
@@ -120,7 +120,7 @@ impl From<NewNetworkId> for NetworkId {
Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum BodyId {
/// The only body in its context.
Unit,
@@ -167,7 +167,7 @@ pub enum BodyId {
Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum BodyPart {
/// The body's declaration, under whatever means it decides.
Voice,
@@ -231,7 +231,7 @@ impl BodyPart {
Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum Junction {
/// An indexed teyrchain belonging to and operated by the context.
///
@@ -240,7 +240,7 @@ pub enum Junction {
/// A 32-byte identifier for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
///
/// Generally used when the context is a Substrate-based chain.
/// Generally used when the context is a Bizinikiwi-based chain.
AccountId32 { network: Option<NetworkId>, id: [u8; 32] },
/// An 8-byte index for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
+3 -3
View File
@@ -46,7 +46,7 @@ pub(crate) const MAX_JUNCTIONS: usize = 8;
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum Junctions {
/// The interpreting consensus system.
Here,
@@ -461,7 +461,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
/// let mut m = X1(Teyrchain(21));
/// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(()));
/// assert_eq!(m, X2(Teyrchain(21), PalletInstance(3)));
@@ -590,7 +590,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*};
/// let mut m = X3(Teyrchain(2), PalletInstance(3), OnlyChild);
/// assert_eq!(m.match_and_split(&X2(Teyrchain(2), PalletInstance(3))), Some(&OnlyChild));
/// assert_eq!(m.match_and_split(&X1(Teyrchain(2))), None);
+16 -16
View File
@@ -61,7 +61,7 @@ pub type QueryId = u64;
#[derive_where(Clone, Eq, PartialEq, Debug)]
#[codec(encode_bound())]
#[scale_info(bounds(), skip_type_params(Call))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub struct Xcm<Call>(pub Vec<Instruction<Call>>);
@@ -220,7 +220,7 @@ parameter_types! {
#[derive(
Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub struct PalletInfo {
#[codec(compact)]
@@ -270,7 +270,7 @@ impl TryInto<NewPalletInfo> for PalletInfo {
#[derive(
Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum MaybeErrorCode {
Success,
@@ -297,7 +297,7 @@ impl Default for MaybeErrorCode {
#[derive(
Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo, MaxEncodedLen,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum Response {
/// No response. Serves as a neutral default.
@@ -331,8 +331,8 @@ impl TryFrom<NewResponse> for Response {
ExecutionResult(result) =>
Self::ExecutionResult(result.map(|(num, old_error)| (num, old_error.into()))),
Version(version) => Self::Version(version),
PalletsInfo(pallet_info) => {
let inner = pallet_info
PalletsInfo(pezpallet_info) => {
let inner = pezpallet_info
.into_iter()
.map(TryInto::try_into)
.collect::<result::Result<Vec<_>, _>>()?;
@@ -348,7 +348,7 @@ impl TryFrom<NewResponse> for Response {
/// Information regarding the composition of a query response.
#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub struct QueryResponseInfo {
/// The destination to which the query response message should be send.
@@ -374,7 +374,7 @@ impl TryFrom<NewQueryResponseInfo> for QueryResponseInfo {
/// An optional weight limit.
#[derive(Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum WeightLimit {
/// No weight limit imposed.
@@ -403,26 +403,26 @@ impl From<WeightLimit> for Option<Weight> {
/// Basically just the XCM (more general) version of `TeyrchainDispatchOrigin`.
#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode, DecodeWithMemTracking, Debug, TypeInfo)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum OriginKind {
/// Origin should just be the native dispatch origin representation for the sender in the
/// local runtime framework. For Cumulus/Frame chains this is the `Teyrchain` or `Relay` origin
/// local runtime framework. For Pezcumulus/Frame chains this is the `Teyrchain` or `Relay` origin
/// if coming from a chain, though there may be others if the `MultiLocation` XCM origin has a
/// primary/native dispatch origin form.
Native,
/// Origin should just be the standard account-based origin with the sovereign account of
/// the sender. For Cumulus/Frame chains, this is the `Signed` origin.
/// the sender. For Pezcumulus/Frame chains, this is the `Signed` origin.
SovereignAccount,
/// Origin should be the super-user. For Cumulus/Frame chains, this is the `Root` origin.
/// Origin should be the super-user. For Pezcumulus/Frame chains, this is the `Root` origin.
/// This will not usually be an available option.
Superuser,
/// Origin should be interpreted as an XCM native origin and the `MultiLocation` should be
/// encoded directly in the dispatch origin unchanged. For Cumulus/Frame chains, this will be
/// the `pallet_xcm::Origin::Xcm` type.
/// encoded directly in the dispatch origin unchanged. For Pezcumulus/Frame chains, this will be
/// the `pezpallet_xcm::Origin::Xcm` type.
Xcm,
}
@@ -474,7 +474,7 @@ impl XcmContext {
#[codec(decode_bound())]
#[codec(decode_with_mem_tracking_bound())]
#[scale_info(bounds(), skip_type_params(Call))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum Instruction<Call> {
/// Withdraw asset(s) (`assets`) from the ownership of `origin` and place them into the Holding
@@ -927,7 +927,7 @@ pub enum Instruction<Call> {
///
/// Sends a `QueryResponse` to Origin whose data field `PalletsInfo` containing the information
/// of all pallets on the local chain whose name is equal to `name`. This is empty in the case
/// that the local chain is not based on Substrate Frame.
/// that the local chain is not based on Bizinikiwi Frame.
///
/// Safety: No concerns.
///
+8 -8
View File
@@ -56,7 +56,7 @@ use scale_info::TypeInfo;
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum AssetInstance {
/// Undefined - used if the non-fungible asset class has only one instance.
Undefined,
@@ -264,7 +264,7 @@ impl TryFrom<AssetInstance> for u128 {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum Fungibility {
/// A fungible asset; we record a number of units, as a `u128` in the inner item.
Fungible(#[codec(compact)] u128),
@@ -347,7 +347,7 @@ impl TryFrom<NewFungibility> for Fungibility {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum WildFungibility {
/// The asset is fungible.
Fungible,
@@ -384,7 +384,7 @@ impl TryFrom<NewWildFungibility> for WildFungibility {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum AssetId {
/// A specific location identifying an asset.
Concrete(MultiLocation),
@@ -462,7 +462,7 @@ impl AssetId {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub struct MultiAsset {
/// The overall asset identity (aka *class*, in the case of a non-fungible).
pub id: AssetId,
@@ -573,7 +573,7 @@ impl TryFrom<NewMultiAsset> for MultiAsset {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub struct MultiAssets(Vec<MultiAsset>);
/// Maximum number of items in a single `MultiAssets` value that can be decoded.
@@ -793,7 +793,7 @@ impl MultiAssets {
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum WildMultiAsset {
/// All assets in Holding.
All,
@@ -910,7 +910,7 @@ impl<A: Into<AssetId>, B: Into<WildFungibility>> From<(A, B)> for WildMultiAsset
serde::Deserialize,
)]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum MultiAssetFilter {
/// Specify the filter as being everything contained by the given `MultiAssets` inner.
Definite(MultiAssets),
+7 -7
View File
@@ -33,7 +33,7 @@ use scale_info::TypeInfo;
/// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain.
/// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum.
/// - A logical functional component of a chain, e.g. a single instance of a pallet on a Frame-based
/// Substrate chain.
/// Bizinikiwi chain.
/// - An account.
///
/// A `MultiLocation` is a *relative identifier*, meaning that it can only be used to define the
@@ -267,7 +267,7 @@ impl MultiLocation {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
/// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild));
/// assert_eq!(
/// m.match_and_split(&MultiLocation::new(1, X1(PalletInstance(3)))),
@@ -292,7 +292,7 @@ impl MultiLocation {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// let mut m: MultiLocation = (Parent, Teyrchain(21), 69u64).into();
/// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(()));
/// assert_eq!(m, MultiLocation::new(1, X2(Teyrchain(21), PalletInstance(3))));
@@ -311,7 +311,7 @@ impl MultiLocation {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// let mut m: MultiLocation = (Parent, Teyrchain(21), 69u64).into();
/// let r = m.appended_with((Parent, PalletInstance(3))).unwrap();
/// assert_eq!(r, MultiLocation::new(1, X2(Teyrchain(21), PalletInstance(3))));
@@ -329,7 +329,7 @@ impl MultiLocation {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// let mut m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
/// assert_eq!(m.prepend_with((Parent, Teyrchain(21), OnlyChild)), Ok(()));
/// assert_eq!(m, MultiLocation::new(1, X1(PalletInstance(3))));
@@ -376,7 +376,7 @@ impl MultiLocation {
///
/// # Example
/// ```rust
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// # use pezstaging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
/// let m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
/// let r = m.prepended_with((Parent, Teyrchain(21), OnlyChild)).unwrap();
/// assert_eq!(r, MultiLocation::new(1, X1(PalletInstance(3))));
@@ -397,7 +397,7 @@ impl MultiLocation {
target: &MultiLocation,
context: InteriorMultiLocation,
) -> Result<(), ()> {
// TODO: https://github.com/paritytech/polkadot/issues/4489 Optimize this.
// TODO: https://github.com/pezkuwichain/kurdistan-sdk/issues/149 Optimize this.
// 1. Use our `context` to figure out how the `target` would address us.
let inverted_target = context.invert_target(target)?;
+8 -8
View File
@@ -20,11 +20,11 @@ use crate::v5::Error as NewError;
use core::result;
use scale_info::TypeInfo;
pub use sp_weights::Weight;
pub use pezsp_weights::Weight;
// A simple trait to get the weight of some object.
pub trait GetWeight<W> {
fn weight(&self) -> sp_weights::Weight;
fn weight(&self) -> pezsp_weights::Weight;
}
use super::*;
@@ -44,7 +44,7 @@ use super::*;
TypeInfo,
MaxEncodedLen,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum Error {
// Errors that happen due to instructions being executed. These alone are defined in the
@@ -238,7 +238,7 @@ pub type Result = result::Result<(), Error>;
/// Outcome of an XCM execution.
#[derive(Clone, Encode, Decode, Eq, PartialEq, Debug, TypeInfo)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum Outcome {
/// Execution completed successfully; given weight was used.
Complete(Weight),
@@ -384,7 +384,7 @@ impl<C> ExecuteXcm<C> for () {
#[derive(
Clone, Encode, Decode, DecodeWithMemTracking, Eq, PartialEq, Debug, scale_info::TypeInfo,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
pub enum SendError {
/// The message and destination combination was not recognized as being reachable.
///
@@ -424,8 +424,8 @@ pub type SendResult<T> = result::Result<(T, MultiAssets), SendError>;
/// # Example
/// ```rust
/// # use codec::Encode;
/// # use staging_xcm::v3::{prelude::*, Weight};
/// # use staging_xcm::VersionedXcm;
/// # use pezstaging_xcm::v3::{prelude::*, Weight};
/// # use pezstaging_xcm::VersionedXcm;
/// # use std::convert::Infallible;
///
/// /// A sender that only passes the message through and does nothing.
@@ -478,7 +478,7 @@ pub type SendResult<T> = result::Result<(T, MultiAssets), SendError>;
/// require_weight_at_most: Weight::zero(),
/// call: call.into(),
/// }]);
/// let message_hash = message.using_encoded(sp_io::hashing::blake2_256);
/// let message_hash = message.using_encoded(pezsp_io::hashing::blake2_256);
///
/// // Sender2 will block this.
/// assert!(send_xcm::<(Sender1, Sender2, Sender3)>(Parent.into(), message.clone()).is_err());
+1 -1
View File
@@ -55,7 +55,7 @@ pub enum Junction {
/// A 32-byte identifier for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
///
/// Generally used when the context is a Substrate-based chain.
/// Generally used when the context is a Bizinikiwi-based chain.
AccountId32 { network: Option<NetworkId>, id: [u8; 32] },
/// An 8-byte index for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
+2 -2
View File
@@ -498,7 +498,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions, Junction::*, Location};
/// # use pezstaging_xcm::v4::{Junctions, Junction::*, Location};
/// # fn main() {
/// let mut m = Junctions::from([Teyrchain(21)]);
/// assert_eq!(m.append_with([PalletInstance(3)]), Ok(()));
@@ -543,7 +543,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions, Junction::*};
/// # use pezstaging_xcm::v4::{Junctions, Junction::*};
/// # fn main() {
/// let mut m = Junctions::from([Teyrchain(2), PalletInstance(3), OnlyChild]);
/// assert_eq!(m.match_and_split(&[Teyrchain(2), PalletInstance(3)].into()), Some(&OnlyChild));
+10 -10
View File
@@ -33,7 +33,7 @@ use scale_info::TypeInfo;
/// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain.
/// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum.
/// - A logical functional component of a chain, e.g. a single instance of a pallet on a Frame-based
/// Substrate chain.
/// Bizinikiwi chain.
/// - An account.
///
/// A `Location` is a *relative identifier*, meaning that it can only be used to define the
@@ -139,7 +139,7 @@ impl Location {
/// To be used when pattern matching, for example:
///
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location};
/// fn get_teyrchain_id(loc: &Location) -> Option<u32> {
/// match loc.unpack() {
/// (0, [Teyrchain(id)]) => Some(*id),
@@ -274,7 +274,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location};
/// # fn main() {
/// let mut m = Location::new(1, [PalletInstance(3), OnlyChild]);
/// assert_eq!(
@@ -301,7 +301,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Teyrchain(21), 69u64).into();
/// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(()));
@@ -322,7 +322,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Teyrchain(21), 69u64).into();
/// let r = m.appended_with((Parent, PalletInstance(3))).unwrap();
@@ -342,7 +342,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Parent, PalletInstance(3)).into();
/// assert_eq!(m.prepend_with((Parent, Teyrchain(21), OnlyChild)), Ok(()));
@@ -391,7 +391,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v4::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let m: Location = (Parent, Parent, PalletInstance(3)).into();
/// let r = m.prepended_with((Parent, Teyrchain(21), OnlyChild)).unwrap();
@@ -448,7 +448,7 @@ impl Reanchorable for Location {
///
/// Does not modify `self` in case of overflow.
fn reanchor(&mut self, target: &Location, context: &InteriorLocation) -> Result<(), ()> {
// TODO: https://github.com/paritytech/polkadot/issues/4489 Optimize this.
// TODO: https://github.com/pezkuwichain/kurdistan-sdk/issues/149 Optimize this.
// 1. Use our `context` to figure out how the `target` would address us.
let inverted_target = context.invert_target(target)?;
@@ -549,8 +549,8 @@ impl From<[u8; 32]> for Location {
}
}
impl From<sp_runtime::AccountId32> for Location {
fn from(id: sp_runtime::AccountId32) -> Self {
impl From<pezsp_runtime::AccountId32> for Location {
fn from(id: pezsp_runtime::AccountId32) -> Self {
Junction::AccountId32 { network: None, id: id.into() }.into()
}
}
+6 -6
View File
@@ -36,7 +36,7 @@ use codec::{
};
use core::{fmt::Debug, result};
use derive_where::derive_where;
use frame_support::dispatch::GetDispatchInfo;
use pezframe_support::dispatch::GetDispatchInfo;
use scale_info::TypeInfo;
mod asset;
@@ -316,8 +316,8 @@ impl TryFrom<OldResponse> for Response {
ExecutionResult(result) =>
Self::ExecutionResult(result.map(|(num, old_error)| (num, old_error.into()))),
Version(version) => Self::Version(version),
PalletsInfo(pallet_info) => {
let inner = pallet_info
PalletsInfo(pezpallet_info) => {
let inner = pezpallet_info
.into_iter()
.map(TryInto::try_into)
.collect::<result::Result<Vec<_>, _>>()?;
@@ -345,8 +345,8 @@ impl TryFrom<NewResponse> for Response {
.transpose()?,
),
Version(version) => Self::Version(version),
PalletsInfo(pallet_info) => {
let inner = pallet_info
PalletsInfo(pezpallet_info) => {
let inner = pezpallet_info
.into_iter()
.map(TryInto::try_into)
.collect::<result::Result<Vec<_>, _>>()?;
@@ -888,7 +888,7 @@ pub enum Instruction<Call> {
///
/// Sends a `QueryResponse` to Origin whose data field `PalletsInfo` containing the information
/// of all pallets on the local chain whose name is equal to `name`. This is empty in the case
/// that the local chain is not based on Substrate Frame.
/// that the local chain is not based on Bizinikiwi Frame.
///
/// Safety: No concerns.
///
+4 -4
View File
@@ -21,7 +21,7 @@ use codec::{Decode, Encode};
use core::result;
use scale_info::TypeInfo;
pub use sp_weights::Weight;
pub use pezsp_weights::Weight;
use super::*;
@@ -162,8 +162,8 @@ pub type SendResult<T> = result::Result<(T, Assets), SendError>;
/// # Example
/// ```rust
/// # use codec::Encode;
/// # use staging_xcm::v4::{prelude::*, Weight};
/// # use staging_xcm::VersionedXcm;
/// # use pezstaging_xcm::v4::{prelude::*, Weight};
/// # use pezstaging_xcm::VersionedXcm;
/// # use std::convert::Infallible;
///
/// /// A sender that only passes the message through and does nothing.
@@ -216,7 +216,7 @@ pub type SendResult<T> = result::Result<(T, Assets), SendError>;
/// require_weight_at_most: Weight::zero(),
/// call: call.into(),
/// }]);
/// let message_hash = message.using_encoded(sp_io::hashing::blake2_256);
/// let message_hash = message.using_encoded(pezsp_io::hashing::blake2_256);
///
/// // Sender2 will block this.
/// assert!(send_xcm::<(Sender1, Sender2, Sender3)>(Parent.into(), message.clone()).is_err());
+1 -1
View File
@@ -55,7 +55,7 @@ pub enum Junction {
/// A 32-byte identifier for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
///
/// Generally used when the context is a Substrate-based chain.
/// Generally used when the context is a Bizinikiwi-based chain.
AccountId32 { network: Option<NetworkId>, id: [u8; 32] },
/// An 8-byte index for an account of a specific network that is respected as a sovereign
/// endpoint within the context.
+2 -2
View File
@@ -498,7 +498,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions, Junction::*, Location};
/// # use pezstaging_xcm::v5::{Junctions, Junction::*, Location};
/// # fn main() {
/// let mut m = Junctions::from([Teyrchain(21)]);
/// assert_eq!(m.append_with([PalletInstance(3)]), Ok(()));
@@ -543,7 +543,7 @@ impl Junctions {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions, Junction::*};
/// # use pezstaging_xcm::v5::{Junctions, Junction::*};
/// # fn main() {
/// let mut m = Junctions::from([Teyrchain(2), PalletInstance(3), OnlyChild]);
/// assert_eq!(m.match_and_split(&[Teyrchain(2), PalletInstance(3)].into()), Some(&OnlyChild));
+10 -10
View File
@@ -33,7 +33,7 @@ use scale_info::TypeInfo;
/// - A layer-0 super-chain, e.g. the Pezkuwi Relay chain.
/// - A layer-2 smart contract, e.g. an ERC-20 on Ethereum.
/// - A logical functional component of a chain, e.g. a single instance of a pallet on a Frame-based
/// Substrate chain.
/// Bizinikiwi chain.
/// - An account.
///
/// A `Location` is a *relative identifier*, meaning that it can only be used to define the
@@ -139,7 +139,7 @@ impl Location {
/// To be used when pattern matching, for example:
///
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location};
/// fn get_teyrchain_id(loc: &Location) -> Option<u32> {
/// match loc.unpack() {
/// (0, [Teyrchain(id)]) => Some(*id),
@@ -274,7 +274,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location};
/// # fn main() {
/// let mut m = Location::new(1, [PalletInstance(3), OnlyChild]);
/// assert_eq!(
@@ -301,7 +301,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Teyrchain(21), 69u64).into();
/// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(()));
@@ -322,7 +322,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Teyrchain(21), 69u64).into();
/// let r = m.appended_with((Parent, PalletInstance(3))).unwrap();
@@ -342,7 +342,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let mut m: Location = (Parent, Parent, PalletInstance(3)).into();
/// assert_eq!(m.prepend_with((Parent, Teyrchain(21), OnlyChild)), Ok(()));
@@ -391,7 +391,7 @@ impl Location {
///
/// # Example
/// ```rust
/// # use staging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # use pezstaging_xcm::v5::{Junctions::*, Junction::*, Location, Parent};
/// # fn main() {
/// let m: Location = (Parent, Parent, PalletInstance(3)).into();
/// let r = m.prepended_with((Parent, Teyrchain(21), OnlyChild)).unwrap();
@@ -448,7 +448,7 @@ impl Reanchorable for Location {
///
/// Does not modify `self` in case of overflow.
fn reanchor(&mut self, target: &Location, context: &InteriorLocation) -> Result<(), ()> {
// TODO: https://github.com/paritytech/polkadot/issues/4489 Optimize this.
// TODO: https://github.com/pezkuwichain/kurdistan-sdk/issues/149 Optimize this.
// 1. Use our `context` to figure out how the `target` would address us.
let inverted_target = context.invert_target(target)?;
@@ -535,8 +535,8 @@ impl From<[u8; 32]> for Location {
}
}
impl From<sp_runtime::AccountId32> for Location {
fn from(id: sp_runtime::AccountId32) -> Self {
impl From<pezsp_runtime::AccountId32> for Location {
fn from(id: pezsp_runtime::AccountId32) -> Self {
Junction::AccountId32 { network: None, id: id.into() }.into()
}
}
+3 -3
View File
@@ -301,8 +301,8 @@ impl TryFrom<OldResponse> for Response {
.transpose()?,
),
Version(version) => Self::Version(version),
PalletsInfo(pallet_info) => {
let inner = pallet_info
PalletsInfo(pezpallet_info) => {
let inner = pezpallet_info
.into_iter()
.map(TryInto::try_into)
.collect::<result::Result<Vec<_>, _>>()?;
@@ -846,7 +846,7 @@ pub enum Instruction<Call> {
///
/// Sends a `QueryResponse` to Origin whose data field `PalletsInfo` containing the information
/// of all pallets on the local chain whose name is equal to `name`. This is empty in the case
/// that the local chain is not based on Substrate Frame.
/// that the local chain is not based on Bizinikiwi Frame.
///
/// Safety: No concerns.
///
+5 -5
View File
@@ -21,7 +21,7 @@ use codec::{Decode, DecodeWithMemTracking, Encode};
use core::result;
use scale_info::TypeInfo;
pub use sp_weights::Weight;
pub use pezsp_weights::Weight;
use super::*;
@@ -40,7 +40,7 @@ use super::*;
TypeInfo,
MaxEncodedLen,
)]
#[scale_info(replace_segment("staging_xcm", "xcm"))]
#[scale_info(replace_segment("pezstaging_xcm", "xcm"))]
#[cfg_attr(feature = "json-schema", derive(schemars::JsonSchema))]
pub enum Error {
// Errors that happen due to instructions being executed. These alone are defined in the
@@ -392,8 +392,8 @@ pub type SendResult<T> = result::Result<(T, Assets), SendError>;
/// # Example
/// ```rust
/// # use codec::Encode;
/// # use staging_xcm::v5::{prelude::*, Weight};
/// # use staging_xcm::VersionedXcm;
/// # use pezstaging_xcm::v5::{prelude::*, Weight};
/// # use pezstaging_xcm::VersionedXcm;
/// # use std::convert::Infallible;
///
/// /// A sender that only passes the message through and does nothing.
@@ -446,7 +446,7 @@ pub type SendResult<T> = result::Result<(T, Assets), SendError>;
/// call: call.into(),
/// fallback_max_weight: None,
/// }]);
/// let message_hash = message.using_encoded(sp_io::hashing::blake2_256);
/// let message_hash = message.using_encoded(pezsp_io::hashing::blake2_256);
///
/// // Sender2 will block this.
/// assert!(send_xcm::<(Sender1, Sender2, Sender3)>(Parent.into(), message.clone()).is_err());
+34 -34
View File
@@ -1,5 +1,5 @@
[package]
name = "staging-xcm-builder"
name = "pezstaging-xcm-builder"
description = "Tools & types for building with XCM and its executor."
authors.workspace = true
edition.workspace = true
@@ -14,17 +14,17 @@ workspace = true
[dependencies]
codec = { features = ["derive"], workspace = true }
environmental = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pezframe-support = { workspace = true }
pezframe-system = { workspace = true }
impl-trait-for-tuples = { workspace = true }
pallet-asset-conversion = { workspace = true }
pallet-transaction-payment = { workspace = true }
pezpallet-asset-conversion = { workspace = true }
pezpallet-transaction-payment = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
sp-arithmetic = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-weights = { workspace = true }
pezsp-arithmetic = { workspace = true }
pezsp-core = { workspace = true }
pezsp-io = { workspace = true }
pezsp-runtime = { workspace = true }
pezsp-weights = { workspace = true }
tracing = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
@@ -33,10 +33,10 @@ xcm-executor = { workspace = true }
pezkuwi-teyrchain-primitives = { workspace = true }
[dev-dependencies]
pallet-assets = { workspace = true, default-features = true }
pallet-balances = { workspace = true, default-features = true }
pallet-salary = { workspace = true, default-features = true }
pallet-xcm = { workspace = true, default-features = true }
pezpallet-assets = { workspace = true, default-features = true }
pezpallet-balances = { workspace = true, default-features = true }
pezpallet-salary = { workspace = true, default-features = true }
pezpallet-xcm = { workspace = true, default-features = true }
pezkuwi-primitives = { workspace = true, default-features = true }
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
pezkuwi-test-runtime = { workspace = true }
@@ -45,26 +45,26 @@ primitive-types = { features = [
"num-traits",
"scale-info",
], workspace = true }
sp-tracing = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true, default-features = true }
xcm-simulator = { workspace = true, default-features = true }
[features]
default = ["std"]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-salary/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"pezpallet-asset-conversion/runtime-benchmarks",
"pezpallet-assets/runtime-benchmarks",
"pezpallet-balances/runtime-benchmarks",
"pezpallet-salary/runtime-benchmarks",
"pezpallet-transaction-payment/runtime-benchmarks",
"pezpallet-xcm/runtime-benchmarks",
"pezkuwi-primitives/runtime-benchmarks",
"pezkuwi-runtime-teyrchains/runtime-benchmarks",
"pezkuwi-test-runtime/runtime-benchmarks",
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
"sp-io/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm-simulator/runtime-benchmarks",
"xcm/runtime-benchmarks",
@@ -72,18 +72,18 @@ runtime-benchmarks = [
std = [
"codec/std",
"environmental/std",
"frame-support/std",
"frame-system/std",
"pallet-asset-conversion/std",
"pallet-transaction-payment/std",
"pezframe-support/std",
"pezframe-system/std",
"pezpallet-asset-conversion/std",
"pezpallet-transaction-payment/std",
"pezkuwi-teyrchain-primitives/std",
"primitive-types/std",
"scale-info/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-weights/std",
"pezsp-arithmetic/std",
"pezsp-core/std",
"pezsp-io/std",
"pezsp-runtime/std",
"pezsp-weights/std",
"tracing/std",
"xcm-executor/std",
"xcm/std",
@@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with [`frame_support::traits::fungibles`] through XCM.
//! Adapters to work with [`pezframe_support::traits::fungibles`] through XCM.
use core::{marker::PhantomData, result};
use frame_support::traits::{Contains, Get};
use sp_runtime::traits::MaybeEquivalence;
use pezframe_support::traits::{Contains, Get};
use pezsp_runtime::traits::MaybeEquivalence;
use xcm::latest::prelude::*;
use xcm_executor::traits::{
Error as MatchError, MatchesFungibles, MatchesInstance, MatchesNonFungible, MatchesNonFungibles,
@@ -215,7 +215,7 @@ mod tests {
fn matched_converted_concrete_id_for_fungibles_works() {
type AssetIdForTrustBackedAssets = u32;
type Balance = u128;
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub TrustBackedAssetsPalletLocation: Location = PalletInstance(50).into();
}
@@ -280,7 +280,7 @@ mod tests {
fn matched_converted_concrete_id_for_nonfungibles_works() {
type ClassId = u32;
type ClassInstanceId = u64;
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub TrustBackedAssetsPalletLocation: Location = PalletInstance(50).into();
}
@@ -19,16 +19,16 @@
extern crate alloc;
use alloc::vec;
use core::marker::PhantomData;
use frame_support::{ensure, traits::tokens::fungibles};
use pallet_asset_conversion::{QuotePrice, SwapCredit};
use pezframe_support::{ensure, traits::tokens::fungibles};
use pezpallet_asset_conversion::{QuotePrice, SwapCredit};
use xcm::prelude::*;
use xcm_executor::{
traits::{AssetExchange, MatchesFungibles},
AssetsInHolding,
};
/// An adapter from [`pallet_asset_conversion::SwapCredit`] and
/// [`pallet_asset_conversion::QuotePrice`] to [`xcm_executor::traits::AssetExchange`].
/// An adapter from [`pezpallet_asset_conversion::SwapCredit`] and
/// [`pezpallet_asset_conversion::QuotePrice`] to [`xcm_executor::traits::AssetExchange`].
///
/// This adapter takes just one fungible asset in `give` and allows only one fungible asset in
/// `want`. If you need to handle more assets in either `give` or `want`, then you should use
@@ -17,7 +17,7 @@
//! Mock to test [`SingleAssetExchangeAdapter`].
use core::marker::PhantomData;
use frame_support::{
use pezframe_support::{
assert_ok, construct_runtime, derive_impl, ord_parameter_types, parameter_types,
traits::{
fungible::{self, NativeFromLeft, NativeOrWithId},
@@ -28,8 +28,8 @@ use frame_support::{
},
PalletId,
};
use sp_core::{ConstU128, ConstU32, Get};
use sp_runtime::{
use pezsp_core::{ConstU128, ConstU32, Get};
use pezsp_runtime::{
traits::{AccountIdConversion, IdentityLookup, MaybeEquivalence, TryConvert, TryConvertInto},
BuildStorage, Permill,
};
@@ -38,41 +38,41 @@ use xcm_executor::{traits::ConvertLocation, XcmExecutor};
use crate::{FungibleAdapter, IsConcrete, MatchedConvertedConcreteId, StartsWith};
pub type Block = frame_system::mocking::MockBlock<Runtime>;
pub type Block = pezframe_system::mocking::MockBlock<Runtime>;
pub type AccountId = u64;
pub type Balance = u128;
construct_runtime! {
pub struct Runtime {
System: frame_system,
Balances: pallet_balances,
AssetsPallet: pallet_assets::<Instance1>,
PoolAssets: pallet_assets::<Instance2>,
XcmPallet: pallet_xcm,
AssetConversion: pallet_asset_conversion,
System: pezframe_system,
Balances: pezpallet_balances,
AssetsPallet: pezpallet_assets::<Instance1>,
PoolAssets: pezpallet_assets::<Instance2>,
XcmPallet: pezpallet_xcm,
AssetConversion: pezpallet_asset_conversion,
}
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
type Block = Block;
type AccountId = AccountId;
type Lookup = IdentityLookup<AccountId>;
type AccountData = pallet_balances::AccountData<Balance>;
type AccountData = pezpallet_balances::AccountData<Balance>;
}
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime {
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for Runtime {
type Balance = Balance;
type AccountStore = System;
type ExistentialDeposit = ConstU128<1>;
}
pub type TrustBackedAssetsInstance = pallet_assets::Instance1;
pub type PoolAssetsInstance = pallet_assets::Instance2;
pub type TrustBackedAssetsInstance = pezpallet_assets::Instance1;
pub type PoolAssetsInstance = pezpallet_assets::Instance2;
#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)]
impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
#[derive_impl(pezpallet_assets::config_preludes::TestDefaultConfig)]
impl pezpallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type Currency = Balances;
type Balance = Balance;
type AssetDeposit = ConstU128<1>;
@@ -80,15 +80,15 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type MetadataDepositBase = ConstU128<1>;
type MetadataDepositPerByte = ConstU128<1>;
type ApprovalDeposit = ConstU128<1>;
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type CreateOrigin = AsEnsureOriginWithArg<pezframe_system::EnsureSigned<AccountId>>;
type ForceOrigin = pezframe_system::EnsureRoot<AccountId>;
type Freezer = ();
type Holder = ();
type CallbackHandle = ();
}
#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig)]
impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
#[derive_impl(pezpallet_assets::config_preludes::TestDefaultConfig)]
impl pezpallet_assets::Config<PoolAssetsInstance> for Runtime {
type Currency = Balances;
type Balance = Balance;
type AssetDeposit = ConstU128<1>;
@@ -96,8 +96,8 @@ impl pallet_assets::Config<PoolAssetsInstance> for Runtime {
type MetadataDepositBase = ConstU128<1>;
type MetadataDepositPerByte = ConstU128<1>;
type ApprovalDeposit = ConstU128<1>;
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
type CreateOrigin = AsEnsureOriginWithArg<pezframe_system::EnsureSigned<AccountId>>;
type ForceOrigin = pezframe_system::EnsureRoot<AccountId>;
type Freezer = ();
type Holder = ();
type CallbackHandle = ();
@@ -118,19 +118,19 @@ ord_parameter_types! {
AccountIdConversion::<AccountId>::into_account_truncating(&AssetConversionPalletId::get());
}
pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter<
pub type PoolIdToAccountId = pezpallet_asset_conversion::AccountIdConverter<
AssetConversionPalletId,
(NativeOrWithId<u32>, NativeOrWithId<u32>),
>;
impl pallet_asset_conversion::Config for Runtime {
impl pezpallet_asset_conversion::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type HigherPrecisionBalance = sp_core::U256;
type HigherPrecisionBalance = pezsp_core::U256;
type AssetKind = NativeOrWithId<u32>;
type Assets = NativeAndAssets;
type PoolId = (Self::AssetKind, Self::AssetKind);
type PoolLocator = pallet_asset_conversion::WithFirstAsset<
type PoolLocator = pezpallet_asset_conversion::WithFirstAsset<
Native,
AccountId,
Self::AssetKind,
@@ -184,10 +184,10 @@ pub type Weigher = crate::FixedWeightBounds<WeightPerInstruction, RuntimeCall, M
pub struct LocationToAssetId;
impl MaybeEquivalence<Location, NativeOrWithId<u32>> for LocationToAssetId {
fn convert(location: &Location) -> Option<NativeOrWithId<u32>> {
let pallet_instance = TrustBackedAssetsPalletIndex::get();
let pezpallet_instance = TrustBackedAssetsPalletIndex::get();
match location.unpack() {
(0, [PalletInstance(instance), GeneralIndex(index)])
if *instance == pallet_instance =>
if *instance == pezpallet_instance =>
Some(NativeOrWithId::WithId(*index as u32)),
(0, []) => Some(NativeOrWithId::Native),
_ => None,
@@ -195,10 +195,10 @@ impl MaybeEquivalence<Location, NativeOrWithId<u32>> for LocationToAssetId {
}
fn convert_back(asset_id: &NativeOrWithId<u32>) -> Option<Location> {
let pallet_instance = TrustBackedAssetsPalletIndex::get();
let pezpallet_instance = TrustBackedAssetsPalletIndex::get();
Some(match asset_id {
NativeOrWithId::WithId(id) =>
Location::new(0, [PalletInstance(pallet_instance), GeneralIndex((*id).into())]),
Location::new(0, [PalletInstance(pezpallet_instance), GeneralIndex((*id).into())]),
NativeOrWithId::Native => Location::new(0, []),
})
}
@@ -269,7 +269,7 @@ impl ConvertLocation<AccountId> for AccountIndex64Aliases {
/// `Convert` implementation to convert from some a `Signed` (system) `Origin` into an
/// `AccountIndex64`.
///
/// Typically used when configuring `pallet-xcm` in tests to allow `u64` accounts to dispatch an XCM
/// Typically used when configuring `pezpallet-xcm` in tests to allow `u64` accounts to dispatch an XCM
/// from an `AccountIndex64` origin.
pub struct SignedToAccountIndex64<RuntimeOrigin, AccountId, Network>(
PhantomData<(RuntimeOrigin, AccountId, Network)>,
@@ -277,12 +277,12 @@ pub struct SignedToAccountIndex64<RuntimeOrigin, AccountId, Network>(
impl<RuntimeOrigin: OriginTrait + Clone, AccountId: Into<u64>, Network: Get<Option<NetworkId>>>
TryConvert<RuntimeOrigin, Location> for SignedToAccountIndex64<RuntimeOrigin, AccountId, Network>
where
RuntimeOrigin::PalletsOrigin: From<frame_system::RawOrigin<AccountId>>
+ TryInto<frame_system::RawOrigin<AccountId>, Error = RuntimeOrigin::PalletsOrigin>,
RuntimeOrigin::PalletsOrigin: From<pezframe_system::RawOrigin<AccountId>>
+ TryInto<pezframe_system::RawOrigin<AccountId>, Error = RuntimeOrigin::PalletsOrigin>,
{
fn try_convert(o: RuntimeOrigin) -> Result<Location, RuntimeOrigin> {
o.try_with_caller(|caller| match caller.try_into() {
Ok(frame_system::RawOrigin::Signed(who)) =>
Ok(pezframe_system::RawOrigin::Signed(who)) =>
Ok(Junction::AccountIndex64 { network: Network::get(), index: who.into() }.into()),
Ok(other) => Err(other.into()),
Err(other) => Err(other),
@@ -298,7 +298,7 @@ parameter_types! {
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountIndex64<RuntimeOrigin, AccountId, NoNetwork>;
impl pallet_xcm::Config for Runtime {
impl pezpallet_xcm::Config for Runtime {
// We turn off sending for these tests
type SendXcmOrigin = crate::EnsureXcmOrigin<RuntimeOrigin, ()>;
type XcmRouter = ();
@@ -318,12 +318,12 @@ impl pallet_xcm::Config for Runtime {
type UniversalLocation = UniversalLocation;
// No version discovery needed
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 0;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
type AdminOrigin = pezframe_system::EnsureRoot<AccountId>;
// No locking
type TrustedLockers = ();
type MaxLockers = frame_support::traits::ConstU32<0>;
type MaxRemoteLockConsumers = frame_support::traits::ConstU32<0>;
type MaxLockers = pezframe_support::traits::ConstU32<0>;
type MaxRemoteLockConsumers = pezframe_support::traits::ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
// How to turn locations into accounts
type SovereignAccountOf = LocationToAccountId;
@@ -331,7 +331,7 @@ impl pallet_xcm::Config for Runtime {
type Currency = Balances;
type CurrencyMatcher = crate::IsConcrete<HereLocation>;
// Pallet benchmarks, no need for this recipe
type WeightInfo = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
// Runtime types
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
@@ -342,10 +342,10 @@ impl pallet_xcm::Config for Runtime {
pub const INITIAL_BALANCE: Balance = 1_000_000_000;
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let mut t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
pallet_balances::GenesisConfig::<Runtime> {
pezpallet_balances::GenesisConfig::<Runtime> {
balances: vec![(0, INITIAL_BALANCE), (1, INITIAL_BALANCE), (2, INITIAL_BALANCE)],
..Default::default()
}
@@ -354,7 +354,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
let owner = 0;
let mut ext = sp_io::TestExternalities::new(t);
let mut ext = pezsp_io::TestExternalities::new(t);
ext.execute_with(|| {
System::set_block_number(1);
assert_ok!(AssetsPallet::force_create(RuntimeOrigin::root(), 1, owner, false, 1,));
+4 -4
View File
@@ -18,7 +18,7 @@
use crate::{CreateMatcher, MatchXcm};
use core::{cell::Cell, marker::PhantomData, ops::ControlFlow, result::Result};
use frame_support::{
use pezframe_support::{
ensure,
traits::{Contains, ContainsPair, Get, Nothing, ProcessMessageError},
};
@@ -29,7 +29,7 @@ use xcm_executor::traits::{CheckSuspension, DenyExecution, OnResponse, Propertie
/// Execution barrier that just takes `max_weight` from `properties.weight_credit`.
///
/// Useful to allow XCM execution by local chain users via extrinsics.
/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset
/// E.g. `pezpallet_xcm::reserve_asset_transfer` to transfer a reserve asset
/// out of the local chain to another one.
pub struct TakeWeightCredit;
impl ShouldExecute for TakeWeightCredit {
@@ -546,7 +546,7 @@ where
}
}
// See issue <https://github.com/paritytech/polkadot/issues/5233>
// See issue <https://github.com/pezkuwichain/kurdistan-sdk/issues/155>
pub struct DenyReserveTransferToRelayChain;
impl DenyExecution for DenyReserveTransferToRelayChain {
fn deny_execution<RuntimeCall>(
@@ -627,7 +627,7 @@ impl<Inner: DenyExecution> DenyRecursively<Inner> {
}).flatten().ok_or(ProcessMessageError::StackLimitReached)?;
// Ensure the counter is decremented even if an early return occurs.
sp_core::defer! {
pezsp_core::defer! {
recursion_count::with(|count| {
*count = count.saturating_sub(1);
});
+2 -2
View File
@@ -19,9 +19,9 @@
//! from `xcm-executor` to perform their tasks.
use alloc::boxed::Box;
use frame_support::{
use pezframe_support::{
dispatch::{DispatchErrorWithPostInfo, WithPostDispatchInfo},
pallet_prelude::DispatchError,
pezpallet_prelude::DispatchError,
};
use xcm::prelude::*;
pub use xcm_executor::traits::QueryHandler;
+10 -10
View File
@@ -14,14 +14,14 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with `frame_support::traits::Currency` through XCM.
//! Adapters to work with `pezframe_support::traits::Currency` through XCM.
#![allow(deprecated)]
use super::MintLocation;
use core::{fmt::Debug, marker::PhantomData, result};
use frame_support::traits::{ExistenceRequirement::AllowDeath, Get, WithdrawReasons};
use sp_runtime::traits::CheckedSub;
use pezframe_support::traits::{ExistenceRequirement::AllowDeath, Get, WithdrawReasons};
use pezsp_runtime::traits::CheckedSub;
use xcm::latest::{Asset, Error as XcmError, Location, Result, XcmContext};
use xcm_executor::{
traits::{ConvertLocation, MatchesFungible, TransactAsset},
@@ -52,13 +52,13 @@ impl From<Error> for XcmError {
/// # Example
/// ```
/// use codec::Decode;
/// use frame_support::{parameter_types, PalletId};
/// use sp_runtime::traits::{AccountIdConversion, TrailingZeroInput};
/// use pezframe_support::{parameter_types, PalletId};
/// use pezsp_runtime::traits::{AccountIdConversion, TrailingZeroInput};
/// use xcm::latest::prelude::*;
/// use staging_xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete};
/// use pezstaging_xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete};
///
/// /// Our chain's account id.
/// type AccountId = sp_runtime::AccountId32;
/// type AccountId = pezsp_runtime::AccountId32;
///
/// /// Our relay chain's location.
/// parameter_types! {
@@ -93,7 +93,7 @@ pub struct CurrencyAdapter<Currency, Matcher, AccountIdConverter, AccountId, Che
);
impl<
Currency: frame_support::traits::Currency<AccountId>,
Currency: pezframe_support::traits::Currency<AccountId>,
Matcher: MatchesFungible<Currency::Balance>,
AccountIdConverter: ConvertLocation<AccountId>,
AccountId: Clone, // can't get away without it since Currency is generic over it.
@@ -129,7 +129,7 @@ impl<
if ok {
Currency::reactivate(amount);
} else {
frame_support::defensive!(
pezframe_support::defensive!(
"`can_check_in` must have returned `true` immediately prior; qed"
);
}
@@ -137,7 +137,7 @@ impl<
}
impl<
Currency: frame_support::traits::Currency<AccountId>,
Currency: pezframe_support::traits::Currency<AccountId>,
Matcher: MatchesFungible<Currency::Balance>,
AccountIdConverter: ConvertLocation<AccountId>,
AccountId: Clone + Debug, // can't get away without it since Currency is generic over it.
+1 -1
View File
@@ -15,7 +15,7 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use core::marker::PhantomData;
use frame_support::traits::{Contains, Get};
use pezframe_support::traits::{Contains, Get};
use xcm::prelude::*;
use xcm_executor::traits::{FeeManager, FeeReason, TransactAsset};
@@ -19,7 +19,7 @@
use alloc::vec::Vec;
use core::marker::PhantomData;
use frame_support::traits::{Contains, ContainsPair, Get};
use pezframe_support::traits::{Contains, ContainsPair, Get};
use xcm::latest::{Asset, AssetFilter, AssetId, Location, WildAsset};
/// Accepts an asset iff it is a native asset.
@@ -83,12 +83,12 @@ impl Get<Vec<AssetFilter>> for AllAssets {
#[cfg(test)]
mod tests {
use super::*;
use frame_support::traits::Equals;
use pezframe_support::traits::Equals;
use xcm::latest::prelude::*;
#[test]
fn location_with_asset_filters_works() {
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub ParaA: Location = Location::new(1, [Teyrchain(1001)]);
pub ParaB: Location = Location::new(1, [Teyrchain(1002)]);
pub ParaC: Location = Location::new(1, [Teyrchain(1003)]);
@@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with [`frame_support::traits::fungible`] through XCM.
//! Adapters to work with [`pezframe_support::traits::fungible`] through XCM.
use super::MintLocation;
use core::{fmt::Debug, marker::PhantomData, result};
use frame_support::traits::{
use pezframe_support::traits::{
tokens::{
fungible, Fortitude::Polite, Precision::Exact, Preservation::Expendable, Provenance::Minted,
},
@@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with [`frame_support::traits::fungibles`] through XCM.
//! Adapters to work with [`pezframe_support::traits::fungibles`] through XCM.
use core::{fmt::Debug, marker::PhantomData, result};
use frame_support::traits::{
use pezframe_support::traits::{
tokens::{
fungibles, Fortitude::Polite, Precision::Exact, Preservation::Expendable,
Provenance::Minted,
@@ -18,9 +18,9 @@ use crate::universal_exports::ensure_is_remote;
use alloc::vec::Vec;
use codec::{Compact, Decode, Encode};
use core::marker::PhantomData;
use frame_support::traits::Get;
use sp_io::hashing::blake2_256;
use sp_runtime::traits::{AccountIdConversion, TrailingZeroInput, TryConvert};
use pezframe_support::traits::Get;
use pezsp_io::hashing::blake2_256;
use pezsp_runtime::traits::{AccountIdConversion, TrailingZeroInput, TryConvert};
use xcm::latest::prelude::*;
use xcm_executor::traits::ConvertLocation;
@@ -521,7 +521,7 @@ mod tests {
pub type ForeignChainAliasTreasuryAccount<AccountId> =
HashedDescription<AccountId, DescribeFamily<DescribeTreasuryVoiceTerminal>>;
use frame_support::parameter_types;
use pezframe_support::parameter_types;
use xcm::latest::Junction;
fn account20() -> Junction {
+3 -3
View File
@@ -17,7 +17,7 @@
//! XCM matcher API, used primarily for writing barrier conditions.
use core::ops::ControlFlow;
use frame_support::traits::ProcessMessageError;
use pezframe_support::traits::ProcessMessageError;
use xcm::latest::{Instruction, Location};
/// Creates an instruction matcher from an XCM. Since XCM versions differ, we need to make a trait
@@ -48,9 +48,9 @@ impl<'a, Call> CreateMatcher for &'a mut [Instruction<Call>] {
///
/// Example:
/// ```rust
/// use frame_support::traits::ProcessMessageError;
/// use pezframe_support::traits::ProcessMessageError;
/// use xcm::latest::Instruction;
/// use staging_xcm_builder::{CreateMatcher, MatchXcm};
/// use pezstaging_xcm_builder::{CreateMatcher, MatchXcm};
///
/// let mut msg = [Instruction::<()>::ClearOrigin];
/// let res = msg
@@ -18,8 +18,8 @@
//! `InteriorLocation` types.
use core::marker::PhantomData;
use frame_support::traits::{Contains, Get};
use sp_runtime::traits::MaybeEquivalence;
use pezframe_support::traits::{Contains, Get};
use pezsp_runtime::traits::MaybeEquivalence;
use xcm::latest::{InteriorLocation, Location, NetworkId};
/// An implementation of `Contains` that checks for `Location` or
+3 -3
View File
@@ -17,7 +17,7 @@
//! Various implementations for the `MatchesFungible` trait.
use core::marker::PhantomData;
use frame_support::traits::Get;
use pezframe_support::traits::Get;
use xcm::latest::{
Asset, AssetId, AssetInstance,
Fungibility::{Fungible, NonFungible},
@@ -32,10 +32,10 @@ use xcm_executor::traits::{MatchesFungible, MatchesNonFungible};
///
/// ```
/// use xcm::latest::{Location, Parent};
/// use staging_xcm_builder::IsConcrete;
/// use pezstaging_xcm_builder::IsConcrete;
/// use xcm_executor::traits::MatchesFungible;
///
/// frame_support::parameter_types! {
/// pezframe_support::parameter_types! {
/// pub TargetLocation: Location = Parent.into();
/// }
///
@@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with [`frame_support::traits::tokens::nonfungible`] through XCM.
//! Adapters to work with [`pezframe_support::traits::tokens::nonfungible`] through XCM.
use crate::MintLocation;
use core::{fmt::Debug, marker::PhantomData, result};
use frame_support::{
use pezframe_support::{
ensure,
traits::{tokens::nonfungible, Get},
};
@@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
//! Adapters to work with [`frame_support::traits::tokens::nonfungibles`] through XCM.
//! Adapters to work with [`pezframe_support::traits::tokens::nonfungibles`] through XCM.
use crate::{AssetChecking, MintLocation};
use core::{fmt::Debug, marker::PhantomData, result};
use frame_support::{
use pezframe_support::{
ensure,
traits::{tokens::nonfungibles, Get},
};
@@ -17,7 +17,7 @@
//! Implementation for `ContainsPair<Location, Location>`.
use core::marker::PhantomData;
use frame_support::traits::{Contains, ContainsPair, Get};
use pezframe_support::traits::{Contains, ContainsPair, Get};
use xcm::latest::prelude::*;
/// Alias a Foreign `AccountId32` with a local `AccountId32` if the foreign `AccountId32` matches
@@ -17,10 +17,10 @@
//! Various implementations for `ConvertOrigin`.
use core::marker::PhantomData;
use frame_support::traits::{Contains, EnsureOrigin, Get, GetBacking, OriginTrait};
use frame_system::RawOrigin as SystemRawOrigin;
use pezframe_support::traits::{Contains, EnsureOrigin, Get, GetBacking, OriginTrait};
use pezframe_system::RawOrigin as SystemRawOrigin;
use pezkuwi_teyrchain_primitives::primitives::IsSystem;
use sp_runtime::traits::TryConvert;
use pezsp_runtime::traits::TryConvert;
use xcm::latest::{BodyId, BodyPart, Junction, Junctions::*, Location, NetworkId, OriginKind};
use xcm_executor::traits::{ConvertLocation, ConvertOrigin};
@@ -263,7 +263,7 @@ where
/// `Convert` implementation to convert from some a `Signed` (system) `Origin` into an
/// `AccountId32`.
///
/// Typically used when configuring `pallet-xcm` for allowing normal accounts to dispatch an XCM
/// Typically used when configuring `pezpallet-xcm` for allowing normal accounts to dispatch an XCM
/// from an `AccountId32` origin.
pub struct SignedToAccountId32<RuntimeOrigin, AccountId, Network>(
PhantomData<(RuntimeOrigin, AccountId, Network)>,
@@ -290,7 +290,7 @@ where
/// `Convert` implementation to convert from some an origin which implements `Backing` into a
/// corresponding `Plurality` `Location`.
///
/// Typically used when configuring `pallet-xcm` for allowing a collective's Origin to dispatch an
/// Typically used when configuring `pezpallet-xcm` for allowing a collective's Origin to dispatch an
/// XCM from a `Plurality` origin.
pub struct BackingToPlurality<RuntimeOrigin, COrigin, Body>(
PhantomData<(RuntimeOrigin, COrigin, Body)>,
@@ -363,20 +363,20 @@ impl<WhitelistedSuperuserLocations: Contains<Location>, RuntimeOrigin: OriginTra
#[cfg(test)]
mod tests {
use super::*;
use frame_support::{construct_runtime, derive_impl, parameter_types, traits::Equals};
use pezframe_support::{construct_runtime, derive_impl, parameter_types, traits::Equals};
use xcm::latest::{Junction::*, OriginKind};
type Block = frame_system::mocking::MockBlock<Test>;
type Block = pezframe_system::mocking::MockBlock<Test>;
construct_runtime!(
pub enum Test
{
System: frame_system,
System: pezframe_system,
}
);
#[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 Block = Block;
}
+4 -4
View File
@@ -18,15 +18,15 @@
use crate::{transfer::TransferOverXcmHelperT, TransferOverXcmHelper};
use core::marker::PhantomData;
use frame_support::traits::{
use pezframe_support::traits::{
tokens::{Pay, PaymentStatus},
Get,
};
use sp_runtime::traits::TryConvert;
use pezsp_runtime::traits::TryConvert;
use xcm::prelude::*;
use xcm_executor::traits::WaiveDeliveryFees;
/// Implementation of the `frame_support::traits::tokens::Pay` trait, to allow
/// Implementation of the `pezframe_support::traits::tokens::Pay` trait, to allow
/// for XCM-based payments of a given `Balance` of some asset ID existing on some chain under
/// ownership of some `Interior` location of the local chain to a particular `Beneficiary`. The
/// `AssetKind` value is not itself bounded (to avoid the issue of needing to wrap some preexisting
@@ -129,7 +129,7 @@ where
/// Specialization of the [`PayOverXcm`] trait to allow `[u8; 32]`-based `AccountId` values to be
/// paid on a remote chain.
///
/// Implementation of the [`frame_support::traits::tokens::Pay`] trait, to allow
/// Implementation of the [`pezframe_support::traits::tokens::Pay`] trait, to allow
/// for XCM payments of a given `Balance` of `AssetKind` existing on a `DestinationChain` under
/// ownership of some `Interior` location of the local chain to a particular `Beneficiary`.
///
@@ -18,12 +18,12 @@
use codec::{Decode, DecodeLimit, FullCodec, MaxEncodedLen};
use core::{fmt::Debug, marker::PhantomData};
use frame_support::{
use pezframe_support::{
dispatch::GetDispatchInfo,
traits::{ProcessMessage, ProcessMessageError},
};
use scale_info::TypeInfo;
use sp_weights::{Weight, WeightMeter};
use pezsp_weights::{Weight, WeightMeter};
use xcm::{prelude::*, MAX_XCM_DECODE_DEPTH};
const LOG_TARGET: &str = "xcm::process-message";
@@ -133,7 +133,7 @@ mod tests {
use super::*;
use alloc::vec;
use codec::Encode;
use frame_support::{
use pezframe_support::{
assert_err, assert_ok,
traits::{ProcessMessageError, ProcessMessageError::*},
};
@@ -156,7 +156,7 @@ mod tests {
#[test]
fn process_message_trivial_fails() {
// Trap makes it fail.
sp_io::TestExternalities::default().execute_with(|| {
pezsp_io::TestExternalities::default().execute_with(|| {
assert!(!process(v3_xcm(false)).unwrap());
assert!(!process(v4_xcm(false)).unwrap());
assert!(!process(v5_xcm(false)).unwrap());
@@ -216,7 +216,7 @@ mod tests {
#[test]
fn process_message_overweight_fails() {
sp_io::TestExternalities::default().execute_with(|| {
pezsp_io::TestExternalities::default().execute_with(|| {
for msg in [v4_xcm(true), v4_xcm(false), v4_xcm(false), v3_xcm(false)] {
let msg = &msg.encode()[..];
+1 -1
View File
@@ -19,7 +19,7 @@
use alloc::vec::Vec;
use codec::Encode;
use core::{marker::PhantomData, result::Result};
use frame_system::unique;
use pezframe_system::unique;
use xcm::prelude::*;
use xcm_executor::{traits::FeeReason, FeesMode};
+3 -3
View File
@@ -17,7 +17,7 @@
// Shared test utilities and implementations for the XCM Builder.
use alloc::vec::Vec;
use frame_support::{
use pezframe_support::{
parameter_types,
traits::{Contains, CrateVersion, PalletInfoData, PalletsInfoAccess},
};
@@ -125,13 +125,13 @@ impl PalletsInfoAccess for TestPalletsInfo {
PalletInfoData {
index: 0,
name: "System",
module_name: "pallet_system",
module_name: "pezpallet_system",
crate_version: CrateVersion { major: 1, minor: 10, patch: 1 },
},
PalletInfoData {
index: 1,
name: "Balances",
module_name: "pallet_balances",
module_name: "pezpallet_balances",
crate_version: CrateVersion { major: 1, minor: 42, patch: 69 },
},
]
@@ -18,7 +18,7 @@
use super::mock::*;
use crate::{universal_exports::*, WithTopicSource};
use frame_support::{parameter_types, traits::Get};
use pezframe_support::{parameter_types, traits::Get};
use std::{cell::RefCell, marker::PhantomData};
use xcm::AlwaysLatest;
use xcm_executor::{
@@ -19,7 +19,7 @@ use crate::test_utils::TrappedAssets;
#[test]
fn sovereign_paid_remote_exporter_produces_xcm_which_does_not_trap_assets() {
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub BridgeFeeAsset: Location = Parent.into();
pub LocalNetwork: NetworkId = ExecutorUniversalLocation::get().global_consensus().expect("valid `NetworkId`");
pub LocalBridgeLocation: Location = match &ExecutorUniversalLocation::get().split_global() {
@@ -54,7 +54,7 @@ fn sovereign_paid_remote_exporter_produces_xcm_which_does_not_trap_assets() {
)
.expect("valid message");
let message = Xcm::<TestCall>::from(message.0 .1);
let mut message_id = message.using_encoded(sp_io::hashing::blake2_256);
let mut message_id = message.using_encoded(pezsp_io::hashing::blake2_256);
// allow origin to pass barrier
let origin = Location::new(1, Teyrchain(50));
+10 -10
View File
@@ -24,7 +24,7 @@ fn expect_pallet_should_work() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 42,
}]);
@@ -41,7 +41,7 @@ fn expect_pallet_should_work() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 41,
}]);
@@ -62,7 +62,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 60,
}]);
@@ -85,7 +85,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"System".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 42,
}]);
@@ -108,7 +108,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_system".as_ref().into(),
module_name: b"pezpallet_system".as_ref().into(),
crate_major: 1,
min_crate_minor: 42,
}]);
@@ -131,7 +131,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 0,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 42,
}]);
@@ -154,7 +154,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 2,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 42,
}]);
@@ -177,7 +177,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 2,
min_crate_minor: 42,
}]);
@@ -200,7 +200,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 0,
min_crate_minor: 42,
}]);
@@ -223,7 +223,7 @@ fn expect_pallet_should_fail_correctly() {
let message = Xcm(vec![ExpectPallet {
index: 1,
name: b"Balances".as_ref().into(),
module_name: b"pallet_balances".as_ref().into(),
module_name: b"pezpallet_balances".as_ref().into(),
crate_major: 1,
min_crate_minor: 43,
}]);
+5 -5
View File
@@ -33,11 +33,11 @@ pub use core::{
fmt::Debug,
ops::ControlFlow,
};
use frame_support::traits::{ContainsPair, Everything};
pub use frame_support::{
use pezframe_support::traits::{ContainsPair, Everything};
pub use pezframe_support::{
dispatch::{DispatchInfo, DispatchResultWithPostInfo, GetDispatchInfo, PostDispatchInfo},
ensure, parameter_types,
sp_runtime::{traits::Dispatchable, DispatchError, DispatchErrorWithPostInfo},
pezsp_runtime::{traits::Dispatchable, DispatchError, DispatchErrorWithPostInfo},
traits::{Contains, Get, IsInVec},
};
pub use xcm::latest::{prelude::*, QueryId, Weight};
@@ -418,7 +418,7 @@ pub fn response(query_id: u64) -> Option<Response> {
/// Mock implementation of the [`QueryHandler`] trait for creating XCM success queries and expecting
/// responses.
pub struct TestQueryHandler<T, BlockNumber>(core::marker::PhantomData<(T, BlockNumber)>);
impl<T: Config, BlockNumber: sp_runtime::traits::Zero + Encode> QueryHandler
impl<T: Config, BlockNumber: pezsp_runtime::traits::Zero + Encode> QueryHandler
for TestQueryHandler<T, BlockNumber>
{
type BlockNumber = BlockNumber;
@@ -778,5 +778,5 @@ pub fn fungible_multi_asset(location: Location, amount: u128) -> Asset {
}
pub fn fake_message_hash<T>(message: &Xcm<T>) -> XcmHash {
message.using_encoded(sp_io::hashing::blake2_256)
message.using_encoded(pezsp_io::hashing::blake2_256)
}
+1 -1
View File
@@ -16,7 +16,7 @@
use super::{test_utils::*, *};
use alloc::{vec, vec::Vec};
use frame_support::{
use pezframe_support::{
assert_err,
traits::{ConstU32, ContainsPair, ProcessMessageError},
weights::constants::{WEIGHT_PROOF_SIZE_PER_MB, WEIGHT_REF_TIME_PER_SECOND},
+35 -35
View File
@@ -16,28 +16,28 @@
use super::*;
use frame_support::{
use pezframe_support::{
construct_runtime, derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, Disabled, Everything, Nothing},
};
use frame_system::{EnsureRoot, EnsureSigned};
use pezframe_system::{EnsureRoot, EnsureSigned};
use pezkuwi_primitives::{AccountIndex, BlakeTwo256, Signature};
use sp_runtime::{generic, traits::MaybeEquivalence, AccountId32, BuildStorage};
use pezsp_runtime::{generic, traits::MaybeEquivalence, AccountId32, BuildStorage};
use xcm_executor::{traits::ConvertLocation, XcmExecutor};
use xcm_simulator::ParaId;
pub type TxExtension = (
frame_system::AuthorizeCall<Test>,
frame_system::CheckNonZeroSender<Test>,
frame_system::CheckSpecVersion<Test>,
frame_system::CheckTxVersion<Test>,
frame_system::CheckGenesis<Test>,
frame_system::CheckMortality<Test>,
frame_system::CheckNonce<Test>,
frame_system::CheckWeight<Test>,
frame_system::WeightReclaim<Test>,
pezframe_system::AuthorizeCall<Test>,
pezframe_system::CheckNonZeroSender<Test>,
pezframe_system::CheckSpecVersion<Test>,
pezframe_system::CheckTxVersion<Test>,
pezframe_system::CheckGenesis<Test>,
pezframe_system::CheckMortality<Test>,
pezframe_system::CheckNonce<Test>,
pezframe_system::CheckWeight<Test>,
pezframe_system::WeightReclaim<Test>,
);
pub type Address = sp_runtime::MultiAddress<AccountId, AccountIndex>;
pub type Address = pezsp_runtime::MultiAddress<AccountId, AccountIndex>;
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, TxExtension>;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
@@ -48,20 +48,20 @@ pub type AccountId = AccountId32;
construct_runtime!(
pub enum Test {
System: frame_system,
Balances: pallet_balances,
Assets: pallet_assets,
Salary: pallet_salary,
XcmPallet: pallet_xcm,
System: pezframe_system,
Balances: pezpallet_balances,
Assets: pezpallet_assets,
Salary: pezpallet_salary,
XcmPallet: pezpallet_xcm,
}
);
#[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 Block = Block;
type AccountData = pallet_balances::AccountData<Balance>;
type AccountData = pezpallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type Lookup = sp_runtime::traits::IdentityLookup<AccountId>;
type Lookup = pezsp_runtime::traits::IdentityLookup<AccountId>;
}
pub type Balance = u128;
@@ -70,7 +70,7 @@ parameter_types! {
pub const ExistentialDeposit: Balance = 1;
}
impl pallet_balances::Config for Test {
impl pezpallet_balances::Config for Test {
type MaxLocks = ConstU32<0>;
type Balance = Balance;
type RuntimeEvent = RuntimeEvent;
@@ -97,7 +97,7 @@ parameter_types! {
pub const RemoveItemsLimit: u32 = 50;
}
impl pallet_assets::Config for Test {
impl pezpallet_assets::Config for Test {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
type AssetId = AssetIdForAssets;
@@ -145,7 +145,7 @@ pub struct AssetKind {
}
pub struct LocatableAssetKindConverter;
impl sp_runtime::traits::TryConvert<AssetKind, LocatableAssetId> for LocatableAssetKindConverter {
impl pezsp_runtime::traits::TryConvert<AssetKind, LocatableAssetId> for LocatableAssetKindConverter {
fn try_convert(value: AssetKind) -> Result<LocatableAssetId, AssetKind> {
Ok(LocatableAssetId { asset_id: value.asset_id, location: value.destination })
}
@@ -196,7 +196,7 @@ pub type LocalAssetsTransactor = FungiblesAdapter<
>;
type OriginConverter = (
pallet_xcm::XcmPassthrough<RuntimeOrigin>,
pezpallet_xcm::XcmPassthrough<RuntimeOrigin>,
SignedAccountId32AsNative<AnyNetwork, RuntimeOrigin>,
);
type Barrier = AllowUnpaidExecutionFrom<Everything>;
@@ -273,7 +273,7 @@ pub(crate) type SovereignAccountOf = (
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>,
);
impl pallet_xcm::Config for Test {
impl pezpallet_xcm::Config for Test {
type RuntimeEvent = RuntimeEvent;
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
type XcmRouter = TestMessageSender;
@@ -287,15 +287,15 @@ impl pallet_xcm::Config for Test {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
type TrustedLockers = ();
type SovereignAccountOf = SovereignAccountOf;
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 = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
type AdminOrigin = EnsureRoot<AccountId>;
type AuthorizedAliasConsideration = Disabled;
}
@@ -310,10 +310,10 @@ pub fn sibling_chain_account_id(para_id: u32, account: [u8; 32]) -> AccountId {
SovereignAccountOf::convert_location(&location).unwrap()
}
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<Test>::default().build_storage().unwrap();
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let mut t = pezframe_system::GenesisConfig::<Test>::default().build_storage().unwrap();
let admin_account: AccountId = AccountId::new([0u8; 32]);
pallet_assets::GenesisConfig::<Test> {
pezpallet_assets::GenesisConfig::<Test> {
assets: vec![
(0, admin_account.clone(), true, MINIMUM_BALANCE),
(1, admin_account.clone(), true, MINIMUM_BALANCE),
@@ -334,7 +334,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
}
.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
}
+1 -1
View File
@@ -18,7 +18,7 @@
//! correct destination
use super::{mock::*, *};
use frame_support::{assert_ok, traits::tokens::Pay};
use pezframe_support::{assert_ok, traits::tokens::Pay};
parameter_types! {
pub SenderAccount: AccountId = AccountId::new([3u8; 32]);
@@ -18,11 +18,11 @@
use super::{mock::*, *};
use frame_support::{
use pezframe_support::{
assert_ok,
traits::{tokens::GetSalary, RankedMembers},
};
use sp_runtime::{traits::ConvertToValue, DispatchResult};
use pezsp_runtime::{traits::ConvertToValue, DispatchResult};
parameter_types! {
pub Interior: InteriorLocation = Plurality { id: BodyId::Treasury, part: BodyPart::Voice }.into();
@@ -73,7 +73,7 @@ impl RankedMembers for TestClub {
}
fn demote(who: &Self::AccountId) -> DispatchResult {
CLUB.with(|club| match club.borrow().get(who) {
None => Err(sp_runtime::DispatchError::Unavailable),
None => Err(pezsp_runtime::DispatchError::Unavailable),
Some(&0) => {
club.borrow_mut().remove(&who);
Ok(())
@@ -104,7 +104,7 @@ impl GetSalary<Rank, AccountId, Balance> for FixedSalary {
}
}
impl pallet_salary::Config for Test {
impl pezpallet_salary::Config for Test {
type WeightInfo = ();
type RuntimeEvent = RuntimeEvent;
type Paymaster = SalaryPayOverXcm;
@@ -19,7 +19,7 @@
use super::{mock::*, *};
use crate::AliasesIntoAccountId32;
use frame_support::{
use pezframe_support::{
assert_ok, parameter_types,
traits::{fungible::Mutate, fungibles::Mutate as FungiblesMutate},
};
@@ -17,7 +17,7 @@
use super::*;
#[test]
fn pallet_query_should_work() {
fn pezpallet_query_should_work() {
AllowUnpaidFrom::set(vec![[Teyrchain(1)].into()]);
// They want to transfer 100 of our native asset from sovereign account of teyrchain #1 into #2
// and let them know to hand it to account #3.
@@ -52,12 +52,12 @@ fn pallet_query_should_work() {
}
#[test]
fn pallet_query_with_results_should_work() {
fn pezpallet_query_with_results_should_work() {
AllowUnpaidFrom::set(vec![[Teyrchain(1)].into()]);
// They want to transfer 100 of our native asset from sovereign account of teyrchain #1 into #2
// and let them know to hand it to account #3.
let message = Xcm(vec![QueryPallet {
module_name: "pallet_balances".into(),
module_name: "pezpallet_balances".into(),
response_info: QueryResponseInfo {
destination: Teyrchain(1).into(),
query_id: 1,
@@ -82,7 +82,7 @@ fn pallet_query_with_results_should_work() {
vec![PalletInfo::new(
1,
b"Balances".as_ref().into(),
b"pallet_balances".as_ref().into(),
b"pezpallet_balances".as_ref().into(),
1,
42,
69,
+2 -2
View File
@@ -15,7 +15,7 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use super::*;
use frame_support::{assert_ok, traits::Everything};
use pezframe_support::{assert_ok, traits::Everything};
use xcm_executor::traits::Properties;
fn props() -> Properties {
@@ -42,7 +42,7 @@ fn trailing_set_topic_as_id_with_unique_topic_should_work() {
);
// simulate sending `valid_xcm` with the `WithUniqueTopic` router
let mut sent_xcm = sp_io::TestExternalities::default().execute_with(|| {
let mut sent_xcm = pezsp_io::TestExternalities::default().execute_with(|| {
assert_ok!(send_xcm::<WithUniqueTopic<TestMessageSender>>(Location::parent(), valid_xcm,));
sent_xcm()
});
+2 -2
View File
@@ -162,9 +162,9 @@ fn errors_should_return_unused_weight() {
#[test]
fn weight_bounds_should_respect_instructions_limit() {
use sp_tracing::capture_test_logs;
use pezsp_tracing::capture_test_logs;
sp_tracing::init_for_tests();
pezsp_tracing::init_for_tests();
MaxInstructions::set(3);
// 4 instructions are too many.
let log_capture = capture_test_logs!({
+2 -2
View File
@@ -14,8 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use frame_support::storage::{with_transaction, TransactionOutcome};
use sp_runtime::DispatchError;
use pezframe_support::storage::{with_transaction, TransactionOutcome};
use pezsp_runtime::DispatchError;
use xcm::latest::prelude::*;
use xcm_executor::traits::ProcessTransaction;
+3 -3
View File
@@ -19,12 +19,12 @@
use crate::LocatableAssetId;
use alloc::vec;
use core::{fmt::Debug, marker::PhantomData};
use frame_support::traits::Get;
use sp_runtime::traits::TryConvert;
use pezframe_support::traits::Get;
use pezsp_runtime::traits::TryConvert;
use xcm::{latest::Error, opaque::lts::Weight, prelude::*};
use xcm_executor::traits::{FeeManager, FeeReason, QueryHandler, QueryResponseStatus};
pub use frame_support::traits::tokens::transfer::{Transfer, TransferStatus};
pub use pezframe_support::traits::tokens::transfer::{Transfer, TransferStatus};
const LOG_TARGET: &str = "xcm::transfer_over_xcm";
@@ -15,7 +15,7 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use core::marker::PhantomData;
use frame_support::traits::tokens::asset_ops::{
use pezframe_support::traits::tokens::asset_ops::{
common_strategies::{
ChangeOwnerFrom, ConfigValue, DeriveAndReportId, IfOwnedBy, Owner, WithConfig,
WithConfigValue,
@@ -16,9 +16,9 @@
//! XCM utilities to work with NFT-like entities (unique instances).
//! The adapters and other utility types use the
//! [`asset_ops`](frame_support::traits::tokens::asset_ops) traits.
//! [`asset_ops`](pezframe_support::traits::tokens::asset_ops) traits.
use sp_runtime::{traits::Convert, DispatchError};
use pezsp_runtime::{traits::Convert, DispatchError};
use xcm::latest::prelude::*;
pub mod adapter;
@@ -22,7 +22,7 @@ use crate::InspectMessageQueues;
use alloc::{vec, vec::Vec};
use codec::{Decode, Encode};
use core::{convert::TryInto, marker::PhantomData};
use frame_support::{ensure, traits::Get};
use pezframe_support::{ensure, traits::Get};
use xcm::prelude::*;
use xcm_executor::traits::{validate_export, ExportXcm};
use SendError::*;
@@ -132,7 +132,7 @@ impl<Exporter: ExportXcm, UniversalLocation: Get<InteriorLocation>> SendXcm
let xcm = msg.take().ok_or(MissingArgument)?;
let hash =
(Some(Location::here()), &remote_location).using_encoded(sp_io::hashing::blake2_128);
(Some(Location::here()), &remote_location).using_encoded(pezsp_io::hashing::blake2_128);
let channel = u32::decode(&mut hash.as_ref()).unwrap_or(0);
validate_export::<Exporter>(
@@ -662,7 +662,7 @@ impl<
tracing::debug!(target: "xcm::universal_exports", "Failed to convert destination to versioned location");
SendError::DestinationUnsupported })?;
let id = maybe_id.unwrap_or_else(|| message.using_encoded(sp_io::hashing::blake2_256));
let id = maybe_id.unwrap_or_else(|| message.using_encoded(pezsp_io::hashing::blake2_256));
let blob = BridgeMessage { universal_dest, message }.encode();
Ok(((blob, id), Price::get()))
}
@@ -676,7 +676,7 @@ impl<
#[cfg(test)]
mod tests {
use super::*;
use frame_support::{
use pezframe_support::{
assert_err, assert_ok,
traits::{Contains, Equals},
};
@@ -769,7 +769,7 @@ mod tests {
#[test]
fn local_exporters_works() {
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub Local: NetworkId = ByGenesis([0; 32]);
pub UniversalLocation: InteriorLocation = [GlobalConsensus(Local::get()), Teyrchain(1234)].into();
pub DifferentRemote: NetworkId = ByGenesis([22; 32]);
@@ -825,7 +825,7 @@ mod tests {
#[test]
fn remote_exporters_works() {
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub Local: NetworkId = ByGenesis([0; 32]);
pub UniversalLocation: InteriorLocation = [GlobalConsensus(Local::get()), Teyrchain(1234)].into();
pub DifferentRemote: NetworkId = ByGenesis([22; 32]);
@@ -934,7 +934,7 @@ mod tests {
#[test]
fn network_export_table_works() {
frame_support::parameter_types! {
pezframe_support::parameter_types! {
pub NetworkA: NetworkId = ByGenesis([0; 32]);
pub Teyrchain1000InNetworkA: InteriorLocation = [Teyrchain(1000)].into();
pub Teyrchain2000InNetworkA: InteriorLocation = [Teyrchain(2000)].into();
+2 -2
View File
@@ -16,7 +16,7 @@
use codec::Decode;
use core::{marker::PhantomData, result::Result};
use frame_support::{
use pezframe_support::{
dispatch::GetDispatchInfo,
traits::{
fungible::{Balanced, Credit, Inspect},
@@ -27,7 +27,7 @@ use frame_support::{
WeightToFee as WeightToFeeT,
},
};
use sp_runtime::traits::{SaturatedConversion, Saturating, Zero};
use pezsp_runtime::traits::{SaturatedConversion, Saturating, Zero};
use xcm::latest::{prelude::*, GetWeight, Weight};
use xcm_executor::{
traits::{WeightBounds, WeightTrader},
+24 -24
View File
@@ -15,21 +15,21 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use core::cell::RefCell;
use frame_support::{
use pezframe_support::{
construct_runtime, derive_impl, parameter_types,
traits::{Disabled, Everything, Nothing},
weights::Weight,
};
use frame_system::EnsureRoot;
use pezframe_system::EnsureRoot;
use primitive_types::H256;
use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage};
use pezsp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage};
use pezkuwi_runtime_teyrchains::{configuration, origin, shared};
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
use xcm::latest::{opaque, prelude::*};
use xcm_executor::XcmExecutor;
use staging_xcm_builder as xcm_builder;
use pezstaging_xcm_builder as xcm_builder;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom,
@@ -74,13 +74,13 @@ pub type TestXcmRouter = EnsureDecodableXcm<TestSendXcm>;
pub const UNITS: Balance = 1_000_000_000_000;
pub const CENTS: Balance = UNITS / 30_000;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
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;
@@ -89,7 +89,7 @@ impl frame_system::Config for Runtime {
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 = ();
@@ -97,15 +97,15 @@ impl frame_system::Config for Runtime {
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 * CENTS;
}
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime {
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for Runtime {
type Balance = Balance;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
@@ -202,7 +202,7 @@ impl xcm_executor::Config for XcmConfig {
/// sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;
impl pallet_xcm::Config for Runtime {
impl pezpallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type UniversalLocation = UniversalLocation;
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
@@ -217,15 +217,15 @@ impl pallet_xcm::Config for Runtime {
type RuntimeCall = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
type TrustedLockers = ();
type SovereignAccountOf = ();
type Currency = Balances;
type CurrencyMatcher = IsConcrete<KsmLocation>;
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 = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
type AdminOrigin = EnsureRoot<AccountId>;
// Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`.
type AuthorizedAliasConsideration = Disabled;
@@ -233,26 +233,26 @@ impl pallet_xcm::Config for Runtime {
impl origin::Config for Runtime {}
type Block = frame_system::mocking::MockBlock<Runtime>;
type Block = pezframe_system::mocking::MockBlock<Runtime>;
construct_runtime!(
pub enum Runtime
{
System: frame_system,
Balances: pallet_balances,
System: pezframe_system,
Balances: pezpallet_balances,
ParasOrigin: origin,
XcmPallet: pallet_xcm,
XcmPallet: pezpallet_xcm,
}
);
pub fn kusama_like_with_balances(balances: Vec<(AccountId, Balance)>) -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
pub fn kusama_like_with_balances(balances: Vec<(AccountId, Balance)>) -> pezsp_io::TestExternalities {
let mut t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
pallet_balances::GenesisConfig::<Runtime> { balances, ..Default::default() }
pezpallet_balances::GenesisConfig::<Runtime> { balances, ..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
}
+4 -4
View File
@@ -21,7 +21,7 @@ use mock::{
CENTS,
};
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
use sp_runtime::traits::AccountIdConversion;
use pezsp_runtime::traits::AccountIdConversion;
use xcm::latest::{prelude::*, Error::UntrustedTeleportLocation};
use xcm_executor::XcmExecutor;
use xcm_simulator::fake_message_hash;
@@ -96,7 +96,7 @@ fn transfer_asset_works() {
weight,
);
System::assert_last_event(
pallet_balances::Event::Transfer { from: ALICE, to: bob.clone(), amount }.into(),
pezpallet_balances::Event::Transfer { from: ALICE, to: bob.clone(), amount }.into(),
);
assert_eq!(r, Outcome::Complete { used: weight });
assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - amount);
@@ -332,8 +332,8 @@ fn reserve_based_transfer_works() {
#[test]
fn recursive_xcm_execution_fail() {
use crate::mock::*;
use frame_support::traits::{Everything, Nothing, ProcessMessageError};
use staging_xcm_builder::*;
use pezframe_support::traits::{Everything, Nothing, ProcessMessageError};
use pezstaging_xcm_builder::*;
use std::ops::ControlFlow;
use xcm::opaque::latest::prelude::*;
use xcm_executor::traits::{DenyExecution, Properties, ShouldExecute};
+19 -19
View File
@@ -1,5 +1,5 @@
[package]
name = "staging-xcm-executor"
name = "pezstaging-xcm-executor"
description = "An abstract and configurable XCM message executor."
authors.workspace = true
edition.workspace = true
@@ -14,38 +14,38 @@ workspace = true
[dependencies]
codec = { features = ["derive"], workspace = true }
environmental = { workspace = true }
frame-benchmarking = { optional = true, workspace = true }
frame-support = { workspace = true }
pezframe-benchmarking = { optional = true, workspace = true }
pezframe-support = { workspace = true }
impl-trait-for-tuples = { workspace = true }
scale-info = { features = ["derive", "serde"], workspace = true }
sp-arithmetic = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-weights = { workspace = true }
pezsp-arithmetic = { workspace = true }
pezsp-core = { workspace = true }
pezsp-io = { workspace = true }
pezsp-runtime = { workspace = true }
pezsp-weights = { workspace = true }
tracing = { workspace = true }
xcm = { workspace = true }
[features]
default = ["std"]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"sp-io/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pezframe-benchmarking/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
std = [
"codec/std",
"environmental/std",
"frame-benchmarking/std",
"frame-support/std",
"pezframe-benchmarking/std",
"pezframe-support/std",
"scale-info/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-weights/std",
"pezsp-arithmetic/std",
"pezsp-core/std",
"pezsp-io/std",
"pezsp-runtime/std",
"pezsp-weights/std",
"tracing/std",
"xcm/std",
]
@@ -12,48 +12,48 @@ workspace = true
[dependencies]
codec = { workspace = true, default-features = true }
frame-support = { workspace = true }
frame-system = { workspace = true, default-features = true }
pezframe-support = { workspace = true }
pezframe-system = { workspace = true, default-features = true }
futures = { workspace = true }
pallet-sudo = { workspace = true, default-features = true }
pallet-transaction-payment = { workspace = true, default-features = true }
pallet-xcm = { workspace = true, default-features = true }
pezpallet-sudo = { workspace = true, default-features = true }
pezpallet-transaction-payment = { workspace = true, default-features = true }
pezpallet-xcm = { workspace = true, default-features = true }
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
pezkuwi-test-client = { workspace = true }
pezkuwi-test-runtime = { workspace = true }
pezkuwi-test-service = { workspace = true }
sp-consensus = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
sp-runtime = { workspace = true }
sp-state-machine = { workspace = true, default-features = true }
sp-tracing = { workspace = true, default-features = true }
pezsp-consensus = { workspace = true, default-features = true }
pezsp-keyring = { workspace = true, default-features = true }
pezsp-runtime = { workspace = true }
pezsp-state-machine = { workspace = true, default-features = true }
pezsp-tracing = { workspace = true, default-features = true }
xcm = { workspace = true }
xcm-executor = { workspace = true, default-features = true }
[features]
default = ["std"]
std = [
"frame-support/std",
"frame-system/std",
"pallet-sudo/std",
"pezframe-support/std",
"pezframe-system/std",
"pezpallet-sudo/std",
"pezkuwi-runtime-teyrchains/std",
"sp-runtime/std",
"pezsp-runtime/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"pezpallet-sudo/runtime-benchmarks",
"pezpallet-transaction-payment/runtime-benchmarks",
"pezpallet-xcm/runtime-benchmarks",
"pezkuwi-runtime-teyrchains/runtime-benchmarks",
"pezkuwi-test-client/runtime-benchmarks",
"pezkuwi-test-runtime/runtime-benchmarks",
"pezkuwi-test-service/runtime-benchmarks",
"sp-consensus/runtime-benchmarks",
"sp-keyring/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-state-machine/runtime-benchmarks",
"pezsp-consensus/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"pezsp-state-machine/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
@@ -17,21 +17,21 @@
#![cfg(test)]
use codec::Encode;
use frame_support::weights::Weight;
use pezframe_support::weights::Weight;
use pezkuwi_test_client::{
BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, InitPezkuwiBlockBuilder,
TestClientBuilder, TestClientBuilderExt,
};
use pezkuwi_test_runtime::{pallet_test_notifier, xcm_config::XcmConfig};
use pezkuwi_test_runtime::{pezpallet_test_notifier, xcm_config::XcmConfig};
use pezkuwi_test_service::construct_extrinsic;
use sp_runtime::traits::Block;
use sp_state_machine::InspectState;
use pezsp_runtime::traits::Block;
use pezsp_state_machine::InspectState;
use xcm::{latest::prelude::*, VersionedResponse, VersionedXcm};
use xcm_executor::traits::WeightBounds;
#[test]
fn basic_buy_fees_message_executes() {
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
let client = TestClientBuilder::new().build();
let msg = Xcm(vec![
@@ -44,11 +44,11 @@ fn basic_buy_fees_message_executes() {
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute {
pezkuwi_test_runtime::RuntimeCall::Xcm(pezpallet_xcm::Call::execute {
message: Box::new(VersionedXcm::from(msg)),
max_weight: Weight::from_parts(1_000_000_000, 1024 * 1024),
}),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
0,
);
@@ -57,13 +57,13 @@ fn basic_buy_fees_message_executes() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
client.state_at(block_hash).expect("state should exist").inspect_state(|| {
assert!(pezkuwi_test_runtime::System::events().iter().any(|r| matches!(
r.event,
pezkuwi_test_runtime::RuntimeEvent::Xcm(pallet_xcm::Event::Attempted {
pezkuwi_test_runtime::RuntimeEvent::Xcm(pezpallet_xcm::Event::Attempted {
outcome: Outcome::Complete { .. }
}),
)));
@@ -72,7 +72,7 @@ fn basic_buy_fees_message_executes() {
#[test]
fn transact_recursion_limit_works() {
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
let client = TestClientBuilder::new().build();
let base_xcm = |call: pezkuwi_test_runtime::RuntimeCall| {
@@ -100,7 +100,7 @@ fn transact_recursion_limit_works() {
10 => {
let inner_call = call.take().unwrap();
let expected_transact_status =
sp_runtime::DispatchError::Module(sp_runtime::ModuleError {
pezsp_runtime::DispatchError::Module(pezsp_runtime::ModuleError {
index: 27,
error: [28, 0, 40, 0], // ExceedsStackLimit
message: Some("LocalExecutionIncompleteWithError"),
@@ -120,7 +120,7 @@ fn transact_recursion_limit_works() {
}
let max_weight =
<XcmConfig as xcm_executor::Config>::Weigher::weight(&mut msg, Weight::MAX).unwrap();
call = Some(pezkuwi_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute {
call = Some(pezkuwi_test_runtime::RuntimeCall::Xcm(pezpallet_xcm::Call::execute {
message: Box::new(VersionedXcm::from(msg.clone())),
max_weight,
}));
@@ -128,25 +128,25 @@ fn transact_recursion_limit_works() {
let mut block_builder = client.init_pezkuwi_block_builder();
let execute = construct_extrinsic(&client, call.unwrap(), sp_keyring::Sr25519Keyring::Alice, 0);
let execute = construct_extrinsic(&client, call.unwrap(), pezsp_keyring::Sr25519Keyring::Alice, 0);
block_builder.push_pezkuwi_extrinsic(execute).expect("pushes extrinsic");
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
client.state_at(block_hash).expect("state should exist").inspect_state(|| {
let events = pezkuwi_test_runtime::System::events();
// verify 10 pallet_xcm calls were successful
// verify 10 pezpallet_xcm calls were successful
assert_eq!(
pezkuwi_test_runtime::System::events()
.iter()
.filter(|r| matches!(
r.event,
pezkuwi_test_runtime::RuntimeEvent::Xcm(pallet_xcm::Event::Attempted {
pezkuwi_test_runtime::RuntimeEvent::Xcm(pezpallet_xcm::Event::Attempted {
outcome: Outcome::Complete { .. }
}),
))
@@ -157,22 +157,22 @@ fn transact_recursion_limit_works() {
assert!(events.iter().any(|r| matches!(
&r.event,
pezkuwi_test_runtime::RuntimeEvent::TransactionPayment(
pallet_transaction_payment::Event::TransactionFeePaid {
pezpallet_transaction_payment::Event::TransactionFeePaid {
who: payer,
..
}
) if *payer == sp_keyring::Sr25519Keyring::Alice.into(),
) if *payer == pezsp_keyring::Sr25519Keyring::Alice.into(),
)));
});
}
#[test]
fn query_response_fires() {
use pallet_test_notifier::Event::*;
use pallet_xcm::QueryStatus;
use pezpallet_test_notifier::Event::*;
use pezpallet_xcm::QueryStatus;
use pezkuwi_test_runtime::RuntimeEvent::TestNotifier;
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
let client = TestClientBuilder::new().build();
let mut block_builder = client.init_pezkuwi_block_builder();
@@ -180,9 +180,9 @@ fn query_response_fires() {
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::TestNotifier(
pallet_test_notifier::Call::prepare_new_query {},
pezpallet_test_notifier::Call::prepare_new_query {},
),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
0,
);
@@ -191,7 +191,7 @@ fn query_response_fires() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
let mut query_id = None;
@@ -215,11 +215,11 @@ fn query_response_fires() {
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute {
pezkuwi_test_runtime::RuntimeCall::Xcm(pezpallet_xcm::Call::execute {
message: msg,
max_weight: Weight::from_parts(1_000_000_000, 1024 * 1024),
}),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
1,
);
@@ -228,13 +228,13 @@ fn query_response_fires() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
client.state_at(block_hash).expect("state should exist").inspect_state(|| {
assert!(pezkuwi_test_runtime::System::events().iter().any(|r| matches!(
r.event,
pezkuwi_test_runtime::RuntimeEvent::Xcm(pallet_xcm::Event::ResponseReady {
pezkuwi_test_runtime::RuntimeEvent::Xcm(pezpallet_xcm::Event::ResponseReady {
query_id: q,
response: Response::ExecutionResult(None),
}) if q == query_id,
@@ -251,10 +251,10 @@ fn query_response_fires() {
#[test]
fn query_response_elicits_handler() {
use pallet_test_notifier::Event::*;
use pezpallet_test_notifier::Event::*;
use pezkuwi_test_runtime::RuntimeEvent::TestNotifier;
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
let client = TestClientBuilder::new().build();
let mut block_builder = client.init_pezkuwi_block_builder();
@@ -262,9 +262,9 @@ fn query_response_elicits_handler() {
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::TestNotifier(
pallet_test_notifier::Call::prepare_new_notify_query {},
pezpallet_test_notifier::Call::prepare_new_notify_query {},
),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
0,
);
@@ -273,7 +273,7 @@ fn query_response_elicits_handler() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
let mut query_id = None;
@@ -296,11 +296,11 @@ fn query_response_elicits_handler() {
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute {
pezkuwi_test_runtime::RuntimeCall::Xcm(pezpallet_xcm::Call::execute {
message: Box::new(VersionedXcm::from(msg)),
max_weight: Weight::from_parts(1_000_000_000, 1024 * 1024),
}),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
1,
);
@@ -309,7 +309,7 @@ fn query_response_elicits_handler() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
client.state_at(block_hash).expect("state should exist").inspect_state(|| {
@@ -327,10 +327,10 @@ fn query_response_elicits_handler() {
/// Simulates a cross-chain message from Teyrchain to Teyrchain through Relay Chain
/// that deposits assets into the reserve of the destination.
/// Regression test for `DepositReserveAsset` changes in
/// <https://github.com/paritytech/polkadot-sdk/pull/3340>
/// <https://github.com/pezkuwichain/kurdistan-sdk/issues/113>
#[test]
fn deposit_reserve_asset_works_for_any_xcm_sender() {
sp_tracing::try_init_simple();
pezsp_tracing::try_init_simple();
let client = TestClientBuilder::new().build();
// Init values for the simulated origin Teyrchain
@@ -342,7 +342,7 @@ fn deposit_reserve_asset_works_for_any_xcm_sender() {
let weight_limit = Unlimited;
let reserve = Location::parent();
let dest = Location::new(1, [Teyrchain(2000)]);
let beneficiary_id = sp_keyring::Sr25519Keyring::Alice.to_account_id();
let beneficiary_id = pezsp_keyring::Sr25519Keyring::Alice.to_account_id();
let beneficiary = Location::new(0, [AccountId32 { network: None, id: beneficiary_id.into() }]);
// spends up to half of fees for execution on reserve and other half for execution on
@@ -379,9 +379,9 @@ fn deposit_reserve_asset_works_for_any_xcm_sender() {
// Make the para available, so that `DMP` doesn't reject the XCM because the para is unknown.
let make_para_available = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::Sudo(pallet_sudo::Call::sudo {
pezkuwi_test_runtime::RuntimeCall::Sudo(pezpallet_sudo::Call::sudo {
call: Box::new(pezkuwi_test_runtime::RuntimeCall::System(
frame_system::Call::set_storage {
pezframe_system::Call::set_storage {
items: vec![(
pezkuwi_runtime_teyrchains::paras::Heads::<
pezkuwi_test_runtime::Runtime,
@@ -391,18 +391,18 @@ fn deposit_reserve_asset_works_for_any_xcm_sender() {
},
)),
}),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
0,
);
// Simulate execution of an incoming XCM message at the reserve chain
let execute = construct_extrinsic(
&client,
pezkuwi_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute {
pezkuwi_test_runtime::RuntimeCall::Xcm(pezpallet_xcm::Call::execute {
message: Box::new(VersionedXcm::from(msg)),
max_weight: Weight::from_parts(1_000_000_000, 1024 * 1024),
}),
sp_keyring::Sr25519Keyring::Alice,
pezsp_keyring::Sr25519Keyring::Alice,
1,
);
@@ -414,13 +414,13 @@ fn deposit_reserve_asset_works_for_any_xcm_sender() {
let block = block_builder.build().expect("Finalizes the block").block;
let block_hash = block.hash();
futures::executor::block_on(client.import(sp_consensus::BlockOrigin::Own, block))
futures::executor::block_on(client.import(pezsp_consensus::BlockOrigin::Own, block))
.expect("imports the block");
client.state_at(block_hash).expect("state should exist").inspect_state(|| {
assert!(pezkuwi_test_runtime::System::events().iter().any(|r| matches!(
r.event,
pezkuwi_test_runtime::RuntimeEvent::Xcm(pallet_xcm::Event::Attempted {
pezkuwi_test_runtime::RuntimeEvent::Xcm(pezpallet_xcm::Event::Attempted {
outcome: Outcome::Complete { .. }
}),
)));

Some files were not shown because too many files have changed in this diff Show More