mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +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:
@@ -147,15 +147,16 @@ pub(crate) fn take_sent_xcm() -> Vec<(MultiLocation, Xcm<()>)> {
|
||||
/// Sender that never returns error, always sends
|
||||
pub struct TestSendXcm;
|
||||
impl SendXcm for TestSendXcm {
|
||||
fn send_xcm(dest: MultiLocation, msg: Xcm<()>) -> SendResult {
|
||||
SENT_XCM.with(|q| q.borrow_mut().push((dest, msg)));
|
||||
fn send_xcm(dest: impl Into<MultiLocation>, msg: Xcm<()>) -> SendResult {
|
||||
SENT_XCM.with(|q| q.borrow_mut().push((dest.into(), msg)));
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
/// Sender that returns error if `X8` junction and stops routing
|
||||
pub struct TestSendXcmErrX8;
|
||||
impl SendXcm for TestSendXcmErrX8 {
|
||||
fn send_xcm(dest: MultiLocation, msg: Xcm<()>) -> SendResult {
|
||||
fn send_xcm(dest: impl Into<MultiLocation>, msg: Xcm<()>) -> SendResult {
|
||||
let dest = dest.into();
|
||||
if dest.len() == 8 {
|
||||
Err(SendError::Transport("Destination location full"))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user