mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 09:07:56 +00:00
Update documentation and templates for Pezkuwi branding
This commit is contained in:
@@ -3,7 +3,7 @@ use evm_runtime_template::{BuildStorage, Runtime, System};
|
||||
use pezframe_support::weights::Weight;
|
||||
|
||||
pub fn run_with_system_weight<F: FnMut()>(w: Weight, mut assertions: F) {
|
||||
let mut t: sp_io::TestExternalities =
|
||||
let mut t: pezsp_io::TestExternalities =
|
||||
pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap().into();
|
||||
t.execute_with(|| {
|
||||
System::set_block_consumed_resources(w, 0);
|
||||
|
||||
@@ -29,8 +29,8 @@ mod runtime_tests {
|
||||
BlockNumber, Runtime,
|
||||
};
|
||||
use pezframe_support::{pezpallet_prelude::Weight, traits::TypedGet, PezpalletId};
|
||||
use sp_runtime::{Cow, Perbill};
|
||||
use sp_version::RuntimeVersion;
|
||||
use pezsp_runtime::{Cow, Perbill};
|
||||
use pezsp_version::RuntimeVersion;
|
||||
use xcm::latest::prelude::BodyId;
|
||||
|
||||
// RUNTIME_API_VERSIONS constant is generated by a macro and is private.
|
||||
@@ -67,7 +67,7 @@ mod runtime_tests {
|
||||
MAXIMUM_BLOCK_WEIGHT,
|
||||
Weight::from_parts(
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
pezcumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
)
|
||||
);
|
||||
|
||||
@@ -76,7 +76,7 @@ mod runtime_tests {
|
||||
MAXIMUM_BLOCK_WEIGHT,
|
||||
Weight::from_parts(
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
pezcumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64
|
||||
)
|
||||
);
|
||||
|
||||
@@ -107,9 +107,9 @@ mod runtime_tests {
|
||||
|
||||
assert_eq!(MAX_BLOCK_LENGTH, 5 * 1024 * 1024);
|
||||
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::SS58Prefix::get(), 42);
|
||||
assert_eq!(<Runtime as frame_system::Config>::SS58Prefix::get(), 42);
|
||||
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::MaxConsumers::get(), 16);
|
||||
assert_eq!(<Runtime as frame_system::Config>::MaxConsumers::get(), 16);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -173,14 +173,14 @@ mod runtime_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cumulus_pezpallet_teyrchain_system_constants() {
|
||||
fn pezcumulus_pezpallet_teyrchain_system_constants() {
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pezpallet_teyrchain_system::Config>::ReservedXcmpWeight::get(),
|
||||
<Runtime as pezcumulus_pezpallet_teyrchain_system::Config>::ReservedXcmpWeight::get(),
|
||||
MAXIMUM_BLOCK_WEIGHT.saturating_div(4)
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pezpallet_teyrchain_system::Config>::ReservedDmpWeight::get(),
|
||||
<Runtime as pezcumulus_pezpallet_teyrchain_system::Config>::ReservedDmpWeight::get(),
|
||||
MAXIMUM_BLOCK_WEIGHT.saturating_div(4)
|
||||
);
|
||||
}
|
||||
@@ -192,9 +192,9 @@ mod runtime_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cumulus_pezpallet_xcmp_queue_constants() {
|
||||
fn pezcumulus_pezpallet_xcmp_queue_constants() {
|
||||
assert_eq!(
|
||||
<Runtime as cumulus_pezpallet_xcmp_queue::Config>::MaxInboundSuspended::get(),
|
||||
<Runtime as pezcumulus_pezpallet_xcmp_queue::Config>::MaxInboundSuspended::get(),
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
mod common;
|
||||
use common::*;
|
||||
use evm_runtime_template::{Runtime, RuntimeBlockWeights};
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_support::pallet_prelude::*;
|
||||
use pezpallet_transaction_payment::Multiplier;
|
||||
use pezkuwi_runtime_common::MinimumMultiplier;
|
||||
use sp_runtime::{traits::Convert, Perquintill};
|
||||
use pezsp_runtime::{traits::Convert, Perquintill};
|
||||
|
||||
fn min_multiplier() -> Multiplier {
|
||||
MinimumMultiplier::get()
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use evm_runtime_template::{Aura, AuraExt, Authorship, CollatorSelection, Session};
|
||||
use evm_runtime_template::{
|
||||
Balances, CumulusXcm, MessageQueue, Multisig, TeyrChainInfo, TeyrChainSystem, PezkuwiXcm,
|
||||
Balances, PezcumulusXcm, MessageQueue, Multisig, TeyrChainInfo, TeyrChainSystem, PezkuwiXcm,
|
||||
Proxy, Runtime, Sudo, System, Timestamp, TransactionPayment, XcmpQueue,
|
||||
};
|
||||
use pezframe_support::traits::PalletInfo;
|
||||
use pezframe_support::traits::PezpalletInfo;
|
||||
|
||||
fn assert_pezpallet_prefix<P: 'static>(name: &str) {
|
||||
assert_eq!(<Runtime as pezframe_system::Config>::PalletInfo::name::<P>(), Some(name));
|
||||
assert_eq!(<Runtime as frame_system::Config>::PezpalletInfo::name::<P>(), Some(name));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -24,7 +24,7 @@ fn verify_pezpallet_prefixes() {
|
||||
assert_pezpallet_prefix::<Multisig>("Multisig");
|
||||
assert_pezpallet_prefix::<XcmpQueue>("XcmpQueue");
|
||||
assert_pezpallet_prefix::<PezkuwiXcm>("PezkuwiXcm");
|
||||
assert_pezpallet_prefix::<CumulusXcm>("CumulusXcm");
|
||||
assert_pezpallet_prefix::<PezcumulusXcm>("PezcumulusXcm");
|
||||
assert_pezpallet_prefix::<MessageQueue>("MessageQueue");
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
pub mod teyrchain;
|
||||
pub mod relay_chain;
|
||||
|
||||
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_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 ALICE: pezsp_runtime::AccountId32 = pezsp_runtime::AccountId32::new([1u8; 32]);
|
||||
pub const INITIAL_BALANCE: u128 = 1_000_000_000;
|
||||
|
||||
decl_test_teyrchain! {
|
||||
@@ -61,22 +61,22 @@ 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 = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
|
||||
@@ -91,16 +91,16 @@ pub fn para_ext(para_id: u32) -> 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(|| {
|
||||
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, System};
|
||||
|
||||
let mut t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
|
||||
@@ -116,12 +116,12 @@ 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);
|
||||
});
|
||||
ext
|
||||
}
|
||||
|
||||
pub type RelayChainPezpalletXcm = pezpallet_xcm::Pallet<relay_chain::Runtime>;
|
||||
pub type TeyrChainPezpalletXcm = pezpallet_xcm::Pallet<teyrchain::Runtime>;
|
||||
pub type RelayChainPezpalletXcm = pezpallet_xcm::Pezpallet<relay_chain::Runtime>;
|
||||
pub type TeyrChainPezpalletXcm = pezpallet_xcm::Pezpallet<teyrchain::Runtime>;
|
||||
|
||||
@@ -10,8 +10,8 @@ use pezkuwi_runtime_teyrchains::{
|
||||
inclusion::{AggregateMessageOrigin, UmpQueueId},
|
||||
origin, shared,
|
||||
};
|
||||
use sp_core::ConstU32;
|
||||
use sp_runtime::{traits::IdentityLookup, AccountId32};
|
||||
use pezsp_core::ConstU32;
|
||||
use pezsp_runtime::{traits::IdentityLookup, AccountId32};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{IsConcrete, SignedToAccountId32};
|
||||
pub use xcm_config::*;
|
||||
@@ -25,7 +25,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Runtime {
|
||||
impl frame_system::Config for Runtime {
|
||||
type AccountData = pezpallet_balances::AccountData<Balance>;
|
||||
type AccountId = AccountId;
|
||||
type Block = Block;
|
||||
|
||||
@@ -8,8 +8,8 @@ use pezframe_support::{
|
||||
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use sp_core::ConstU32;
|
||||
use sp_runtime::traits::{Get, IdentityLookup};
|
||||
use pezsp_core::ConstU32;
|
||||
use pezsp_runtime::traits::{Get, IdentityLookup};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::EnsureXcmOrigin;
|
||||
pub use xcm_config::*;
|
||||
@@ -24,7 +24,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Runtime {
|
||||
impl frame_system::Config for Runtime {
|
||||
type AccountData = pezpallet_balances::AccountData<Balance>;
|
||||
type AccountId = AccountId;
|
||||
type Block = Block;
|
||||
|
||||
Reference in New Issue
Block a user