Currently to process an XCM message in my own pallet call, I inherit the config of my pallet from frame_system + pallet_xcm to have a representable origin:
#[pallet::config]
pub trait Config: frame_system::Config + pallet_xcm::Config {
...
// We need a specified origin to be used with the functions of the pallet_xcm that take an origin
type Origin: From<<Self as frame_system::Config>::Origin>
+ Into<Result<XcmOrigin, <Self as Config>::Origin>> + Debug;
...
}
After this I can call a function like ensure_xcm from the pallet_xcm like this:
ensure_xcm(<T as Config>::Origin::from(origin))
My problem is that ensure_xcm gets the origin as the parachain id, but I want the account that created the xcm message in the first place, not just the parachain. It this possible?