fix(@desktop/wallet): Wallet - Send - Crash after opening send modal
The error seen in the bug is linked to getSuggestedFees returning an rpc error that was unhandled, I think this should resolve this issue. fixes #6801
This commit is contained in:
parent
e1c548696f
commit
171b31ad93
|
@ -370,6 +370,7 @@ QtObject:
|
|||
return self.transferTokens(from_addr, to_addr, assetSymbol, value, gas, gasPrice, maxPriorityFeePerGas, maxFeePerGas, password, chainId, uuid, eip1559Enabled)
|
||||
|
||||
proc suggestedFees*(self: Service, chainId: int): SuggestedFees =
|
||||
try:
|
||||
let response = eth.suggestedFees(chainId).result
|
||||
return SuggestedFees(
|
||||
gasPrice: parseFloat(response{"gasPrice"}.getStr),
|
||||
|
@ -380,12 +381,17 @@ QtObject:
|
|||
maxFeePerGasH: parseFloat(response{"maxFeePerGasHigh"}.getStr),
|
||||
eip1559Enabled: response{"eip1559Enabled"}.getbool,
|
||||
)
|
||||
except Exception as e:
|
||||
error "Error getting suggested fees", msg = e.msg
|
||||
|
||||
proc suggestedRoutes*(self: Service, account: string, amount: float64, token: string, disabledChainIDs: seq[uint64]): SuggestedRoutes =
|
||||
try:
|
||||
let response = eth.suggestedRoutes(account, amount, token, disabledChainIDs)
|
||||
return SuggestedRoutes(
|
||||
networks: Json.decode($response.result{"networks"}, seq[NetworkDto])
|
||||
)
|
||||
except Exception as e:
|
||||
error "Error getting suggested routes", msg = e.msg
|
||||
|
||||
proc fetchCryptoServices*(self: Service): seq[CryptoRampDto] =
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue