|
@@ -1,14 +1,20 @@
|
|
|
|
+require('dotenv').config();
|
|
require('babel-register');
|
|
require('babel-register');
|
|
require('babel-polyfill');
|
|
require('babel-polyfill');
|
|
|
|
|
|
-var provider;
|
|
|
|
-var HDWalletProvider = require('truffle-hdwallet-provider');
|
|
|
|
-var mnemonic = '[REDACTED]';
|
|
|
|
|
|
+const HDWalletProvider = require('truffle-hdwallet-provider');
|
|
|
|
|
|
-if (!process.env.SOLIDITY_COVERAGE){
|
|
|
|
- provider = new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/')
|
|
|
|
-}
|
|
|
|
|
|
+const providerWithMnemonic = (mnemonic, rpcEndpoint) =>
|
|
|
|
+ new HDWalletProvider(mnemonic, rpcEndpoint)
|
|
|
|
|
|
|
|
+const infuraProvider = network => providerWithMnemonic(
|
|
|
|
+ process.env.MNEMONIC,
|
|
|
|
+ `https://${network}.infura.io/${process.env.INFURA_API_KEY}`
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+const ropstenProvider = process.env.SOLIDITY_COVERAGE
|
|
|
|
+ ? undefined
|
|
|
|
+ : infuraProvider('ropsten')
|
|
|
|
|
|
module.exports = {
|
|
module.exports = {
|
|
networks: {
|
|
networks: {
|
|
@@ -18,7 +24,7 @@ module.exports = {
|
|
network_id: '*'
|
|
network_id: '*'
|
|
},
|
|
},
|
|
ropsten: {
|
|
ropsten: {
|
|
- provider: provider,
|
|
|
|
|
|
+ provider: ropstenProvider,
|
|
network_id: 3 // official id of the ropsten network
|
|
network_id: 3 // official id of the ropsten network
|
|
},
|
|
},
|
|
coverage: {
|
|
coverage: {
|
|
@@ -27,6 +33,16 @@ module.exports = {
|
|
port: 8555,
|
|
port: 8555,
|
|
gas: 0xfffffffffff,
|
|
gas: 0xfffffffffff,
|
|
gasPrice: 0x01
|
|
gasPrice: 0x01
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ testrpc: {
|
|
|
|
+ host: 'localhost',
|
|
|
|
+ port: 8545,
|
|
|
|
+ network_id: '*'
|
|
|
|
+ },
|
|
|
|
+ ganache: {
|
|
|
|
+ host: 'localhost',
|
|
|
|
+ port: 7545,
|
|
|
|
+ network_id: '*'
|
|
|
|
+ },
|
|
}
|
|
}
|
|
};
|
|
};
|