Skip to content

Commit ed36745

Browse files
committed
function reanamed to improve readability
1 parent d2f7776 commit ed36745

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ui/imports/shared/popups/send/controls/GasSelector.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Item {
6161
}
6262
property double decimalTotalGasAmountL1: {
6363
const l1FeeInGWei = modelData.gasFees.l1GasFee
64-
const l1FeeInEth = Utils.getGasDecimalValue(modelData.fromNetwork, l1FeeInGWei, modelData.gasAmount)
64+
const l1FeeInEth = Utils.calculateGasCost(modelData.fromNetwork, l1FeeInGWei, modelData.gasAmount)
6565
return l1FeeInEth
6666
}
6767

ui/imports/shared/popups/send/views/FeesView.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Rectangle {
7272
id: gasSelector
7373
width: parent.width
7474
getGasNativeCryptoValue: function(gasPrice, gasAmount, chainId) {
75-
return Utils.getGasDecimalValue(chainId, gasPrice, gasAmount)
75+
return Utils.calculateGasCost(chainId, gasPrice, gasAmount)
7676
}
7777
getFiatValue: root.currencyStore.getFiatValue
7878
formatCurrencyAmount: root.currencyStore.formatCurrencyAmount

ui/imports/utils/Utils.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,10 +853,10 @@ QtObject {
853853
StatusQUtils.AmountsArithmetic.fromNumber(1, rawDecimals - gasDecimals))
854854
}
855855

856-
function getGasDecimalValue(chainID, gasValue, gasLimit) {
857-
let rawValue = nativeTokenGasToRaw(chainID, gasValue)
858-
rawValue = StatusQUtils.AmountsArithmetic.times(rawValue, StatusQUtils.AmountsArithmetic.fromNumber(gasLimit))
859-
return nativeTokenRawToDecimal(chainID, rawValue)
856+
function calculateGasCost(chainID, gasPriceInGwei, gasAmount) {
857+
let rawGasPrice = nativeTokenGasToRaw(chainID, gasPriceInGwei)
858+
rawGasPrice = StatusQUtils.AmountsArithmetic.times(rawGasPrice, StatusQUtils.AmountsArithmetic.fromNumber(gasAmount))
859+
return nativeTokenRawToDecimal(chainID, rawGasPrice)
860860
}
861861

862862
// Leave this function at the bottom of the file as QT Creator messes up the code color after this

0 commit comments

Comments
 (0)