diff --git a/frame/support/src/origin.rs b/frame/support/src/origin.rs index 6dd38eb1b2ab4..869296b52f88c 100644 --- a/frame/support/src/origin.rs +++ b/frame/support/src/origin.rs @@ -349,13 +349,13 @@ macro_rules! impl_outer_origin { } } - impl Into<$crate::sp_std::result::Result<$system::Origin<$runtime>, $name>> for $name { + impl From<$name> for $crate::sp_std::result::Result<$system::Origin<$runtime>, $name>{ /// NOTE: converting to pallet origin loses the origin filter information. - fn into(self) -> $crate::sp_std::result::Result<$system::Origin<$runtime>, Self> { - if let $caller_name::system(l) = self.caller { + fn from(val: $name) -> Self { + if let $caller_name::system(l) = val.caller { Ok(l) } else { - Err(self) + Err(val) } } }