From b9755655b6d7b37af80acb68668359ba625df806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 10:04:27 +0000 Subject: [PATCH 1/2] deps: bump cborg from 5.1.11 to 6.1.1 Bumps [cborg](https://github.com/rvagg/cborg) from 5.1.11 to 6.1.1. - [Release notes](https://github.com/rvagg/cborg/releases) - [Changelog](https://github.com/rvagg/cborg/blob/master/CHANGELOG.md) - [Commits](https://github.com/rvagg/cborg/compare/v5.1.11...v6.1.1) --- updated-dependencies: - dependency-name: cborg dependency-version: 6.1.1 dependency-type: direct:production 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 798f7e0..d5744dd 100644 --- a/package.json +++ b/package.json @@ -176,7 +176,7 @@ "@libp2p/crypto": "^5.0.0", "@libp2p/interface": "^3.0.2", "@libp2p/logger": "^6.0.4", - "cborg": "^5.1.0", + "cborg": "^6.1.1", "interface-datastore": "^10.0.0", "multiformats": "^14.0.0", "protons-runtime": "^7.0.0", From 9d34c2a8a081d916aa532534057302ef3654a371 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 31 Jul 2026 12:41:33 +0200 Subject: [PATCH 2/2] chore: fix build --- src/validator.ts | 1 - test/index.spec.ts | 13 ------------- test/selector.spec.ts | 2 -- test/utils.spec.ts | 1 - test/validator.spec.ts | 5 ----- 5 files changed, 22 deletions(-) diff --git a/src/validator.ts b/src/validator.ts index 0cf649d..840fdb2 100644 --- a/src/validator.ts +++ b/src/validator.ts @@ -84,7 +84,6 @@ export async function ipnsValidator (routingKey: Uint8Array, marshalledRecord: U throw new InvalidEmbeddedPublicKeyError('Could not extract public key from IPNS record or routing key') } - // @ts-expect-error @libp2p/crypto needs a new multiformats const expectedRoutingKey = multihashToIPNSRoutingKey(recordPubKey.toMultihash()) if (!uint8ArrayEquals(expectedRoutingKey, routingKey)) { diff --git a/test/index.spec.ts b/test/index.spec.ts index 038b705..7406eee 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -106,7 +106,6 @@ describe('ipns', function () { const record = await createIPNSRecordWithExpiration(privateKey, contentPath, sequence, expiration) const marshalledRecord = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalledRecord) const pb = IpnsEntry.decode(marshalledRecord) @@ -121,7 +120,6 @@ describe('ipns', function () { const record = await createIPNSRecordWithExpiration(privateKey, contentPath, sequence, expiration, { v1Compatible: false }) const marshalledRecord = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalledRecord) const pb = IpnsEntry.decode(marshalIPNSRecord(record)) @@ -141,7 +139,6 @@ describe('ipns', function () { }) const marshalledRecord = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalledRecord) const pb = IpnsEntry.decode(marshalledRecord) @@ -160,7 +157,6 @@ describe('ipns', function () { }) const marshalledRecord = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalledRecord) const pb = IpnsEntry.decode(marshalledRecord) @@ -175,7 +171,6 @@ describe('ipns', function () { const validity = 1000000 const record = await createIPNSRecord(privateKey, contentPath, sequence, validity) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalIPNSRecord(record)) }) @@ -184,7 +179,6 @@ describe('ipns', function () { const validity = 1000000 const record = await createIPNSRecord(privateKey, contentPath, sequence, validity, { v1Compatible: false }) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalIPNSRecord(record)) }) @@ -213,7 +207,6 @@ describe('ipns', function () { const otherKey = await generateKeyPair('Ed25519') const peerId = peerIdFromPrivateKey(otherKey) const expectedValue = `/ipns/${peerId.toCID().toString(base36)}` - // @ts-expect-error @libp2p/crypto needs a new multiformats const record = await createIPNSRecord(privateKey, peerId.toCID(), 0, 1000000) expect(record.value).to.equal(expectedValue) }) @@ -286,7 +279,6 @@ describe('ipns', function () { // confirm a v1 exists expect(pb).to.have.property('signatureV1') - // @ts-expect-error @libp2p/crypto needs a new multiformats await expect(ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), IpnsEntry.encode(pb))).to.eventually.be.rejected() .with.property('name', SignatureVerificationError.name) }) @@ -304,7 +296,6 @@ describe('ipns', function () { // confirm a v1 exists expect(pb).to.have.property('signatureV1') - // @ts-expect-error @libp2p/crypto needs a new multiformats await expect(ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), IpnsEntry.encode(pb))).to.eventually.be.rejected() .with.property('name', SignatureVerificationError.name) }) @@ -318,7 +309,6 @@ describe('ipns', function () { // corrupt the record by changing the value to random bytes record.value = uint8ArrayToString(randomBytes(46)) - // @ts-expect-error @libp2p/crypto needs a new multiformats await expect(ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalIPNSRecord(record))).to.eventually.be.rejected() .with.property('name', SignatureVerificationError.name) }) @@ -331,7 +321,6 @@ describe('ipns', function () { await new Promise(resolve => setTimeout(resolve, 1)) - // @ts-expect-error @libp2p/crypto needs a new multiformats await expect(ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalIPNSRecord(record))).to.eventually.be.rejected() .with.property('name', RecordExpiredError.name) }) @@ -354,7 +343,6 @@ describe('ipns', function () { expect(createdRecord.signatureV2).to.equalBytes(unmarshalledData.signatureV2) expect(createdRecord.data).to.equalBytes(unmarshalledData.data) - // @ts-expect-error @libp2p/crypto needs a new multiformats await ipnsValidator(multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()), marshalledData) }) @@ -409,7 +397,6 @@ describe('ipns', function () { delete record.pubKey const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()) await expect(ipnsValidator(key, marshalledData)).to.eventually.be.rejected() diff --git a/test/selector.spec.ts b/test/selector.spec.ts index 1024b79..70c1a87 100644 --- a/test/selector.spec.ts +++ b/test/selector.spec.ts @@ -24,7 +24,6 @@ describe('selector', function () { const marshalledData = marshalIPNSRecord(record) const marshalledNewData = marshalIPNSRecord(newRecord) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()) let valid = ipnsSelector(key, [marshalledNewData, marshalledData]) @@ -44,7 +43,6 @@ describe('selector', function () { const marshalledData = marshalIPNSRecord(record) const marshalledNewData = marshalIPNSRecord(newRecord) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey.publicKey.toMultihash()) let valid = ipnsSelector(key, [marshalledNewData, marshalledData]) diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 5e09a61..1d84443 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -109,7 +109,6 @@ describe('utils', () => { Object.entries(cases).forEach(([name, input]) => { it(`should round trip a ${name} key`, async () => { - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(input.toMultihash()) const output = multihashFromIPNSRoutingKey(key) diff --git a/test/validator.spec.ts b/test/validator.spec.ts index 0f3c33a..2805ec0 100644 --- a/test/validator.spec.ts +++ b/test/validator.spec.ts @@ -24,7 +24,6 @@ describe('validator', function () { const validity = 1000000 const record = await createIPNSRecord(privateKey1, contentPath, sequence, validity, { v1Compatible: false }) const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey1.publicKey.toMultihash()) await ipnsValidator(key, marshalledData) @@ -35,7 +34,6 @@ describe('validator', function () { const validity = 1000000 const record = await createIPNSRecord(privateKey1, contentPath, sequence, validity, { v1Compatible: true }) const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey1.publicKey.toMultihash()) await ipnsValidator(key, marshalledData) @@ -51,7 +49,6 @@ describe('validator', function () { record.value = uint8ArrayToString(randomBytes(record.value?.length ?? 0)) const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey1.publicKey.toMultihash()) await expect(ipnsValidator(key, marshalledData)).to.eventually.be.rejected() @@ -65,7 +62,6 @@ describe('validator', function () { const record = await createIPNSRecord(privateKey1, contentPath, sequence, validity) const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey2.publicKey.toMultihash()) await expect(ipnsValidator(key, marshalledData)).to.eventually.be.rejected() @@ -80,7 +76,6 @@ describe('validator', function () { record.pubKey = publicKeyToProtobuf(privateKey2.publicKey) const marshalledData = marshalIPNSRecord(record) - // @ts-expect-error @libp2p/crypto needs a new multiformats const key = multihashToIPNSRoutingKey(privateKey1.publicKey.toMultihash()) await expect(ipnsValidator(key, marshalledData)).to.eventually.be.rejected()