mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Fixes
This commit is contained in:
@@ -345,7 +345,10 @@ mod tests {
|
||||
};
|
||||
use sp_version::RuntimeVersion;
|
||||
use std::cell::RefCell;
|
||||
use xcm::latest::{MultiLocation, OriginKind, Weightless};
|
||||
use xcm::{
|
||||
latest::{MultiLocation, OriginKind},
|
||||
v3::traits::Weightless,
|
||||
};
|
||||
|
||||
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
@@ -428,12 +431,11 @@ mod tests {
|
||||
Err(message)
|
||||
}
|
||||
|
||||
fn execute_xcm_in_credit(
|
||||
fn execute(
|
||||
_origin: impl Into<MultiLocation>,
|
||||
message: Xcm,
|
||||
_hash: XcmHash,
|
||||
weight_limit: Weight,
|
||||
_credit: Weight,
|
||||
) -> Outcome {
|
||||
let o = match (message.0.len(), &message.0.first()) {
|
||||
(1, Some(Transact { require_weight_at_most, .. })) => {
|
||||
|
||||
@@ -52,7 +52,7 @@ use rand_chacha::{
|
||||
ChaChaRng,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{traits::Hash, RuntimeDebug};
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_std::{convert::TryFrom, prelude::*};
|
||||
use xcm::{latest::prelude::*, VersionedXcm, WrapVersion, MAX_XCM_DECODE_DEPTH};
|
||||
use xcm_executor::traits::ConvertOrigin;
|
||||
@@ -598,7 +598,7 @@ impl<T: Config> Pallet<T> {
|
||||
log::debug!("Processing XCMP-XCM: {:?}", &hash);
|
||||
let (result, event) = match Xcm::<T::Call>::try_from(xcm) {
|
||||
Ok(xcm) => {
|
||||
let location = (1, Parachain(sender.into()));
|
||||
let location = (Parent, Parachain(sender.into()));
|
||||
match T::XcmExecutor::execute_xcm(location, xcm, hash, max_weight) {
|
||||
Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)),
|
||||
Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))),
|
||||
@@ -1099,7 +1099,7 @@ impl<T: Config> SendXcm for Pallet<T> {
|
||||
_ => {
|
||||
*dest = Some(d);
|
||||
Err(SendError::NotApplicable)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1110,10 +1110,8 @@ impl<T: Config> SendXcm for Pallet<T> {
|
||||
Ok(_) => {
|
||||
Self::deposit_event(Event::XcmpMessageSent(Some(hash)));
|
||||
Ok(hash)
|
||||
}
|
||||
Err(e) => {
|
||||
Err(SendError::Transport(<&'static str>::from(e)))
|
||||
}
|
||||
},
|
||||
Err(e) => Err(SendError::Transport(<&'static str>::from(e))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ pub mod pallet {
|
||||
*seq += 1;
|
||||
*seq
|
||||
});
|
||||
match T::XcmSender::send_xcm(
|
||||
(1, Junction::Parachain(para.into())),
|
||||
match send_xcm::<T::XcmSender>(
|
||||
(Parent, Junction::Parachain(para.into())),
|
||||
Xcm(vec![Transact {
|
||||
origin_kind: OriginKind::Native,
|
||||
require_weight_at_most: 1_000,
|
||||
@@ -165,8 +165,8 @@ pub mod pallet {
|
||||
let para = ensure_sibling_para(<T as Config>::Origin::from(origin))?;
|
||||
|
||||
Self::deposit_event(Event::Pinged(para, seq, payload.clone()));
|
||||
match T::XcmSender::send_xcm(
|
||||
(1, Junction::Parachain(para.into())),
|
||||
match send_xcm::<T::XcmSender>(
|
||||
(Parent, Junction::Parachain(para.into())),
|
||||
Xcm(vec![Transact {
|
||||
origin_kind: OriginKind::Native,
|
||||
require_weight_at_most: 1_000,
|
||||
|
||||
Reference in New Issue
Block a user