From 7fded023b896b8450130be51fc5e3774f87bdff1 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:15:52 +0200 Subject: [PATCH] refactor(pop-node): pallet config - testnet --- .../testnet/src/{assets_config.rs => config/assets.rs} | 0 .../src/{contracts_config.rs => config/contracts.rs} | 0 runtime/testnet/src/config/mod.rs | 5 +++++ runtime/testnet/src/{proxy_config.rs => config/proxy.rs} | 3 ++- runtime/testnet/src/{xcm_config.rs => config/xcm.rs} | 2 +- runtime/testnet/src/lib.rs | 9 +++------ 6 files changed, 11 insertions(+), 8 deletions(-) rename runtime/testnet/src/{assets_config.rs => config/assets.rs} (100%) rename runtime/testnet/src/{contracts_config.rs => config/contracts.rs} (100%) create mode 100644 runtime/testnet/src/config/mod.rs rename runtime/testnet/src/{proxy_config.rs => config/proxy.rs} (98%) rename runtime/testnet/src/{xcm_config.rs => config/xcm.rs} (99%) diff --git a/runtime/testnet/src/assets_config.rs b/runtime/testnet/src/config/assets.rs similarity index 100% rename from runtime/testnet/src/assets_config.rs rename to runtime/testnet/src/config/assets.rs diff --git a/runtime/testnet/src/contracts_config.rs b/runtime/testnet/src/config/contracts.rs similarity index 100% rename from runtime/testnet/src/contracts_config.rs rename to runtime/testnet/src/config/contracts.rs diff --git a/runtime/testnet/src/config/mod.rs b/runtime/testnet/src/config/mod.rs new file mode 100644 index 00000000..544a1c6e --- /dev/null +++ b/runtime/testnet/src/config/mod.rs @@ -0,0 +1,5 @@ +mod assets; +mod contracts; +mod proxy; +// Public due to integration tests crate. +pub mod xcm; \ No newline at end of file diff --git a/runtime/testnet/src/proxy_config.rs b/runtime/testnet/src/config/proxy.rs similarity index 98% rename from runtime/testnet/src/proxy_config.rs rename to runtime/testnet/src/config/proxy.rs index 53d95773..282dbcbb 100644 --- a/runtime/testnet/src/proxy_config.rs +++ b/runtime/testnet/src/config/proxy.rs @@ -1,7 +1,8 @@ use crate::{ - assets_config::TrustBackedAssetsCall, deposit, Balance, Balances, Runtime, RuntimeCall, + deposit, Balance, Balances, Runtime, RuntimeCall, RuntimeEvent, }; +use super::assets::TrustBackedAssetsCall; use codec::{Decode, Encode, MaxEncodedLen}; use sp_runtime::{traits::BlakeTwo256, RuntimeDebug}; diff --git a/runtime/testnet/src/xcm_config.rs b/runtime/testnet/src/config/xcm.rs similarity index 99% rename from runtime/testnet/src/xcm_config.rs rename to runtime/testnet/src/config/xcm.rs index ff6d6136..a210f7a4 100644 --- a/runtime/testnet/src/xcm_config.rs +++ b/runtime/testnet/src/config/xcm.rs @@ -1,4 +1,4 @@ -use super::{ +use crate::{ AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 95af3a5f..9d93823b 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -6,12 +6,9 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -mod assets_config; -mod contracts_config; mod extensions; -mod proxy_config; mod weights; -pub mod xcm_config; +mod config; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; @@ -60,7 +57,7 @@ pub use pop_runtime_common::{ RELAY_CHAIN_SLOT_DURATION_MILLIS, SLOT_DURATION, UNINCLUDED_SEGMENT_CAPACITY, UNIT, }; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -use xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin}; +use config::xcm::{RelayLocation, XcmOriginToTransactDispatchOrigin}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -433,7 +430,7 @@ impl pallet_message_queue::Config for Runtime { #[cfg(not(feature = "runtime-benchmarks"))] type MessageProcessor = xcm_builder::ProcessXcmMessage< AggregateMessageOrigin, - xcm_executor::XcmExecutor, + xcm_executor::XcmExecutor, RuntimeCall, >; type Size = u32;