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

Commit 5d5d788

Browse files
authored
deps: update all deps (#94)
1 parent 31dc528 commit 5d5d788

File tree

8 files changed

+591
-70
lines changed

8 files changed

+591
-70
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"dependencies": {
179179
"@libp2p/components": "^2.0.0",
180180
"@libp2p/crypto": "^1.0.0",
181-
"@libp2p/interface-connection": "^2.0.0",
181+
"@libp2p/interface-connection": "^3.0.1",
182182
"@libp2p/interface-peer-id": "^1.0.2",
183183
"@libp2p/interface-pubsub": "^2.0.0",
184184
"@libp2p/interface-registrar": "^2.0.0",
@@ -205,8 +205,8 @@
205205
"it-pair": "^2.0.2",
206206
"p-defer": "^4.0.0",
207207
"p-wait-for": "^5.0.0",
208-
"protons": "^4.0.1",
209-
"protons-runtime": "^2.0.2",
208+
"protons": "^5.0.0",
209+
"protons-runtime": "^3.0.1",
210210
"sinon": "^14.0.0",
211211
"util": "^0.12.4"
212212
}

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ export abstract class PubSubBaseProtocol<Events = PubSubEvents> extends EventEmi
485485
* Encode RPC object into a Uint8Array.
486486
* This can be override to use a custom router protobuf.
487487
*/
488-
abstract encodeRpc (rpc: PubSubRPC): Uint8ArrayList
488+
abstract encodeRpc (rpc: PubSubRPC): Uint8Array
489489

490490
/**
491491
* Encode RPC object into a Uint8Array.
492492
* This can be override to use a custom router protobuf.
493493
*/
494-
abstract encodeMessage (rpc: PubSubRPCMessage): Uint8ArrayList
494+
abstract encodeMessage (rpc: PubSubRPCMessage): Uint8Array
495495

496496
/**
497497
* Send an rpc object to a peer

src/sign.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import type { PeerId } from '@libp2p/interface-peer-id'
55
import { keys } from '@libp2p/crypto'
66
import type { PubSubRPCMessage, SignedMessage } from '@libp2p/interface-pubsub'
77
import { peerIdFromKeys } from '@libp2p/peer-id'
8-
import type { Uint8ArrayList } from 'uint8arraylist'
98

109
export const SignPrefix = uint8ArrayFromString('libp2p-pubsub:')
1110

1211
/**
1312
* Signs the provided message with the given `peerId`
1413
*/
15-
export async function signMessage (peerId: PeerId, message: { from: PeerId, topic: string, data: Uint8Array, sequenceNumber: bigint }, encode: (rpc: PubSubRPCMessage) => Uint8ArrayList): Promise<SignedMessage> {
14+
export async function signMessage (peerId: PeerId, message: { from: PeerId, topic: string, data: Uint8Array, sequenceNumber: bigint }, encode: (rpc: PubSubRPCMessage) => Uint8Array): Promise<SignedMessage> {
1615
if (peerId.privateKey == null) {
1716
throw new Error('Cannot sign message, no private key present')
1817
}
@@ -46,7 +45,7 @@ export async function signMessage (peerId: PeerId, message: { from: PeerId, topi
4645
/**
4746
* Verifies the signature of the given message
4847
*/
49-
export async function verifySignature (message: SignedMessage, encode: (rpc: PubSubRPCMessage) => Uint8ArrayList) {
48+
export async function verifySignature (message: SignedMessage, encode: (rpc: PubSubRPCMessage) => Uint8Array) {
5049
if (message.type !== 'signed') {
5150
throw new Error('Message type must be "signed" to be verified')
5251
}

test/instance.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ class PubsubProtocol extends PubSubBaseProtocol {
88
throw new Error('Method not implemented.')
99
}
1010

11-
encodeRpc (rpc: PubSubRPC): Uint8ArrayList {
11+
encodeRpc (rpc: PubSubRPC): Uint8Array {
1212
throw new Error('Method not implemented.')
1313
}
1414

1515
decodeMessage (bytes: Uint8Array | Uint8ArrayList): PubSubRPCMessage {
1616
throw new Error('Method not implemented.')
1717
}
1818

19-
encodeMessage (rpc: PubSubRPCMessage): Uint8ArrayList {
19+
encodeMessage (rpc: PubSubRPCMessage): Uint8Array {
2020
throw new Error('Method not implemented.')
2121
}
2222

test/lifecycle.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class PubsubProtocol extends PubSubBaseProtocol {
1919
throw new Error('Method not implemented.')
2020
}
2121

22-
encodeRpc (rpc: PubSubRPC): Uint8ArrayList {
22+
encodeRpc (rpc: PubSubRPC): Uint8Array {
2323
throw new Error('Method not implemented.')
2424
}
2525

2626
decodeMessage (bytes: Uint8Array | Uint8ArrayList): PubSubRPCMessage {
2727
throw new Error('Method not implemented.')
2828
}
2929

30-
encodeMessage (rpc: PubSubRPCMessage): Uint8ArrayList {
30+
encodeMessage (rpc: PubSubRPCMessage): Uint8Array {
3131
throw new Error('Method not implemented.')
3232
}
3333

0 commit comments

Comments
 (0)