WA-521 Including gas calculation upfront error when set free records in smartcontracts
This commit is contained in:
parent
b868dcd6f3
commit
82f4a24749
|
@ -42,10 +42,17 @@ export const executeTransaction = async (
|
||||||
const gnosisSafe = await getSafeEthereumInstance(safeAddress)
|
const gnosisSafe = await getSafeEthereumInstance(safeAddress)
|
||||||
const txConfirmationData =
|
const txConfirmationData =
|
||||||
gnosisSafe.contract.execTransactionIfApproved.getData(to, valueInWei, data, operation, nonce)
|
gnosisSafe.contract.execTransactionIfApproved.getData(to, valueInWei, data, operation, nonce)
|
||||||
|
const numOwners = await gnosisSafe.getOwners()
|
||||||
const gas = await calculateGasOf(txConfirmationData, sender, safeAddress)
|
const gas = await calculateGasOf(txConfirmationData, sender, safeAddress)
|
||||||
|
const gasIncludingRemovingStoreUpfront = gas + (numOwners.length * 15000)
|
||||||
const txReceipt =
|
const txReceipt = await gnosisSafe.execTransactionIfApproved(
|
||||||
await gnosisSafe.execTransactionIfApproved(to, valueInWei, data, operation, nonce, { from: sender, gas, gasPrice })
|
to,
|
||||||
|
valueInWei,
|
||||||
|
data,
|
||||||
|
operation,
|
||||||
|
nonce,
|
||||||
|
{ from: sender, gas: gasIncludingRemovingStoreUpfront, gasPrice },
|
||||||
|
)
|
||||||
const txHash = txReceipt.tx
|
const txHash = txReceipt.tx
|
||||||
await checkReceiptStatus(txHash)
|
await checkReceiptStatus(txHash)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue