From d2ec9854ad39546f297bb09b485a6eb4c4544fd3 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 24 Nov 2020 13:15:59 -0400 Subject: [PATCH] fix: transaction dialog not showing up due to missing slot --- src/app/utilsView/view.nim | 7 +++++++ ui/app/AppLayouts/Browser/BrowserLayout.qml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/utilsView/view.nim b/src/app/utilsView/view.nim index 792382244d..fa36718215 100644 --- a/src/app/utilsView/view.nim +++ b/src/app/utilsView/view.nim @@ -81,3 +81,10 @@ QtObject: proc urlFromUserInput*(self: UtilsView, input: string): string {.slot.} = result = url_fromUserInput(input) + + proc wei2Eth*(self: UtilsView, wei: string, decimals: int): string {.slot.} = + var weiValue = wei + if(weiValue.startsWith("0x")): + weiValue = fromHex(Stuint[256], weiValue).toString() + return status_utils.wei2Eth(weiValue, decimals) + diff --git a/ui/app/AppLayouts/Browser/BrowserLayout.qml b/ui/app/AppLayouts/Browser/BrowserLayout.qml index 6c79c55c67..8492dc6a34 100644 --- a/ui/app/AppLayouts/Browser/BrowserLayout.qml +++ b/ui/app/AppLayouts/Browser/BrowserLayout.qml @@ -129,7 +129,7 @@ Rectangle { request.payload.method === "eth_sendTransaction") { walletModel.setFocusedAccountByAddress(request.payload.params[0].from) var acc = walletModel.focusedAccount - const value = utilsModel.wei2Token(request.payload.params[0].value, 18) + const value = utilsModel.wei2Eth(request.payload.params[0].value, 18); const sendDialog = sendTransactionModalComponent.createObject(browserWindow, { trxData:request.payload.params[0].data,