@libp2p/floodsub 3.0.1 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/floodsub",
3
- "version": "3.0.1",
3
+ "version": "3.0.4",
4
4
  "description": "libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-floodsub#readme",
@@ -73,15 +73,15 @@
73
73
  "release": "patch"
74
74
  },
75
75
  {
76
- "type": "chore",
76
+ "type": "docs",
77
77
  "release": "patch"
78
78
  },
79
79
  {
80
- "type": "docs",
80
+ "type": "test",
81
81
  "release": "patch"
82
82
  },
83
83
  {
84
- "type": "test",
84
+ "type": "deps",
85
85
  "release": "patch"
86
86
  },
87
87
  {
@@ -111,7 +111,11 @@
111
111
  },
112
112
  {
113
113
  "type": "docs",
114
- "section": "Trivial Changes"
114
+ "section": "Documentation"
115
+ },
116
+ {
117
+ "type": "deps",
118
+ "section": "Dependencies"
115
119
  },
116
120
  {
117
121
  "type": "test",
@@ -144,24 +148,25 @@
144
148
  },
145
149
  "dependencies": {
146
150
  "@libp2p/interface-peer-id": "^1.0.2",
147
- "@libp2p/interface-pubsub": "^1.0.3",
151
+ "@libp2p/interface-pubsub": "^2.0.0",
148
152
  "@libp2p/logger": "^2.0.0",
149
- "@libp2p/pubsub": "^3.0.1",
150
- "protons-runtime": "^1.0.3",
153
+ "@libp2p/pubsub": "^3.1.1",
154
+ "protons-runtime": "^3.0.1",
155
+ "uint8arraylist": "^2.1.1",
151
156
  "uint8arrays": "^3.0.0"
152
157
  },
153
158
  "devDependencies": {
154
159
  "@libp2p/components": "^2.0.0",
155
- "@libp2p/interface-mocks": "^3.0.1",
156
- "@libp2p/interface-pubsub-compliance-tests": "^1.0.1",
157
- "@libp2p/peer-collections": "^1.0.2",
160
+ "@libp2p/interface-mocks": "^4.0.1",
161
+ "@libp2p/interface-pubsub-compliance-tests": "^2.0.1",
162
+ "@libp2p/peer-collections": "^2.0.0",
158
163
  "@libp2p/peer-id": "^1.1.10",
159
164
  "@libp2p/peer-id-factory": "^1.0.9",
160
165
  "@multiformats/multiaddr": "^10.1.8",
161
166
  "aegir": "^37.2.0",
162
167
  "multiformats": "^9.4.5",
163
- "p-wait-for": "^4.1.0",
164
- "protons": "^3.0.3",
168
+ "p-wait-for": "^5.0.0",
169
+ "protons": "^5.0.0",
165
170
  "sinon": "^14.0.0",
166
171
  "wherearewe": "^1.0.0"
167
172
  }
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ import type { PubSubInit, Message, PubSubRPC, PubSubRPCMessage, PublishResult }
6
6
  import type { PeerId } from '@libp2p/interface-peer-id'
7
7
  import { logger } from '@libp2p/logger'
8
8
  import { RPC } from './message/rpc.js'
9
+ import type { Uint8ArrayList } from 'uint8arraylist'
9
10
 
10
11
  const log = logger('libp2p:floodsub')
11
12
 
@@ -43,7 +44,7 @@ export class FloodSub extends PubSubBaseProtocol {
43
44
  /**
44
45
  * Decode a Uint8Array into an RPC object
45
46
  */
46
- decodeRpc (bytes: Uint8Array): PubSubRPC {
47
+ decodeRpc (bytes: Uint8Array | Uint8ArrayList): PubSubRPC {
47
48
  return RPC.decode(bytes)
48
49
  }
49
50
 
@@ -54,7 +55,7 @@ export class FloodSub extends PubSubBaseProtocol {
54
55
  return RPC.encode(rpc)
55
56
  }
56
57
 
57
- decodeMessage (bytes: Uint8Array): PubSubRPCMessage {
58
+ decodeMessage (bytes: Uint8Array | Uint8ArrayList): PubSubRPCMessage {
58
59
  return RPC.Message.decode(bytes)
59
60
  }
60
61