Skip to content

Commit

Permalink
deps: switch it-pb-stream for it-protobuf-stream (#121)
Browse files Browse the repository at this point in the history
Switches modules
  • Loading branch information
achingbrain committed Aug 15, 2023
1 parent 2577b74 commit 76633f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"it-all": "^3.0.1",
"it-first": "^3.0.1",
"it-handshake": "^4.1.2",
"it-pb-stream": "^4.0.0",
"it-protobuf-stream": "^1.0.0",
"it-pipe": "^3.0.0",
"it-stream-types": "^2.0.1",
"multiformats": "^12.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/relay/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pbStream } from 'it-pb-stream'
import { pipe } from 'it-pipe'
import { pbStream } from 'it-protobuf-stream'
import { HopMessage } from './pb/index.js'
import type { Daemon } from '../index.js'
import type { PeerId } from '@libp2p/interface-peer-id'
Expand All @@ -11,12 +11,12 @@ const RELAY_V2_HOP = '/libp2p/circuit/relay/0.2.0/hop'
export const reserve = async (d: Daemon, peerID: PeerId, message?: Partial<HopMessage>): Promise<HopMessage> => {
const stream = await d.client.openStream(peerID, RELAY_V2_HOP)
const pb = pbStream(stream)
pb.writePB({
await pb.write({
type: HopMessage.Type.RESERVE,
...(message ?? {})
}, HopMessage)

return pb.readPB(HopMessage)
return pb.read(HopMessage)
}

export const echoHandler = {
Expand Down

0 comments on commit 76633f7

Please sign in to comment.