fix xcm pallet origin (#3272)

This commit is contained in:
Shawn Tabrizi
2021-06-16 21:57:29 +01:00
committed by GitHub
parent 462ca043e5
commit 0282ad3128
4 changed files with 14 additions and 13 deletions
+1 -1
View File
@@ -1474,7 +1474,7 @@ construct_runtime! {
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>} = 73,
// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 99,
}
}
+1 -1
View File
@@ -253,7 +253,7 @@ construct_runtime! {
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 91,
// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 99,
}
}
+1 -1
View File
@@ -1072,7 +1072,7 @@ construct_runtime! {
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>} = 64,
// Pallet for sending XCM.
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>} = 99,
XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin} = 99,
}
}
+2 -1
View File
@@ -262,10 +262,10 @@ pub mod pallet {
AccountIdConversion::<T::AccountId>::into_account(&ID)
}
}
}
/// Origin for the parachains module.
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)]
#[pallet::origin]
pub enum Origin {
/// It comes from somewhere in the XCM space.
Xcm(MultiLocation),
@@ -276,6 +276,7 @@ impl From<MultiLocation> for Origin {
Origin::Xcm(location)
}
}
}
/// Ensure that the origin `o` represents a sibling parachain.
/// Returns `Ok` with the parachain ID of the sibling or an `Err` otherwise.