Skip to content

Commit f25fdc8

Browse files
committed
chore: fix build
1 parent d93ca52 commit f25fdc8

File tree

9 files changed

+17
-15
lines changed

9 files changed

+17
-15
lines changed

packages/client/test/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ describe('delegated-routing-v1-http-api-client', () => {
378378
results.forEach(resultProviders => {
379379
expect(resultProviders.map(prov => ({
380380
id: prov.ID.toString(),
381-
// eslint-disable-next-line max-nested-callbacks
381+
382382
addrs: prov.Addrs?.map(ma => ma.toString())
383383
}))).to.deep.equal(providers.map(prov => ({
384384
id: prov.ID,

packages/client/test/routings.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-nested-callbacks */
21
/* eslint-env mocha */
32

43
import { generateKeyPair } from '@libp2p/crypto/keys'

packages/interop/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"@libp2p/identify": "^4.0.5",
3232
"@libp2p/interface": "^3.0.2",
3333
"@libp2p/kad-dht": "^16.0.5",
34+
"@libp2p/keychain": "^6.0.5",
3435
"@libp2p/ping": "^3.0.5",
3536
"aegir": "^47.0.10",
3637
"fastify": "^5.3.3",

packages/interop/test/fixtures/create-helia.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { identify } from '@libp2p/identify'
22
import { kadDHT, removePublicAddressesMapper } from '@libp2p/kad-dht'
3+
import { keychain } from '@libp2p/keychain'
34
import { ping } from '@libp2p/ping'
45
import { createHelia as createNode } from 'helia'
56
import { ipnsSelector } from 'ipns/selector'
67
import { ipnsValidator } from 'ipns/validator'
78
import type { Libp2p } from '@libp2p/interface'
89
import type { KadDHT } from '@libp2p/kad-dht'
9-
import type { HeliaInit, HeliaLibp2p } from 'helia'
10+
import type { Keychain } from '@libp2p/keychain'
11+
import type { HeliaInit, Helia } from 'helia'
1012

11-
export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp2p<Libp2p<{ dht: KadDHT }>>> {
13+
export async function createHelia (init?: Partial<HeliaInit>): Promise<Helia<Libp2p<{ dht: KadDHT, keychain: Keychain }>>> {
1214
const helia = await createNode({
1315
libp2p: {
1416
peerDiscovery: [],
@@ -25,7 +27,8 @@ export async function createHelia (init?: Partial<HeliaInit>): Promise<HeliaLibp
2527
}
2628
}),
2729
identify: identify(),
28-
ping: ping()
30+
ping: ping(),
31+
keychain: keychain()
2932
}
3033
}
3134
})

packages/interop/test/index.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ import { createHelia } from './fixtures/create-helia.js'
1515
import type { DelegatedRoutingV1HttpApiClient } from '@helia/delegated-routing-v1-http-api-client'
1616
import type { Libp2p } from '@libp2p/interface'
1717
import type { KadDHT } from '@libp2p/kad-dht'
18+
import type { Keychain } from '@libp2p/keychain'
1819
import type { FastifyInstance } from 'fastify'
19-
import type { HeliaLibp2p } from 'helia'
20+
import type { Helia } from 'helia'
2021

2122
describe('delegated-routing-v1-http-api interop', () => {
22-
let network: Array<HeliaLibp2p<Libp2p<{ dht: KadDHT }>>>
23+
let network: Array<Helia<Libp2p<{ dht: KadDHT, keychain: Keychain }>>>
2324
let server: FastifyInstance
2425
let client: DelegatedRoutingV1HttpApiClient
2526

@@ -93,11 +94,10 @@ describe('delegated-routing-v1-http-api interop', () => {
9394
// publish a record using a remote host
9495
const i = ipns(network[5])
9596
const cid = CID.parse('bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354')
96-
const privateKey = await generateKeyPair('Ed25519')
97-
await i.publish(privateKey, cid)
97+
const result = await i.publish('key-name', cid)
9898

9999
// use client to resolve the published record
100-
const record = await client.getIPNS(privateKey.publicKey.toCID())
100+
const record = await client.getIPNS(result.publicKey.toCID())
101101
expect(record.value).to.equal(`/ipfs/${cid.toString()}`)
102102
})
103103

@@ -111,7 +111,6 @@ describe('delegated-routing-v1-http-api interop', () => {
111111

112112
// resolve the record using a remote host
113113
const i = ipns(network[8])
114-
// @ts-expect-error helia needs to be updated to the latest libp2p deps
115114
const result = await i.resolve(privateKey.publicKey.toCID())
116115
expect(result.cid.toString()).to.equal(cid.toString())
117116
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function getIpnsV1 (fastify: FastifyInstance, helia: Helia): void
4040
const { name: cidStr } = request.params
4141
cid = CID.parse(cidStr)
4242
} catch (err) {
43-
fastify.log.error('could not parse CID from params', err)
43+
fastify.log.error({ err }, 'could not parse CID from params')
4444
return reply.code(422).type('text/html').send('Unprocessable Entity')
4545
}
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function putIpnsV1 (fastify: FastifyInstance, helia: Helia): void
4848
const { name: cidStr } = request.params
4949
cid = CID.parse(cidStr)
5050
} catch (err) {
51-
fastify.log.error('could not parse CID from params', err)
51+
fastify.log.error({ err }, 'could not parse CID from params')
5252
return reply.code(422).type('text/html').send('Unprocessable Entity')
5353
}
5454

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function getPeersV1 (fastify: FastifyInstance, helia: Helia): voi
4040
const peerCid = CID.parse(cidStr)
4141
peerId = peerIdFromCID(peerCid)
4242
} catch (err) {
43-
fastify.log.error('could not parse CID from params', err)
43+
fastify.log.error({ err }, 'could not parse CID from params')
4444
return reply.code(422).type('text/html').send('Unprocessable Entity')
4545
}
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function getProvidersV1 (fastify: FastifyInstance, helia: Helia):
5252
const { cid: cidStr } = request.params
5353
cid = CID.parse(cidStr)
5454
} catch (err) {
55-
fastify.log.error('could not parse CID from params', err)
55+
fastify.log.error({ err }, 'could not parse CID from params')
5656
return reply.code(422).type('text/html').send('Unprocessable Entity')
5757
}
5858

0 commit comments

Comments
 (0)