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
* of the PKCS SubjectPublicKeyInfo.
*
* @param {function(Error, id)} callback
* @returns {undefined}
* @returns {Promise<string>}
*/
async id () {
const hash = await this.public.hash()

View File

@ -98,7 +98,7 @@ describe('AES-CTR', () => {
// @ts-check
/**
* @type {function(Cipher): void}
* @type {function(Cipher): Promise<void>}
*/
async function encryptAndDecrypt (cipher) {
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 () => {
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)

View File

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