From c2dd0a535dd9f58a750af68c82b4d55b0e49cd55 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Sat, 18 Jul 2020 12:44:23 +0200 Subject: [PATCH] chore(types): fix typing --- src/keys/secp256k1-class.js | 3 +-- test/aes/aes.spec.js | 2 +- test/keys/secp256k1.spec.js | 4 ++-- test/util/index.js | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/keys/secp256k1-class.js b/src/keys/secp256k1-class.js index e8c5390..daa5487 100644 --- a/src/keys/secp256k1-class.js +++ b/src/keys/secp256k1-class.js @@ -78,8 +78,7 @@ module.exports = (keysProtobuf, randomBytes, crypto) => { * The public key is a protobuf encoding containing a type and the DER encoding * of the PKCS SubjectPublicKeyInfo. * - * @param {function(Error, id)} callback - * @returns {undefined} + * @returns {Promise} */ async id () { const hash = await this.public.hash() diff --git a/test/aes/aes.spec.js b/test/aes/aes.spec.js index 45b4b11..9a99366 100644 --- a/test/aes/aes.spec.js +++ b/test/aes/aes.spec.js @@ -98,7 +98,7 @@ describe('AES-CTR', () => { // @ts-check /** - * @type {function(Cipher): void} + * @type {function(Cipher): Promise} */ async function encryptAndDecrypt (cipher) { const data = Buffer.alloc(100) diff --git a/test/keys/secp256k1.spec.js b/test/keys/secp256k1.spec.js index da245ab..e1e3c97 100644 --- a/test/keys/secp256k1.spec.js +++ b/test/keys/secp256k1.spec.js @@ -31,7 +31,7 @@ describe('secp256k1 keys', () => { }) it('optionally accepts a `bits` argument when generating a key', async () => { - const _key = await secp256k1.generateKeyPair(256) + const _key = await secp256k1.generateKeyPair() expect(_key).to.be.an.instanceof(secp256k1.Secp256k1PrivateKey) }) @@ -71,7 +71,7 @@ describe('secp256k1 keys', () => { }) it('not equals other key', async () => { - const key2 = await secp256k1.generateKeyPair(256) + const key2 = await secp256k1.generateKeyPair() expect(key.equals(key2)).to.eql(false) expect(key2.equals(key)).to.eql(false) expect(key.public.equals(key2.public)).to.eql(false) diff --git a/test/util/index.js b/test/util/index.js index 7293d4f..209a54c 100644 --- a/test/util/index.js +++ b/test/util/index.js @@ -6,7 +6,7 @@ const expect = chai.expect // @ts-check /** - * @type {function(any, string): void} + * @type {function(any, string): Promise} */ const expectErrCode = async (p, code) => { try {