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, "") mainModuleInst.resolveENS(value, "")
} }
function getWei2Eth(wei) { function getWei2Eth(wei, decimals) {
return globalUtils.wei2Eth(wei,18) return globalUtils.wei2Eth(wei, decimals)
} }
function getEth2Wei(eth) { function getEth2Wei(eth, decimals) {
return globalUtils.eth2Wei(eth, 18) return globalUtils.eth2Wei(eth, decimals)
} }
function plainText(text) { function plainText(text) {

View File

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

View File

@ -79,7 +79,7 @@ Item {
amountToSend: root.amountToSend amountToSend: root.amountToSend
isLoading: root.isLoading isLoading: root.isLoading
weiToEth: function(wei) { 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 isLoading: root.isLoading
interactive: root.interactive interactive: root.interactive
weiToEth: function(wei) { weiToEth: function(wei) {
return parseFloat(store.getWei2Eth(wei)) return parseFloat(store.getWei2Eth(wei, selectedAsset.decimals))
} }
} }
} }
@ -128,7 +128,7 @@ Item {
isLoading: root.isLoading isLoading: root.isLoading
interactive: root.interactive interactive: root.interactive
weiToEth: function(wei) { 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 customMode: root.customMode
requiredGasInEth: root.requiredGasInEth requiredGasInEth: root.requiredGasInEth
selectedAsset: root.selectedAsset selectedAsset: root.selectedAsset
onReCalculateSuggestedRoute: root.reCalculateSuggestedRoute() reCalculateSuggestedRoute: function() {
root.reCalculateSuggestedRoute()
}
bestRoutes: root.bestRoutes bestRoutes: root.bestRoutes
weiToEth: root.weiToEth weiToEth: root.weiToEth
interactive: root.interactive interactive: root.interactive