fix(@desktop/wallet): Fix for send transaction USDC error

fixes #8224
This commit is contained in:
Khushboo Mehta 2022-11-15 12:22:03 +01:00 committed by Iuri Matias
parent 77c5084355
commit c256ac0ac2
4 changed files with 11 additions and 9 deletions

View File

@ -114,12 +114,12 @@ QtObject {
mainModuleInst.resolveENS(value, "")
}
function getWei2Eth(wei) {
return globalUtils.wei2Eth(wei,18)
function getWei2Eth(wei, decimals) {
return globalUtils.wei2Eth(wei, decimals)
}
function getEth2Wei(eth) {
return globalUtils.eth2Wei(eth, 18)
function getEth2Wei(eth, decimals) {
return globalUtils.eth2Wei(eth, decimals)
}
function plainText(text) {

View File

@ -33,7 +33,7 @@ Item {
property bool interactive: true
property var weiToEth: function(wei) {}
signal reCalculateSuggestedRoute()
property var reCalculateSuggestedRoute: function() {}
QtObject {
id: d

View File

@ -79,7 +79,7 @@ Item {
amountToSend: root.amountToSend
isLoading: root.isLoading
weiToEth: function(wei) {
return "%1 %2".arg(LocaleUtils.numberToLocaleString(parseFloat(store.getWei2Eth(wei)))).arg(selectedAsset.symbol)
return "%1 %2".arg(LocaleUtils.numberToLocaleString(parseFloat(store.getWei2Eth(wei, selectedAsset.decimals)))).arg(selectedAsset.symbol)
}
}
}
@ -103,7 +103,7 @@ Item {
isLoading: root.isLoading
interactive: root.interactive
weiToEth: function(wei) {
return parseFloat(store.getWei2Eth(wei))
return parseFloat(store.getWei2Eth(wei, selectedAsset.decimals))
}
}
}
@ -128,7 +128,7 @@ Item {
isLoading: root.isLoading
interactive: root.interactive
weiToEth: function(wei) {
return parseFloat(store.getWei2Eth(wei))
return parseFloat(store.getWei2Eth(wei, selectedAsset.decimals))
}
}
}

View File

@ -87,7 +87,9 @@ ColumnLayout {
customMode: root.customMode
requiredGasInEth: root.requiredGasInEth
selectedAsset: root.selectedAsset
onReCalculateSuggestedRoute: root.reCalculateSuggestedRoute()
reCalculateSuggestedRoute: function() {
root.reCalculateSuggestedRoute()
}
bestRoutes: root.bestRoutes
weiToEth: root.weiToEth
interactive: root.interactive