mirror of
https://github.com/fluencelabs/js-libp2p-crypto
synced 2025-03-15 09:41:03 +00:00
chore(types): fix typing
This commit is contained in:
parent
2f18a077b4
commit
c2dd0a535d
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user