vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
242 stars 52 forks source link

fix: remove explicit param from GossipSubParams constructor #1080

Closed diegomrsantos closed 2 months ago

diegomrsantos commented 2 months ago

I believe explicit is used to check if the GossipSubParams instance was created by the user either passing params to GossipSubParams(...) or GossipSubParams.init(...). In the first case explicit should be set to true when calling the Nim constructor, in the second case, the param isn't necessary and should be always be set to true by init. If none of those options were used, it means the instance was created by using Nim default values. In this case, GossipSubParams.init() should be called to set the values to their default value defined by nim-libp2p. https://github.com/status-im/nim-libp2p/blob/5e55ca3b69e18a56a0a5a34941676f4df08523ae/libp2p/protocols/pubsub/gossipsub.nim#L774

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.80%. Comparing base (03f67d3) to head (403449d).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1080/graphs/tree.svg?width=650&height=150&src=pr&token=M88zHaQffJ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p)](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1080?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p) ```diff @@ Coverage Diff @@ ## unstable #1080 +/- ## ============================================ - Coverage 84.82% 84.80% -0.02% ============================================ Files 91 91 Lines 15428 15428 ============================================ - Hits 13087 13084 -3 - Misses 2341 2344 +3 ``` | [Files](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1080?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p) | Coverage Δ | | |---|---|---| | [libp2p/protocols/pubsub/gossipsub.nim](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1080?src=pr&el=tree&filepath=libp2p%2Fprotocols%2Fpubsub%2Fgossipsub.nim&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p#diff-bGlicDJwL3Byb3RvY29scy9wdWJzdWIvZ29zc2lwc3ViLm5pbQ==) | `86.46% <ø> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1080/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p)