chore(types): fix typing

This commit is contained in:
Jacob Heun 2020-07-18 12:44:23 +02:00
parent 2f18a077b4
commit c2dd0a535d
4 changed files with 5 additions and 6 deletions

View File

@ -78,8 +78,7 @@ module.exports = (keysProtobuf, randomBytes, crypto) => {
* The public key is a protobuf encoding containing a type and the DER encoding * The public key is a protobuf encoding containing a type and the DER encoding
* of the PKCS SubjectPublicKeyInfo. * of the PKCS SubjectPublicKeyInfo.
* *
* @param {function(Error, id)} callback * @returns {Promise<string>}
* @returns {undefined}
*/ */
async id () { async id () {
const hash = await this.public.hash() const hash = await this.public.hash()

View File

@ -98,7 +98,7 @@ describe('AES-CTR', () => {
// @ts-check // @ts-check
/** /**
* @type {function(Cipher): void} * @type {function(Cipher): Promise<void>}
*/ */
async function encryptAndDecrypt (cipher) { async function encryptAndDecrypt (cipher) {
const data = Buffer.alloc(100) const data = Buffer.alloc(100)

View File

@ -31,7 +31,7 @@ describe('secp256k1 keys', () => {
}) })
it('optionally accepts a `bits` argument when generating a key', async () => { 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) expect(_key).to.be.an.instanceof(secp256k1.Secp256k1PrivateKey)
}) })
@ -71,7 +71,7 @@ describe('secp256k1 keys', () => {
}) })
it('not equals other key', async () => { 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(key.equals(key2)).to.eql(false)
expect(key2.equals(key)).to.eql(false) expect(key2.equals(key)).to.eql(false)
expect(key.public.equals(key2.public)).to.eql(false) expect(key.public.equals(key2.public)).to.eql(false)

View File

@ -6,7 +6,7 @@ const expect = chai.expect
// @ts-check // @ts-check
/** /**
* @type {function(any, string): void} * @type {function(any, string): Promise<void>}
*/ */
const expectErrCode = async (p, code) => { const expectErrCode = async (p, code) => {
try { try {