Skip to content

Commit

Permalink
remove unneeded async
Browse files Browse the repository at this point in the history
  • Loading branch information
dimxy committed Oct 11, 2024
1 parent eb01307 commit af57ce5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mm2src/coins/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6101,7 +6101,7 @@ fn rpc_event_handlers_for_eth_transport(ctx: &MmArc, ticker: String) -> Vec<RpcT
vec![CoinTransportMetrics::new(metrics, ticker, RpcClientType::Ethereum).into_shared()]
}

async fn get_max_eth_tx_type_conf(conf: &Json) -> Result<Option<u64>, String> {
fn get_max_eth_tx_type_conf(conf: &Json) -> Result<Option<u64>, String> {
if !conf["max_eth_tx_type"].is_null() {
let max_eth_tx_type = conf["max_eth_tx_type"]
.as_u64()
Expand Down Expand Up @@ -6290,7 +6290,7 @@ pub async fn eth_coin_from_conf_and_request(
let (max_eth_tx_type, gas_limit, gas_fee_estimator) = {
let coin_type = coin_type.clone();
(async move || -> Result<_, String> {
let max_eth_tx_type = get_max_eth_tx_type_conf(conf).await?;
let max_eth_tx_type = get_max_eth_tx_type_conf(conf)?;
let gas_limit = extract_gas_limit_from_conf(conf)?;
let gas_fee_estimator = extract_gas_fee_estimator_from_value(req)?;
if let EthCoinType::Erc20 { platform, .. } | EthCoinType::Nft { platform } = &coin_type {
Expand Down
6 changes: 3 additions & 3 deletions mm2src/coins/eth/v2_activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl EthCoin {
};

// allow token params to override platform coin setting
let max_eth_tx_type = get_max_eth_tx_type_conf(&conf).await?.unwrap_or(self.max_eth_tx_type);
let max_eth_tx_type = get_max_eth_tx_type_conf(&conf)?.unwrap_or(self.max_eth_tx_type);
let gas_limit = extract_gas_limit_from_conf(&conf)
.map_to_mm(|e| EthTokenActivationError::InternalError(format!("invalid gas_limit config {}", e)))?
.unwrap_or(self.gas_limit.clone());
Expand Down Expand Up @@ -510,7 +510,7 @@ impl EthCoin {
};

// allow token params to override platform coin setting
let max_eth_tx_type = get_max_eth_tx_type_conf(&conf).await?.unwrap_or(self.max_eth_tx_type);
let max_eth_tx_type = get_max_eth_tx_type_conf(&conf)?.unwrap_or(self.max_eth_tx_type);
let gas_limit = extract_gas_limit_from_conf(&conf)
.map_to_mm(|e| EthTokenActivationError::InternalError(format!("invalid gas_limit config {}", e)))?
.unwrap_or(self.gas_limit.clone());
Expand Down Expand Up @@ -642,7 +642,7 @@ pub async fn eth_coin_from_conf_and_request_v2(
// Create an abortable system linked to the `MmCtx` so if the app is stopped on `MmArc::stop`,
// all spawned futures related to `ETH` coin will be aborted as well.
let abortable_system = ctx.abortable_system.create_subsystem()?;
let max_eth_tx_type = get_max_eth_tx_type_conf(conf).await?.unwrap_or_default();
let max_eth_tx_type = get_max_eth_tx_type_conf(conf)?.unwrap_or_default();
let gas_limit = extract_gas_limit_from_conf(conf)
.map_to_mm(|e| EthActivationV2Error::InternalError(format!("invalid gas_limit config {}", e)))?
.unwrap_or_default();
Expand Down

0 comments on commit af57ce5

Please sign in to comment.