Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 09735eb97a
commit c89d7cac55
1424 changed files with 6415 additions and 6064 deletions
@@ -42,7 +42,7 @@ pezpallet-xcm = { workspace = true }
pezkuwi-teyrchain-primitives = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm-runtime-apis = { workspace = true }
xcm-runtime-pezapis = { workspace = true }
[features]
default = ["std"]
@@ -68,7 +68,7 @@ std = [
"teyrchain-info/std",
"teyrchains-common/std",
"xcm-executor/std",
"xcm-runtime-apis/std",
"xcm-runtime-pezapis/std",
"xcm/std",
]
runtime-benchmarks = [
@@ -91,6 +91,6 @@ runtime-benchmarks = [
"teyrchain-info/runtime-benchmarks",
"teyrchains-common/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm-runtime-apis/runtime-benchmarks",
"xcm-runtime-pezapis/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
@@ -16,7 +16,7 @@
use core::marker::PhantomData;
use codec::{Decode, DecodeLimit};
use pezcumulus_pallet_teyrchain_system::teyrchain_inherent::{
use pezcumulus_pezpallet_teyrchain_system::teyrchain_inherent::{
deconstruct_teyrchain_inherent_data, InboundMessagesData,
};
use pezcumulus_primitives_core::{
@@ -135,7 +135,7 @@ pub trait BasicTeyrchainRuntime:
+ pezpallet_xcm::Config
+ teyrchain_info::Config
+ pezpallet_collator_selection::Config
+ pezcumulus_pallet_teyrchain_system::Config
+ pezcumulus_pezpallet_teyrchain_system::Config
+ pezpallet_timestamp::Config
{
}
@@ -148,7 +148,7 @@ where
+ pezpallet_xcm::Config
+ teyrchain_info::Config
+ pezpallet_collator_selection::Config
+ pezcumulus_pallet_teyrchain_system::Config
+ pezcumulus_pezpallet_teyrchain_system::Config
+ pezpallet_timestamp::Config,
ValidatorIdOf<T>: From<AccountIdOf<T>>,
{
@@ -269,7 +269,7 @@ pub struct RuntimeHelper<Runtime, AllPalletsWithoutSystem>(
/// Utility function that advances the chain to the desired block number.
/// If an author is provided, that author information is injected to all the blocks in the meantime.
impl<
Runtime: pezframe_system::Config + pezcumulus_pallet_teyrchain_system::Config + pezpallet_timestamp::Config,
Runtime: pezframe_system::Config + pezcumulus_pezpallet_teyrchain_system::Config + pezpallet_timestamp::Config,
AllPalletsWithoutSystem,
> RuntimeHelper<Runtime, AllPalletsWithoutSystem>
where
@@ -356,7 +356,7 @@ where
let (inherent_data, downward_messages, horizontal_messages) =
deconstruct_teyrchain_inherent_data(inherent_data);
let _ = pezcumulus_pallet_teyrchain_system::Pallet::<Runtime>::set_validation_data(
let _ = pezcumulus_pezpallet_teyrchain_system::Pallet::<Runtime>::set_validation_data(
Runtime::RuntimeOrigin::none(),
inherent_data,
InboundMessagesData::new(
@@ -410,7 +410,7 @@ impl<XcmConfig: xcm_executor::Config, AllPalletsWithoutSystem>
}
impl<
Runtime: pezpallet_xcm::Config + pezcumulus_pallet_teyrchain_system::Config,
Runtime: pezpallet_xcm::Config + pezcumulus_pezpallet_teyrchain_system::Config,
AllPalletsWithoutSystem,
> RuntimeHelper<Runtime, AllPalletsWithoutSystem>
{
@@ -426,7 +426,7 @@ impl<
) -> DispatchResult
where
HrmpChannelOpener: pezframe_support::inherent::ProvideInherent<
Call = pezcumulus_pallet_teyrchain_system::Call<Runtime>,
Call = pezcumulus_pezpallet_teyrchain_system::Call<Runtime>,
>,
{
// open hrmp (if needed)
@@ -453,7 +453,7 @@ impl<
}
impl<
Runtime: pezcumulus_pallet_teyrchain_system::Config + pezpallet_xcm::Config,
Runtime: pezcumulus_pezpallet_teyrchain_system::Config + pezpallet_xcm::Config,
AllPalletsWithoutSystem,
> RuntimeHelper<Runtime, AllPalletsWithoutSystem>
{
@@ -577,7 +577,7 @@ pub enum XcmReceivedFrom {
Sibling,
}
impl<TeyrchainSystem: pezcumulus_pallet_teyrchain_system::Config, AllPalletsWithoutSystem>
impl<TeyrchainSystem: pezcumulus_pezpallet_teyrchain_system::Config, AllPalletsWithoutSystem>
RuntimeHelper<TeyrchainSystem, AllPalletsWithoutSystem>
{
pub fn xcm_max_weight(from: XcmReceivedFrom) -> Weight {
@@ -621,20 +621,20 @@ impl<Runtime: pezframe_system::Config + pezpallet_xcm::Config, AllPalletsWithout
}
impl<
Runtime: pezframe_system::Config + pezcumulus_pallet_xcmp_queue::Config,
Runtime: pezframe_system::Config + pezcumulus_pezpallet_xcmp_queue::Config,
AllPalletsWithoutSystem,
> RuntimeHelper<Runtime, AllPalletsWithoutSystem>
{
pub fn xcmp_queue_message_sent(
unwrap_xcmp_queue_event: Box<
dyn Fn(Vec<u8>) -> Option<pezcumulus_pallet_xcmp_queue::Event<Runtime>>,
dyn Fn(Vec<u8>) -> Option<pezcumulus_pezpallet_xcmp_queue::Event<Runtime>>,
>,
) -> Option<XcmHash> {
<pezframe_system::Pallet<Runtime>>::events()
.into_iter()
.filter_map(|e| unwrap_xcmp_queue_event(e.event.encode()))
.find_map(|e| match e {
pezcumulus_pallet_xcmp_queue::Event::XcmpMessageSent { message_hash } =>
pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { message_hash } =>
Some(message_hash),
_ => None,
})
@@ -676,8 +676,8 @@ pub fn assert_total<Fungibles, AccountId>(
/// AuRa consensus hook expects pallets to be initialized, before calling this function make sure to
/// `run_to_block` at least once.
pub fn mock_open_hrmp_channel<
C: pezcumulus_pallet_teyrchain_system::Config,
T: ProvideInherent<Call = pezcumulus_pallet_teyrchain_system::Call<C>>,
C: pezcumulus_pezpallet_teyrchain_system::Config,
T: ProvideInherent<Call = pezcumulus_pezpallet_teyrchain_system::Call<C>>,
>(
sender: ParaId,
recipient: ParaId,
@@ -32,7 +32,7 @@ use pezsp_runtime::{
};
use teyrchains_common::AccountId;
use xcm::prelude::InstructionError;
use xcm_runtime_apis::fees::{
use xcm_runtime_pezapis::fees::{
runtime_decl_for_xcm_payment_api::XcmPaymentApiV2, Error as XcmPaymentApiError,
};
@@ -53,7 +53,7 @@ pub fn change_storage_constant_by_governance_works<Runtime, StorageConstant, Sto
+ pezpallet_xcm::Config
+ teyrchain_info::Config
+ pezpallet_collator_selection::Config
+ pezcumulus_pallet_teyrchain_system::Config
+ pezcumulus_pezpallet_teyrchain_system::Config
+ pezpallet_timestamp::Config,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
StorageConstant: Get<StorageConstantType>,
@@ -118,7 +118,7 @@ pub fn set_storage_keys_by_governance_works<Runtime>(
+ pezpallet_xcm::Config
+ teyrchain_info::Config
+ pezpallet_collator_selection::Config
+ pezcumulus_pallet_teyrchain_system::Config
+ pezcumulus_pezpallet_teyrchain_system::Config
+ pezpallet_timestamp::Config,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
{
@@ -164,8 +164,8 @@ where
+ pezpallet_xcm::Config
+ teyrchain_info::Config
+ pezpallet_collator_selection::Config
+ pezcumulus_pallet_teyrchain_system::Config
+ pezcumulus_pallet_xcmp_queue::Config
+ pezcumulus_pezpallet_teyrchain_system::Config
+ pezcumulus_pezpallet_xcmp_queue::Config
+ pezpallet_timestamp::Config,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
RuntimeOrigin: OriginTrait<AccountId = <Runtime as pezframe_system::Config>::AccountId>,