mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Make most XCM APIs accept an Into<MultiLocation> where MultiLocation is accepted (#3627)
* Change send_xcm MultiLocation argument to be generic * Change pallet_xcm::send_xcm MultiLocation and Junctions argument to be generic * Change convert_origin MultiLocation argument to be generic * Change OnResponse MultiLocation arguments to be generic * Change UniversalWeigher MultiLocation argumente to be generic * Change ExecuteXcm MultiLocation argument to be generic * Remove usages of into for the MultiLocation argument in execute_xcm * Make use of generic MultiLocation arguments in rustdocs * Cargo fmt * Remove unused import in tests * Resolve conflicts * cargo fmt * Appease spellcheck * impl Into<MultiLocation> in more places
This commit is contained in:
@@ -296,9 +296,10 @@ macro_rules! decl_test_network {
|
||||
pub struct ParachainXcmRouter<T>($crate::PhantomData<T>);
|
||||
|
||||
impl<T: $crate::Get<$crate::ParaId>> $crate::SendXcm for ParachainXcmRouter<T> {
|
||||
fn send_xcm(destination: $crate::MultiLocation, message: $crate::Xcm<()>) -> $crate::SendResult {
|
||||
fn send_xcm(destination: impl Into<$crate::MultiLocation>, message: $crate::Xcm<()>) -> $crate::SendResult {
|
||||
use $crate::{UmpSink, XcmpMessageHandlerT};
|
||||
|
||||
let destination = destination.into();
|
||||
match destination.interior() {
|
||||
$crate::Junctions::Here if destination.parent_count() == 1 => {
|
||||
$crate::PARA_MESSAGE_BUS.with(
|
||||
@@ -320,9 +321,10 @@ macro_rules! decl_test_network {
|
||||
/// XCM router for relay chain.
|
||||
pub struct RelayChainXcmRouter;
|
||||
impl $crate::SendXcm for RelayChainXcmRouter {
|
||||
fn send_xcm(destination: $crate::MultiLocation, message: $crate::Xcm<()>) -> $crate::SendResult {
|
||||
fn send_xcm(destination: impl Into<$crate::MultiLocation>, message: $crate::Xcm<()>) -> $crate::SendResult {
|
||||
use $crate::DmpMessageHandlerT;
|
||||
|
||||
let destination = destination.into();
|
||||
match destination.interior() {
|
||||
$(
|
||||
$crate::X1($crate::Parachain(id)) if *id == $para_id && destination.parent_count() == 0 => {
|
||||
|
||||
Reference in New Issue
Block a user