Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
21 changes: 11 additions & 10 deletions xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,19 @@ pub mod pallet {
AccountIdConversion::<T::AccountId>::into_account(&ID)
}
}
}

/// Origin for the parachains module.
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)]
pub enum Origin {
/// It comes from somewhere in the XCM space.
Xcm(MultiLocation),
}
/// 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),
}

impl From<MultiLocation> for Origin {
fn from(location: MultiLocation) -> Origin {
Origin::Xcm(location)
impl From<MultiLocation> for Origin {
fn from(location: MultiLocation) -> Origin {
Origin::Xcm(location)
}
}
}

Expand Down