Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
add balance to intial console print out of accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed Jul 4, 2018
1 parent 6ad268f commit b63e8e7
Show file tree
Hide file tree
Showing 3 changed files with 547 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var URL = require("url");
var fs = require("fs");
var to = require("ganache-core/lib/utils/to");
var initArgs = require("./args")
var BN = require("bn.js");

var argv = initArgs(yargs, pkg.version).argv

Expand Down Expand Up @@ -121,7 +122,8 @@ server.listen(options.port, options.hostname, function(err, result) {
var addresses = Object.keys(accounts);

addresses.forEach(function(address, index) {
var line = "(" + index + ") " + address;
var balance = new BN(accounts[address].account.balance).divRound(new BN("1000000000000000000")).toString();
var line = "(" + index + ") " + address + " (~" + balance + " ETH)";

if (state.isUnlocked(address) == false) {
line += " 🔒";
Expand All @@ -135,7 +137,7 @@ server.listen(options.port, options.hostname, function(err, result) {
console.log("==================");

addresses.forEach(function(address, index) {
console.log("(" + index + ") " + accounts[address].secretKey.toString("hex"));
console.log("(" + index + ") " + "0x" + accounts[address].secretKey.toString("hex"));
});


Expand Down
Loading

0 comments on commit b63e8e7

Please sign in to comment.