Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix pallet_xcm::execute #4490

Merged
merged 3 commits into from
Jan 18, 2022
Merged
Changes from 2 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
12 changes: 9 additions & 3 deletions xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,21 @@ pub mod pallet {
origin: OriginFor<T>,
message: Box<VersionedXcm<<T as SysConfig>::Call>>,
max_weight: Weight,
) -> DispatchResult {
) -> DispatchResultWithPostInfo {
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
let message = (*message).try_into().map_err(|()| Error::<T>::BadVersion)?;
let value = (origin_location, message);
ensure!(T::XcmExecuteFilter::contains(&value), Error::<T>::Filtered);
let (origin_location, message) = value;
let outcome = T::XcmExecutor::execute_xcm(origin_location, message, max_weight);
let outcome = T::XcmExecutor::execute_xcm_in_credit(
origin_location,
message,
max_weight,
max_weight,
);
let result = Ok(Some(outcome.weight_used().saturating_add(100_000_000)).into());
Self::deposit_event(Event::Attempted(outcome));
Ok(())
result
}

/// Extoll that a particular destination can be communicated with through a particular
Expand Down