Skip to content

Commit

Permalink
fix: add static member for multicodec (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Jun 3, 2020
1 parent df12156 commit dd86739
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
node_modules/
src/
package-lock.json
2 changes: 1 addition & 1 deletion test/2-nodes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chai.use(require('dirty-chai'))
chai.use(require('chai-spies'))
const expect = chai.expect

const { GossipsubID: multicodec } = require('../src/constants')
const { multicodec } = require('../src')

const {
createGossipsub,
Expand Down
3 changes: 2 additions & 1 deletion ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Gossipsub extends BasicPubsub {
control: Map<Peer, ControlMessage>
_options: GossipOptions

public static multicodec: string = constants.GossipsubID

/**
* @param {PeerId} peerId instance of the peer's PeerId
* @param {Object} registrar
Expand Down Expand Up @@ -715,4 +717,3 @@ class Gossipsub extends BasicPubsub {
}

export = Gossipsub
module.exports.multicodec = constants.GossipsubID

0 comments on commit dd86739

Please sign in to comment.