Skip to content
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

chore: use pubsub interface #122

Merged
merged 9 commits into from
Aug 24, 2020
Merged

chore: use pubsub interface #122

merged 9 commits into from
Aug 24, 2020

Conversation

vasco-santos
Copy link
Collaborator

@vasco-santos vasco-santos commented Aug 17, 2020

This PR moves away from libp2p-pubsub base implementation and uses the new (still in PR) interface-pubsub.

The interface-pubsub provides some advantages over libp2p-pubsub:

The current base pubsub implementation in the interface is mostly the content of https://github.com/libp2p/js-libp2p-pubsub/tree/v0.6.x with some changes in the constructor.

This PR aims to:

  • Use interface-pubsub with its base implementation and test suite
  • Remove unnecessary tests
  • Heartbeat start/stop errors removed
  • Handler for subscribe/unsubscribe feature added (remove libp2p abstraction that mostly adds this)

Note: The interface still needs to be updated with the content of pubsub.js in this repo.

Needs:

})
})
})

describe('2 nodes', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was initially planning to remove all this file. These tests are mostly redundant now, but all the mesh related expects are an extension from the interface tests, as they are specific to gossipsub.
We can create new tests to guarantee that the mesh content is properly tested, or keep these tests for now and open an issue to tackle this test refactor later as it is not a priority

ts/heartbeat.ts Show resolved Hide resolved
ts/index.ts Outdated Show resolved Hide resolved
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch from 6c31d45 to 1f5cc00 Compare August 17, 2020 18:01
package.json Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2020

Codecov Report

Merging #122 into gsv1.1 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           gsv1.1     #122   +/-   ##
=======================================
  Coverage   91.66%   91.66%           
=======================================
  Files           2        2           
  Lines          24       24           
=======================================
  Hits           22       22           
  Misses          2        2           
Impacted Files Coverage Δ
test/utils/index.js 81.81% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7aa09c8...590b7e4. Read the comment docs.

ts/pubsub.js Outdated Show resolved Hide resolved
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch 3 times, most recently from 7d36a97 to cd6400a Compare August 19, 2020 16:49
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch from cd6400a to 752976e Compare August 19, 2020 16:57
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch from 752976e to e44efdc Compare August 19, 2020 17:38
@vasco-santos
Copy link
Collaborator Author

While this still depends on some branches, we can perhaps get this merged as this will not go to master yet.
cc @wemeetagain

@vasco-santos vasco-santos marked this pull request as ready for review August 24, 2020 09:29
@vasco-santos vasco-santos requested review from wemeetagain and removed request for wemeetagain August 24, 2020 09:41
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch from 527910f to 9004471 Compare August 24, 2020 13:14
@vasco-santos vasco-santos force-pushed the chore/use-pubsub-interface branch from 9004471 to 590b7e4 Compare August 24, 2020 13:30
@wemeetagain wemeetagain merged commit 4841fd4 into gsv1.1 Aug 24, 2020
@wemeetagain wemeetagain deleted the chore/use-pubsub-interface branch August 24, 2020 14:42
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.

3 participants