Skip to content

Commit

Permalink
fix wasm build for trezor init
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Nov 27, 2023
1 parent 1785065 commit f569e73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions mm2src/coins/z_coin.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
12 changes: 6 additions & 6 deletions mm2src/crypto/src/hw_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ impl HwClient {
}

#[cfg(target_arch = "wasm32")]
pub(crate) async fn trezor<Processor: TrezorConnectProcessor>(
processor: &Processor,
) -> MmResult<TrezorClient, HwProcessingError<Processor::Error>> {
pub(crate) async fn trezor(
processor: Arc<dyn TrezorConnectProcessor<Error = RpcTaskError>>,
) -> MmResult<TrezorClient, HwProcessingError<RpcTaskError>> {
let timeout = processor.on_connect().await?;

let fut = async move {
Expand Down Expand Up @@ -184,9 +184,9 @@ impl HwClient {
}

#[cfg(target_os = "ios")]
pub(crate) async fn trezor<Processor: TrezorConnectProcessor>(
_processor: &Processor,
) -> MmResult<TrezorClient, HwProcessingError<Processor::Error>> {
pub(crate) async fn trezor(
_processor: Arc<dyn TrezorConnectProcessor<Error = RpcTaskError>>,
) -> MmResult<TrezorClient, HwProcessingError<RpcTaskError>> {
MmError::err(HwProcessingError::HwError(HwError::Internal(
"Not supported on iOS!".into(),
)))
Expand Down
3 changes: 2 additions & 1 deletion mm2src/mm2_main/src/lp_init/init_metamask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<InitMetamaskTask>;
pub type InitMetamaskStatus =
Expand Down Expand Up @@ -120,7 +121,7 @@ impl RpcTask for InitMetamaskTask {
}
}

async fn run(&mut self, task_handle: InitMetamaskTaskHandleShared) -> Result<Self::Item, MmError<Self::Error>> {
async fn run(&mut self, _task_handle: InitMetamaskTaskHandleShared) -> Result<Self::Item, MmError<Self::Error>> {
let crypto_ctx = CryptoCtx::from_ctx(&self.ctx)?;

let metamask = crypto_ctx.init_metamask_ctx(self.req.project.clone()).await?;
Expand Down

0 comments on commit f569e73

Please sign in to comment.