Skip to content

Commit 7ca7f06

Browse files
committed
fix: code review
1 parent a68dc87 commit 7ca7f06

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ class PubsubBaseProtocol extends EventEmitter {
101101
this.libp2p.dialProtocol(peerInfo, this.multicodec, (err, conn) => {
102102
this.log('dial to %s complete', idB58Str)
103103

104-
// If the dial is not in the set, it means that floodsub has been
104+
// If the dial is not in the set, it means that pubsub has been
105105
// stopped
106-
const floodsubStopped = !this._dials.has(idB58Str)
106+
const pubsubStopped = !this._dials.has(idB58Str)
107107
this._dials.delete(idB58Str)
108108

109109
if (err) {
110110
this.log.err(err)
111111
return callback()
112112
}
113113

114-
// Floodsub has been stopped, so we should just bail out
115-
if (floodsubStopped) {
116-
this.log('floodsub was stopped, not processing dial to %s', idB58Str)
114+
// pubsub has been stopped, so we should just bail out
115+
if (pubsubStopped) {
116+
this.log('pubsub was stopped, not processing dial to %s', idB58Str)
117117
return callback()
118118
}
119119

@@ -160,7 +160,7 @@ class PubsubBaseProtocol extends EventEmitter {
160160
}
161161

162162
/**
163-
* Mounts the floodsub protocol onto the libp2p node and sends our
163+
* Mounts the pubsub protocol onto the libp2p node and sends our
164164
* subscriptions to every peer conneceted
165165
*
166166
* @param {Function} callback
@@ -191,7 +191,7 @@ class PubsubBaseProtocol extends EventEmitter {
191191
}
192192

193193
/**
194-
* Unmounts the floodsub protocol and shuts down every connection
194+
* Unmounts the pubsub protocol and shuts down every connection
195195
*
196196
* @param {Function} callback
197197
* @returns {undefined}

test/pubsub.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const createNode = utils.createNode
1414

1515
class PubsubImplementation extends PubsubBaseProtocol {
1616
constructor (libp2p) {
17-
super('libp2p:floodsub', 'libp2p:pubsub-implementation', libp2p)
17+
super('libp2p:pubsub', 'libp2p:pubsub-implementation', libp2p)
1818
}
1919

2020
_processConnection (idB58Str, conn, peer) {
@@ -308,7 +308,7 @@ describe('pubsub base protocol', () => {
308308
// causes pubsub to dial peer B
309309
nodeA.emit('peer:connect', nodeB.peerInfo)
310310

311-
// Stop floodsub before the dial can complete
311+
// Stop pubsub before the dial can complete
312312
psA.stop(() => {
313313
// Check that the dial was not processed
314314
setTimeout(() => {

0 commit comments

Comments
 (0)