From d975df23e24d33e2d6eab6a942a148e1afb8cdc1 Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 23 Dec 2024 12:39:52 -0300 Subject: [PATCH] Remove unnecesary changes --- client/manual-xcm/src/lib.rs | 51 +------------------ client/service-container-chain/src/rpc.rs | 1 - .../nodes/frontier/src/rpc/mod.rs | 1 - container-chains/nodes/simple/src/rpc.rs | 1 - node/src/rpc.rs | 11 +--- node/src/service.rs | 3 +- 6 files changed, 4 insertions(+), 64 deletions(-) diff --git a/client/manual-xcm/src/lib.rs b/client/manual-xcm/src/lib.rs index 964bc7cec..c01979049 100644 --- a/client/manual-xcm/src/lib.rs +++ b/client/manual-xcm/src/lib.rs @@ -29,17 +29,11 @@ const DEFAULT_PROOF_SIZE: u64 = 64 * 1024; #[jsonrpsee::core::async_trait] pub trait ManualXcmApi { /// Inject a downward xcm message - A message that comes from the relay chain. - /// You may provide an arbitrary message, or if you provide an empty byte array, + /// You may provide an arbitrary message, or if you provide an emtpy byte array, /// Then a default message (DOT transfer down to ALITH) will be injected #[method(name = "xcm_injectDownwardMessage")] async fn inject_downward_message(&self, message: Vec) -> RpcResult<()>; - /// Inject a upward xcm message - A message that comes from the a parachain. - /// You may provide an arbitrary message, or if you provide an empty byte array, - /// Then a default message (DOT transfer up to ALITH) will be injected - #[method(name = "xcm_injectUpwardMessage")] - async fn inject_upward_message(&self, message: Vec) -> RpcResult<()>; - /// Inject an HRMP message - A message that comes from a dedicated channel to a sibling /// parachain. /// @@ -57,7 +51,6 @@ pub trait ManualXcmApi { pub struct ManualXcm { pub downward_message_channel: flume::Sender>, - pub upward_message_channel: Option>>, pub hrmp_message_channel: flume::Sender<(ParaId, Vec)>, } @@ -103,48 +96,6 @@ impl ManualXcmApiServer for ManualXcm { Ok(()) } - async fn inject_upward_message(&self, msg: Vec) -> RpcResult<()> { - let upward_message_channel = self.upward_message_channel.clone(); - // If no message is supplied, inject a default one. - let msg = if msg.is_empty() { - staging_xcm::VersionedXcm::<()>::V4(Xcm(vec![ - ReserveAssetDeposited((Here, 10000000000000u128).into()), - ClearOrigin, - BuyExecution { - fees: (Here, 10000000000000u128).into(), - weight_limit: Limited(Weight::from_parts( - 4_000_000_000u64, - DEFAULT_PROOF_SIZE * 2, - )), - }, - DepositAsset { - assets: AllCounted(1).into(), - beneficiary: Location::new( - 0, - [AccountKey20 { - network: None, - key: hex_literal::hex!("f24FF3a9CF04c71Dbc94D0b566f7A27B94566cac"), - }], - ), - }, - ])) - .encode() - } else { - msg - }; - - // Push the message to the shared channel where it will be queued up - // to be injected in to an upcoming block. - if let Some(upm_channel) = upward_message_channel { - upm_channel - .send_async(msg) - .await - .map_err(|err| internal_err(err.to_string()))?; - } - - Ok(()) - } - async fn inject_hrmp_message(&self, sender: ParaId, msg: Vec) -> RpcResult<()> { let hrmp_message_channel = self.hrmp_message_channel.clone(); diff --git a/client/service-container-chain/src/rpc.rs b/client/service-container-chain/src/rpc.rs index 2d352011a..fec3bb165 100644 --- a/client/service-container-chain/src/rpc.rs +++ b/client/service-container-chain/src/rpc.rs @@ -107,7 +107,6 @@ where module.merge( ManualXcm { downward_message_channel, - upward_message_channel: None, hrmp_message_channel, } .into_rpc(), diff --git a/container-chains/nodes/frontier/src/rpc/mod.rs b/container-chains/nodes/frontier/src/rpc/mod.rs index 93d3ed929..a62299808 100644 --- a/container-chains/nodes/frontier/src/rpc/mod.rs +++ b/container-chains/nodes/frontier/src/rpc/mod.rs @@ -324,7 +324,6 @@ where io.merge( ManualXcm { downward_message_channel, - upward_message_channel: None, hrmp_message_channel, } .into_rpc(), diff --git a/container-chains/nodes/simple/src/rpc.rs b/container-chains/nodes/simple/src/rpc.rs index db487c3bc..7c3bf2fb0 100644 --- a/container-chains/nodes/simple/src/rpc.rs +++ b/container-chains/nodes/simple/src/rpc.rs @@ -93,7 +93,6 @@ where module.merge( ManualXcm { downward_message_channel, - upward_message_channel: None, hrmp_message_channel, } .into_rpc(), diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 1e1c8fffc..26317acdd 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -54,11 +54,7 @@ pub struct FullDeps { /// Manual seal command sink pub command_sink: Option>>, /// Channels for manual xcm messages (downward, hrmp) - pub xcm_senders: Option<( - flume::Sender>, - flume::Sender>, - flume::Sender<(ParaId, Vec)>, - )>, + pub xcm_senders: Option<(flume::Sender>, flume::Sender<(ParaId, Vec)>)>, } /// Instantiate all RPC extensions. @@ -102,13 +98,10 @@ where )?; }; - if let Some((downward_message_channel, upward_message_channel, hrmp_message_channel)) = - xcm_senders - { + if let Some((downward_message_channel, hrmp_message_channel)) = xcm_senders { module.merge( ManualXcm { downward_message_channel, - upward_message_channel: Some(upward_message_channel), hrmp_message_channel, } .into_rpc(), diff --git a/node/src/service.rs b/node/src/service.rs index 73a82007f..68780f9c8 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -896,9 +896,8 @@ pub fn start_dev_node( if parachain_config.role.is_authority() { let client = node_builder.client.clone(); let (downward_xcm_sender, downward_xcm_receiver) = flume::bounded::>(100); - let (upward_xcm_sender, _) = flume::bounded::>(100); let (hrmp_xcm_sender, hrmp_xcm_receiver) = flume::bounded::<(ParaId, Vec)>(100); - xcm_senders = Some((downward_xcm_sender, upward_xcm_sender, hrmp_xcm_sender)); + xcm_senders = Some((downward_xcm_sender, hrmp_xcm_sender)); command_sink = node_builder.install_manual_seal(ManualSealConfiguration { block_import,