Skip to content

Commit 76633f7

Browse files
authored
deps: switch it-pb-stream for it-protobuf-stream (#121)
Switches modules
1 parent 2577b74 commit 76633f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"it-all": "^3.0.1",
142142
"it-first": "^3.0.1",
143143
"it-handshake": "^4.1.2",
144-
"it-pb-stream": "^4.0.0",
144+
"it-protobuf-stream": "^1.0.0",
145145
"it-pipe": "^3.0.0",
146146
"it-stream-types": "^2.0.1",
147147
"multiformats": "^12.0.1",

src/relay/util.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { pbStream } from 'it-pb-stream'
21
import { pipe } from 'it-pipe'
2+
import { pbStream } from 'it-protobuf-stream'
33
import { HopMessage } from './pb/index.js'
44
import type { Daemon } from '../index.js'
55
import type { PeerId } from '@libp2p/interface-peer-id'
@@ -11,12 +11,12 @@ const RELAY_V2_HOP = '/libp2p/circuit/relay/0.2.0/hop'
1111
export const reserve = async (d: Daemon, peerID: PeerId, message?: Partial<HopMessage>): Promise<HopMessage> => {
1212
const stream = await d.client.openStream(peerID, RELAY_V2_HOP)
1313
const pb = pbStream(stream)
14-
pb.writePB({
14+
await pb.write({
1515
type: HopMessage.Type.RESERVE,
1616
...(message ?? {})
1717
}, HopMessage)
1818

19-
return pb.readPB(HopMessage)
19+
return pb.read(HopMessage)
2020
}
2121

2222
export const echoHandler = {

0 commit comments

Comments
 (0)