add default account to mint menu

This commit is contained in:
Iuri Matias 2019-05-24 17:59:02 -04:00
parent 5ca24ad142
commit 62aecd49a0
3 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ function mainMenu(actions) {
subAction = (await menus.tokens()).action
if (subAction === 'Mint') {
let params = (await menus.mintToken())
let params = (await menus.mintToken(actions.web3Object().eth.defaultAccount))
await actions.mintToken(params);
} if (subAction === 'Approve') {
let params = (await menus.approveToken())

View File

@ -19,7 +19,7 @@ const actions = new Actions(program.chain || "development", accounts || []);
actions.connect({
url: (program.url || "ws://localhost:8556"),
accountIndex: (program.index || 0)
accountIndex: (program.index || 0)
}, async () => {
cmd(actions)
});

View File

@ -202,7 +202,6 @@ const menus = {
])
},
createFunder: async function() {
return inquirer.prompt([
{
@ -240,7 +239,7 @@ const menus = {
])
},
mintToken: async function() {
mintToken: async function(defaultAccount) {
console.dir("note: If the transaction fails it likely means this account cannot mint the token (e.g not the owner)");
return inquirer.prompt([
{
@ -256,6 +255,7 @@ const menus = {
type: 'input',
name: 'account',
message: 'What account to mint?',
default: defaultAccount,
filter: String
},
{