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:
@@ -16,10 +16,10 @@ codec = { workspace = true, default-features = true }
|
||||
paste = { workspace = true, default-features = true }
|
||||
scale-info = { workspace = true }
|
||||
|
||||
frame-support = { workspace = true, default-features = true }
|
||||
frame-system = { workspace = true, default-features = true }
|
||||
sp-io = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
pezframe-support = { workspace = true, default-features = true }
|
||||
pezframe-system = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
|
||||
pezkuwi-core-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||
@@ -31,14 +31,14 @@ xcm-executor = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezkuwi-core-primitives/runtime-benchmarks",
|
||||
"pezkuwi-primitives/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-benchmarks",
|
||||
|
||||
@@ -18,17 +18,17 @@ scale-info = { features = [
|
||||
], workspace = true, default-features = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
frame-support = { workspace = true, default-features = true }
|
||||
frame-system = { workspace = true, default-features = true }
|
||||
pallet-balances = { workspace = true, default-features = true }
|
||||
pallet-message-queue = { workspace = true, default-features = true }
|
||||
pallet-uniques = { workspace = true, default-features = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-io = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
sp-tracing = { workspace = true, default-features = true }
|
||||
pezframe-support = { workspace = true, default-features = true }
|
||||
pezframe-system = { workspace = true, default-features = true }
|
||||
pezpallet-balances = { workspace = true, default-features = true }
|
||||
pezpallet-message-queue = { workspace = true, default-features = true }
|
||||
pezpallet-uniques = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
pezsp-tracing = { workspace = true, default-features = true }
|
||||
|
||||
pallet-xcm = { workspace = true, default-features = true }
|
||||
pezpallet-xcm = { workspace = true, default-features = true }
|
||||
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
|
||||
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
|
||||
xcm = { workspace = true, default-features = true }
|
||||
@@ -37,21 +37,21 @@ xcm-executor = { workspace = true, default-features = true }
|
||||
xcm-simulator = { workspace = true, default-features = true }
|
||||
|
||||
[dev-dependencies]
|
||||
sp-tracing = { workspace = true }
|
||||
pezsp-tracing = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
runtime-benchmarks = [
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-message-queue/runtime-benchmarks",
|
||||
"pallet-uniques/runtime-benchmarks",
|
||||
"pallet-xcm/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-message-queue/runtime-benchmarks",
|
||||
"pezpallet-uniques/runtime-benchmarks",
|
||||
"pezpallet-xcm/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-simulator/runtime-benchmarks",
|
||||
|
||||
@@ -25,13 +25,13 @@ mod relay_chain;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use sp_runtime::BuildStorage;
|
||||
use sp_tracing;
|
||||
use pezsp_runtime::BuildStorage;
|
||||
use pezsp_tracing;
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::ConvertLocation;
|
||||
use xcm_simulator::{decl_test_network, decl_test_relay_chain, decl_test_teyrchain, TestExt};
|
||||
|
||||
pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new([1u8; 32]);
|
||||
pub const ALICE: pezsp_runtime::AccountId32 = pezsp_runtime::AccountId32::new([1u8; 32]);
|
||||
pub const INITIAL_BALANCE: u128 = 1_000_000_000;
|
||||
|
||||
decl_test_teyrchain! {
|
||||
@@ -84,48 +84,48 @@ pub fn child_account_id(para: u32) -> relay_chain::AccountId {
|
||||
relay_chain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
|
||||
}
|
||||
|
||||
pub fn child_account_account_id(para: u32, who: sp_runtime::AccountId32) -> relay_chain::AccountId {
|
||||
pub fn child_account_account_id(para: u32, who: pezsp_runtime::AccountId32) -> relay_chain::AccountId {
|
||||
let location = (Teyrchain(para), AccountId32 { network: None, id: who.into() });
|
||||
relay_chain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
|
||||
}
|
||||
|
||||
pub fn sibling_account_account_id(para: u32, who: sp_runtime::AccountId32) -> teyrchain::AccountId {
|
||||
pub fn sibling_account_account_id(para: u32, who: pezsp_runtime::AccountId32) -> teyrchain::AccountId {
|
||||
let location = (Parent, Teyrchain(para), AccountId32 { network: None, id: who.into() });
|
||||
teyrchain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
|
||||
}
|
||||
|
||||
pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> teyrchain::AccountId {
|
||||
pub fn parent_account_account_id(who: pezsp_runtime::AccountId32) -> teyrchain::AccountId {
|
||||
let location = (Parent, AccountId32 { network: None, id: who.into() });
|
||||
teyrchain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
|
||||
}
|
||||
|
||||
pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
|
||||
pub fn para_ext(para_id: u32) -> pezsp_io::TestExternalities {
|
||||
use teyrchain::{MsgQueue, 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), (parent_account_id(), INITIAL_BALANCE)],
|
||||
..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(|| {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
System::set_block_number(1);
|
||||
MsgQueue::set_para_id(para_id.into());
|
||||
});
|
||||
ext
|
||||
}
|
||||
|
||||
pub fn relay_ext() -> sp_io::TestExternalities {
|
||||
pub fn relay_ext() -> pezsp_io::TestExternalities {
|
||||
use relay_chain::{Runtime, RuntimeOrigin, System, Uniques};
|
||||
|
||||
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),
|
||||
(child_account_id(1), INITIAL_BALANCE),
|
||||
@@ -136,7 +136,7 @@ pub fn relay_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);
|
||||
assert_eq!(Uniques::force_create(RuntimeOrigin::root(), 1, ALICE, true), Ok(()));
|
||||
@@ -145,5 +145,5 @@ pub fn relay_ext() -> sp_io::TestExternalities {
|
||||
ext
|
||||
}
|
||||
|
||||
pub type RelayChainPalletXcm = pallet_xcm::Pallet<relay_chain::Runtime>;
|
||||
pub type TeyrchainPalletXcm = pallet_xcm::Pallet<teyrchain::Runtime>;
|
||||
pub type RelayChainPalletXcm = pezpallet_xcm::Pallet<relay_chain::Runtime>;
|
||||
pub type TeyrchainPalletXcm = pezpallet_xcm::Pallet<teyrchain::Runtime>;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
mod xcm_config;
|
||||
pub use xcm_config::*;
|
||||
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{
|
||||
AsEnsureOriginWithArg, ConstU128, Disabled, Everything, Nothing, ProcessMessage,
|
||||
@@ -28,9 +28,9 @@ use frame_support::{
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
|
||||
use frame_system::EnsureRoot;
|
||||
use sp_core::ConstU32;
|
||||
use sp_runtime::{traits::IdentityLookup, AccountId32};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezsp_core::ConstU32;
|
||||
use pezsp_runtime::{traits::IdentityLookup, AccountId32};
|
||||
|
||||
use pezkuwi_runtime_teyrchains::{
|
||||
configuration,
|
||||
@@ -48,33 +48,33 @@ 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 Balance = Balance;
|
||||
type ExistentialDeposit = ConstU128<1>;
|
||||
type AccountStore = System;
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
impl pezpallet_uniques::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type CollectionId = u32;
|
||||
type ItemId = u32;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<frame_system::EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type CollectionDeposit = frame_support::traits::ConstU128<1_000>;
|
||||
type ItemDeposit = frame_support::traits::ConstU128<1_000>;
|
||||
type MetadataDepositBase = frame_support::traits::ConstU128<1_000>;
|
||||
type AttributeDepositBase = frame_support::traits::ConstU128<1_000>;
|
||||
type DepositPerByte = frame_support::traits::ConstU128<1>;
|
||||
type CreateOrigin = AsEnsureOriginWithArg<pezframe_system::EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = pezframe_system::EnsureRoot<AccountId>;
|
||||
type CollectionDeposit = pezframe_support::traits::ConstU128<1_000>;
|
||||
type ItemDeposit = pezframe_support::traits::ConstU128<1_000>;
|
||||
type MetadataDepositBase = pezframe_support::traits::ConstU128<1_000>;
|
||||
type AttributeDepositBase = pezframe_support::traits::ConstU128<1_000>;
|
||||
type DepositPerByte = pezframe_support::traits::ConstU128<1>;
|
||||
type StringLimit = ConstU32<64>;
|
||||
type KeyLimit = ConstU32<64>;
|
||||
type ValueLimit = ConstU32<128>;
|
||||
@@ -95,7 +95,7 @@ impl configuration::Config for Runtime {
|
||||
pub type LocalOriginToLocation =
|
||||
SignedToAccountId32<RuntimeOrigin, AccountId, constants::RelayNetwork>;
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
impl pezpallet_xcm::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -110,7 +110,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = IsConcrete<constants::TokenLocation>;
|
||||
type TrustedLockers = ();
|
||||
@@ -118,14 +118,14 @@ impl pallet_xcm::Config for Runtime {
|
||||
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 = Disabled;
|
||||
}
|
||||
|
||||
impl origin::Config for Runtime {}
|
||||
|
||||
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.
|
||||
@@ -156,7 +156,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;
|
||||
@@ -172,11 +172,11 @@ impl pallet_message_queue::Config for Runtime {
|
||||
construct_runtime!(
|
||||
pub enum Runtime
|
||||
{
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
ParasOrigin: origin,
|
||||
XcmPallet: pallet_xcm,
|
||||
Uniques: pallet_uniques,
|
||||
MessageQueue: pallet_message_queue,
|
||||
XcmPallet: pezpallet_xcm,
|
||||
Uniques: pezpallet_uniques,
|
||||
MessageQueue: pezpallet_message_queue,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::traits::Everything;
|
||||
use pezframe_support::traits::Everything;
|
||||
use xcm_builder::AllowUnpaidExecutionFrom;
|
||||
|
||||
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -23,7 +23,7 @@ pub mod teleporter;
|
||||
pub mod weigher;
|
||||
|
||||
use crate::relay_chain::{RuntimeCall, XcmPallet};
|
||||
use frame_support::traits::{Everything, Nothing};
|
||||
use pezframe_support::traits::{Everything, Nothing};
|
||||
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, FrameTransactionalProcessor};
|
||||
use xcm_executor::Config;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::relay_chain::RuntimeCall;
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::FixedWeightBounds;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use crate::*;
|
||||
|
||||
use codec::Encode;
|
||||
use frame_support::{assert_ok, weights::Weight};
|
||||
use pezframe_support::{assert_ok, weights::Weight};
|
||||
use xcm::latest::QueryResponseInfo;
|
||||
use xcm_simulator::{mock_message_queue::ReceivedDmp, TestExt};
|
||||
|
||||
@@ -30,8 +30,8 @@ fn buy_execution<C>(fees: impl Into<Asset>) -> Instruction<C> {
|
||||
///
|
||||
/// Example usage:
|
||||
/// ```ignore
|
||||
/// assert!(system_contains_event!(teyrchain, System(frame_system::Event::Remarked { .. })));
|
||||
/// assert!(system_contains_event!(relay_chain, XcmPallet(pallet_xcm::Event::Attempted { .. })));
|
||||
/// assert!(system_contains_event!(teyrchain, System(pezframe_system::Event::Remarked { .. })));
|
||||
/// assert!(system_contains_event!(relay_chain, XcmPallet(pezpallet_xcm::Event::Attempted { .. })));
|
||||
/// ```
|
||||
macro_rules! system_contains_event {
|
||||
($runtime:ident, $variant:ident($($pattern:tt)*)) => {
|
||||
@@ -53,7 +53,7 @@ fn dmp() {
|
||||
MockNet::reset();
|
||||
|
||||
let remark = teyrchain::RuntimeCall::System(
|
||||
frame_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
pezframe_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
);
|
||||
Relay::execute_with(|| {
|
||||
assert_ok!(RelayChainPalletXcm::send_xcm(
|
||||
@@ -68,7 +68,7 @@ fn dmp() {
|
||||
});
|
||||
|
||||
ParaA::execute_with(|| {
|
||||
assert!(system_contains_event!(teyrchain, System(frame_system::Event::Remarked { .. })));
|
||||
assert!(system_contains_event!(teyrchain, System(pezframe_system::Event::Remarked { .. })));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ fn ump() {
|
||||
MockNet::reset();
|
||||
|
||||
let remark = relay_chain::RuntimeCall::System(
|
||||
frame_system::Call::<relay_chain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
pezframe_system::Call::<relay_chain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
);
|
||||
ParaA::execute_with(|| {
|
||||
assert_ok!(TeyrchainPalletXcm::send_xcm(
|
||||
@@ -92,7 +92,7 @@ fn ump() {
|
||||
});
|
||||
|
||||
Relay::execute_with(|| {
|
||||
assert!(system_contains_event!(relay_chain, System(frame_system::Event::Remarked { .. })));
|
||||
assert!(system_contains_event!(relay_chain, System(pezframe_system::Event::Remarked { .. })));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ fn xcmp() {
|
||||
MockNet::reset();
|
||||
|
||||
let remark = teyrchain::RuntimeCall::System(
|
||||
frame_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
pezframe_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
);
|
||||
ParaA::execute_with(|| {
|
||||
assert_ok!(TeyrchainPalletXcm::send_xcm(
|
||||
@@ -116,7 +116,7 @@ fn xcmp() {
|
||||
});
|
||||
|
||||
ParaB::execute_with(|| {
|
||||
assert!(system_contains_event!(teyrchain, System(frame_system::Event::Remarked { .. })));
|
||||
assert!(system_contains_event!(teyrchain, System(pezframe_system::Event::Remarked { .. })));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ fn reserve_transfer() {
|
||||
);
|
||||
// Ensure expected events were emitted
|
||||
let attempted_emitted =
|
||||
system_contains_event!(relay_chain, XcmPallet(pallet_xcm::Event::Attempted { .. }));
|
||||
system_contains_event!(relay_chain, XcmPallet(pezpallet_xcm::Event::Attempted { .. }));
|
||||
let sent_emitted =
|
||||
system_contains_event!(relay_chain, XcmPallet(pallet_xcm::Event::Sent { .. }));
|
||||
system_contains_event!(relay_chain, XcmPallet(pezpallet_xcm::Event::Sent { .. }));
|
||||
assert!(attempted_emitted, "Expected XcmPallet::Attempted event emitted");
|
||||
assert!(sent_emitted, "Expected XcmPallet::Sent event emitted");
|
||||
});
|
||||
@@ -151,7 +151,7 @@ fn reserve_transfer() {
|
||||
ParaA::execute_with(|| {
|
||||
// free execution, full amount received
|
||||
assert_eq!(
|
||||
pallet_balances::Pallet::<teyrchain::Runtime>::free_balance(&ALICE),
|
||||
pezpallet_balances::Pallet::<teyrchain::Runtime>::free_balance(&ALICE),
|
||||
INITIAL_BALANCE + withdraw_amount
|
||||
);
|
||||
});
|
||||
@@ -159,7 +159,7 @@ fn reserve_transfer() {
|
||||
|
||||
#[test]
|
||||
fn reserve_transfer_with_error() {
|
||||
use sp_tracing::{
|
||||
use pezsp_tracing::{
|
||||
test_log_capture::init_log_capture,
|
||||
tracing::{subscriber, Level},
|
||||
};
|
||||
@@ -191,7 +191,7 @@ fn reserve_transfer_with_error() {
|
||||
|
||||
// Verify that XcmPallet::Attempted was NOT emitted (rollback happened)
|
||||
let xcm_attempted_emitted =
|
||||
system_contains_event!(relay_chain, XcmPallet(pallet_xcm::Event::Attempted { .. }));
|
||||
system_contains_event!(relay_chain, XcmPallet(pezpallet_xcm::Event::Attempted { .. }));
|
||||
assert!(
|
||||
!xcm_attempted_emitted,
|
||||
"Expected no XcmPallet::Attempted event due to rollback, but it was emitted"
|
||||
@@ -201,7 +201,7 @@ fn reserve_transfer_with_error() {
|
||||
// Ensure no balance change due to the error
|
||||
ParaA::execute_with(|| {
|
||||
assert_eq!(
|
||||
pallet_balances::Pallet::<teyrchain::Runtime>::free_balance(&ALICE),
|
||||
pezpallet_balances::Pallet::<teyrchain::Runtime>::free_balance(&ALICE),
|
||||
INITIAL_BALANCE
|
||||
);
|
||||
});
|
||||
@@ -223,7 +223,7 @@ fn remote_locking_and_unlocking() {
|
||||
});
|
||||
|
||||
Relay::execute_with(|| {
|
||||
use pallet_balances::{BalanceLock, Reasons};
|
||||
use pezpallet_balances::{BalanceLock, Reasons};
|
||||
assert_eq!(
|
||||
relay_chain::Balances::locks(&child_account_id(2)),
|
||||
vec![BalanceLock { id: *b"py/xcmlk", amount: locked_amount, reasons: Reasons::All }]
|
||||
@@ -250,7 +250,7 @@ fn remote_locking_and_unlocking() {
|
||||
});
|
||||
|
||||
Relay::execute_with(|| {
|
||||
use pallet_balances::{BalanceLock, Reasons};
|
||||
use pezpallet_balances::{BalanceLock, Reasons};
|
||||
// Lock is reduced
|
||||
assert_eq!(
|
||||
relay_chain::Balances::locks(&child_account_id(2)),
|
||||
@@ -358,7 +358,7 @@ fn teleport_nft() {
|
||||
/// Asserts that the teyrchain accounts are updated as expected.
|
||||
#[test]
|
||||
fn reserve_asset_transfer_nft() {
|
||||
sp_tracing::init_for_tests();
|
||||
pezsp_tracing::init_for_tests();
|
||||
MockNet::reset();
|
||||
|
||||
Relay::execute_with(|| {
|
||||
@@ -445,7 +445,7 @@ fn reserve_asset_class_create_and_reserve_transfer() {
|
||||
let message = Xcm(vec![Transact {
|
||||
origin_kind: OriginKind::Xcm,
|
||||
call: teyrchain::RuntimeCall::from(
|
||||
pallet_uniques::Call::<teyrchain::Runtime>::create {
|
||||
pezpallet_uniques::Call::<teyrchain::Runtime>::create {
|
||||
collection: (Parent, 2u64).into(),
|
||||
admin: parent_account_id(),
|
||||
},
|
||||
@@ -544,7 +544,7 @@ fn query_holding() {
|
||||
// Send withdraw and deposit with query holding
|
||||
assert_ok!(TeyrchainPalletXcm::send_xcm(Here, Parent, message.clone(),));
|
||||
|
||||
VersionedXcm::from(message).using_encoded(sp_core::blake2_256)
|
||||
VersionedXcm::from(message).using_encoded(pezsp_core::blake2_256)
|
||||
});
|
||||
|
||||
// Check that transfer was executed
|
||||
|
||||
@@ -20,16 +20,16 @@ mod xcm_config;
|
||||
pub use xcm_config::*;
|
||||
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{
|
||||
ConstU128, ContainsPair, Disabled, EnsureOrigin, EnsureOriginWithArg, Everything, Nothing,
|
||||
},
|
||||
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use sp_core::ConstU32;
|
||||
use sp_runtime::{
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezsp_core::ConstU32;
|
||||
use pezsp_runtime::{
|
||||
traits::{Get, IdentityLookup},
|
||||
AccountId32,
|
||||
};
|
||||
@@ -45,16 +45,16 @@ 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 Balance = Balance;
|
||||
type ExistentialDeposit = ConstU128<1>;
|
||||
type AccountStore = System;
|
||||
@@ -63,7 +63,7 @@ impl pallet_balances::Config for Runtime {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub struct UniquesHelper;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl pallet_uniques::BenchmarkHelper<Location, AssetInstance> for UniquesHelper {
|
||||
impl pezpallet_uniques::BenchmarkHelper<Location, AssetInstance> for UniquesHelper {
|
||||
fn collection(i: u16) -> Location {
|
||||
GeneralIndex(i as u128).into()
|
||||
}
|
||||
@@ -72,18 +72,18 @@ impl pallet_uniques::BenchmarkHelper<Location, AssetInstance> for UniquesHelper
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
impl pezpallet_uniques::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type CollectionId = Location;
|
||||
type ItemId = AssetInstance;
|
||||
type Currency = Balances;
|
||||
type CreateOrigin = ForeignCreators;
|
||||
type ForceOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type CollectionDeposit = frame_support::traits::ConstU128<1_000>;
|
||||
type ItemDeposit = frame_support::traits::ConstU128<1_000>;
|
||||
type MetadataDepositBase = frame_support::traits::ConstU128<1_000>;
|
||||
type AttributeDepositBase = frame_support::traits::ConstU128<1_000>;
|
||||
type DepositPerByte = frame_support::traits::ConstU128<1>;
|
||||
type ForceOrigin = pezframe_system::EnsureRoot<AccountId>;
|
||||
type CollectionDeposit = pezframe_support::traits::ConstU128<1_000>;
|
||||
type ItemDeposit = pezframe_support::traits::ConstU128<1_000>;
|
||||
type MetadataDepositBase = pezframe_support::traits::ConstU128<1_000>;
|
||||
type AttributeDepositBase = pezframe_support::traits::ConstU128<1_000>;
|
||||
type DepositPerByte = pezframe_support::traits::ConstU128<1>;
|
||||
type StringLimit = ConstU32<64>;
|
||||
type KeyLimit = ConstU32<64>;
|
||||
type ValueLimit = ConstU32<128>;
|
||||
@@ -103,7 +103,7 @@ impl EnsureOriginWithArg<RuntimeOrigin, Location> for ForeignCreators {
|
||||
o: RuntimeOrigin,
|
||||
a: &Location,
|
||||
) -> core::result::Result<Self::Success, RuntimeOrigin> {
|
||||
let origin_location = pallet_xcm::EnsureXcm::<Everything>::try_origin(o.clone())?;
|
||||
let origin_location = pezpallet_xcm::EnsureXcm::<Everything>::try_origin(o.clone())?;
|
||||
if !a.starts_with(&origin_location) {
|
||||
return Err(o);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ impl EnsureOriginWithArg<RuntimeOrigin, Location> for ForeignCreators {
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn try_successful_origin(a: &Location) -> Result<RuntimeOrigin, ()> {
|
||||
Ok(pallet_xcm::Origin::Xcm(a.clone()).into())
|
||||
Ok(pezpallet_xcm::Origin::Xcm(a.clone()).into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ parameter_types! {
|
||||
|
||||
pub type TrustedLockers = TrustedLockerCase<RelayTokenForRelay>;
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
impl pezpallet_xcm::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -158,7 +158,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = ();
|
||||
type TrustedLockers = TrustedLockers;
|
||||
@@ -166,19 +166,19 @@ impl pallet_xcm::Config for Runtime {
|
||||
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 = Disabled;
|
||||
}
|
||||
|
||||
type Block = frame_system::mocking::MockBlock<Runtime>;
|
||||
type Block = pezframe_system::mocking::MockBlock<Runtime>;
|
||||
|
||||
construct_runtime!(
|
||||
pub struct Runtime {
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
MsgQueue: mock_message_queue,
|
||||
PezkuwiXcm: pallet_xcm,
|
||||
ForeignUniques: pallet_uniques,
|
||||
PezkuwiXcm: pezpallet_xcm,
|
||||
ForeignUniques: pezpallet_uniques,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::traits::Everything;
|
||||
use pezframe_support::traits::Everything;
|
||||
use xcm_builder::AllowUnpaidExecutionFrom;
|
||||
|
||||
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::teyrchain::Runtime;
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_simulator::mock_message_queue::TeyrchainId;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ pub mod teleporter;
|
||||
pub mod weigher;
|
||||
|
||||
use crate::teyrchain::{MsgQueue, PezkuwiXcm, RuntimeCall};
|
||||
use frame_support::traits::{Everything, Nothing};
|
||||
use pezframe_support::traits::{Everything, Nothing};
|
||||
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, FrameTransactionalProcessor};
|
||||
|
||||
// Generated from `decl_test_network!`
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use crate::teyrchain::{
|
||||
constants::RelayNetwork, location_converter::LocationConverter, RuntimeOrigin,
|
||||
};
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use xcm_builder::{SignedAccountId32AsNative, SovereignSignedViaLocation};
|
||||
|
||||
type XcmOriginToCallOrigin = (
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::teyrchain::teleporter::TrustedTeleporters;
|
||||
use frame_support::traits::EverythingBut;
|
||||
use pezframe_support::traits::EverythingBut;
|
||||
use xcm_builder::NativeAsset;
|
||||
|
||||
pub type TrustedReserves = (NativeAsset, EverythingBut<TrustedTeleporters>);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::teyrchain::RuntimeCall;
|
||||
use frame_support::parameter_types;
|
||||
use pezframe_support::parameter_types;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::FixedWeightBounds;
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@ scale-info = { features = [
|
||||
"derive",
|
||||
], workspace = true, default-features = true }
|
||||
|
||||
frame-executive = { workspace = true, default-features = true }
|
||||
frame-support = { workspace = true, default-features = true }
|
||||
frame-system = { workspace = true, default-features = true }
|
||||
frame-try-runtime = { workspace = true, default-features = true }
|
||||
pallet-balances = { workspace = true, default-features = true }
|
||||
pallet-message-queue = { workspace = true, default-features = true }
|
||||
sp-core = { workspace = true, default-features = true }
|
||||
sp-io = { workspace = true, default-features = true }
|
||||
sp-runtime = { workspace = true, default-features = true }
|
||||
pezframe-executive = { workspace = true, default-features = true }
|
||||
pezframe-support = { workspace = true, default-features = true }
|
||||
pezframe-system = { workspace = true, default-features = true }
|
||||
pezframe-try-runtime = { workspace = true, default-features = true }
|
||||
pezpallet-balances = { workspace = true, default-features = true }
|
||||
pezpallet-message-queue = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
pezsp-runtime = { workspace = true, default-features = true }
|
||||
|
||||
pallet-xcm = { workspace = true, default-features = true }
|
||||
pezpallet-xcm = { workspace = true, default-features = true }
|
||||
pezkuwi-core-primitives = { workspace = true, default-features = true }
|
||||
pezkuwi-runtime-teyrchains = { workspace = true, default-features = true }
|
||||
pezkuwi-teyrchain-primitives = { workspace = true, default-features = true }
|
||||
@@ -43,29 +43,29 @@ xcm-simulator = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
try-runtime = [
|
||||
"frame-executive/try-runtime",
|
||||
"frame-support/try-runtime",
|
||||
"frame-system/try-runtime",
|
||||
"frame-try-runtime/try-runtime",
|
||||
"pallet-balances/try-runtime",
|
||||
"pallet-message-queue/try-runtime",
|
||||
"pallet-xcm/try-runtime",
|
||||
"pezframe-executive/try-runtime",
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezframe-try-runtime/try-runtime",
|
||||
"pezpallet-balances/try-runtime",
|
||||
"pezpallet-message-queue/try-runtime",
|
||||
"pezpallet-xcm/try-runtime",
|
||||
"pezkuwi-runtime-teyrchains/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-executive/runtime-benchmarks",
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"frame-try-runtime/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-message-queue/runtime-benchmarks",
|
||||
"pallet-xcm/runtime-benchmarks",
|
||||
"pezframe-executive/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezframe-try-runtime/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-message-queue/runtime-benchmarks",
|
||||
"pezpallet-xcm/runtime-benchmarks",
|
||||
"pezkuwi-core-primitives/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-simulator/runtime-benchmarks",
|
||||
|
||||
@@ -25,12 +25,12 @@ mod relay_chain;
|
||||
use codec::DecodeLimit;
|
||||
use pezkuwi_core_primitives::AccountId;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use sp_runtime::{traits::AccountIdConversion, BuildStorage};
|
||||
use pezsp_runtime::{traits::AccountIdConversion, BuildStorage};
|
||||
use xcm_simulator::{decl_test_network, decl_test_relay_chain, decl_test_teyrchain, TestExt};
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use frame_support::traits::{TryState, TryStateSelect::All};
|
||||
use frame_support::{assert_ok, traits::IntegrityTest};
|
||||
use pezframe_support::traits::{TryState, TryStateSelect::All};
|
||||
use pezframe_support::{assert_ok, traits::IntegrityTest};
|
||||
use xcm::{latest::prelude::*, MAX_XCM_DECODE_DEPTH};
|
||||
|
||||
use arbitrary::{Arbitrary, Error, Unstructured};
|
||||
@@ -115,19 +115,19 @@ pub fn para_account_id(id: u32) -> relay_chain::AccountId {
|
||||
ParaId::from(id).into_account_truncating()
|
||||
}
|
||||
|
||||
pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
|
||||
pub fn para_ext(para_id: u32) -> pezsp_io::TestExternalities {
|
||||
use teyrchain::{MsgQueue, 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: (0..6).map(|i| ([i; 32].into(), INITIAL_BALANCE)).collect(),
|
||||
..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);
|
||||
MsgQueue::set_para_id(para_id.into());
|
||||
@@ -135,26 +135,26 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
|
||||
ext
|
||||
}
|
||||
|
||||
pub fn relay_ext() -> sp_io::TestExternalities {
|
||||
pub fn relay_ext() -> pezsp_io::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();
|
||||
|
||||
let mut balances: Vec<(AccountId, u128)> = vec![];
|
||||
balances.append(&mut (1..=3).map(|i| (para_account_id(i), INITIAL_BALANCE)).collect());
|
||||
balances.append(&mut (0..6).map(|i| ([i; 32].into(), INITIAL_BALANCE)).collect());
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
pub type RelayChainPalletXcm = pallet_xcm::Pallet<relay_chain::Runtime>;
|
||||
pub type TeyrchainPalletXcm = pallet_xcm::Pallet<teyrchain::Runtime>;
|
||||
pub type RelayChainPalletXcm = pezpallet_xcm::Pallet<relay_chain::Runtime>;
|
||||
pub type TeyrchainPalletXcm = pezpallet_xcm::Pallet<teyrchain::Runtime>;
|
||||
|
||||
// We check XCM messages recursively for blocklisted messages
|
||||
fn recursively_matches_blocklisted_messages(message: &Instruction<()>) -> bool {
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
//! Relay chain runtime mock.
|
||||
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{Disabled, Everything, Nothing, ProcessMessage, ProcessMessageError},
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
|
||||
use frame_system::EnsureRoot;
|
||||
use sp_core::ConstU32;
|
||||
use sp_runtime::{
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezsp_core::ConstU32;
|
||||
use pezsp_runtime::{
|
||||
generic,
|
||||
traits::{BlakeTwo256, IdentifyAccount, Verify},
|
||||
MultiAddress, MultiSignature,
|
||||
@@ -45,7 +45,7 @@ use xcm_builder::{
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
|
||||
pub type TxExtension = (frame_system::CheckNonZeroSender<Runtime>,);
|
||||
pub type TxExtension = (pezframe_system::CheckNonZeroSender<Runtime>,);
|
||||
|
||||
pub type BlockNumber = u64;
|
||||
pub type Address = MultiAddress<AccountId, ()>;
|
||||
@@ -62,20 +62,20 @@ parameter_types! {
|
||||
pub const BlockHashCount: u32 = 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 = sp_runtime::traits::AccountIdLookup<AccountId, ()>;
|
||||
type Lookup = pezsp_runtime::traits::AccountIdLookup<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 Runtime {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Runtime {
|
||||
type Balance = Balance;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = System;
|
||||
@@ -155,7 +155,7 @@ impl Config for XcmConfig {
|
||||
|
||||
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>;
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
impl pezpallet_xcm::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -170,7 +170,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = ();
|
||||
type TrustedLockers = ();
|
||||
@@ -178,7 +178,7 @@ impl pallet_xcm::Config for Runtime {
|
||||
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 = Disabled;
|
||||
}
|
||||
@@ -214,7 +214,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;
|
||||
@@ -225,7 +225,7 @@ impl pallet_message_queue::Config for Runtime {
|
||||
type MessageProcessor = MessageProcessor;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type MessageProcessor =
|
||||
pallet_message_queue::mock_helpers::NoopMessageProcessor<AggregateMessageOrigin>;
|
||||
pezpallet_message_queue::mock_helpers::NoopMessageProcessor<AggregateMessageOrigin>;
|
||||
type QueueChangeHandler = ();
|
||||
type QueuePausedQuery = ();
|
||||
type WeightInfo = ();
|
||||
@@ -234,10 +234,10 @@ impl pallet_message_queue::Config for Runtime {
|
||||
construct_runtime!(
|
||||
pub enum Runtime
|
||||
{
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
ParasOrigin: origin,
|
||||
XcmPallet: pallet_xcm,
|
||||
MessageQueue: pallet_message_queue,
|
||||
XcmPallet: pezpallet_xcm,
|
||||
MessageQueue: pezpallet_message_queue,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -17,20 +17,20 @@
|
||||
//! Teyrchain runtime mock.
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types,
|
||||
traits::{Disabled, Everything, Nothing},
|
||||
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
|
||||
};
|
||||
|
||||
use frame_system::EnsureRoot;
|
||||
use sp_runtime::{
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezsp_runtime::{
|
||||
generic,
|
||||
traits::{AccountIdLookup, BlakeTwo256, Hash, IdentifyAccount, Verify},
|
||||
MultiAddress, MultiSignature,
|
||||
};
|
||||
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use pezkuwi_core_primitives::BlockNumber as RelayBlockNumber;
|
||||
use pezkuwi_teyrchain_primitives::primitives::{
|
||||
DmpMessageHandler, Id as ParaId, Sibling, XcmpMessageFormat, XcmpMessageHandler,
|
||||
@@ -44,7 +44,7 @@ use xcm_builder::{
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
|
||||
pub type TxExtension = (frame_system::CheckNonZeroSender<Runtime>,);
|
||||
pub type TxExtension = (pezframe_system::CheckNonZeroSender<Runtime>,);
|
||||
|
||||
pub type BlockNumber = u64;
|
||||
pub type Address = MultiAddress<AccountId, ()>;
|
||||
@@ -61,20 +61,20 @@ parameter_types! {
|
||||
pub const BlockHashCount: u32 = 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 = AccountIdLookup<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 Runtime {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Runtime {
|
||||
type Balance = Balance;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = System;
|
||||
@@ -150,15 +150,15 @@ impl Config for XcmConfig {
|
||||
type XcmRecorder = ();
|
||||
}
|
||||
|
||||
#[frame_support::pallet]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod mock_msg_queue {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[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>;
|
||||
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ pub mod mock_msg_queue {
|
||||
max_weight: Weight,
|
||||
) -> Result<Weight, XcmError> {
|
||||
let hash = Encode::using_encoded(&xcm, T::Hashing::hash);
|
||||
let mut message_hash = xcm.using_encoded(sp_io::hashing::blake2_256);
|
||||
let mut message_hash = xcm.using_encoded(pezsp_io::hashing::blake2_256);
|
||||
let (result, event) = match Xcm::<T::RuntimeCall>::try_from(xcm) {
|
||||
Ok(xcm) => {
|
||||
let location = Location::new(1, [Teyrchain(sender.into())]);
|
||||
@@ -285,7 +285,7 @@ pub mod mock_msg_queue {
|
||||
limit: Weight,
|
||||
) -> Weight {
|
||||
for (_i, (_sent_at, data)) in iter.enumerate() {
|
||||
let mut id = sp_io::hashing::blake2_256(&data[..]);
|
||||
let mut id = pezsp_io::hashing::blake2_256(&data[..]);
|
||||
let maybe_msg = VersionedXcm::<T::RuntimeCall>::decode(&mut &data[..])
|
||||
.map(Xcm::<T::RuntimeCall>::try_from);
|
||||
match maybe_msg {
|
||||
@@ -320,7 +320,7 @@ impl mock_msg_queue::Config for Runtime {
|
||||
|
||||
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
impl pezpallet_xcm::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type SendXcmOrigin = EnsureXcmOrigin<RuntimeOrigin, LocalOriginToLocation>;
|
||||
type XcmRouter = XcmRouter;
|
||||
@@ -334,15 +334,15 @@ impl pallet_xcm::Config for Runtime {
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = ();
|
||||
type TrustedLockers = ();
|
||||
type SovereignAccountOf = LocationToAccountId;
|
||||
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;
|
||||
}
|
||||
@@ -350,9 +350,9 @@ impl pallet_xcm::Config for Runtime {
|
||||
construct_runtime!(
|
||||
pub enum Runtime
|
||||
{
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
MsgQueue: mock_msg_queue,
|
||||
PezkuwiXcm: pallet_xcm,
|
||||
PezkuwiXcm: pezpallet_xcm,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -27,11 +27,11 @@ pub use paste;
|
||||
|
||||
pub use alloc::collections::vec_deque::VecDeque;
|
||||
pub use core::{cell::RefCell, marker::PhantomData};
|
||||
pub use frame_support::{
|
||||
pub use pezframe_support::{
|
||||
traits::{EnqueueMessage, Get, ProcessMessage, ProcessMessageError, ServiceQueues},
|
||||
weights::{Weight, WeightMeter},
|
||||
};
|
||||
pub use sp_io::{hashing::blake2_256, TestExternalities};
|
||||
pub use pezsp_io::{hashing::blake2_256, TestExternalities};
|
||||
|
||||
pub use pezkuwi_core_primitives::BlockNumber as RelayBlockNumber;
|
||||
pub use pezkuwi_runtime_teyrchains::{
|
||||
@@ -48,7 +48,7 @@ pub use xcm_executor::XcmExecutor;
|
||||
|
||||
pub trait TestExt {
|
||||
/// Initialize the test environment.
|
||||
fn new_ext() -> sp_io::TestExternalities;
|
||||
fn new_ext() -> pezsp_io::TestExternalities;
|
||||
/// Resets the state of the test environment.
|
||||
fn reset_ext();
|
||||
/// Execute code in the context of the test externalities, without automatic
|
||||
@@ -149,7 +149,7 @@ macro_rules! decl_test_relay_chain {
|
||||
|
||||
match &event.event {
|
||||
runtime_event::MessageQueue(
|
||||
pallet_message_queue::Event::Processed {origin, ..}) => {
|
||||
pezpallet_message_queue::Event::Processed {origin, ..}) => {
|
||||
assert_eq!(origin, &AggregateMessageOrigin::Ump(UmpQueueId::Para(para)));
|
||||
},
|
||||
event => panic!("Unexpected event: {:#?}", event),
|
||||
@@ -455,7 +455,7 @@ macro_rules! decl_test_network {
|
||||
|
||||
pub mod helpers {
|
||||
use super::*;
|
||||
use sp_runtime::testing::H256;
|
||||
use pezsp_runtime::testing::H256;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
/// Derives a topic ID for an XCM in tests.
|
||||
@@ -472,7 +472,7 @@ pub mod helpers {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use sp_runtime::testing::H256;
|
||||
/// use pezsp_runtime::testing::H256;
|
||||
/// use xcm_simulator::helpers::TopicIdTracker;
|
||||
///
|
||||
/// // Dummy topic IDs
|
||||
@@ -612,7 +612,7 @@ pub mod helpers {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use sp_runtime::testing::H256;
|
||||
use pezsp_runtime::testing::H256;
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Expected exactly one topic ID")]
|
||||
|
||||
@@ -22,21 +22,21 @@ use pezkuwi_primitives::BlockNumber as RelayBlockNumber;
|
||||
use pezkuwi_teyrchain_primitives::primitives::{
|
||||
DmpMessageHandler, Id as ParaId, XcmpMessageFormat, XcmpMessageHandler,
|
||||
};
|
||||
use sp_runtime::traits::{Get, Hash};
|
||||
use pezsp_runtime::traits::{Get, Hash};
|
||||
|
||||
use xcm::{latest::prelude::*, VersionedXcm};
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
#[frame_support::pallet]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[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>;
|
||||
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ pub mod pallet {
|
||||
max_weight: xcm::latest::Weight,
|
||||
) -> Result<xcm::latest::Weight, XcmError> {
|
||||
let hash = Encode::using_encoded(&xcm, T::Hashing::hash);
|
||||
let mut message_hash = Encode::using_encoded(&xcm, sp_io::hashing::blake2_256);
|
||||
let mut message_hash = Encode::using_encoded(&xcm, pezsp_io::hashing::blake2_256);
|
||||
let (result, event) = match Xcm::<T::RuntimeCall>::try_from(xcm) {
|
||||
Ok(xcm) => {
|
||||
let location = (Parent, Teyrchain(sender.into()));
|
||||
@@ -159,7 +159,7 @@ pub mod pallet {
|
||||
limit: Weight,
|
||||
) -> Weight {
|
||||
for (_sent_at, data) in iter {
|
||||
let mut id = sp_io::hashing::blake2_256(&data[..]);
|
||||
let mut id = pezsp_io::hashing::blake2_256(&data[..]);
|
||||
let maybe_versioned = VersionedXcm::<T::RuntimeCall>::decode(&mut &data[..]);
|
||||
match maybe_versioned {
|
||||
Err(_) => {
|
||||
|
||||
Reference in New Issue
Block a user