Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pop-node): runtime pallet configs #76

Merged
merged 10 commits into from
Apr 25, 2024
2 changes: 1 addition & 1 deletion integration-tests/src/chains/pop_network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ decl_test_parachains! {
runtime = pop_runtime_devnet,
core = {
XcmpMessageHandler: pop_runtime_devnet::XcmpQueue,
LocationToAccountId: pop_runtime_devnet::xcm_config::LocationToAccountId,
LocationToAccountId: pop_runtime_devnet::config::xcm::LocationToAccountId,
ParachainInfo: pop_runtime_devnet::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use frame_support::{
use polkadot_runtime_parachains::assigner_on_demand;
use pop_runtime_common::Balance;
use pop_runtime_devnet as pop_runtime;
use pop_runtime_devnet::xcm_config::XcmConfig as PopNetworkXcmConfig;
use pop_runtime_devnet::config::xcm::XcmConfig as PopNetworkXcmConfig;
use rococo_runtime::xcm_config::XcmConfig as RococoXcmConfig;
use sp_core::Encode;
use xcm::prelude::*;
Expand Down
5 changes: 5 additions & 0 deletions runtime/devnet/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod assets;
mod contracts;
mod proxy;
// Public due to integration tests crate.
pub mod xcm;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::{assets_config::TrustBackedAssetsCall, Balances, Runtime, RuntimeCall, RuntimeEvent};
use sp_runtime::traits::BlakeTwo256;

use super::assets::TrustBackedAssetsCall;
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent};
use frame_support::traits::InstanceFilter;
use pop_runtime_common::proxy::{
AnnouncementDepositBase, AnnouncementDepositFactor, MaxPending, MaxProxies, ProxyDepositBase,
ProxyDepositFactor, ProxyType,
};
use sp_runtime::traits::BlakeTwo256;

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{
use crate::{
AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
};
Expand Down
10 changes: 4 additions & 6 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
#[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;
// Public due to integration tests crate.
pub mod config;

use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
Expand All @@ -30,6 +28,7 @@ use sp_std::prelude::*;
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;

use config::xcm::{RelayLocation, XcmOriginToTransactDispatchOrigin};
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
Expand Down Expand Up @@ -60,7 +59,6 @@ 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};

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -433,7 +431,7 @@ impl pallet_message_queue::Config for Runtime {
#[cfg(not(feature = "runtime-benchmarks"))]
type MessageProcessor = xcm_builder::ProcessXcmMessage<
AggregateMessageOrigin,
xcm_executor::XcmExecutor<xcm_config::XcmConfig>,
xcm_executor::XcmExecutor<config::xcm::XcmConfig>,
RuntimeCall,
>;
type Size = u32;
Expand Down
5 changes: 5 additions & 0 deletions runtime/testnet/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod assets;
mod contracts;
mod proxy;
// Public due to integration tests crate.
pub mod xcm;
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::{assets_config::TrustBackedAssetsCall, Balances, Runtime, RuntimeCall, RuntimeEvent};
use sp_runtime::traits::BlakeTwo256;

use super::assets::TrustBackedAssetsCall;
use crate::{Balances, Runtime, RuntimeCall, RuntimeEvent};
use frame_support::traits::InstanceFilter;
use pop_runtime_common::proxy::{
AnnouncementDepositBase, AnnouncementDepositFactor, MaxPending, MaxProxies, ProxyDepositBase,
ProxyDepositFactor, ProxyType,
};
use sp_runtime::traits::BlakeTwo256;

impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{
use crate::{
AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
};
Expand Down
9 changes: 3 additions & 6 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

mod assets_config;
mod contracts_config;
mod config;
mod extensions;
mod proxy_config;
mod weights;
pub mod xcm_config;

use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
Expand All @@ -30,6 +27,7 @@ use sp_std::prelude::*;
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;

use config::xcm::{RelayLocation, XcmOriginToTransactDispatchOrigin};
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use frame_support::{
construct_runtime, derive_impl,
Expand Down Expand Up @@ -60,7 +58,6 @@ 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};

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -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_config::XcmConfig>,
xcm_executor::XcmExecutor<config::xcm::XcmConfig>,
RuntimeCall,
>;
type Size = u32;
Expand Down
Loading