Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
fix: update interfaces (#147)
Browse files Browse the repository at this point in the history
Updates libp2p interfaces to the latest version.
  • Loading branch information
achingbrain committed Apr 20, 2022
1 parent b8ab289 commit c80ce05
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"dep-check": "aegir dep-check",
"build": "aegir build",
"generate": "protons ./src/message/rpc.proto",
"test": "aegir test -f dist/test",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
Expand All @@ -142,22 +142,22 @@
"release": "aegir release"
},
"dependencies": {
"@libp2p/interfaces": "^1.3.20",
"@libp2p/logger": "^1.1.3",
"@libp2p/pubsub": "^1.2.14",
"protons-runtime": "^1.0.2",
"@libp2p/interfaces": "^1.3.22",
"@libp2p/logger": "^1.1.4",
"@libp2p/pubsub": "^1.2.18",
"protons-runtime": "^1.0.3",
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"@libp2p/interface-compliance-tests": "^1.1.21",
"@libp2p/peer-collections": "^1.0.1",
"@libp2p/peer-id": "^1.1.9",
"@libp2p/interface-compliance-tests": "^1.1.23",
"@libp2p/peer-collections": "^1.0.2",
"@libp2p/peer-id": "^1.1.10",
"@libp2p/peer-id-factory": "^1.0.9",
"@multiformats/multiaddr": "^10.1.8",
"aegir": "^37.0.7",
"aegir": "^37.0.14",
"multiformats": "^9.4.5",
"p-wait-for": "^4.1.0",
"protons": "^3.0.2",
"protons": "^3.0.3",
"sinon": "^13.0.1",
"wherearewe": "^1.0.0"
}
Expand Down
9 changes: 5 additions & 4 deletions test/floodsub.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { PeerStreams } from '@libp2p/pubsub/peer-streams'
import { FloodSub, multicodec } from '../src/index.js'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { mockRegistrar } from '@libp2p/interface-compliance-tests/mocks'
import { CustomEvent } from '@libp2p/interfaces'
import pWaitFor from 'p-wait-for'
import { Components } from '@libp2p/interfaces/components'
import { PeerSet } from '@libp2p/peer-collections'
Expand Down Expand Up @@ -63,8 +62,10 @@ describe('floodsub', () => {
}

floodsub.subscribe(topic)
floodsub.addEventListener(topic, () => {
callCount++
floodsub.addEventListener('message', (evt) => {
if (evt.detail.topic === topic) {
callCount++
}
})

// the message should not be in the cache
Expand Down Expand Up @@ -99,7 +100,7 @@ describe('floodsub', () => {
}

expect(floodsub.send).to.have.property('callCount', 0)
await floodsub.dispatchEvent(new CustomEvent(topic, { detail: message }))
floodsub.publish(topic, message)

await pWaitFor(async () => spy.callCount === 1)

Expand Down

0 comments on commit c80ce05

Please sign in to comment.