From b1a7dc95081f9728fb26bdf3bd3402af523f5f88 Mon Sep 17 00:00:00 2001 From: Robert Valta Date: Sun, 29 Jul 2018 01:46:14 +0300 Subject: [PATCH 1/2] Add gas for ropsten migration --- truffle.js | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/truffle.js b/truffle.js index ca327f13..8793b879 100644 --- a/truffle.js +++ b/truffle.js @@ -1,22 +1,24 @@ -const HDWalletProvider = require('truffle-hdwallet-provider') -const fs = require('fs') +const HDWalletProvider = require('truffle-hdwallet-provider'); +const fs = require('fs'); // First read in the secrets.json to get our mnemonic -let secrets -let mnemonic +let secrets; +let mnemonic; if (fs.existsSync('secrets.json')) { - secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8')) - mnemonic = secrets.mnemonic + secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8')); + mnemonic = secrets.mnemonic; } else { - console.log('No secrets.json found. If you are trying to publish EPM ' + - 'this will fail. Otherwise, you can ignore this message!') - mnemonic = '' + console.log( + 'No secrets.json found. If you are trying to publish EPM ' + + 'this will fail. Otherwise, you can ignore this message!', + ); + mnemonic = ''; } module.exports = { networks: { live: { - network_id: 1 // Ethereum public network + network_id: 1, // Ethereum public network // optional config values // host - defaults to "localhost" // port - defaults to 8545 @@ -25,18 +27,19 @@ module.exports = { // from - default address to use for any transaction Truffle makes during migrations }, ropsten: { - provider: new HDWalletProvider(mnemonic, 'https://ropsten.infura.io'), - network_id: '3' + provider: new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/'), + network_id: '3', + gas: 5300000, }, testrpc: { - network_id: 'default' + network_id: 'default', }, coverage: { - host: "localhost", - network_id: "*", - port: 8555, + host: 'localhost', + network_id: '*', + port: 8555, gas: 0xfffffffffff, - gasPrice: 0x01 + gasPrice: 0x01, }, - } -} + }, +}; From 8feaf63111893349ae15091ffa3d4e2afa651607 Mon Sep 17 00:00:00 2001 From: Robert Valta Date: Sun, 29 Jul 2018 01:54:42 +0300 Subject: [PATCH 2/2] Fix linting --- truffle.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/truffle.js b/truffle.js index 8793b879..1db6d4da 100644 --- a/truffle.js +++ b/truffle.js @@ -1,24 +1,24 @@ -const HDWalletProvider = require('truffle-hdwallet-provider'); -const fs = require('fs'); +const HDWalletProvider = require('truffle-hdwallet-provider') +const fs = require('fs') // First read in the secrets.json to get our mnemonic -let secrets; -let mnemonic; +let secrets +let mnemonic if (fs.existsSync('secrets.json')) { - secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8')); - mnemonic = secrets.mnemonic; + secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8')) + mnemonic = secrets.mnemonic } else { console.log( 'No secrets.json found. If you are trying to publish EPM ' + - 'this will fail. Otherwise, you can ignore this message!', - ); - mnemonic = ''; + 'this will fail. Otherwise, you can ignore this message!' + ) + mnemonic = '' } module.exports = { networks: { live: { - network_id: 1, // Ethereum public network + network_id: 1 // Ethereum public network // optional config values // host - defaults to "localhost" // port - defaults to 8545 @@ -29,17 +29,17 @@ module.exports = { ropsten: { provider: new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/'), network_id: '3', - gas: 5300000, + gas: 5300000 }, testrpc: { - network_id: 'default', + network_id: 'default' }, coverage: { host: 'localhost', network_id: '*', port: 8555, gas: 0xfffffffffff, - gasPrice: 0x01, - }, - }, -}; + gasPrice: 0x01 + } + } +}