Complete terminology rebrand to Pezkuwi ecosystem

Applied global changes: Polkadot->Pezkuwi, Parachain->TeyrChain, pallet->pezpallet, frame->pezframe.

Updated authors in Cargo.toml to include Kurdistan Tech Institute and pezkuwichain team.

Used Cargo aliases to maintain SDK compatibility while using rebranded names in source code.
This commit is contained in:
2025-12-22 09:03:43 +03:00
parent a52909422a
commit d839cbd92b
180 changed files with 3537 additions and 2889 deletions
+27 -27
View File
@@ -1,29 +1,29 @@
pub mod parachain;
pub mod teyrchain;
pub mod relay_chain;
use sp_runtime::BuildStorage;
use sp_tracing;
use xcm::prelude::*;
use xcm_executor::traits::ConvertLocation;
use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt};
use xcm_simulator::{decl_test_network, decl_test_teyrchain, decl_test_relay_chain, TestExt};
pub const ALICE: sp_runtime::AccountId32 = sp_runtime::AccountId32::new([1u8; 32]);
pub const INITIAL_BALANCE: u128 = 1_000_000_000;
decl_test_parachain! {
decl_test_teyrchain! {
pub struct ParaA {
Runtime = parachain::Runtime,
XcmpMessageHandler = parachain::MsgQueue,
DmpMessageHandler = parachain::MsgQueue,
Runtime = teyrchain::Runtime,
XcmpMessageHandler = teyrchain::MsgQueue,
DmpMessageHandler = teyrchain::MsgQueue,
new_ext = para_ext(1),
}
}
decl_test_parachain! {
decl_test_teyrchain! {
pub struct ParaB {
Runtime = parachain::Runtime,
XcmpMessageHandler = parachain::MsgQueue,
DmpMessageHandler = parachain::MsgQueue,
Runtime = teyrchain::Runtime,
XcmpMessageHandler = teyrchain::MsgQueue,
DmpMessageHandler = teyrchain::MsgQueue,
new_ext = para_ext(2),
}
}
@@ -43,44 +43,44 @@ decl_test_relay_chain! {
decl_test_network! {
pub struct MockNet {
relay_chain = Relay,
parachains = vec![
teyrchains = vec![
(1, ParaA),
(2, ParaB),
],
}
}
pub fn parent_account_id() -> parachain::AccountId {
pub fn parent_account_id() -> teyrchain::AccountId {
let location = (Parent,);
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
teyrchain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
}
pub fn child_account_id(para: u32) -> relay_chain::AccountId {
let location = (Parachain(para),);
let location = (TeyrChain(para),);
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 {
let location = (Parachain(para), AccountId32 { network: None, id: who.into() });
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) -> parachain::AccountId {
let location = (Parent, Parachain(para), AccountId32 { network: None, id: who.into() });
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
pub fn sibling_account_account_id(para: u32, who: sp_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) -> parachain::AccountId {
pub fn parent_account_account_id(who: sp_runtime::AccountId32) -> teyrchain::AccountId {
let location = (Parent, AccountId32 { network: None, id: who.into() });
parachain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
teyrchain::location_converter::LocationConverter::convert_location(&location.into()).unwrap()
}
pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
use parachain::{MsgQueue, Runtime, System};
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()
}
@@ -99,9 +99,9 @@ pub fn para_ext(para_id: u32) -> sp_io::TestExternalities {
pub fn relay_ext() -> sp_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();
pallet_balances::GenesisConfig::<Runtime> {
pezpallet_balances::GenesisConfig::<Runtime> {
balances: vec![
(ALICE, INITIAL_BALANCE),
(child_account_id(1), INITIAL_BALANCE),
@@ -119,5 +119,5 @@ pub fn relay_ext() -> sp_io::TestExternalities {
ext
}
pub type RelayChainPalletXcm = pallet_xcm::Pallet<relay_chain::Runtime>;
pub type ParachainPalletXcm = pallet_xcm::Pallet<parachain::Runtime>;
pub type RelayChainPezpalletXcm = pezpallet_xcm::Pallet<relay_chain::Runtime>;
pub type TeyrChainPezpalletXcm = pezpallet_xcm::Pallet<teyrchain::Runtime>;
@@ -1,13 +1,13 @@
//! Relay chain runtime mock.
mod xcm_config;
use frame_support::{
use pezframe_support::{
construct_runtime, derive_impl, parameter_types,
traits::{ConstU128, Disabled, Everything, Nothing, ProcessMessage, ProcessMessageError},
weights::{Weight, WeightMeter},
};
use frame_system::EnsureRoot;
use polkadot_runtime_parachains::{
use pezframe_system::EnsureRoot;
use pezkuwi_runtime_teyrchains::{
configuration,
inclusion::{AggregateMessageOrigin, UmpQueueId},
origin, shared,
@@ -26,16 +26,16 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
type AccountData = pezpallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type Block = Block;
type Lookup = IdentityLookup<Self::AccountId>;
}
#[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 Balance = Balance;
type ExistentialDeposit = ConstU128<1>;
@@ -52,9 +52,9 @@ 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 AdminOrigin = EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
// Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`.
type AuthorizedAliasConsideration = Disabled;
type Currency = Balances;
@@ -72,7 +72,7 @@ impl pallet_xcm::Config for Runtime {
type TrustedLockers = ();
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type WeightInfo = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
type XcmExecuteFilter = Nothing;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmReserveTransferFilter = Everything;
@@ -84,7 +84,7 @@ 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>;
parameter_types! {
/// Amount of weight that can be spent per block to service messages.
@@ -93,7 +93,7 @@ parameter_types! {
pub const MessageQueueMaxStale: u32 = 16;
}
/// Message processor to handle any messages that were enqueued into the `MessageQueue` pallet.
/// Message processor to handle any messages that were enqueued into the `MessageQueue` pezpallet.
pub struct MessageProcessor;
impl ProcessMessage for MessageProcessor {
type Origin = AggregateMessageOrigin;
@@ -111,11 +111,11 @@ impl ProcessMessage for MessageProcessor {
Junction,
xcm_executor::XcmExecutor<XcmConfig>,
RuntimeCall,
>::process_message(message, Junction::Parachain(para.into()), meter, id)
>::process_message(message, Junction::TeyrChain(para.into()), meter, id)
}
}
impl pallet_message_queue::Config for Runtime {
impl pezpallet_message_queue::Config for Runtime {
type HeapSize = MessageQueueHeapSize;
type IdleMaxServiceWeight = ();
type MaxStale = MessageQueueMaxStale;
@@ -131,10 +131,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,
XcmPezpallet: pezpallet_xcm,
MessageQueue: pezpallet_message_queue,
}
);
@@ -1,4 +1,4 @@
use frame_support::traits::Everything;
use pezframe_support::traits::Everything;
use xcm_builder::AllowUnpaidExecutionFrom;
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
@@ -1,4 +1,4 @@
use frame_support::parameter_types;
use pezframe_support::parameter_types;
use xcm::latest::prelude::*;
parameter_types! {
@@ -5,11 +5,11 @@ pub mod location_converter;
pub mod origin_converter;
pub mod weigher;
use frame_support::traits::{Everything, Nothing};
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, FrameTransactionalProcessor};
use pezframe_support::traits::{Everything, Nothing};
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, PezframeTransactionalProcessor};
use xcm_executor::Config;
use crate::xcm_mock::relay_chain::{RuntimeCall, XcmPallet};
use crate::xcm_mock::relay_chain::{RuntimeCall, XcmPezpallet};
// Generated from `decl_test_network!`
pub type XcmRouter = EnsureDecodableXcm<crate::xcm_mock::RelayChainXcmRouter>;
@@ -19,7 +19,7 @@ impl Config for XcmConfig {
type Aliasers = Nothing;
type AssetClaims = ();
type AssetExchanger = ();
type AssetLocker = XcmPallet;
type AssetLocker = XcmPezpallet;
type AssetTransactor = asset_transactor::AssetTransactor;
type AssetTrap = ();
type Barrier = barrier::Barrier;
@@ -33,17 +33,17 @@ impl Config for XcmConfig {
type MaxAssetsIntoHolding = constants::MaxAssetsIntoHolding;
type MessageExporter = ();
type OriginConverter = origin_converter::OriginConverter;
type PalletInstancesInfo = ();
type PezpalletInstancesInfo = ();
type ResponseHandler = ();
type RuntimeCall = RuntimeCall;
type SafeCallFilter = Everything;
type SubscriptionService = ();
type Trader = FixedRateOfFungible<constants::TokensPerSecondPerByte, ()>;
type TransactionalProcessor = FrameTransactionalProcessor;
type TransactionalProcessor = PezframeTransactionalProcessor;
type UniversalAliases = Nothing;
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type XcmEventEmitter = XcmPallet;
type XcmRecorder = XcmPallet;
type XcmEventEmitter = XcmPezpallet;
type XcmRecorder = XcmPezpallet;
type XcmSender = XcmRouter;
}
@@ -1,7 +1,7 @@
use polkadot_parachain_primitives::primitives::Id as ParaId;
use polkadot_runtime_parachains::origin;
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
use pezkuwi_runtime_teyrchains::origin;
use xcm_builder::{
ChildParachainAsNative, ChildSystemParachainAsSuperuser, SignedAccountId32AsNative,
ChildTeyrChainAsNative, ChildSystemTeyrChainAsSuperuser, SignedAccountId32AsNative,
SovereignSignedViaLocation,
};
@@ -11,9 +11,9 @@ use crate::xcm_mock::relay_chain::{
type LocalOriginConverter = (
SovereignSignedViaLocation<LocationConverter, RuntimeOrigin>,
ChildParachainAsNative<origin::Origin, RuntimeOrigin>,
ChildTeyrChainAsNative<origin::Origin, RuntimeOrigin>,
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
ChildSystemParachainAsSuperuser<ParaId, RuntimeOrigin>,
ChildSystemTeyrChainAsSuperuser<ParaId, RuntimeOrigin>,
);
pub type OriginConverter = LocalOriginConverter;
@@ -1,4 +1,4 @@
use frame_support::parameter_types;
use pezframe_support::parameter_types;
use xcm::latest::prelude::*;
use xcm_builder::FixedWeightBounds;
@@ -1,12 +1,12 @@
mod xcm_config;
use core::marker::PhantomData;
use frame_support::{
use pezframe_support::{
construct_runtime, derive_impl, parameter_types,
traits::{ConstU128, ContainsPair, Disabled, Everything, Nothing},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use frame_system::EnsureRoot;
use pezframe_system::EnsureRoot;
use sp_core::ConstU32;
use sp_runtime::{
traits::{Get, IdentityLookup},
@@ -25,16 +25,16 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Runtime {
type AccountData = pezpallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type Block = Block;
type Lookup = IdentityLookup<Self::AccountId>;
}
#[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 Balance = Balance;
type ExistentialDeposit = ConstU128<1>;
@@ -67,9 +67,9 @@ parameter_types! {
pub type TrustedLockers = TrustedLockerCase<RelayTokenForRelay>;
impl pallet_xcm::Config for Runtime {
impl pezpallet_xcm::Config for Runtime {
type AdminOrigin = EnsureRoot<AccountId>;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
type AdvertisedXcmVersion = pezpallet_xcm::CurrentXcmVersion;
// Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`.
type AuthorizedAliasConsideration = Disabled;
type Currency = Balances;
@@ -86,7 +86,7 @@ impl pallet_xcm::Config for Runtime {
type TrustedLockers = TrustedLockers;
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type WeightInfo = pallet_xcm::TestWeightInfo;
type WeightInfo = pezpallet_xcm::TestWeightInfo;
type XcmExecuteFilter = Everything;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmReserveTransferFilter = Everything;
@@ -96,13 +96,13 @@ impl pallet_xcm::Config for Runtime {
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
}
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,
PolkadotXcm: pallet_xcm,
PezkuwiXcm: pezpallet_xcm,
}
);
@@ -1,6 +1,6 @@
use xcm_builder::{FungibleAdapter, IsConcrete};
use crate::parachain::{
use crate::teyrchain::{
constants::KsmLocation, location_converter::LocationConverter, AccountId, Balances,
};
@@ -1,4 +1,4 @@
use frame_support::traits::Everything;
use pezframe_support::traits::Everything;
use xcm_builder::AllowUnpaidExecutionFrom;
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
@@ -1,8 +1,8 @@
use frame_support::parameter_types;
use pezframe_support::parameter_types;
use xcm::latest::prelude::*;
use xcm_simulator::mock_message_queue::ParachainId;
use xcm_simulator::mock_message_queue::TeyrChainId;
use crate::xcm_mock::parachain::Runtime;
use crate::xcm_mock::teyrchain::Runtime;
parameter_types! {
pub KsmPerSecondPerByte: (AssetId, u128, u128) = (AssetId(Parent.into()), 1, 1);
@@ -12,5 +12,5 @@ parameter_types! {
parameter_types! {
pub const KsmLocation: Location = Location::parent();
pub const RelayNetwork: NetworkId = NetworkId::Kusama;
pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::<Runtime>::get().into())].into();
pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), TeyrChain(TeyrChainId::<Runtime>::get().into())].into();
}
@@ -1,6 +1,6 @@
use xcm_builder::{AccountId32Aliases, DescribeAllTerminal, DescribeFamily, HashedDescription};
use crate::xcm_mock::parachain::{constants::RelayNetwork, AccountId};
use crate::xcm_mock::teyrchain::{constants::RelayNetwork, AccountId};
type LocationToAccountId = (
HashedDescription<AccountId, DescribeFamily<DescribeAllTerminal>>,
@@ -5,20 +5,20 @@ pub mod location_converter;
pub mod origin_converter;
pub mod weigher;
use frame_support::traits::{Everything, Nothing};
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, FrameTransactionalProcessor};
use pezframe_support::traits::{Everything, Nothing};
use xcm_builder::{EnsureDecodableXcm, FixedRateOfFungible, PezframeTransactionalProcessor};
use crate::xcm_mock::parachain::{MsgQueue, PolkadotXcm, RuntimeCall};
use crate::xcm_mock::teyrchain::{MsgQueue, PezkuwiXcm, RuntimeCall};
// Generated from `decl_test_network!`
pub type XcmRouter = EnsureDecodableXcm<crate::xcm_mock::ParachainXcmRouter<MsgQueue>>;
pub type XcmRouter = EnsureDecodableXcm<crate::xcm_mock::TeyrChainXcmRouter<MsgQueue>>;
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type Aliasers = Nothing;
type AssetClaims = ();
type AssetExchanger = ();
type AssetLocker = PolkadotXcm;
type AssetLocker = PezkuwiXcm;
type AssetTransactor = asset_transactor::AssetTransactor;
type AssetTrap = ();
type Barrier = barrier::Barrier;
@@ -32,17 +32,17 @@ impl xcm_executor::Config for XcmConfig {
type MaxAssetsIntoHolding = constants::MaxAssetsIntoHolding;
type MessageExporter = ();
type OriginConverter = origin_converter::OriginConverter;
type PalletInstancesInfo = ();
type PezpalletInstancesInfo = ();
type ResponseHandler = ();
type RuntimeCall = RuntimeCall;
type SafeCallFilter = Everything;
type SubscriptionService = ();
type Trader = FixedRateOfFungible<constants::KsmPerSecondPerByte, ()>;
type TransactionalProcessor = FrameTransactionalProcessor;
type TransactionalProcessor = PezframeTransactionalProcessor;
type UniversalAliases = Nothing;
type UniversalLocation = constants::UniversalLocation;
type Weigher = weigher::Weigher;
type XcmEventEmitter = PolkadotXcm;
type XcmRecorder = PolkadotXcm;
type XcmEventEmitter = PezkuwiXcm;
type XcmRecorder = PezkuwiXcm;
type XcmSender = XcmRouter;
}
@@ -1,7 +1,7 @@
use pallet_xcm::XcmPassthrough;
use pezpallet_xcm::XcmPassthrough;
use xcm_builder::{SignedAccountId32AsNative, SovereignSignedViaLocation};
use crate::xcm_mock::parachain::{
use crate::xcm_mock::teyrchain::{
constants::RelayNetwork, location_converter::LocationConverter, RuntimeOrigin,
};
@@ -1,8 +1,8 @@
use frame_support::parameter_types;
use pezframe_support::parameter_types;
use xcm::latest::prelude::*;
use xcm_builder::FixedWeightBounds;
use crate::xcm_mock::parachain::RuntimeCall;
use crate::xcm_mock::teyrchain::RuntimeCall;
parameter_types! {
pub const UnitWeightCost: Weight = Weight::from_parts(1, 1);