From b6856b208323db03ed2b7d60aec3d91ae6061291 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 21 Jan 2020 10:32:44 -0500 Subject: [PATCH] fix(@embark/test): increase default gas limit to 8M so tests support bigger contracts Was needed for the Teller Dapp as its Escrow contract is too big for the other default --- packages/plugins/ethereum-blockchain-client/src/index.js | 3 +-- packages/plugins/ganache/src/index.js | 4 +++- packages/plugins/mocha-tests/src/lib/index.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/plugins/ethereum-blockchain-client/src/index.js b/packages/plugins/ethereum-blockchain-client/src/index.js index 2837d50eee..8ab730a37c 100644 --- a/packages/plugins/ethereum-blockchain-client/src/index.js +++ b/packages/plugins/ethereum-blockchain-client/src/index.js @@ -70,8 +70,7 @@ class EthereumBlockchainClient { } if (!contract.gasPrice) { - const gasPrice = await web3.eth.getGasPrice(); - contract.gasPrice = contract.gasPrice || gasPrice; + contract.gasPrice = await web3.eth.getGasPrice(); } embarkJsUtils.secureSend(web3, contractObject, { diff --git a/packages/plugins/ganache/src/index.js b/packages/plugins/ganache/src/index.js index ebbc3b8aa3..c6f6d83b22 100644 --- a/packages/plugins/ganache/src/index.js +++ b/packages/plugins/ganache/src/index.js @@ -2,7 +2,9 @@ class Ganache { constructor(embark) { embark.events.request('blockchain:vm:register', () => { const ganache = require('ganache-cli'); - return ganache.provider(); + // Default to 8000000, which is the server default + // Somehow, the provider default is 6721975 + return ganache.provider({gasLimit: '0x7A1200'}); }); } } diff --git a/packages/plugins/mocha-tests/src/lib/index.js b/packages/plugins/mocha-tests/src/lib/index.js index d3581bebf4..fe6032a2bd 100644 --- a/packages/plugins/mocha-tests/src/lib/index.js +++ b/packages/plugins/mocha-tests/src/lib/index.js @@ -7,7 +7,7 @@ const Web3 = require('web3'); const Reporter = require('./reporter'); -const GAS_LIMIT = 6000000; +const GAS_LIMIT = 8000000; const JAVASCRIPT_TEST_MATCH = /^.+\.js$/i; const TEST_TIMEOUT = 15000; // 15 seconds in milliseconds