Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aphelionz committed May 27, 2021
1 parent e9e8ee7 commit b6d4172
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/ethereum-identity-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EthIdentityProvider extends IdentityProvider {
// Returns a signature of pubkeysignature
async signIdentity (data, options = {}) {
const wallet = this.wallet
if (!wallet) { throw new Error(`wallet is required`) }
if (!wallet) { throw new Error('wallet is required') }

return wallet.signMessage(data)
}
Expand All @@ -37,16 +37,16 @@ class EthIdentityProvider extends IdentityProvider {
async _createWallet (options = {}) {
if (options.mnemonicOpts) {
if (!options.mnemonicOpts.mnemonic) {
throw new Error(`mnemonic is required`)
throw new Error('mnemonic is required')
}
return Wallet.fromMnemonic(options.mnemonicOpts.mnemonic, options.mnemonicOpts.path, options.mnemonicOpts.wordlist)
}
if (options.encryptedJsonOpts) {
if (!options.encryptedJsonOpts.json) {
throw new Error(`encrypted json is required`)
throw new Error('encrypted json is required')
}
if (!options.encryptedJsonOpts.password) {
throw new Error(`password for encrypted json is required`)
throw new Error('password for encrypted json is required')
}
return Wallet.fromEncryptedJson(options.encryptedJsonOpts.json, options.encryptedJsonOpts.password, options.encryptedJsonOpts.progressCallback)
}
Expand Down
2 changes: 1 addition & 1 deletion src/identities.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Identities {
async sign (identity, data) {
const signingKey = await this.keystore.getKey(identity.id)
if (!signingKey) {
throw new Error(`Private signing key not found from Keystore`)
throw new Error('Private signing key not found from Keystore')
}
const sig = await this.keystore.sign(signingKey, data)
return sig
Expand Down
2 changes: 1 addition & 1 deletion src/identity-provider-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class IdentityProvider {

/* Return the type for this identity provider */
static get type () {
throw new Error(`'static get type ()' needs to be defined in the inheriting class`)
throw new Error('\'static get type ()\' needs to be defined in the inheriting class')
}

/*
Expand Down
2 changes: 1 addition & 1 deletion test/did-identity-provider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('DID Identity Provider', function () {
err = e.toString()
}
assert.strictEqual(signature, undefined)
assert.strictEqual(err, `Error: Private signing key not found from Keystore`)
assert.strictEqual(err, 'Error: Private signing key not found from Keystore')
})

describe('verify data signed by an identity', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/ethereum-identity-provider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('Ethereum Identity Provider', function () {
err = e.toString()
}
assert.strictEqual(signature, undefined)
assert.strictEqual(err, `Error: Private signing key not found from Keystore`)
assert.strictEqual(err, 'Error: Private signing key not found from Keystore')
})

describe('verify data signed by an identity', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/identity-provider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('Identity Provider', function () {
err = e.toString()
}
assert.strictEqual(signature, undefined)
assert.strictEqual(err, `Error: Private signing key not found from Keystore`)
assert.strictEqual(err, 'Error: Private signing key not found from Keystore')
})

after(async () => {
Expand Down

0 comments on commit b6d4172

Please sign in to comment.