From 9632a14f0c1c6537e2fb095d679c0fe8bb25bfc8 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Fri, 10 May 2024 08:29:33 +0500 Subject: [PATCH] move inherents to empty block production dir --- core/src/commands/fast_forward.rs | 17 +++++++++-------- .../inherents/custom_idps/mod.rs | 0 .../inherents/custom_idps/para_parachain.rs | 0 .../inherents/custom_idps/relay_parachains.rs | 0 .../inherents/custom_idps/timestamp.rs | 0 .../empty_block_creation}/inherents/mod.rs | 0 .../inherents/pre_apply.rs | 0 .../inherents/providers.rs | 2 +- core/src/common/empty_block_creation/mod.rs | 1 + core/src/common/mod.rs | 1 + core/src/lib.rs | 1 - 11 files changed, 12 insertions(+), 10 deletions(-) rename core/src/{ => common/empty_block_creation}/inherents/custom_idps/mod.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/custom_idps/para_parachain.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/custom_idps/relay_parachains.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/custom_idps/timestamp.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/mod.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/pre_apply.rs (100%) rename core/src/{ => common/empty_block_creation}/inherents/providers.rs (98%) create mode 100644 core/src/common/empty_block_creation/mod.rs diff --git a/core/src/commands/fast_forward.rs b/core/src/commands/fast_forward.rs index 3cf39bef6b..69748eb5e4 100644 --- a/core/src/commands/fast_forward.rs +++ b/core/src/commands/fast_forward.rs @@ -30,15 +30,16 @@ use sp_runtime::{ use sp_state_machine::TestExternalities; use crate::{ - common::state::{ - build_executor, state_machine_call, state_machine_call_with_proof, RuntimeChecks, State, + common::{ + empty_block_creation::inherents::{ + pre_apply::pre_apply_inherents, + providers::{InherentProvider, ProviderVariant}, + }, + state::{ + build_executor, state_machine_call, state_machine_call_with_proof, RuntimeChecks, State, + }, }, - full_extensions, - inherents::{ - pre_apply::pre_apply_inherents, - providers::{InherentProvider, ProviderVariant}, - }, - BlockT, SharedParams, + full_extensions, BlockT, SharedParams, }; /// Configuration for [`run`]. diff --git a/core/src/inherents/custom_idps/mod.rs b/core/src/common/empty_block_creation/inherents/custom_idps/mod.rs similarity index 100% rename from core/src/inherents/custom_idps/mod.rs rename to core/src/common/empty_block_creation/inherents/custom_idps/mod.rs diff --git a/core/src/inherents/custom_idps/para_parachain.rs b/core/src/common/empty_block_creation/inherents/custom_idps/para_parachain.rs similarity index 100% rename from core/src/inherents/custom_idps/para_parachain.rs rename to core/src/common/empty_block_creation/inherents/custom_idps/para_parachain.rs diff --git a/core/src/inherents/custom_idps/relay_parachains.rs b/core/src/common/empty_block_creation/inherents/custom_idps/relay_parachains.rs similarity index 100% rename from core/src/inherents/custom_idps/relay_parachains.rs rename to core/src/common/empty_block_creation/inherents/custom_idps/relay_parachains.rs diff --git a/core/src/inherents/custom_idps/timestamp.rs b/core/src/common/empty_block_creation/inherents/custom_idps/timestamp.rs similarity index 100% rename from core/src/inherents/custom_idps/timestamp.rs rename to core/src/common/empty_block_creation/inherents/custom_idps/timestamp.rs diff --git a/core/src/inherents/mod.rs b/core/src/common/empty_block_creation/inherents/mod.rs similarity index 100% rename from core/src/inherents/mod.rs rename to core/src/common/empty_block_creation/inherents/mod.rs diff --git a/core/src/inherents/pre_apply.rs b/core/src/common/empty_block_creation/inherents/pre_apply.rs similarity index 100% rename from core/src/inherents/pre_apply.rs rename to core/src/common/empty_block_creation/inherents/pre_apply.rs diff --git a/core/src/inherents/providers.rs b/core/src/common/empty_block_creation/inherents/providers.rs similarity index 98% rename from core/src/inherents/providers.rs rename to core/src/common/empty_block_creation/inherents/providers.rs index 021880394d..09e4c786a6 100644 --- a/core/src/inherents/providers.rs +++ b/core/src/common/empty_block_creation/inherents/providers.rs @@ -35,7 +35,7 @@ use sp_std::prelude::*; use strum::IntoEnumIterator; use strum_macros::{Display, EnumIter}; -use crate::inherents::custom_idps; +use crate::common::empty_block_creation::inherents::custom_idps; /// Trait for providing the inherent data and digest items for block construction. pub trait InherentProvider { diff --git a/core/src/common/empty_block_creation/mod.rs b/core/src/common/empty_block_creation/mod.rs new file mode 100644 index 0000000000..d4561d921d --- /dev/null +++ b/core/src/common/empty_block_creation/mod.rs @@ -0,0 +1 @@ +pub mod inherents; diff --git a/core/src/common/mod.rs b/core/src/common/mod.rs index f317067f6e..5085ea1846 100644 --- a/core/src/common/mod.rs +++ b/core/src/common/mod.rs @@ -1,3 +1,4 @@ +pub mod empty_block_creation; pub mod misc_logging; pub mod parse; pub mod shared_parameters; diff --git a/core/src/lib.rs b/core/src/lib.rs index d752a10279..14d4f3d054 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -34,7 +34,6 @@ use sp_weights::Weight; pub mod commands; pub mod common; -mod inherents; pub(crate) const LOG_TARGET: &str = "try-runtime::cli";