File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ Item {
61
61
}
62
62
property double decimalTotalGasAmountL1: {
63
63
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 )
65
65
return l1FeeInEth
66
66
}
67
67
68
68
property double decimalTotalGasAmount: {
69
69
let maxFees = modelData .gasFees .maxFeePerGasM
70
70
let gasPrice = modelData .gasFees .eip1559Enabled ? maxFees : modelData .gasFees .gasPrice
71
- return root .getGasNativeCryptoValue (gasPrice , modelData .gasAmount )
71
+ return root .getGasNativeCryptoValue (gasPrice, modelData .gasAmount , modelData . fromNetwork )
72
72
}
73
73
74
74
property double totalGasAmountFiat: root .getFiatValue (decimalTotalGasAmount, gasSymbol) + root .getFiatValue (decimalTotalGasAmountL1, gasSymbol)
Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ Rectangle {
71
71
GasSelector {
72
72
id: gasSelector
73
73
width: parent .width
74
- getGasNativeCryptoValue : function (gasPrice , gasAmount ) {
75
- return Utils .getGasDecimalValue ( root . selectedAsset . chainId , gasPrice, gasAmount)
74
+ getGasNativeCryptoValue : function (gasPrice , gasAmount , chainId ) {
75
+ return Utils .calculateGasCost ( chainId, gasPrice, gasAmount)
76
76
}
77
77
getFiatValue: root .currencyStore .getFiatValue
78
78
formatCurrencyAmount: root .currencyStore .formatCurrencyAmount
Original file line number Diff line number Diff line change @@ -851,10 +851,10 @@ QtObject {
851
851
StatusQUtils .AmountsArithmetic .fromNumber (1 , rawDecimals - gasDecimals))
852
852
}
853
853
854
- function getGasDecimalValue (chainID , gasValue , gasLimit ) {
855
- let rawValue = nativeTokenGasToRaw (chainID, gasValue )
856
- rawValue = StatusQUtils .AmountsArithmetic .times (rawValue , StatusQUtils .AmountsArithmetic .fromNumber (1 , gasLimit ))
857
- return nativeTokenRawToDecimal (chainID, rawValue )
854
+ function calculateGasCost (chainID , gasPriceInGasUnit , gasAmount ) {
855
+ let rawGasPrice = nativeTokenGasToRaw (chainID, gasPriceInGasUnit )
856
+ rawGasPrice = StatusQUtils .AmountsArithmetic .times (rawGasPrice , StatusQUtils .AmountsArithmetic .fromNumber (gasAmount ))
857
+ return nativeTokenRawToDecimal (chainID, rawGasPrice )
858
858
}
859
859
860
860
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
You can’t perform that action at this time.
0 commit comments