Skip to content

Commit 02e50de

Browse files
committed
chore: linting and deps
1 parent 5ed09a6 commit 02e50de

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

packages/client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"uint8arrays": "^5.1.0"
151151
},
152152
"devDependencies": {
153+
"@libp2p/crypto": "^5.0.1",
153154
"aegir": "^44.1.1",
154155
"body-parser": "^1.20.3",
155156
"it-all": "^3.0.6"

packages/interop/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@
119119
"devDependencies": {
120120
"@helia/delegated-routing-v1-http-api-client": "^3.0.0",
121121
"@helia/delegated-routing-v1-http-api-server": "^3.0.0",
122-
"@helia/ipns": "^7.2.3-ec8bf66",
122+
"@helia/ipns": "next",
123+
"@libp2p/crypto": "^5.0.1",
123124
"@libp2p/identify": "^3.0.1",
124125
"@libp2p/interface": "^2.0.1",
125126
"@libp2p/kad-dht": "^13.0.1",
126127
"aegir": "^44.1.1",
127128
"fastify": "^4.28.1",
128-
"helia": "^4.2.6-ec8bf66",
129+
"helia": "next",
129130
"ipns": "^10.0.0",
130131
"it-first": "^3.0.6",
131132
"multiformats": "^13.2.3"

packages/server/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@
155155
},
156156
"dependencies": {
157157
"@fastify/cors": "^9.0.1",
158-
"@helia/interface": "^4.3.1-ec8bf66",
158+
"@helia/interface": "next",
159+
"@helia/utils": "next",
159160
"@libp2p/interface": "^2.0.1",
160161
"@libp2p/peer-id": "^5.0.1",
161162
"fastify": "^4.28.1",
@@ -164,6 +165,7 @@
164165
"raw-body": "^3.0.0"
165166
},
166167
"devDependencies": {
168+
"@libp2p/crypto": "^5.0.1",
167169
"@multiformats/multiaddr": "^12.3.1",
168170
"@types/sinon": "^17.0.3",
169171
"aegir": "^44.1.1",

packages/server/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// these values are from https://github.com/multiformats/multicodec/blob/master/table.csv
2-
export const LIBP2P_KEY_CODEC = 0x72
2+
export const LIBP2P_KEY_CODEC = 0x72

packages/server/src/routes/routing/v1/ipns/get.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ export default function getIpnsV1 (fastify: FastifyInstance, helia: Helia): void
4747
try {
4848
if (!hasCode(cid.multihash, 0x00) && !hasCode(cid.multihash, 0x12)) {
4949
fastify.log.error('CID multihash had incorrect code %d', cid.multihash.code)
50-
return reply.code(422).type('text/html').send('Unprocessable Entity')
50+
return await reply.code(422).type('text/html').send('Unprocessable Entity')
5151
}
5252

5353
if (cid.code !== LIBP2P_KEY_CODEC) {
5454
fastify.log.error('CID had incorrect code %d', cid.code)
55-
return reply.code(422).type('text/html').send('Unprocessable Entity')
55+
return await reply.code(422).type('text/html').send('Unprocessable Entity')
5656
}
5757

5858
const rawRecord = await helia.routing.get(multihashToIPNSRoutingKey(cid.multihash), {
@@ -64,7 +64,9 @@ export default function getIpnsV1 (fastify: FastifyInstance, helia: Helia): void
6464
// one cannot simply send rawRecord https://github.com/fastify/fastify/issues/5118
6565
.send(Buffer.from(rawRecord, 0, rawRecord.byteLength))
6666
} catch (err: any) {
67-
if (err.code === 'ERR_NOT_FOUND' || err.errors?.[0].code === 'ERR_NOT_FOUND') {
67+
if (err.code === 'ERR_NOT_FOUND' || err.errors?.[0].code === 'ERR_NOT_FOUND' ||
68+
err.name === 'NotFoundError' || err.errors?.[0].name === 'NotFoundError'
69+
) {
6870
return reply.code(404).send('Record not found')
6971
}
7072

packages/server/test/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* eslint-env mocha */
22

3+
import { generateKeyPair } from '@libp2p/crypto/keys'
4+
import { peerIdFromPrivateKey } from '@libp2p/peer-id'
35
import { multiaddr } from '@multiformats/multiaddr'
46
import { expect } from 'aegir/chai'
57
import { createIPNSRecord, marshalIPNSRecord, multihashToIPNSRoutingKey } from 'ipns'
@@ -10,8 +12,6 @@ import type { Helia } from '@helia/interface'
1012
import type { PeerInfo } from '@libp2p/interface'
1113
import type { FastifyInstance } from 'fastify'
1214
import type { StubbedInstance } from 'sinon-ts'
13-
import { peerIdFromPrivateKey } from '@libp2p/peer-id'
14-
import { generateKeyPair } from '@libp2p/crypto/keys'
1515

1616
describe('delegated-routing-v1-http-api-server', () => {
1717
let helia: StubbedInstance<Helia>

0 commit comments

Comments
 (0)