Skip to content

chore: update dependencies and tests #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 1, 2020

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Dec 30, 2019

This PR aims to:

  • update the dependencies
  • fix pubsub.ls() rename to pubsub.getTopics()
  • updates the tests to not use ipfs, but use the modules it needs only

Resolves #18

@vasco-santos vasco-santos force-pushed the chore/update-dependencies-and-tests branch from ddb7075 to cc48cef Compare December 30, 2019 14:40
@vasco-santos vasco-santos force-pushed the chore/update-dependencies-and-tests branch from cc48cef to 670daa7 Compare December 30, 2019 14:41
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks so much for sorting this out. I've just left some minor suggestions.

getTopics: () => pubsub.getTopics(),
getSubscribers: (topic) => pubsub.getSubscribers(topic),
stop: () => pubsub.stop()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I'd just return pubsub and refactor the tests that use subscribe and unsubscribe to use the libp2p PubSub API not the IPFS pubsub API. 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes aim to use the libp2p pubsub API: https://github.com/libp2p/js-libp2p/blob/refactor/async-await/src/pubsub.js

My initial idea was to use the pubsub API directly. But, I would need to also change the src for doing the subscribe and handle in different operations. Also, for js-ipfs, I think it makes more sense to provide libp2p.pubsub to datastore-pubsub, instead of libp2p.pubsub._pubsub for having the API of the pubsub router directly.

I will go ahead and merge this, but we can discuss and make this change if you convince me that it is better 😛

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha my bad I was thinking the libp2p pubsub api WAS the pubsub api but it is different.

@vasco-santos vasco-santos merged commit fe751f8 into master Jan 1, 2020
@vasco-santos vasco-santos deleted the chore/update-dependencies-and-tests branch January 1, 2020 17:44
vasco-santos added a commit that referenced this pull request Jan 9, 2020
vasco-santos added a commit that referenced this pull request Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants