From f569e731edfecc97b690db084336dbb416536c78 Mon Sep 17 00:00:00 2001 From: dimxy Date: Mon, 27 Nov 2023 17:37:26 +0500 Subject: [PATCH] fix wasm build for trezor init --- mm2src/coins/z_coin.rs | 1 + mm2src/crypto/src/hw_client.rs | 12 ++++++------ mm2src/mm2_main/src/lp_init/init_metamask.rs | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mm2src/coins/z_coin.rs b/mm2src/coins/z_coin.rs index 818dd28317..041dc1e251 100644 --- a/mm2src/coins/z_coin.rs +++ b/mm2src/coins/z_coin.rs @@ -1,6 +1,7 @@ use crate::coin_errors::MyAddressError; #[cfg(not(target_arch = "wasm32"))] use crate::my_tx_history_v2::{MyTxHistoryErrorV2, MyTxHistoryRequestV2, MyTxHistoryResponseV2}; +#[cfg(not(target_arch = "wasm32"))] use crate::rpc_command::init_withdraw::WithdrawTaskHandleShared; #[cfg(not(target_arch = "wasm32"))] use crate::rpc_command::init_withdraw::{InitWithdrawCoin, WithdrawInProgressStatus}; diff --git a/mm2src/crypto/src/hw_client.rs b/mm2src/crypto/src/hw_client.rs index fbd7239e11..4cb78b05b5 100644 --- a/mm2src/crypto/src/hw_client.rs +++ b/mm2src/crypto/src/hw_client.rs @@ -92,9 +92,9 @@ impl HwClient { } #[cfg(target_arch = "wasm32")] - pub(crate) async fn trezor( - processor: &Processor, - ) -> MmResult> { + pub(crate) async fn trezor( + processor: Arc>, + ) -> MmResult> { let timeout = processor.on_connect().await?; let fut = async move { @@ -184,9 +184,9 @@ impl HwClient { } #[cfg(target_os = "ios")] - pub(crate) async fn trezor( - _processor: &Processor, - ) -> MmResult> { + pub(crate) async fn trezor( + _processor: Arc>, + ) -> MmResult> { MmError::err(HwProcessingError::HwError(HwError::Internal( "Not supported on iOS!".into(), ))) diff --git a/mm2src/mm2_main/src/lp_init/init_metamask.rs b/mm2src/mm2_main/src/lp_init/init_metamask.rs index fb3494dc58..56f4a4a705 100644 --- a/mm2src/mm2_main/src/lp_init/init_metamask.rs +++ b/mm2src/mm2_main/src/lp_init/init_metamask.rs @@ -13,6 +13,7 @@ use rpc_task::rpc_common::{CancelRpcTaskError, CancelRpcTaskRequest, InitRpcTask RpcTaskStatusRequest}; use rpc_task::{RpcTask, RpcTaskError, RpcTaskHandle, RpcTaskManager, RpcTaskManagerShared, RpcTaskStatus, RpcTaskTypes}; use std::time::Duration; +use std::sync::Arc; pub type InitMetamaskManagerShared = RpcTaskManagerShared; pub type InitMetamaskStatus = @@ -120,7 +121,7 @@ impl RpcTask for InitMetamaskTask { } } - async fn run(&mut self, task_handle: InitMetamaskTaskHandleShared) -> Result> { + async fn run(&mut self, _task_handle: InitMetamaskTaskHandleShared) -> Result> { let crypto_ctx = CryptoCtx::from_ctx(&self.ctx)?; let metamask = crypto_ctx.init_metamask_ctx(self.req.project.clone()).await?;