make impl_outer_origin default to use frame_system (#6695)

This commit is contained in:
Xiliang Chen
2020-07-22 03:47:08 +12:00
committed by GitHub
parent f1523c75f6
commit 168e9df7e2
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -413,7 +413,7 @@ mod tests {
}
impl_outer_origin! {
pub enum Origin for TestRuntime {}
pub enum Origin for TestRuntime where system = system {}
}
impl_outer_dispatch! {
+7 -7
View File
@@ -33,7 +33,7 @@ macro_rules! impl_outer_origin {
) => {
$crate::impl_outer_origin! {
$(#[$attr])*
pub enum $name for $runtime where system = system {
pub enum $name for $runtime where system = frame_system {
$( $rest_without_system )*
}
}
@@ -350,7 +350,7 @@ macro_rules! impl_outer_origin {
mod tests {
use codec::{Encode, Decode};
use crate::traits::{Filter, OriginTrait};
mod system {
mod frame_system {
use super::*;
pub trait Trait {
@@ -404,7 +404,7 @@ mod tests {
}
}
impl system::Trait for TestRuntime {
impl frame_system::Trait for TestRuntime {
type AccountId = u32;
type Call = u32;
type BaseCallFilter = BaseCallFilter;
@@ -425,21 +425,21 @@ mod tests {
);
impl_outer_origin!(
pub enum OriginWithSystem for TestRuntime where system = system {
pub enum OriginWithSystem for TestRuntime where system = frame_system {
origin_without_generic,
origin_with_generic<T>
}
);
impl_outer_origin!(
pub enum OriginWithSystem2 for TestRuntime where system = system {
pub enum OriginWithSystem2 for TestRuntime where system = frame_system {
origin_with_generic<T>,
origin_without_generic,
}
);
impl_outer_origin!(
pub enum OriginEmpty for TestRuntime where system = system {}
pub enum OriginEmpty for TestRuntime where system = frame_system {}
);
#[test]
@@ -464,7 +464,7 @@ mod tests {
assert_eq!(origin.filter_call(&1), false);
origin.set_caller_from(OriginWithSystem::root());
assert!(matches!(origin.caller, OriginWithSystemCaller::system(system::RawOrigin::Root)));
assert!(matches!(origin.caller, OriginWithSystemCaller::system(frame_system::RawOrigin::Root)));
assert_eq!(origin.filter_call(&0), false);
assert_eq!(origin.filter_call(&1), false);