From 87b08d6acabcbe3fd08355303a7c954586d0a646 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Tue, 6 Mar 2018 21:41:10 -0500 Subject: [PATCH] gas limit changes (#127) --- README.md | 2 +- config/default.json | 3 ++- lib/ExtendTruffleContract.ts | 2 +- lib/utils.ts | 2 +- package-scripts.js | 4 ++-- package.json | 5 ++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9fbb10ddc..1b2a8e023 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ The default configuration settings for Arc.js can be found in its `config/defaul { "providerUrl": "http://127.0.0.0:8545", "network": "ganache", - "gasLimit": 6015000 + "gasLimit_runtime": 6015000 } ``` diff --git a/config/default.json b/config/default.json index 2f2975852..d36689c4b 100644 --- a/config/default.json +++ b/config/default.json @@ -1,7 +1,8 @@ { "autoApproveTokenTransfers": true, "defaultVotingMachine": "AbsoluteVote", - "gasLimit": 6300000, + "gasLimit_deployment": 6300000, + "gasLimit_runtime": 4543760, "network": "ganache", "providerUrl": "http://127.0.0.1:8545" } diff --git a/lib/ExtendTruffleContract.ts b/lib/ExtendTruffleContract.ts index 4999eb879..07576eed0 100644 --- a/lib/ExtendTruffleContract.ts +++ b/lib/ExtendTruffleContract.ts @@ -36,7 +36,7 @@ export abstract class ExtendTruffleContract { solidityContract.defaults({ // Use web3.eth.defaultAccount as the from account for all transactions from: Utils.getDefaultAccount(), - gas: Config.get("gasLimit"), + gas: Config.get("gasLimit_runtime"), }); } diff --git a/lib/utils.ts b/lib/utils.ts index 2c4493340..7cd27497e 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -33,7 +33,7 @@ export class Utils { contract.setProvider(myWeb3.currentProvider); contract.defaults({ from: Utils.getDefaultAccount(), - gas: Config.get("gasLimit"), + gas: Config.get("gasLimit_runtime"), }); return contract; } catch (ex) { diff --git a/package-scripts.js b/package-scripts.js index 0436ae2ec..d0f96fee6 100644 --- a/package-scripts.js +++ b/package-scripts.js @@ -39,8 +39,8 @@ const network = env.network || Config.network || "ganache"; const truffleIsInternal = fs.existsSync(joinPath(pathArcJsRoot, "node_modules", "truffle-core-migrate-without-compile")); const truffleCommand = `node ${joinPath(pathArcJsRoot, truffleIsInternal ? "node_modules" : "../../", "truffle-core-migrate-without-compile", "cli")}`; -const ganacheCommand = `ganache-cli -l ${Config.gasLimit} --account="0x0191ecbd1b150b8a3c27c27010ba51b45521689611e669109e034fd66ae69621,9999999999999999999999999999999999999999999" --account="0x00f360233e89c65970a41d4a85990ec6669526b2230e867c352130151453180d,9999999999999999999999999999999999999999999" --account="0x987a26abca7432016104ce2f24ce639340e25afe06ac69f68791399e7a5d1028,9999999999999999999999999999999999999999999" --account="0x89af34b1b7347834048b99423dad174a14bf14540d720d72c16ae92e94b987cb,9999999999999999999999999999999999999999999" --account="0xc867be647eb2bc51e4c0d61066859875cf3634fe949b6f5f85c69ab90e485b37,9999999999999999999999999999999999999999999" --account="0xefabcc2377dee5e51b5a9e65a3854aec85fbbec3cb584d8ad4f9679869fb33c6,9999999999999999999999999999999999999999999"`; -const ganacheDbCommand = `ganache-cli --db ${pathDaostackArcGanacheDb} -l ${Config.gasLimit} --networkId 1512051714758 --mnemonic "behave pipe turkey animal voyage dial relief menu blush match jeans general"`; +const ganacheCommand = `ganache-cli -l ${Config.gasLimit_deployment} --account="0x0191ecbd1b150b8a3c27c27010ba51b45521689611e669109e034fd66ae69621,9999999999999999999999999999999999999999999" --account="0x00f360233e89c65970a41d4a85990ec6669526b2230e867c352130151453180d,9999999999999999999999999999999999999999999" --account="0x987a26abca7432016104ce2f24ce639340e25afe06ac69f68791399e7a5d1028,9999999999999999999999999999999999999999999" --account="0x89af34b1b7347834048b99423dad174a14bf14540d720d72c16ae92e94b987cb,9999999999999999999999999999999999999999999" --account="0xc867be647eb2bc51e4c0d61066859875cf3634fe949b6f5f85c69ab90e485b37,9999999999999999999999999999999999999999999" --account="0xefabcc2377dee5e51b5a9e65a3854aec85fbbec3cb584d8ad4f9679869fb33c6,9999999999999999999999999999999999999999999"`; +const ganacheDbCommand = `ganache-cli --db ${pathDaostackArcGanacheDb} -l ${Config.gasLimit_deployment} --networkId 1512051714758 --mnemonic "behave pipe turkey animal voyage dial relief menu blush match jeans general"`; module.exports = { scripts: { diff --git a/package.json b/package.json index c26060692..b7738ef33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@daostack/arc.js", - "version": "0.0.0-alpha.32", + "version": "0.0.0-alpha.33", "description": "A JavaScript library for interacting with @daostack/arc ethereum smart contracts", "main": "dist/arc.js", "types": "index.d.ts", @@ -50,8 +50,7 @@ }, "homepage": "https://github.com/daostack/arc.js#readme", "peerDependencies": { - "babel-preset-env": "^1.6.1", - "run-with-ganache": "^0.1.1" + "babel-preset-env": "^1.6.1" }, "dependencies": { "archiver": "^2.1.0",