Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
chore: integrate libp2p new pubsub routing
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Aug 28, 2019
1 parent cba8b4c commit c92a241
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SPEC/PUBSUB.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ A great source of [examples][] can be found in the tests for this API.
##### `ipfs.pubsub.publish(topic, data, [callback])`

- `topic: String`
- `data: Buffer` - The message to send
- `data: Buffer|String` - The message to send
- `callback: (Error) => {}` - (Optional) Calls back with an error or nothing if the publish was successful.

If no `callback` is passed, a promise is returned.
Expand Down
11 changes: 3 additions & 8 deletions src/pubsub/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,10 @@ module.exports = (createCommon, options) => {

after((done) => common.teardown(done))

it('should error on string messags', async () => {
it('should publish message from string', () => {
const topic = getTopic()
try {
await ipfs.pubsub.publish(topic, 'hello friend')
} catch (err) {
expect(err).to.exist()
return
}
throw new Error('did not error on string message')

return ipfs.pubsub.publish(topic, 'hello friend')
})

it('should publish message from buffer', () => {
Expand Down

0 comments on commit c92a241

Please sign in to comment.