fix: fix eth2Wei returning a bad string
This commit is contained in:
parent
e3c195dc22
commit
dad1dcf2c5
|
@ -1,4 +1,5 @@
|
||||||
import NimQml, os, strformat, strutils, parseUtils
|
import NimQml, os, strformat, strutils, parseUtils
|
||||||
|
import stint
|
||||||
import ../../status/status
|
import ../../status/status
|
||||||
import ../../status/stickers
|
import ../../status/stickers
|
||||||
import ../../status/libstatus/accounts/constants as accountConstants
|
import ../../status/libstatus/accounts/constants as accountConstants
|
||||||
|
@ -40,7 +41,8 @@ QtObject:
|
||||||
result = getSNTBalance($currAcct.address)
|
result = getSNTBalance($currAcct.address)
|
||||||
|
|
||||||
proc eth2Wei*(self: UtilsView, eth: string, decimals: int): string {.slot.} =
|
proc eth2Wei*(self: UtilsView, eth: string, decimals: int): string {.slot.} =
|
||||||
return $status_utils.eth2Wei(parseFloat(eth), decimals)
|
let uintValue = status_utils.eth2Wei(parseFloat(eth), decimals)
|
||||||
|
return uintValue.toString()
|
||||||
|
|
||||||
proc wei2Token*(self: UtilsView, wei: string, decimals: int): string {.slot.} =
|
proc wei2Token*(self: UtilsView, wei: string, decimals: int): string {.slot.} =
|
||||||
return status_utils.wei2Token(wei, decimals)
|
return status_utils.wei2Token(wei, decimals)
|
||||||
|
|
|
@ -37,9 +37,9 @@ Popup {
|
||||||
function requestTransaction(address, amount, tokenAddress, tokenDecimals = 18) {
|
function requestTransaction(address, amount, tokenAddress, tokenDecimals = 18) {
|
||||||
amount = utilsModel.eth2Wei(amount.toString(), tokenDecimals)
|
amount = utilsModel.eth2Wei(amount.toString(), tokenDecimals)
|
||||||
chatsModel.requestTransaction(chatsModel.activeChannel.id,
|
chatsModel.requestTransaction(chatsModel.activeChannel.id,
|
||||||
address,
|
address,
|
||||||
amount,
|
amount,
|
||||||
tokenAddress)
|
tokenAddress)
|
||||||
chatCommandModal.close()
|
chatCommandModal.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ lupdate_only{
|
||||||
SOURCES = *.qml \
|
SOURCES = *.qml \
|
||||||
app/*.qml \
|
app/*.qml \
|
||||||
shared/*.qml \
|
shared/*.qml \
|
||||||
|
shared/status/*.qml \
|
||||||
onboarding/*.qml \
|
onboarding/*.qml \
|
||||||
onboarding/Login/*.qml \
|
onboarding/Login/*.qml \
|
||||||
app/AppLayouts/*.qml \
|
app/AppLayouts/*.qml \
|
||||||
|
@ -22,6 +23,7 @@ SOURCES = *.qml \
|
||||||
app/AppLayouts/Chat/ChatColumn/*.qml \
|
app/AppLayouts/Chat/ChatColumn/*.qml \
|
||||||
app/AppLayouts/Chat/ChatColumn/ChatComponents/*.qml \
|
app/AppLayouts/Chat/ChatColumn/ChatComponents/*.qml \
|
||||||
app/AppLayouts/Chat/ChatColumn/MessageComponents/*.qml \
|
app/AppLayouts/Chat/ChatColumn/MessageComponents/*.qml \
|
||||||
|
app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/*.qml \
|
||||||
app/AppLayouts/Chat/ContactsColumn/*.qml \
|
app/AppLayouts/Chat/ContactsColumn/*.qml \
|
||||||
app/AppLayouts/Chat/components/*.qml \
|
app/AppLayouts/Chat/components/*.qml \
|
||||||
app/AppLayouts/Node/*.qml \
|
app/AppLayouts/Node/*.qml \
|
||||||
|
|
Loading…
Reference in New Issue