Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcortesi committed Nov 7, 2019
1 parent a708015 commit 63bafb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/commands/account/authorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ process.env.NO_SYNCCHECK = 'true'
testWithGanache('account:authorize cmd', (web3: Web3) => {
test('can authorize account', async () => {
const accounts = await web3.eth.getAccounts()
await Register.run(['--from', accounts[0]])
await Authorize.run(['--from', accounts[0], '--role', 'validator', '--to', accounts[1]])
await Register.run(['--from', accounts[0], '--name', 'Chapulin Colorado'])
await Authorize.run(['--from', accounts[0], '--role', 'validation', '--to', accounts[1]])
})

test('fails if from is not an account', async () => {
const accounts = await web3.eth.getAccounts()
await expect(
Authorize.run(['--from', accounts[0], '--role', 'validator', '--to', accounts[1]])
Authorize.run(['--from', accounts[0], '--role', 'validation', '--to', accounts[1]])
).rejects.toThrow()
})
})
2 changes: 1 addition & 1 deletion packages/cli/src/commands/account/register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ testWithGanache('account:register cmd', (web3: Web3) => {
test('can register account', async () => {
const accounts = await web3.eth.getAccounts()

await Register.run(['--from', accounts[0]])
await Register.run(['--from', accounts[0], '--name', 'Chapulin Colorado'])
})

test('fails if from is missing', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/account/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export default class Register extends BaseCommand {
.isNotAccount(res.flags.from)
.runChecks()
await displaySendTx('register', accounts.createAccount())
await displaySendTx('setName', accounts.setName(name))
await displaySendTx('setName', accounts.setName(res.flags.name))
}
}

0 comments on commit 63bafb7

Please sign in to comment.