Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

use proper intra doc link #10271

Merged
14 changes: 7 additions & 7 deletions frame/support/procedural/src/construct_runtime/expand/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub fn expand_outer_origin(

/// The runtime origin type represanting the origin of a call.
///
/// Origin is always created with the base filter configured in `frame_system::Config::BaseCallFilter`.
/// Origin is always created with the base filter configured in [`frame_system::Config::BaseCallFilter`].
#[derive(Clone)]
pub struct Origin {
caller: OriginCaller,
Expand Down Expand Up @@ -182,15 +182,15 @@ pub fn expand_outer_origin(
// For backwards compatibility and ease of accessing these functions.
#[allow(dead_code)]
impl Origin {
/// Create with system none origin and `frame-system::Config::BaseCallFilter`.
/// Create with system none origin and [`frame_system::Config::BaseCallFilter`].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use #system_path

Copy link
Contributor Author

@dharjeezy dharjeezy Nov 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... Can you elaborate more what you mean by system_path? @bkchr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thiolliere already has written this for you: #9962 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tried out what @thiolliere suggested, it wasn't outputting the right docs and I ran into errors too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you need to fix this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't work for me, did you tested your PR manually before requesting review ?
PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad. @thiolliere will push a fix for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thiolliere i have fix this in my latest push. You can check now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still awaiting your reviews @thiolliere @bkchr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will review when we get time

pub fn none() -> Self {
<Origin as #scrate::traits::OriginTrait>::none()
}
/// Create with system root origin and `frame-system::Config::BaseCallFilter`.
/// Create with system root origin and [`frame_system::Config::BaseCallFilter`].
pub fn root() -> Self {
<Origin as #scrate::traits::OriginTrait>::root()
}
/// Create with system signed origin and `frame-system::Config::BaseCallFilter`.
/// Create with system signed origin and [`frame_system::Config::BaseCallFilter`].
pub fn signed(by: <#runtime as #system_path::Config>::AccountId) -> Self {
<Origin as #scrate::traits::OriginTrait>::signed(by)
}
Expand All @@ -216,7 +216,7 @@ pub fn expand_outer_origin(
}

impl From<#system_path::Origin<#runtime>> for Origin {
/// Convert to runtime origin, using as filter: `frame-system::Config::BaseCallFilter`.
/// Convert to runtime origin, using as filter: [`frame_system::Config::BaseCallFilter`].
fn from(x: #system_path::Origin<#runtime>) -> Self {
let o: OriginCaller = x.into();
o.into()
Expand Down Expand Up @@ -248,7 +248,7 @@ pub fn expand_outer_origin(
}
impl From<Option<<#runtime as #system_path::Config>::AccountId>> for Origin {
/// Convert to runtime origin with caller being system signed or none and use filter
/// `frame-system::Config::BaseCallFilter`.
/// [`frame_system::Config::BaseCallFilter`].
fn from(x: Option<<#runtime as #system_path::Config>::AccountId>) -> Self {
<#system_path::Origin<#runtime>>::from(x).into()
}
Expand Down Expand Up @@ -311,7 +311,7 @@ fn expand_origin_pallet_conversions(
}

impl From<#pallet_origin> for Origin {
/// Convert to runtime origin using `frame-system::Config::BaseCallFilter`.
/// Convert to runtime origin using [`frame_system::Config::BaseCallFilter`].
fn from(x: #pallet_origin) -> Self {
let x: OriginCaller = x.into();
x.into()
Expand Down