From 2ba5c1ae417dce1a8b26d91b847a7cce252c6251 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:17:14 +0000 Subject: [PATCH 1/2] deps(dev): bump aegir from 38.1.8 to 39.0.10 Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 39.0.10. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](https://github.com/ipfs/aegir/compare/v38.1.8...v39.0.10) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c22113..f602ffb 100644 --- a/package.json +++ b/package.json @@ -157,7 +157,7 @@ }, "devDependencies": { "@libp2p/peer-id-factory": "^2.0.1", - "aegir": "^38.1.0", + "aegir": "^39.0.10", "datastore-core": "^9.0.1", "multiformats": "^11.0.1" } From 1836074f5060112c49d269598968c0c21b8ca54f Mon Sep 17 00:00:00 2001 From: achingbrain Date: Thu, 15 Jun 2023 09:15:33 +0200 Subject: [PATCH 2/2] chore: fix linting --- src/index.ts | 20 ++++++++++---------- test/keychain.spec.ts | 16 ++++++++-------- test/peerid.spec.ts | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index 619a9ce..16b8d86 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,19 @@ /* eslint max-nested-callbacks: ["error", 5] */ +import { pbkdf2, randomBytes } from '@libp2p/crypto' +import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' +import { CodeError } from '@libp2p/interfaces/errors' import { logger } from '@libp2p/logger' -import sanitize from 'sanitize-filename' -import mergeOptions from 'merge-options' +import { peerIdFromKeys } from '@libp2p/peer-id' import { Key } from 'interface-datastore/key' -import { CodeError } from '@libp2p/interfaces/errors' -import { codes } from './errors.js' -import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import mergeOptions from 'merge-options' +import sanitize from 'sanitize-filename' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' -import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' +import { toString as uint8ArrayToString } from 'uint8arrays/to-string' +import { codes } from './errors.js' +import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain' import type { PeerId } from '@libp2p/interface-peer-id' -import { pbkdf2, randomBytes } from '@libp2p/crypto' import type { Datastore } from 'interface-datastore' -import { peerIdFromKeys } from '@libp2p/peer-id' -import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain' const log = logger('libp2p:keychain') @@ -390,7 +390,7 @@ export class DefaultKeyChain implements KeyChain { const pem = await this.exportKey(name, password) const privateKey = await importKey(pem, password) - return await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes) + return peerIdFromKeys(privateKey.public.bytes, privateKey.bytes) } /** diff --git a/test/keychain.spec.ts b/test/keychain.spec.ts index 3ec4618..6089b90 100644 --- a/test/keychain.spec.ts +++ b/test/keychain.spec.ts @@ -1,18 +1,18 @@ /* eslint max-nested-callbacks: ["error", 8] */ /* eslint-env mocha */ +import { pbkdf2 } from '@libp2p/crypto' +import { unmarshalPrivateKey } from '@libp2p/crypto/keys' +import { createFromPrivKey } from '@libp2p/peer-id-factory' import { expect } from 'aegir/chai' +import { MemoryDatastore } from 'datastore-core/memory' +import { Key } from 'interface-datastore/key' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { toString as uint8ArrayToString } from 'uint8arrays/to-string' -import { Key } from 'interface-datastore/key' -import { MemoryDatastore } from 'datastore-core/memory' -import { DefaultKeyChain, KeyChainInit } from '../src/index.js' -import { pbkdf2 } from '@libp2p/crypto' -import type { Datastore } from 'interface-datastore' -import type { PeerId } from '@libp2p/interface-peer-id' -import { createFromPrivKey } from '@libp2p/peer-id-factory' -import { unmarshalPrivateKey } from '@libp2p/crypto/keys' +import { DefaultKeyChain, type KeyChainInit } from '../src/index.js' import type { KeyChain, KeyInfo } from '@libp2p/interface-keychain' +import type { PeerId } from '@libp2p/interface-peer-id' +import type { Datastore } from 'interface-datastore' describe('keychain', () => { const passPhrase = 'this is not a secure phrase' diff --git a/test/peerid.spec.ts b/test/peerid.spec.ts index bd7c39e..cc8e8a5 100644 --- a/test/peerid.spec.ts +++ b/test/peerid.spec.ts @@ -1,11 +1,11 @@ /* eslint-env mocha */ +import { supportedKeys, unmarshalPrivateKey, unmarshalPublicKey } from '@libp2p/crypto/keys' +import { createFromPrivKey } from '@libp2p/peer-id-factory' import { expect } from 'aegir/chai' import { base58btc } from 'multiformats/bases/base58' -import { supportedKeys, unmarshalPrivateKey, unmarshalPublicKey } from '@libp2p/crypto/keys' import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import type { PeerId } from '@libp2p/interface-peer-id' -import { createFromPrivKey } from '@libp2p/peer-id-factory' const sample = { id: '122019318b6e5e0cf93a2314bf01269a2cc23cd3dcd452d742cdb9379d8646f6e4a9',