Skip to content

Commit

Permalink
fix(): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Jiang committed Mar 22, 2019
1 parent ef954d3 commit 4c0feb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion test/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ test('balanceOf(address) invalid address', async (t) => {
await t.throwsAsync(token.balanceOf({ }), TypeError)
await t.throwsAsync(token.balanceOf(1234), TypeError)
await t.throwsAsync(token.balanceOf([]), TypeError)
await t.throwsAsync(token.balanceOf(TEST_OWNER_ADDRESS), Error)
await t.throwsAsync(token.balanceOf('did:ara:1234'), Error)
await t.throwsAsync(token.balanceOf(RANDOM_DID), Error)
})
Expand Down
10 changes: 5 additions & 5 deletions token.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const {
* @return {Number}
* @throws {Error|TypeError}
*/
async function balanceOf(account, keyringOpts) {
async function balanceOf(acct, keyringOpts) {
try {
account = await _normalizeIDInput(account)
acct = await _normalizeIDInput(acct, keyringOpts)
} catch (err) {
throw err
}
Expand All @@ -42,7 +42,7 @@ async function balanceOf(account, keyringOpts) {
abi: tokenAbi,
address: ARA_TOKEN_ADDRESS,
functionName: 'balanceOf',
arguments: [ account ]
arguments: [ acct ]
})
} catch (err) {
throw err
Expand Down Expand Up @@ -537,11 +537,11 @@ function _validateApprovalOpts(opts) {
}
}

async function _normalizeIDInput(id) {
async function _normalizeIDInput(id, keyringOpts) {
try {
if (!isAddress(id)) {
id = getIdentifier(id)
id = await getAddressFromDID(id)
id = await getAddressFromDID(id, keyringOpts)
}
} catch (err) {
throw err
Expand Down

0 comments on commit 4c0feb4

Please sign in to comment.