Skip to content

Commit

Permalink
fix review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Nov 16, 2024
1 parent bb186c2 commit 77d7909
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 21 deletions.
3 changes: 0 additions & 3 deletions mm2src/coins/eth/v2_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ pub enum EthTokenActivationParams {
#[derive(Clone, Deserialize)]
pub struct Erc20TokenActivationRequest {
pub required_confirmations: Option<u64>,
// #[serde(default)]
// pub use_walletconnect: Option<bool>,
}

/// Holds ERC-20 token-specific activation parameters when using the task manager for activation.
Expand Down Expand Up @@ -805,7 +803,6 @@ pub(crate) async fn build_address_and_priv_key_policy(
let public_key = compress_public_key(public_key_uncompressed)?;
Ok((
EthPrivKeyPolicy::WalletConnect {
address,
public_key,
public_key_uncompressed,
},
Expand Down
6 changes: 2 additions & 4 deletions mm2src/coins/lp_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ use crypto::{derive_secp256k1_secret, Bip32Error, Bip44Chain, CryptoCtx, CryptoC
Secp256k1ExtendedPublicKey, Secp256k1Secret, WithHwRpcError};
use derive_more::Display;
use enum_derives::{EnumFromStringify, EnumFromTrait};
use ethereum_types::{H160, H256};
use ethereum_types::{H264, H520};
use ethereum_types::{H256, H264, H520};
use futures::compat::Future01CompatExt;
use futures::lock::{Mutex as AsyncMutex, MutexGuard as AsyncMutexGuard};
use futures::{FutureExt, TryFutureExt};
Expand Down Expand Up @@ -2123,7 +2122,7 @@ pub struct WithdrawRequest {
memo: Option<String>,
/// Tendermint specific field used for manually providing the IBC channel IDs.
ibc_source_channel: Option<String>,
/// Currently, this flag is used by ETH/ERC20 coins activated with MetaMask/WalletConnect **only**.
/// Currently, this flag is used by ETH/ERC20 coins activated with MetaMask/WalletConnect(Some wallets e.g Metamask) **only**.
#[serde(default)]
broadcast: bool,
}
Expand Down Expand Up @@ -3903,7 +3902,6 @@ pub enum PrivKeyPolicy<T> {
Metamask(EthMetamaskPolicy),

WalletConnect {
address: H160,
public_key: H264,
public_key_uncompressed: H520,
},
Expand Down
4 changes: 2 additions & 2 deletions mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4745,10 +4745,10 @@ pub fn derive_htlc_key_pair(coin: &UtxoCoinFields, _swap_unique_data: &[u8]) ->
activated_key: activated_key_pair,
..
} => activated_key_pair,
PrivKeyPolicy::Trezor => todo!(),
PrivKeyPolicy::Trezor => panic!("`PrivKeyPolicy::Trezor` is not supported for UTXO coins"),
#[cfg(target_arch = "wasm32")]
PrivKeyPolicy::Metamask(_) => panic!("`PrivKeyPolicy::Metamask` is not supported for UTXO coins"),
PrivKeyPolicy::WalletConnect { .. } => todo!(),
PrivKeyPolicy::WalletConnect { .. } => panic!("`PrivKeyPolicy::WalletConnect` is not supported for UTXO coins"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod dispatcher_legacy;
#[path = "rpc/lp_commands/lp_commands_legacy.rs"]
pub mod lp_commands_legacy;
mod rate_limiter;
#[path = "rpc/wc_commands/wc_commands.rs"] pub mod wc_commands;
pub mod wc_commands;

/// Lists the RPC method not requiring the "userpass" authentication.
/// None is also public to skip auth and display proper error in case of method is missing
Expand Down
11 changes: 0 additions & 11 deletions mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,6 @@ async fn dispatcher_v2(request: MmRpcRequest, ctx: MmArc) -> DispatcherResult<Re
"wc_disconnect_session" => handle_mmrpc(ctx, request, disconnect_session).await,
"wc_set_active_session" => handle_mmrpc(ctx, request, set_active_session).await,
"wc_ping_session" => handle_mmrpc(ctx, request, ping_session).await,
#[cfg(not(target_arch = "wasm32"))]
native_only_methods => match native_only_methods {
#[cfg(all(feature = "enable-solana", not(target_os = "ios"), not(target_os = "android")))]
"enable_solana_with_tokens" => {
handle_mmrpc(ctx, request, enable_platform_coin_with_tokens::<SolanaCoin>).await
},
#[cfg(all(feature = "enable-solana", not(target_os = "ios"), not(target_os = "android")))]
"enable_spl" => handle_mmrpc(ctx, request, enable_token::<SplToken>).await,
_ => MmError::err(DispatcherError::NoSuchMethod),
},
#[cfg(target_arch = "wasm32")]
_ => MmError::err(DispatcherError::NoSuchMethod),
}
}
Expand Down
File renamed without changes.

0 comments on commit 77d7909

Please sign in to comment.