diff --git a/package.json b/package.json index d0ecb976f..134549de2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "prepare": "npm run build", "test": "ava", "lint": "eslint src test && documentation lint src test", - "extract-roles": "scripts/extract-roles" + "extract-roles": "node scripts/extract-roles" }, "repository": { "type": "git", diff --git a/src/acl/index.js b/src/acl/index.js index 53d5b693c..072ee18a3 100644 --- a/src/acl/index.js +++ b/src/acl/index.js @@ -35,7 +35,7 @@ module.exports = ({ web3, network }) => { const roleId = await getRoleId(repoAddr) const call = acl.methods.grantPermission(grantee, repoAddr, roleId) - const estimatedGas = call.estimatedGas() + const estimatedGas = call.estimateGas() return { to: acl.options.address, diff --git a/src/commands/apm_cmds/grant.js b/src/commands/apm_cmds/grant.js index a7834e0e8..e67ef75b2 100644 --- a/src/commands/apm_cmds/grant.js +++ b/src/commands/apm_cmds/grant.js @@ -1,7 +1,6 @@ const APM = require('@aragon/apm') const ACL = require('../../acl') const { ensureWeb3 } = require('../../helpers/web3-fallback') -const { getRecommendedGasLimit } = require('../../util') exports.command = 'grant [grantees..]' exports.describe = @@ -61,10 +60,7 @@ exports.handler = async function({ .defaultGasPrice transaction.from = from transaction.gasPrice = network.gasPrice || DEFAULT_GAS_PRICE - transaction.gas = await getRecommendedGasLimit( - web3, - await transaction.estimateGas() - ) + // the recommended gasLimit is already calculated by the ACL module try { const receipt = await web3.eth.sendTransaction(transaction) diff --git a/src/commands/apm_cmds/publish.js b/src/commands/apm_cmds/publish.js index 7190c642e..21d8d4db1 100644 --- a/src/commands/apm_cmds/publish.js +++ b/src/commands/apm_cmds/publish.js @@ -20,7 +20,6 @@ const deploy = require('../deploy') const startIPFS = require('../ipfs') const getRepoTask = require('../dao_cmds/utils/getRepoTask') const listrOpts = require('../../helpers/listr-options') -const { getRecommendedGasLimit } = require('../../util') const DEFAULT_GAS_PRICE = require('../../../package.json').aragon .defaultGasPrice @@ -578,10 +577,7 @@ exports.task = function({ transaction.from = from transaction.gasPrice = network.gasPrice || DEFAULT_GAS_PRICE - transaction.gas = await getRecommendedGasLimit( - web3, - await transaction.estimateGas() - ) + // apm.js already calculates the recommended gas ctx.receipt = await web3.eth.sendTransaction(transaction) } catch (e) {