diff --git a/mm2src/coins/eth.rs b/mm2src/coins/eth.rs index 2c274fd402e..307839edc2e 100644 --- a/mm2src/coins/eth.rs +++ b/mm2src/coins/eth.rs @@ -4248,7 +4248,7 @@ impl EthCoin { // TODO refactor to error_log_passthrough once simple maker bot is merged let gas_station_price = match &coin.gas_station_url { Some(url) => { - match GasStationData::get_gas_price(url, coin.gas_station_decimals, &coin.gas_station_policy) + match GasStationData::get_gas_price(url, coin.gas_station_decimals, coin.gas_station_policy.clone()) .compat() .await { @@ -5002,7 +5002,7 @@ pub struct GasStationData { } impl GasStationData { - fn average_gwei(&self, decimals: u8, gas_price_policy: &GasStationPricePolicy) -> NumConversResult { + fn average_gwei(&self, decimals: u8, gas_price_policy: GasStationPricePolicy) -> NumConversResult { let gas_price = match gas_price_policy { GasStationPricePolicy::MeanAverageFast => ((&self.average + &self.fast) / MmNumber::from(2)).into(), GasStationPricePolicy::Average => self.average.to_decimal(), @@ -5010,7 +5010,7 @@ impl GasStationData { wei_from_big_decimal(&gas_price, decimals) } - fn get_gas_price(uri: &str, decimals: u8, gas_price_policy: &GasStationPricePolicy) -> Web3RpcFut { + fn get_gas_price(uri: &str, decimals: u8, gas_price_policy: GasStationPricePolicy) -> Web3RpcFut { let uri = uri.to_owned(); let fut = async move { make_gas_station_request(&uri) diff --git a/mm2src/coins/eth/eth_tests.rs b/mm2src/coins/eth/eth_tests.rs index 3a3ba97a369..5c2d844381d 100644 --- a/mm2src/coins/eth/eth_tests.rs +++ b/mm2src/coins/eth/eth_tests.rs @@ -713,7 +713,7 @@ fn test_gas_station() { let res_eth = GasStationData::get_gas_price( "https://ethgasstation.info/api/ethgasAPI.json", 8, - &GasStationPricePolicy::MeanAverageFast, + GasStationPricePolicy::MeanAverageFast, ) .wait() .unwrap(); @@ -725,7 +725,7 @@ fn test_gas_station() { let res_polygon = GasStationData::get_gas_price( "https://gasstation-mainnet.matic.network/", 9, - &GasStationPricePolicy::Average, + GasStationPricePolicy::Average, ) .wait() .unwrap();