fix(@desktop/wallet): properly parse suggested routes error response

This commit is contained in:
Dario Gabriel Lipicar 2024-07-10 18:10:26 -03:00 committed by dlipicar
parent 6ae7e5fea2
commit ceeef2f313
2 changed files with 7 additions and 5 deletions

View File

@ -61,10 +61,12 @@ proc fromEvent*(T: type WalletSignal, signalType: SignalType, jsonSignal: JsonNo
let bestRouteJsonNode = event["Best"] let bestRouteJsonNode = event["Best"]
result.bestRouteRaw = $bestRouteJsonNode result.bestRouteRaw = $bestRouteJsonNode
result.bestRoute = bestRouteJsonNode.toTransactionPathsDtoV2() result.bestRoute = bestRouteJsonNode.toTransactionPathsDtoV2()
if event.contains("details"): if event.contains("ErrorResponse"):
result.error = event["details"].getStr let errorResponseJsonNode = event["ErrorResponse"]
if event.contains("code"): if errorResponseJsonNode.contains("details"):
result.errorCode = event["code"].getStr result.error = errorResponseJsonNode["details"].getStr
if errorResponseJsonNode.contains("code"):
result.errorCode = errorResponseJsonNode["code"].getStr
except: except:
error "Error parsing best route" error "Error parsing best route"
return return

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit c477a3845fda03accff72fe5ad6614ea1bafea09 Subproject commit 21101c9444288187348599347f00abc1b5e68fd6