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

Commit

Permalink
fix: Published message field names (#49)
Browse files Browse the repository at this point in the history
* fix: topicCIDs should be topicIDs

* fix: use supported node versions
  • Loading branch information
richardschneider authored and daviddias committed Nov 16, 2017
1 parent 45c2f8e commit b8f66cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
sudo: false
language: node_js
node_js:
- 4
- 5
- stable

# Make sure we have new NPM.
before_install:
- npm install -g npm
matrix:
include:
- node_js: 6
env: CXX=g++-4.8
- node_js: 8
env: CXX=g++-4.8

script:
- npm run lint
- npm test
- npm run test
- npm run coverage


Expand All @@ -22,9 +20,6 @@ before_script:
after_success:
- npm run coverage-publish

env:
- CXX=g++-4.8

addons:
firefox: 'latest'
apt:
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ class FloodSub extends EventEmitter {
this.cache.put(seqno)

// 2. emit to self
this._emitMessages(msg.topicCIDs, [msg])
this._emitMessages(msg.topicIDs, [msg])

// 3. propagate msg to others
this._forwardMessages(msg.topicCIDs, [msg])
this._forwardMessages(msg.topicIDs, [msg])
})
}

Expand Down Expand Up @@ -277,7 +277,7 @@ class FloodSub extends EventEmitter {
from: from,
data: msg,
seqno: new Buffer(seqno),
topicCIDs: topics
topicIDs: topics
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/message/rpc.proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ message RPC {
optional string from = 1;
optional bytes data = 2;
optional bytes seqno = 3;
repeated string topicCIDs = 4; // CID of topic descriptor object
repeated string topicIDs = 4; // CID of topic descriptor object
}
}`
2 changes: 1 addition & 1 deletion test/2-nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('basics between 2 nodes', () => {
expect(msg.data.toString()).to.equal('banana')
expect(msg.from).to.be.eql(fsB.libp2p.peerInfo.id.toB58String())
expect(Buffer.isBuffer(msg.seqno)).to.be.true()
expect(msg.topicCIDs).to.be.eql(['Z'])
expect(msg.topicIDs).to.be.eql(['Z'])

if (++counter === 10) {
fsA.removeListener('Z', receivedMsg)
Expand Down

0 comments on commit b8f66cd

Please sign in to comment.