ChainSafe / js-libp2p-gossipsub

TypeScript implementation of Gossipsub
Apache License 2.0
151 stars 43 forks source link

feat: added allowPublishToZeroPeers as optional param to publish function #395

Closed maschad closed 1 year ago

maschad commented 1 year ago

Closes https://github.com/ChainSafe/js-libp2p-gossipsub/issues/367

The default for allowPublishToZeroPeers will be false but a user can optionally call with allowPublishToZeroPeers set to true to suppress InsufficientPeers errors

maschad commented 1 year ago

Added a test

codecov-commenter commented 1 year ago

Codecov Report

Base: 83.41% // Head: 83.42% // Increases project coverage by +0.00% :tada:

Coverage data is based on head (c4b1bea) compared to base (41740b5). Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head c4b1bea differs from pull request most recent head d067b9a. Consider uploading reports for the commit d067b9a to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #395 +/- ## ======================================= Coverage 83.41% 83.42% ======================================= Files 48 48 Lines 11766 11771 +5 Branches 1266 1267 +1 ======================================= + Hits 9815 9820 +5 Misses 1951 1951 ``` | [Impacted Files](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub/pull/395?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe) | Coverage Δ | | |---|---|---| | [src/index.ts](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub/pull/395?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe#diff-c3JjL2luZGV4LnRz) | `70.48% <100.00%> (+0.04%)` | :arrow_up: | | [src/types.ts](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub/pull/395?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe#diff-c3JjL3R5cGVzLnRz) | `94.54% <100.00%> (+0.13%)` | :arrow_up: | | [test/gossip.spec.ts](https://codecov.io/gh/ChainSafe/js-libp2p-gossipsub/pull/395?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe#diff-dGVzdC9nb3NzaXAuc3BlYy50cw==) | `96.31% <0.00%> (-0.06%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ChainSafe)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.