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"]
result.bestRouteRaw = $bestRouteJsonNode
result.bestRoute = bestRouteJsonNode.toTransactionPathsDtoV2()
if event.contains("details"):
result.error = event["details"].getStr
if event.contains("code"):
result.errorCode = event["code"].getStr
if event.contains("ErrorResponse"):
let errorResponseJsonNode = event["ErrorResponse"]
if errorResponseJsonNode.contains("details"):
result.error = errorResponseJsonNode["details"].getStr
if errorResponseJsonNode.contains("code"):
result.errorCode = errorResponseJsonNode["code"].getStr
except:
error "Error parsing best route"
return

2
vendor/status-go vendored

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