Skip to content

Commit

Permalink
fix(@embark-ganache): fix ganache having different node accounts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrainville authored and 0x-r4bbit committed Mar 23, 2020
1 parent fde1eeb commit 897aa3f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/plugins/ganache/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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;
}
Expand Down

0 comments on commit 897aa3f

Please sign in to comment.