mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Add ParasSudoWrapper to test-runtime and bring back register_parachain to test-service (#1811)
* Make register/deregister parachain dispatchables This makes `register_parachain` and `deregister_parachain` of `Registrar` dispatchables. Besides that it brings back the functionality of the test node to register a parachain. * Fix tests * PR review comments
This commit is contained in:
@@ -176,7 +176,6 @@ pub struct ParaGenesisArgs {
|
||||
pub parachain: bool,
|
||||
}
|
||||
|
||||
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as Paras {
|
||||
/// All parachains. Ordered ascending by ParaId. Parathreads are not included.
|
||||
|
||||
@@ -63,8 +63,7 @@ use sp_core::OpaqueMetadata;
|
||||
use sp_staking::SessionIndex;
|
||||
use pallet_session::historical as session_historical;
|
||||
use frame_system::EnsureRoot;
|
||||
use runtime_common::paras_sudo_wrapper as paras_sudo_wrapper;
|
||||
use runtime_common::paras_registrar;
|
||||
use runtime_common::{paras_sudo_wrapper, paras_registrar};
|
||||
|
||||
use runtime_parachains::origin as parachains_origin;
|
||||
use runtime_parachains::configuration as parachains_configuration;
|
||||
@@ -740,9 +739,9 @@ impl pallet_authorship::Trait for Runtime {
|
||||
type EventHandler = (Staking, ImOnline);
|
||||
}
|
||||
|
||||
impl parachains_origin::Trait for Runtime { }
|
||||
impl parachains_origin::Trait for Runtime {}
|
||||
|
||||
impl parachains_configuration::Trait for Runtime { }
|
||||
impl parachains_configuration::Trait for Runtime {}
|
||||
|
||||
impl parachains_inclusion::Trait for Runtime {
|
||||
type Event = Event;
|
||||
@@ -752,17 +751,17 @@ impl parachains_paras::Trait for Runtime {
|
||||
type Origin = Origin;
|
||||
}
|
||||
|
||||
impl parachains_router::Trait for Runtime { }
|
||||
impl parachains_router::Trait for Runtime {}
|
||||
|
||||
impl parachains_inclusion_inherent::Trait for Runtime { }
|
||||
impl parachains_inclusion_inherent::Trait for Runtime {}
|
||||
|
||||
impl parachains_scheduler::Trait for Runtime { }
|
||||
impl parachains_scheduler::Trait for Runtime {}
|
||||
|
||||
impl parachains_initializer::Trait for Runtime {
|
||||
type Randomness = Babe;
|
||||
}
|
||||
|
||||
impl paras_sudo_wrapper::Trait for Runtime { }
|
||||
impl paras_sudo_wrapper::Trait for Runtime {}
|
||||
|
||||
impl paras_registrar::Trait for Runtime {
|
||||
type Currency = Balances;
|
||||
|
||||
@@ -37,7 +37,7 @@ use primitives::v1::{
|
||||
PersistedValidationData, Signature, ValidationCode, ValidationData, ValidatorId, ValidatorIndex,
|
||||
};
|
||||
use runtime_common::{
|
||||
claims, SlowAdjustingFeeUpdate,
|
||||
claims, SlowAdjustingFeeUpdate, paras_sudo_wrapper,
|
||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, ParachainSessionKeyPlaceholder,
|
||||
};
|
||||
@@ -74,6 +74,7 @@ pub use pallet_staking::StakerStatus;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
pub use pallet_timestamp::Call as TimestampCall;
|
||||
pub use pallet_balances::Call as BalancesCall;
|
||||
pub use paras_sudo_wrapper::Call as ParasSudoWrapperCall;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
@@ -448,6 +449,8 @@ impl router::Trait for Runtime {}
|
||||
|
||||
impl scheduler::Trait for Runtime {}
|
||||
|
||||
impl paras_sudo_wrapper::Trait for Runtime {}
|
||||
|
||||
construct_runtime! {
|
||||
pub enum Runtime where
|
||||
Block = Block,
|
||||
@@ -487,8 +490,8 @@ construct_runtime! {
|
||||
Initializer: initializer::{Module, Call, Storage},
|
||||
Paras: paras::{Module, Call, Storage, Origin},
|
||||
Scheduler: scheduler::{Module, Call, Storage},
|
||||
ParasSudoWrapper: paras_sudo_wrapper::{Module, Call},
|
||||
|
||||
// Sudo. Last module.
|
||||
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user