Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Aug 16, 2024
1 parent eb53960 commit df99cc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6440,9 +6440,9 @@ async fn get_max_eth_tx_type_conf(ctx: &MmArc, conf: &Json, coin_type: &EthCoinT
if let Some(coin_max_eth_tx_type) = coin_max_eth_tx_type {
Ok(Some(coin_max_eth_tx_type))
} else {
// Note that platform_coin is not available when the token is enabled via "enable_eth_with_tokens"
// Note that platform_coin is not available when the token is enabled via "enable_eth_with_tokens"
// (but we access platform coin directly - see initialise_erc20_token fn).
// So this code works only for the legacy "enable" rpc, called first for the platform coin then for a token
// So this code works only for the legacy "enable" rpc, called first for the platform coin then for a token
let platform_coin = lp_coinfind_or_err(ctx, platform).await;
match platform_coin {
Ok(MmCoinEnum::EthCoin(eth_coin)) => Ok(eth_coin.max_eth_tx_type),
Expand Down
8 changes: 6 additions & 2 deletions mm2src/coins/eth/v2_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ impl EthCoin {
token_addr: protocol.token_addr,
};
let platform_fee_estimator_state = FeeEstimatorState::init_fee_estimator(&ctx, &conf, &coin_type).await?;
let max_eth_tx_type = get_max_eth_tx_type_conf(&ctx, &conf, &coin_type).await?.or_else(|| self.max_eth_tx_type); // use the platform coin setting if token setting is none
let max_eth_tx_type = get_max_eth_tx_type_conf(&ctx, &conf, &coin_type)
.await?
.or(self.max_eth_tx_type); // use the platform coin setting if token setting is none
let use_access_list = conf["use_access_list"].as_bool().unwrap_or(false);
let gas_limit = extract_gas_limit_from_conf(&conf)
.map_to_mm(|e| EthTokenActivationError::InternalError(format!("invalid gas_limit config {}", e)))?;
Expand Down Expand Up @@ -532,7 +534,9 @@ impl EthCoin {
platform: self.ticker.clone(),
};
let platform_fee_estimator_state = FeeEstimatorState::init_fee_estimator(&ctx, &conf, &coin_type).await?;
let max_eth_tx_type = get_max_eth_tx_type_conf(&ctx, &conf, &coin_type).await?.or_else(|| self.max_eth_tx_type); // use the platform coin setting if token setting is none
let max_eth_tx_type = get_max_eth_tx_type_conf(&ctx, &conf, &coin_type)
.await?
.or(self.max_eth_tx_type); // use the platform coin setting if token setting is none
let use_access_list = conf["use_access_list"].as_bool().unwrap_or(false);
let gas_limit = extract_gas_limit_from_conf(&conf)
.map_to_mm(|e| EthTokenActivationError::InternalError(format!("invalid gas_limit config {}", e)))?;
Expand Down

0 comments on commit df99cc5

Please sign in to comment.