mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 15:41:02 +00:00
Send messages using xcm pallet (#1518)
* send messages using xcm pallet * XcmBridge && XcmBridgeAdapter + (untested) config in RialtoParachain * impl encode_send_xcm for the rest * remove duplicate code * some fixes * cleanup * some more tests * cleanup * cleanup * send Rialto -> Millau messages using bridge-messages pallet * fmt * some clippy fixes * more clippy
This commit is contained in:
committed by
Bastian Köcher
parent
b21790b769
commit
c131a5e3c8
@@ -26,8 +26,30 @@ use bp_runtime::EncodedOrDecodedCall;
|
||||
use relay_rialto_client::Rialto;
|
||||
use relay_substrate_client::BalanceOf;
|
||||
use sp_version::RuntimeVersion;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
impl CliEncodeMessage for Rialto {
|
||||
fn encode_send_xcm(
|
||||
message: xcm::VersionedXcm<()>,
|
||||
bridge_instance_index: u8,
|
||||
) -> anyhow::Result<EncodedOrDecodedCall<Self::Call>> {
|
||||
Ok(match bridge_instance_index {
|
||||
bridge::RIALTO_TO_MILLAU_INDEX => {
|
||||
let dest =
|
||||
(Parent, X1(GlobalConsensus(rialto_runtime::xcm_config::MillauNetwork::get())));
|
||||
rialto_runtime::Call::XcmPallet(rialto_runtime::XcmCall::send {
|
||||
dest: Box::new(dest.into()),
|
||||
message: Box::new(message),
|
||||
})
|
||||
.into()
|
||||
},
|
||||
_ => anyhow::bail!(
|
||||
"Unsupported target bridge pallet with instance index: {}",
|
||||
bridge_instance_index
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
fn encode_send_message_call(
|
||||
lane: LaneId,
|
||||
payload: RawMessage,
|
||||
|
||||
Reference in New Issue
Block a user