Skip to content

Commit bcaa967

Browse files
authored
Merge pull request #786 from Adamant-im/trello.com/c/gOHDDVHJ
[trello.com/c/gOHDDVHJ] fix crush from async let
2 parents a8c09a0 + 3a2ca18 commit bcaa967

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Adamant/Modules/Wallets/ERC20/ERC20WalletService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,6 @@ final class ERC20WalletService: WalletCoreProtocol, ERC20GasAlgorithmComputable,
297297

298298
func calculateFee(for address: EthereumAddress? = nil) async {
299299
// Setting initial
300-
async let pricePriceAsync = getGasPrices()
301-
async let gasLimitAsync = getGasLimit(to: address)
302300
var gasPriceCoeficient: Decimal = 1
303301
if isIncreaseFeeEnabled {
304302
gasPriceCoeficient += token.increasedGasPricePercent / 100
@@ -309,8 +307,10 @@ final class ERC20WalletService: WalletCoreProtocol, ERC20GasAlgorithmComputable,
309307

310308
// Getting gas data
311309
do {
312-
let (gasPriceFromChain, gasLimitFromChain) = try await (pricePriceAsync, gasLimitAsync)
310+
let gasPriceFromChain = try await getGasPrices()
311+
let gasLimitFromChain = try await getGasLimit(to: address)
313312
try Task.checkCancellation()
313+
314314
gasPrice = gasPriceFromChain
315315
gasLimit = gasLimitFromChain
316316
} catch {

Adamant/Modules/Wallets/Ethereum/EthWalletService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ final class EthWalletService: WalletCoreProtocol, WalletStaticCoreProtocol, ERC2
350350
}
351351

352352
func calculateFee(for address: EthereumAddress? = nil) async {
353-
async let pricePriceAsync = getGasPrices()
354-
async let gasLimitAsync = getGasLimit(to: address)
355353
var gasPriceCoeficient: Decimal = 1
356354
if isIncreaseFeeEnabled {
357355
gasPriceCoeficient += increasedGasPricePercent / 100
@@ -362,8 +360,10 @@ final class EthWalletService: WalletCoreProtocol, WalletStaticCoreProtocol, ERC2
362360

363361
// Getting gas data
364362
do {
365-
let (gasPriceFromChain, gasLimitFromChain) = try await (pricePriceAsync, gasLimitAsync)
363+
let gasPriceFromChain = try await getGasPrices()
364+
let gasLimitFromChain = try await getGasLimit(to: address)
366365
try Task.checkCancellation()
366+
367367
gasPrice = gasPriceFromChain
368368
gasLimit = gasLimitFromChain
369369
} catch {

0 commit comments

Comments
 (0)