Skip to content

Commit 296663e

Browse files
committed
password read from config file and fix for gasprice
1 parent 11d6980 commit 296663e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/cmds/blockchain/dev_funds.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ class DevFunds {
99
this.blockchainConfig = blockchainConfig;
1010
this.accounts = [];
1111
this.numAccounts = this.blockchainConfig.account.numAccounts || 0;
12-
this.password = readFileSync(dappPath('config/development/password'));
13-
this.password = 'dev_password';
14-
this.existingNumAccounts = 0;
12+
this.password = readFileSync(dappPath('config/development/password'), 'utf8').replace('\n', '');
1513
this.web3 = new Web3();
1614
this.balance = Web3.utils.toWei("1", "ether");
1715
if(this.blockchainConfig.account.balance){
@@ -27,14 +25,14 @@ class DevFunds {
2725

2826
this.web3.eth.getAccounts().then((accounts) => {
2927
this.web3.eth.defaultAccount = accounts[0];
30-
this.existingNumAccounts = accounts.length;
28+
this.accounts = accounts;
3129
cb();
3230
});
3331
}
3432

3533
createAccounts(numAccounts, password, cb) {
36-
console.dir("creating " + (numAccounts - this.existingNumAccounts) + " new accounts with password " + password);
37-
async.timesLimit((numAccounts - this.existingNumAccounts), 1, (_, next) => {
34+
console.dir("creating " + (numAccounts - this.accounts.length) + " new accounts with password " + password);
35+
async.timesLimit((numAccounts - this.accounts.length), 1, (_, next) => {
3836
console.dir("--- creating new account");
3937
this.web3.eth.personal.newAccount(password, next);
4038
}, (err, accounts) => {
@@ -89,7 +87,7 @@ class DevFunds {
8987
this.fundAccounts(this.balance, next);
9088
}
9189
], (err) => {
92-
console.trace(`--- COMPLETED THE ACCOUNTS (${this.accounts.join(', ')} and funded with ${this.balance} wei)`);
90+
console.dir(`--- COMPLETED THE ACCOUNTS (${this.accounts.join(', ')} and funded with ${this.balance} wei)`);
9391
if(err) console.error('Error creating, unlocking, and funding accounts', err);
9492

9593
// this.web3.eth.getAccounts().then((accounts) => {

lib/contracts/contracts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ContractsManager {
100100
}
101101
self.events.request("blockchain:gasPrice", (gasprice) => {
102102
console.dir('[contracts/contracts]: got gasPrice of ' + gasprice);
103-
callback(gasprice);
103+
callback(null, gasprice);
104104
});
105105
},
106106
function prepareContractsFromCompilation(gasPrice, callback) {

0 commit comments

Comments
 (0)