Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: update multiformats and related dependencies #257

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"@libp2p/interface-connection-encrypter": "^3.0.0",
"@libp2p/interface-keys": "^1.0.2",
"@libp2p/interface-metrics": "^4.0.2",
"@libp2p/interface-peer-id": "^1.0.2",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/logger": "^2.0.0",
"@libp2p/peer-id": "^1.1.8",
"@libp2p/peer-id": "^2.0.0",
"@stablelib/chacha20poly1305": "^1.0.1",
"@stablelib/hkdf": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
Expand All @@ -90,10 +90,10 @@
"devDependencies": {
"@libp2p/daemon-client": "^3.0.1",
"@libp2p/daemon-server": "^3.0.1",
"@libp2p/interface-connection-encrypter-compliance-tests": "^3.0.0",
"@libp2p/interface-connection-encrypter-compliance-tests": "^4.0.0",
"@libp2p/interop": "^3.0.1",
"@libp2p/mplex": "^7.0.0",
"@libp2p/peer-id-factory": "^1.0.8",
"@libp2p/peer-id-factory": "^2.0.0",
"@libp2p/tcp": "^6.0.2",
"@multiformats/multiaddr": "^11.0.3",
"aegir": "^37.3.0",
Expand Down
3 changes: 2 additions & 1 deletion test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import sinon from 'sinon'
import { noise } from '../src/index.js'
import { Noise } from '../src/noise.js'
import { createPeerIdsFromFixtures } from './fixtures/peer.js'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'

function createCounterSpy () {
return sinon.spy({
Expand Down Expand Up @@ -43,7 +44,7 @@ describe('Index', () => {
const wrappedInbound = pbStream(inbound.conn)
const wrappedOutbound = pbStream(outbound.conn)

wrappedOutbound.writeLP(Buffer.from('test'))
wrappedOutbound.writeLP(uint8ArrayFromString('test'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary for the browser tests to pass for me as Buffer is not in the browser global scope.

await wrappedInbound.readLP()
expect(metricsRegistry.get('libp2p_noise_xxhandshake_successes_total')?.increment.callCount).to.equal(1)
expect(metricsRegistry.get('libp2p_noise_xxhandshake_error_total')?.increment.callCount).to.equal(0)
Expand Down
1 change: 1 addition & 0 deletions test/interop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
}

const opts: Libp2pOptions = {
// @ts-expect-error @libp2p/interface-peer-id types are not aligned
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed once [email protected] ships

peerId,
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0']
Expand Down