Rename Origin (#1628)

* Rename Origin

* more renaming

* fixes

* fix errors

* last fix?

* rename

* Update mock.rs

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Sergej Sakac
2022-09-21 01:17:31 +02:00
committed by GitHub
parent 6f40bb9efe
commit 14186393b2
35 changed files with 488 additions and 458 deletions
+4 -4
View File
@@ -49,8 +49,8 @@ pub mod pallet {
/// The overarching event type.
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type Origin: From<<Self as SystemConfig>::Origin>
+ Into<Result<CumulusOrigin, <Self as Config>::Origin>>;
type RuntimeOrigin: From<<Self as SystemConfig>::RuntimeOrigin>
+ Into<Result<CumulusOrigin, <Self as Config>::RuntimeOrigin>>;
/// The overarching call type; we assume sibling chains use the same type.
type RuntimeCall: From<Call<Self>> + Encode;
@@ -190,7 +190,7 @@ pub mod pallet {
#[pallet::weight(0)]
pub fn ping(origin: OriginFor<T>, seq: u32, payload: Vec<u8>) -> DispatchResult {
// Only accept pings from other chains.
let para = ensure_sibling_para(<T as Config>::Origin::from(origin))?;
let para = ensure_sibling_para(<T as Config>::RuntimeOrigin::from(origin))?;
Self::deposit_event(Event::Pinged(para, seq, payload.clone()));
match T::XcmSender::send_xcm(
@@ -215,7 +215,7 @@ pub mod pallet {
#[pallet::weight(0)]
pub fn pong(origin: OriginFor<T>, seq: u32, payload: Vec<u8>) -> DispatchResult {
// Only accept pings from other chains.
let para = ensure_sibling_para(<T as Config>::Origin::from(origin))?;
let para = ensure_sibling_para(<T as Config>::RuntimeOrigin::from(origin))?;
if let Some(sent_at) = Pings::<T>::take(seq) {
Self::deposit_event(Event::Ponged(