Set same estimation gasCost as MM (#2011)

Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
This commit is contained in:
nicolas 2021-03-10 05:37:27 -03:00 committed by GitHub
parent 4ee5fe57b2
commit 6444c37380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -237,12 +237,13 @@ export const useEstimateTransactionGas = ({
approvalAndExecution,
})
const totalGasEstimation = (gasEstimation + fixedGasCosts) * 2
const gasPrice = manualGasPrice ? web3.utils.toWei(manualGasPrice, 'gwei') : await calculateGasPrice()
const gasPriceFormatted = web3.utils.fromWei(gasPrice, 'gwei')
const estimatedGasCosts = (gasEstimation + fixedGasCosts) * parseInt(gasPrice, 10)
const estimatedGasCosts = totalGasEstimation * parseInt(gasPrice, 10)
const gasCost = fromTokenUnit(estimatedGasCosts, nativeCoin.decimals)
const gasCostFormatted = formatAmount(gasCost)
const gasLimit = ((gasEstimation + fixedGasCosts) * 2).toString()
const gasLimit = totalGasEstimation.toString()
let txEstimationExecutionStatus = EstimationStatus.SUCCESS