Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Dec 30, 2023
1 parent ae3cbb4 commit 5ebebae
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/helia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@libp2p/dcutr": "^1.0.1",
"@libp2p/identify": "^1.0.1",
"@libp2p/interface": "^1.0.1",
"@libp2p/kad-dht": "^12.0.0",
"@libp2p/kad-dht": "^12.0.1",
"@libp2p/keychain": "^4.0.2",
"@libp2p/mdns": "^10.0.2",
"@libp2p/mplex": "^10.0.2",
Expand All @@ -110,7 +110,7 @@
"interface-datastore": "^8.0.0",
"interface-store": "^5.0.1",
"ipfs-bitswap": "^20.0.0",
"ipns": "^7.0.1",
"ipns": "^8.0.0",
"it-all": "^3.0.2",
"it-drain": "^3.0.1",
"it-filter": "^3.0.1",
Expand All @@ -119,7 +119,7 @@
"mortice": "^3.0.1",
"multiformats": "^13.0.0",
"p-defer": "^4.0.0",
"p-queue": "^7.3.4",
"p-queue": "^8.0.1",
"progress-events": "^1.0.0",
"uint8arrays": "^5.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@chainsafe/libp2p-yamux": "^6.0.1",
"@helia/interface": "^2.1.0",
"@libp2p/identify": "^1.0.1",
"@libp2p/peer-id": "^4.0.3",
"@libp2p/tcp": "^9.0.1",
"@libp2p/websockets": "^8.0.1",
"@multiformats/sha3": "^3.0.0",
Expand All @@ -67,7 +68,7 @@
"ipfsd-ctl": "^13.0.0",
"it-all": "^3.0.2",
"it-to-buffer": "^4.0.1",
"kubo": "^0.24.0",
"kubo": "^0.25.0",
"kubo-rpc-client": "^3.0.1",
"libp2p": "^1.0.1",
"multiformats": "^13.0.0"
Expand Down
7 changes: 4 additions & 3 deletions packages/interop/test/blockstore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env mocha */

import { peerIdFromString } from '@libp2p/peer-id'
import { expect } from 'aegir/chai'
import toBuffer from 'it-to-buffer'
import { CID } from 'multiformats/cid'
Expand All @@ -19,10 +20,10 @@ describe('blockstore', () => {
kubo = await createKuboNode()

// connect the two nodes
await helia.libp2p.peerStore.merge(kubo.peer.id, {
await helia.libp2p.peerStore.merge(peerIdFromString(kubo.peer.id.toString()), {
multiaddrs: kubo.peer.addresses
})
await helia.libp2p.dial(kubo.peer.id)
await helia.libp2p.dial(peerIdFromString(kubo.peer.id.toString()))
})

afterEach(async () => {
Expand Down Expand Up @@ -51,7 +52,7 @@ describe('blockstore', () => {
cidVersion: 1,
rawLeaves: true
})
const output = await helia.blockstore.get(cid)
const output = await helia.blockstore.get(CID.parse(cid.toString()))

expect(output).to.equalBytes(input)
})
Expand Down
7 changes: 4 additions & 3 deletions packages/interop/test/hashes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env mocha */

import { peerIdFromString } from '@libp2p/peer-id'
import { sha3512 } from '@multiformats/sha3'
import { expect } from 'aegir/chai'
import toBuffer from 'it-to-buffer'
Expand All @@ -23,10 +24,10 @@ describe('hashes', () => {
kubo = await createKuboNode()

// connect the two nodes
await helia.libp2p.peerStore.merge(kubo.peer.id, {
await helia.libp2p.peerStore.merge(peerIdFromString(kubo.peer.id.toString()), {
multiaddrs: kubo.peer.addresses
})
await helia.libp2p.dial(kubo.peer.id)
await helia.libp2p.dial(peerIdFromString(kubo.peer.id.toString()))
})

afterEach(async () => {
Expand Down Expand Up @@ -57,7 +58,7 @@ describe('hashes', () => {
hashAlg: 'sha3-512'
})
expect(cid.multihash.code).to.equal(sha3512.code)
const output = await helia.blockstore.get(cid)
const output = await helia.blockstore.get(CID.parse(cid.toString()))

expect(output).to.equalBytes(input)
})
Expand Down
6 changes: 3 additions & 3 deletions packages/interop/test/pins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ describe('pins', () => {
rawLeaves: true
})

await expect(helia.blockstore.has(cid)).to.eventually.be.false()
await expect(helia.blockstore.has(CID.parse(cid.toString()))).to.eventually.be.false()

const output = await helia.pins.add(cid)
const output = await helia.pins.add(CID.parse(cid.toString()))

await expect(helia.blockstore.has(cid)).to.eventually.be.true()
await expect(helia.blockstore.has(CID.parse(cid.toString()))).to.eventually.be.true()

expect(output.cid.toString()).to.equal(cid.toString())
})
Expand Down

0 comments on commit 5ebebae

Please sign in to comment.