Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ use runtime_parachains::{
self,
ParaGenesisArgs,
},
router,
ensure_parachain,
Origin,
};

type BalanceOf<T> =
<<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;

pub trait Trait: paras::Trait {
pub trait Trait: paras::Trait + router::Trait {
/// The aggregated origin type must support the `parachains` origin. We require that we can
/// infallibly convert between this origin and the system origin, but in reality, they're the
/// same type, we just can't express that to the Rust type system without writing a `where`
Expand Down Expand Up @@ -150,6 +151,7 @@ decl_module! {
let _ = <T as Trait>::Currency::unreserve(&debtor, T::ParathreadDeposit::get());

<paras::Module<T>>::schedule_para_cleanup(id);
<router::Module::<T>>::schedule_para_cleanup(id);

Ok(())
}
Expand Down Expand Up @@ -241,6 +243,7 @@ impl<T: Trait> Module<T> {
ensure!(is_parachain, Error::<T>::InvalidChainId);

<paras::Module<T>>::schedule_para_cleanup(id);
<router::Module::<T>>::schedule_para_cleanup(id);

Ok(())
}
Expand Down Expand Up @@ -269,7 +272,7 @@ mod tests {

impl_outer_origin! {
pub enum Origin for Test {
paras,
runtime_parachains,
}
}

Expand Down
4 changes: 2 additions & 2 deletions runtime/parachains/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ use frame_support::{
weights::Weight, traits::Randomness as RandomnessT,
};
use crate::inclusion;
use crate::paras;
use crate as parachains;

/// A test runtime struct.
#[derive(Clone, Eq, PartialEq)]
pub struct Test;

impl_outer_origin! {
pub enum Origin for Test {
paras
parachains
}
}

Expand Down
3 changes: 1 addition & 2 deletions runtime/parachains/src/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ use primitives::v1::Id as ParaId;
use codec::{Decode, Encode};

/// Origin for the parachains.
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug))]
#[derive(PartialEq, Eq, Clone, Encode, Decode, sp_core::RuntimeDebug)]
pub enum Origin {
/// It comes from a parachain.
Parachain(ParaId),
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/paras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use sp_core::RuntimeDebug;
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};

pub use crate::Origin;
use crate::Origin;

pub trait Trait: frame_system::Trait + configuration::Trait {
/// The outer origin type.
Expand Down