From 897aa3f839e0013035e2cd51a8359b241b5215f4 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 18 Mar 2020 13:12:13 -0400 Subject: [PATCH] fix(@embark-ganache): fix ganache having different node accounts When using accounts, yes those account are always the same, but ganache still creates it's own accounts, with a random mnemonic. So Plugins that rely on the node accounts were crashing on second run, because the node accounts were no longer the same. --- packages/plugins/ganache/src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/plugins/ganache/src/index.js b/packages/plugins/ganache/src/index.js index f708034527..1d5ce312a8 100644 --- a/packages/plugins/ganache/src/index.js +++ b/packages/plugins/ganache/src/index.js @@ -53,8 +53,6 @@ class Ganache { // => https://github.com/trufflesuite/ganache-cli/issues/558 this.embark.fs.ensureDirSync(blockchainConfig.datadir); - const hasAccounts = blockchainConfig.accounts && blockchainConfig.accounts.length; - const isTest = this.embark.currentContext.includes('test'); this.currentProvider = ganache.provider({ @@ -65,7 +63,7 @@ class Ganache { network_id: blockchainConfig.networkId || 1337, db_path: isTest ? '' : blockchainConfig.datadir, default_balance_ether: '99999', - mnemonic: hasAccounts || isTest ? '' : constants.blockchain.defaultMnemonic + mnemonic: isTest ? '' : constants.blockchain.defaultMnemonic }); return this.currentProvider; }