mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-25 16:47:54 +00:00
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:
@@ -1,10 +1,10 @@
|
||||
// ExtBuilder impl for all runtime integration tests
|
||||
use evm_runtime_template::{BuildStorage, Runtime, System};
|
||||
use frame_support::weights::Weight;
|
||||
use pezframe_support::weights::Weight;
|
||||
|
||||
pub fn run_with_system_weight<F: FnMut()>(w: Weight, mut assertions: F) {
|
||||
let mut t: sp_io::TestExternalities =
|
||||
frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap().into();
|
||||
pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap().into();
|
||||
t.execute_with(|| {
|
||||
System::set_block_consumed_resources(w, 0);
|
||||
assertions()
|
||||
|
||||
@@ -3,7 +3,7 @@ mod constant_tests {
|
||||
|
||||
#[test]
|
||||
fn test_constants() {
|
||||
assert_eq!(MICROCENTS, 1_000_000);
|
||||
assert_eq!(MICTYRENTS, 1_000_000);
|
||||
|
||||
assert_eq!(MILLICENTS, 1_000_000_000);
|
||||
|
||||
@@ -28,7 +28,7 @@ mod runtime_tests {
|
||||
constants::{currency::*, *},
|
||||
BlockNumber, Runtime,
|
||||
};
|
||||
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
|
||||
use pezframe_support::{pezpallet_prelude::Weight, traits::TypedGet, PezpalletId};
|
||||
use sp_runtime::{Cow, Perbill};
|
||||
use sp_version::RuntimeVersion;
|
||||
use xcm::latest::prelude::BodyId;
|
||||
@@ -39,8 +39,8 @@ mod runtime_tests {
|
||||
assert_eq!(
|
||||
VERSION,
|
||||
RuntimeVersion {
|
||||
spec_name: Cow::Borrowed("template-parachain"),
|
||||
impl_name: Cow::Borrowed("template-parachain"),
|
||||
spec_name: Cow::Borrowed("template-teyrchain"),
|
||||
impl_name: Cow::Borrowed("template-teyrchain"),
|
||||
authoring_version: 1,
|
||||
spec_version: 1,
|
||||
impl_version: 0,
|
||||
@@ -61,12 +61,12 @@ mod runtime_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn frame_system_constants() {
|
||||
fn pezframe_system_constants() {
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
assert_eq!(
|
||||
MAXIMUM_BLOCK_WEIGHT,
|
||||
Weight::from_parts(
|
||||
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
)
|
||||
);
|
||||
@@ -75,7 +75,7 @@ mod runtime_tests {
|
||||
assert_eq!(
|
||||
MAXIMUM_BLOCK_WEIGHT,
|
||||
Weight::from_parts(
|
||||
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
)
|
||||
);
|
||||
@@ -88,7 +88,7 @@ mod runtime_tests {
|
||||
#[cfg(feature = "async-backing")]
|
||||
assert_eq!(UNINCLUDED_SEGMENT_CAPACITY, 3);
|
||||
|
||||
assert_eq!(BLOCK_PROCESSING_VELOCITY, 1);
|
||||
assert_eq!(BLOCK_PTYRESSING_VELOCITY, 1);
|
||||
|
||||
assert_eq!(RELAY_CHAIN_SLOT_DURATION_MILLIS, 6000);
|
||||
|
||||
@@ -107,105 +107,105 @@ mod runtime_tests {
|
||||
|
||||
assert_eq!(MAX_BLOCK_LENGTH, 5 * 1024 * 1024);
|
||||
|
||||
assert_eq!(<Runtime as frame_system::Config>::SS58Prefix::get(), 42);
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::SS58Prefix::get(), 42);
|
||||
|
||||
assert_eq!(<Runtime as frame_system::Config>::MaxConsumers::get(), 16);
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::MaxConsumers::get(), 16);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn proxy_constants() {
|
||||
assert_eq!(<Runtime as pallet_proxy::Config>::MaxProxies::get(), 32);
|
||||
assert_eq!(<Runtime as pezpallet_proxy::Config>::MaxProxies::get(), 32);
|
||||
|
||||
assert_eq!(<Runtime as pallet_proxy::Config>::MaxPending::get(), 32);
|
||||
assert_eq!(<Runtime as pezpallet_proxy::Config>::MaxPending::get(), 32);
|
||||
|
||||
assert_eq!(<Runtime as pallet_proxy::Config>::ProxyDepositBase::get(), deposit(1, 40));
|
||||
assert_eq!(<Runtime as pezpallet_proxy::Config>::ProxyDepositBase::get(), deposit(1, 40));
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as pallet_proxy::Config>::AnnouncementDepositBase::get(),
|
||||
<Runtime as pezpallet_proxy::Config>::AnnouncementDepositBase::get(),
|
||||
deposit(1, 48)
|
||||
);
|
||||
|
||||
assert_eq!(<Runtime as pallet_proxy::Config>::ProxyDepositFactor::get(), deposit(0, 33));
|
||||
assert_eq!(<Runtime as pezpallet_proxy::Config>::ProxyDepositFactor::get(), deposit(0, 33));
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as pallet_proxy::Config>::AnnouncementDepositFactor::get(),
|
||||
<Runtime as pezpallet_proxy::Config>::AnnouncementDepositFactor::get(),
|
||||
deposit(0, 66)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn balances_constants() {
|
||||
assert_eq!(<Runtime as pallet_balances::Config>::MaxFreezes::get(), 0);
|
||||
assert_eq!(<Runtime as pezpallet_balances::Config>::MaxFreezes::get(), 0);
|
||||
|
||||
assert_eq!(<Runtime as pallet_balances::Config>::MaxLocks::get(), 50);
|
||||
assert_eq!(<Runtime as pezpallet_balances::Config>::MaxLocks::get(), 50);
|
||||
|
||||
assert_eq!(<Runtime as pallet_balances::Config>::MaxReserves::get(), 50);
|
||||
assert_eq!(<Runtime as pezpallet_balances::Config>::MaxReserves::get(), 50);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn assets_constants() {
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::AssetDeposit::get(), 10 * CENTS);
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::AssetDeposit::get(), 10 * CENTS);
|
||||
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::AssetAccountDeposit::get(), deposit(1, 16));
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::AssetAccountDeposit::get(), deposit(1, 16));
|
||||
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::ApprovalDeposit::get(), MILLICENTS);
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::ApprovalDeposit::get(), MILLICENTS);
|
||||
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::StringLimit::get(), 50);
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::StringLimit::get(), 50);
|
||||
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::MetadataDepositBase::get(), deposit(1, 68));
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::MetadataDepositBase::get(), deposit(1, 68));
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as pallet_assets::Config>::MetadataDepositPerByte::get(),
|
||||
<Runtime as pezpallet_assets::Config>::MetadataDepositPerByte::get(),
|
||||
deposit(0, 1)
|
||||
);
|
||||
|
||||
assert_eq!(<Runtime as pallet_assets::Config>::RemoveItemsLimit::get(), 1000);
|
||||
assert_eq!(<Runtime as pezpallet_assets::Config>::RemoveItemsLimit::get(), 1000);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transaction_payment_constants() {
|
||||
assert_eq!(configs::TransactionByteFee::get(), 10 * MICROCENTS);
|
||||
assert_eq!(configs::TransactionByteFee::get(), 10 * MICTYRENTS);
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as pallet_transaction_payment::Config>::OperationalFeeMultiplier::get(),
|
||||
<Runtime as pezpallet_transaction_payment::Config>::OperationalFeeMultiplier::get(),
|
||||
5
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cumulus_pallet_parachain_system_constants() {
|
||||
fn cumulus_pezpallet_teyrchain_system_constants() {
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pallet_parachain_system::Config>::ReservedXcmpWeight::get(),
|
||||
<Runtime as cumulus_pezpallet_teyrchain_system::Config>::ReservedXcmpWeight::get(),
|
||||
MAXIMUM_BLOCK_WEIGHT.saturating_div(4)
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pallet_parachain_system::Config>::ReservedDmpWeight::get(),
|
||||
<Runtime as cumulus_pezpallet_teyrchain_system::Config>::ReservedDmpWeight::get(),
|
||||
MAXIMUM_BLOCK_WEIGHT.saturating_div(4)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn message_queue_constants() {
|
||||
assert_eq!(<Runtime as pallet_message_queue::Config>::HeapSize::get(), 64 * 1024);
|
||||
assert_eq!(<Runtime as pallet_message_queue::Config>::MaxStale::get(), 8);
|
||||
assert_eq!(<Runtime as pezpallet_message_queue::Config>::HeapSize::get(), 64 * 1024);
|
||||
assert_eq!(<Runtime as pezpallet_message_queue::Config>::MaxStale::get(), 8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cumulus_pallet_xcmp_queue_constants() {
|
||||
fn cumulus_pezpallet_xcmp_queue_constants() {
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pallet_xcmp_queue::Config>::MaxInboundSuspended::get(),
|
||||
<Runtime as cumulus_pezpallet_xcmp_queue::Config>::MaxInboundSuspended::get(),
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multisig_constants() {
|
||||
assert_eq!(<Runtime as pallet_multisig::Config>::DepositBase::get(), deposit(1, 88));
|
||||
assert_eq!(<Runtime as pezpallet_multisig::Config>::DepositBase::get(), deposit(1, 88));
|
||||
|
||||
assert_eq!(<Runtime as pallet_multisig::Config>::DepositFactor::get(), deposit(0, 32));
|
||||
assert_eq!(<Runtime as pezpallet_multisig::Config>::DepositFactor::get(), deposit(0, 32));
|
||||
|
||||
assert_eq!(<Runtime as pallet_multisig::Config>::MaxSignatories::get(), 100);
|
||||
assert_eq!(<Runtime as pezpallet_multisig::Config>::MaxSignatories::get(), 100);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -221,40 +221,40 @@ mod runtime_tests {
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn aura_constants() {
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
assert!(!<Runtime as pallet_aura::Config>::AllowMultipleBlocksPerSlot::get());
|
||||
assert!(!<Runtime as pezpallet_aura::Config>::AllowMultipleBlocksPerSlot::get());
|
||||
#[cfg(feature = "async-backing")]
|
||||
assert!(<Runtime as pallet_aura::Config>::AllowMultipleBlocksPerSlot::get());
|
||||
assert!(<Runtime as pezpallet_aura::Config>::AllowMultipleBlocksPerSlot::get());
|
||||
|
||||
assert_eq!(<Runtime as pallet_aura::Config>::MaxAuthorities::get(), 100_000);
|
||||
assert_eq!(<Runtime as pezpallet_aura::Config>::MaxAuthorities::get(), 100_000);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn collator_selection_constants() {
|
||||
let pallet_id_to_string = |id: PalletId| -> String {
|
||||
let pezpallet_id_to_string = |id: PezpalletId| -> String {
|
||||
core::str::from_utf8(&id.0).unwrap_or_default().to_string()
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
pallet_id_to_string(<Runtime as pallet_collator_selection::Config>::PotId::get()),
|
||||
pallet_id_to_string(PalletId(*b"PotStake"))
|
||||
pezpallet_id_to_string(<Runtime as pezpallet_collator_selection::Config>::PotId::get()),
|
||||
pezpallet_id_to_string(PezpalletId(*b"PotStake"))
|
||||
);
|
||||
|
||||
assert_eq!(configs::SessionLength::get(), 6 * HOURS);
|
||||
|
||||
assert_eq!(configs::StakingAdminBodyId::get(), BodyId::Defense);
|
||||
|
||||
assert_eq!(<Runtime as pallet_collator_selection::Config>::MaxCandidates::get(), 100);
|
||||
assert_eq!(<Runtime as pezpallet_collator_selection::Config>::MaxCandidates::get(), 100);
|
||||
|
||||
assert_eq!(<Runtime as pallet_collator_selection::Config>::MaxInvulnerables::get(), 20);
|
||||
assert_eq!(<Runtime as pezpallet_collator_selection::Config>::MaxInvulnerables::get(), 20);
|
||||
|
||||
assert_eq!(<Runtime as pallet_collator_selection::Config>::MinEligibleCollators::get(), 4);
|
||||
assert_eq!(<Runtime as pezpallet_collator_selection::Config>::MinEligibleCollators::get(), 4);
|
||||
}
|
||||
}
|
||||
|
||||
mod xcm_tests {
|
||||
use evm_runtime_template::{configs, Runtime};
|
||||
use frame_support::weights::Weight;
|
||||
use pezframe_support::weights::Weight;
|
||||
|
||||
#[test]
|
||||
fn xcm_executor_constants() {
|
||||
@@ -264,9 +264,9 @@ mod xcm_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pallet_xcm_constants() {
|
||||
assert_eq!(<Runtime as pallet_xcm::Config>::MaxLockers::get(), 8);
|
||||
assert_eq!(<Runtime as pallet_xcm::Config>::MaxRemoteLockConsumers::get(), 0);
|
||||
assert_eq!(<Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
|
||||
fn pezpallet_xcm_constants() {
|
||||
assert_eq!(<Runtime as pezpallet_xcm::Config>::MaxLockers::get(), 8);
|
||||
assert_eq!(<Runtime as pezpallet_xcm::Config>::MaxRemoteLockConsumers::get(), 0);
|
||||
assert_eq!(<Runtime as pezpallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
mod common;
|
||||
use common::*;
|
||||
use evm_runtime_template::{Runtime, RuntimeBlockWeights};
|
||||
use frame_support::pallet_prelude::*;
|
||||
use pallet_transaction_payment::Multiplier;
|
||||
use polkadot_runtime_common::MinimumMultiplier;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezpallet_transaction_payment::Multiplier;
|
||||
use pezkuwi_runtime_common::MinimumMultiplier;
|
||||
use sp_runtime::{traits::Convert, Perquintill};
|
||||
|
||||
fn min_multiplier() -> Multiplier {
|
||||
@@ -17,7 +17,7 @@ fn target() -> Weight {
|
||||
}
|
||||
|
||||
fn runtime_multiplier_update(fm: Multiplier) -> Multiplier {
|
||||
<Runtime as pallet_transaction_payment::Config>::FeeMultiplierUpdate::convert(fm)
|
||||
<Runtime as pezpallet_transaction_payment::Config>::FeeMultiplierUpdate::convert(fm)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -2,37 +2,37 @@
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use evm_runtime_template::{Aura, AuraExt, Authorship, CollatorSelection, Session};
|
||||
use evm_runtime_template::{
|
||||
Balances, CumulusXcm, MessageQueue, Multisig, ParachainInfo, ParachainSystem, PolkadotXcm,
|
||||
Balances, CumulusXcm, MessageQueue, Multisig, TeyrChainInfo, TeyrChainSystem, PezkuwiXcm,
|
||||
Proxy, Runtime, Sudo, System, Timestamp, TransactionPayment, XcmpQueue,
|
||||
};
|
||||
use frame_support::traits::PalletInfo;
|
||||
use pezframe_support::traits::PalletInfo;
|
||||
|
||||
fn assert_pallet_prefix<P: 'static>(name: &str) {
|
||||
assert_eq!(<Runtime as frame_system::Config>::PalletInfo::name::<P>(), Some(name));
|
||||
fn assert_pezpallet_prefix<P: 'static>(name: &str) {
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::PalletInfo::name::<P>(), Some(name));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn verify_pallet_prefixes() {
|
||||
assert_pallet_prefix::<System>("System");
|
||||
assert_pallet_prefix::<ParachainSystem>("ParachainSystem");
|
||||
assert_pallet_prefix::<Timestamp>("Timestamp");
|
||||
assert_pallet_prefix::<ParachainInfo>("ParachainInfo");
|
||||
assert_pallet_prefix::<Proxy>("Proxy");
|
||||
assert_pallet_prefix::<Balances>("Balances");
|
||||
assert_pallet_prefix::<TransactionPayment>("TransactionPayment");
|
||||
assert_pallet_prefix::<Sudo>("Sudo");
|
||||
assert_pallet_prefix::<Multisig>("Multisig");
|
||||
assert_pallet_prefix::<XcmpQueue>("XcmpQueue");
|
||||
assert_pallet_prefix::<PolkadotXcm>("PolkadotXcm");
|
||||
assert_pallet_prefix::<CumulusXcm>("CumulusXcm");
|
||||
assert_pallet_prefix::<MessageQueue>("MessageQueue");
|
||||
fn verify_pezpallet_prefixes() {
|
||||
assert_pezpallet_prefix::<System>("System");
|
||||
assert_pezpallet_prefix::<TeyrChainSystem>("TeyrChainSystem");
|
||||
assert_pezpallet_prefix::<Timestamp>("Timestamp");
|
||||
assert_pezpallet_prefix::<TeyrChainInfo>("TeyrChainInfo");
|
||||
assert_pezpallet_prefix::<Proxy>("Proxy");
|
||||
assert_pezpallet_prefix::<Balances>("Balances");
|
||||
assert_pezpallet_prefix::<TransactionPayment>("TransactionPayment");
|
||||
assert_pezpallet_prefix::<Sudo>("Sudo");
|
||||
assert_pezpallet_prefix::<Multisig>("Multisig");
|
||||
assert_pezpallet_prefix::<XcmpQueue>("XcmpQueue");
|
||||
assert_pezpallet_prefix::<PezkuwiXcm>("PezkuwiXcm");
|
||||
assert_pezpallet_prefix::<CumulusXcm>("CumulusXcm");
|
||||
assert_pezpallet_prefix::<MessageQueue>("MessageQueue");
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
{
|
||||
assert_pallet_prefix::<Authorship>("Authorship");
|
||||
assert_pallet_prefix::<CollatorSelection>("CollatorSelection");
|
||||
assert_pallet_prefix::<Session>("Session");
|
||||
assert_pallet_prefix::<Aura>("Aura");
|
||||
assert_pallet_prefix::<AuraExt>("AuraExt");
|
||||
assert_pezpallet_prefix::<Authorship>("Authorship");
|
||||
assert_pezpallet_prefix::<CollatorSelection>("CollatorSelection");
|
||||
assert_pezpallet_prefix::<Session>("Session");
|
||||
assert_pezpallet_prefix::<Aura>("Aura");
|
||||
assert_pezpallet_prefix::<AuraExt>("AuraExt");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
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 PARA_ALICE: [u8; 20] = [1u8; 20];
|
||||
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),
|
||||
}
|
||||
}
|
||||
@@ -44,44 +44,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![
|
||||
(PARA_ALICE.into(), INITIAL_BALANCE),
|
||||
(parent_account_id(), INITIAL_BALANCE),
|
||||
@@ -103,9 +103,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),
|
||||
@@ -123,5 +123,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,11 +1,11 @@
|
||||
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,
|
||||
@@ -24,16 +24,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>;
|
||||
@@ -50,9 +50,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;
|
||||
@@ -70,7 +70,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;
|
||||
@@ -82,7 +82,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.
|
||||
@@ -91,7 +91,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;
|
||||
@@ -109,11 +109,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;
|
||||
@@ -129,10 +129,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;
|
||||
|
||||
|
||||
+14
-14
@@ -2,12 +2,12 @@ mod xcm_config;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use evm_runtime_template::configs::xcm_config::SignedToAccountId20;
|
||||
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};
|
||||
use xcm::latest::prelude::*;
|
||||
@@ -23,16 +23,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>;
|
||||
@@ -65,9 +65,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;
|
||||
@@ -84,7 +84,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;
|
||||
@@ -94,13 +94,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
-1
@@ -1,6 +1,6 @@
|
||||
use xcm_builder::{FungibleAdapter, IsConcrete};
|
||||
|
||||
use crate::parachain::{
|
||||
use crate::teyrchain::{
|
||||
constants::KsmLocation, location_converter::LocationConverter, AccountId, Balances,
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
use frame_support::traits::Everything;
|
||||
use pezframe_support::traits::Everything;
|
||||
use xcm_builder::AllowUnpaidExecutionFrom;
|
||||
|
||||
pub type Barrier = AllowUnpaidExecutionFrom<Everything>;
|
||||
+4
-4
@@ -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
-1
@@ -1,6 +1,6 @@
|
||||
use xcm_builder::{AccountKey20Aliases, 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>>,
|
||||
+9
-9
@@ -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;
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use xcm_builder::{SignedAccountKey20AsNative, SovereignSignedViaLocation};
|
||||
|
||||
use crate::xcm_mock::parachain::{
|
||||
use crate::xcm_mock::teyrchain::{
|
||||
constants::RelayNetwork, location_converter::LocationConverter, RuntimeOrigin,
|
||||
};
|
||||
|
||||
+2
-2
@@ -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);
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub mod xcm_mock;
|
||||
|
||||
use frame_support::{assert_ok, weights::Weight};
|
||||
use pezframe_support::{assert_ok, weights::Weight};
|
||||
use parity_scale_codec::Encode;
|
||||
use xcm::prelude::*;
|
||||
use xcm_mock::*;
|
||||
@@ -24,13 +24,13 @@ fn remote_account_ids_work() {
|
||||
fn dmp() {
|
||||
MockNet::reset();
|
||||
|
||||
let remark = parachain::RuntimeCall::System(
|
||||
frame_system::Call::<parachain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
let remark = teyrchain::RuntimeCall::System(
|
||||
pezframe_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
);
|
||||
Relay::execute_with(|| {
|
||||
assert_ok!(RelayChainPalletXcm::send_xcm(
|
||||
assert_ok!(RelayChainPezpalletXcm::send_xcm(
|
||||
Here,
|
||||
Parachain(1),
|
||||
TeyrChain(1),
|
||||
Xcm(vec![Transact {
|
||||
origin_kind: OriginKind::SovereignAccount,
|
||||
fallback_max_weight: Some(Weight::from_parts(INITIAL_BALANCE as u64, 1024 * 1024)),
|
||||
@@ -40,10 +40,10 @@ fn dmp() {
|
||||
});
|
||||
|
||||
ParaA::execute_with(|| {
|
||||
use parachain::{RuntimeEvent, System};
|
||||
use teyrchain::{RuntimeEvent, System};
|
||||
assert!(System::events().iter().any(|r| matches!(
|
||||
r.event,
|
||||
RuntimeEvent::System(frame_system::Event::Remarked { .. })
|
||||
RuntimeEvent::System(pezframe_system::Event::Remarked { .. })
|
||||
)));
|
||||
});
|
||||
}
|
||||
@@ -53,10 +53,10 @@ 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!(ParachainPalletXcm::send_xcm(
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(
|
||||
Here,
|
||||
Parent,
|
||||
Xcm(vec![Transact {
|
||||
@@ -71,7 +71,7 @@ fn ump() {
|
||||
use relay_chain::{RuntimeEvent, System};
|
||||
assert!(System::events().iter().any(|r| matches!(
|
||||
r.event,
|
||||
RuntimeEvent::System(frame_system::Event::Remarked { .. })
|
||||
RuntimeEvent::System(pezframe_system::Event::Remarked { .. })
|
||||
)));
|
||||
});
|
||||
}
|
||||
@@ -80,13 +80,13 @@ fn ump() {
|
||||
fn xcmp() {
|
||||
MockNet::reset();
|
||||
|
||||
let remark = parachain::RuntimeCall::System(
|
||||
frame_system::Call::<parachain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
let remark = teyrchain::RuntimeCall::System(
|
||||
pezframe_system::Call::<teyrchain::Runtime>::remark_with_event { remark: vec![1, 2, 3] },
|
||||
);
|
||||
ParaA::execute_with(|| {
|
||||
assert_ok!(ParachainPalletXcm::send_xcm(
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(
|
||||
Here,
|
||||
(Parent, Parachain(2)),
|
||||
(Parent, TeyrChain(2)),
|
||||
Xcm(vec![Transact {
|
||||
origin_kind: OriginKind::SovereignAccount,
|
||||
fallback_max_weight: Some(Weight::from_parts(INITIAL_BALANCE as u64, 1024 * 1024)),
|
||||
@@ -96,10 +96,10 @@ fn xcmp() {
|
||||
});
|
||||
|
||||
ParaB::execute_with(|| {
|
||||
use parachain::{RuntimeEvent, System};
|
||||
use teyrchain::{RuntimeEvent, System};
|
||||
assert!(System::events().iter().any(|r| matches!(
|
||||
r.event,
|
||||
RuntimeEvent::System(frame_system::Event::Remarked { .. })
|
||||
RuntimeEvent::System(pezframe_system::Event::Remarked { .. })
|
||||
)));
|
||||
});
|
||||
}
|
||||
@@ -113,13 +113,13 @@ fn remote_locking_and_unlocking() {
|
||||
ParaB::execute_with(|| {
|
||||
let message = Xcm(vec![LockAsset {
|
||||
asset: (Here, locked_amount).into(),
|
||||
unlocker: Parachain(1).into(),
|
||||
unlocker: TeyrChain(1).into(),
|
||||
}]);
|
||||
assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone()));
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(Here, Parent, message.clone()));
|
||||
});
|
||||
|
||||
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 }]
|
||||
@@ -128,9 +128,9 @@ fn remote_locking_and_unlocking() {
|
||||
|
||||
ParaA::execute_with(|| {
|
||||
assert_eq!(
|
||||
ReceivedDmp::<parachain::Runtime>::get(),
|
||||
ReceivedDmp::<teyrchain::Runtime>::get(),
|
||||
vec![Xcm(vec![NoteUnlockable {
|
||||
owner: (Parent, Parachain(2)).into(),
|
||||
owner: (Parent, TeyrChain(2)).into(),
|
||||
asset: (Parent, locked_amount).into()
|
||||
}])]
|
||||
);
|
||||
@@ -142,11 +142,11 @@ fn remote_locking_and_unlocking() {
|
||||
asset: (Parent, locked_amount - 50).into(),
|
||||
locker: Parent.into(),
|
||||
}]);
|
||||
assert_ok!(ParachainPalletXcm::send_xcm(Here, (Parent, Parachain(1)), message));
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(Here, (Parent, TeyrChain(1)), message));
|
||||
});
|
||||
|
||||
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)),
|
||||
@@ -160,9 +160,9 @@ fn remote_locking_and_unlocking() {
|
||||
}
|
||||
|
||||
/// Scenario:
|
||||
/// A parachain transfers funds on the relay chain to another parachain account.
|
||||
/// A teyrchain transfers funds on the relay chain to another teyrchain account.
|
||||
///
|
||||
/// Asserts that the parachain accounts are updated as expected.
|
||||
/// Asserts that the teyrchain accounts are updated as expected.
|
||||
#[test]
|
||||
fn withdraw_and_deposit() {
|
||||
MockNet::reset();
|
||||
@@ -173,10 +173,10 @@ fn withdraw_and_deposit() {
|
||||
let message = Xcm(vec![
|
||||
WithdrawAsset((Here, send_amount).into()),
|
||||
buy_execution((Here, send_amount)),
|
||||
DepositAsset { assets: AllCounted(1).into(), beneficiary: Parachain(2).into() },
|
||||
DepositAsset { assets: AllCounted(1).into(), beneficiary: TeyrChain(2).into() },
|
||||
]);
|
||||
// Send withdraw and deposit
|
||||
assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone()));
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(Here, Parent, message.clone()));
|
||||
});
|
||||
|
||||
Relay::execute_with(|| {
|
||||
@@ -192,7 +192,7 @@ fn withdraw_and_deposit() {
|
||||
}
|
||||
|
||||
/// Scenario:
|
||||
/// A parachain wants to be notified that a transfer worked correctly.
|
||||
/// A teyrchain wants to be notified that a transfer worked correctly.
|
||||
/// It sends a `QueryHolding` after the deposit to get notified on success.
|
||||
///
|
||||
/// Asserts that the balances are updated correctly and the expected XCM is sent.
|
||||
@@ -208,10 +208,10 @@ fn query_holding() {
|
||||
let message = Xcm(vec![
|
||||
WithdrawAsset((Here, send_amount).into()),
|
||||
buy_execution((Here, send_amount)),
|
||||
DepositAsset { assets: AllCounted(1).into(), beneficiary: Parachain(2).into() },
|
||||
DepositAsset { assets: AllCounted(1).into(), beneficiary: TeyrChain(2).into() },
|
||||
ReportHolding {
|
||||
response_info: QueryResponseInfo {
|
||||
destination: Parachain(1).into(),
|
||||
destination: TeyrChain(1).into(),
|
||||
query_id: query_id_set,
|
||||
max_weight: Weight::from_parts(1_000_000_000, 1024 * 1024),
|
||||
},
|
||||
@@ -219,7 +219,7 @@ fn query_holding() {
|
||||
},
|
||||
]);
|
||||
// Send withdraw and deposit with query holding
|
||||
assert_ok!(ParachainPalletXcm::send_xcm(Here, Parent, message.clone(),));
|
||||
assert_ok!(TeyrChainPezpalletXcm::send_xcm(Here, Parent, message.clone(),));
|
||||
});
|
||||
|
||||
// Check that transfer was executed
|
||||
@@ -239,7 +239,7 @@ fn query_holding() {
|
||||
// Check that QueryResponse message was received
|
||||
ParaA::execute_with(|| {
|
||||
assert_eq!(
|
||||
ReceivedDmp::<parachain::Runtime>::get(),
|
||||
ReceivedDmp::<teyrchain::Runtime>::get(),
|
||||
vec![Xcm(vec![QueryResponse {
|
||||
query_id: query_id_set,
|
||||
response: Response::Assets(Assets::new()),
|
||||
|
||||
Reference in New Issue
Block a user