Merge pull request #1845 from gnosis/hotfix/xdai-gas-estimation-low

(Hotix) - xDAI Gas estimation fix
This commit is contained in:
Daniel Sanchez 2021-02-02 23:24:49 +01:00 committed by GitHub
commit a1acfc206a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "safe-react",
"version": "2.19.0",
"version": "2.19.1",
"description": "Allowing crypto users manage funds in a safer way",
"website": "https://github.com/gnosis/safe-react#readme",
"bugs": {

View File

@ -182,15 +182,17 @@ const calculateMinimumGasForTransaction = async (
const amountOfGasToTryTx = txGasEstimation + dataGasEstimation + additionalGas
console.info(`Estimating transaction creation with gas amount: ${amountOfGasToTryTx}`)
try {
await getGasEstimationTxResponse({
const estimation = await getGasEstimationTxResponse({
to: safeAddress,
from: safeAddress,
data: estimateData,
gasPrice: 0,
gas: amountOfGasToTryTx,
})
console.info(`Gas estimation successfully finished with gas amount: ${amountOfGasToTryTx}`)
return amountOfGasToTryTx
if (estimation > 0) {
console.info(`Gas estimation successfully finished with gas amount: ${amountOfGasToTryTx}`)
return amountOfGasToTryTx
}
} catch (error) {
console.log(`Error trying to estimate gas with amount: ${amountOfGasToTryTx}`)
}