vacp2p / nim-libp2p

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

`{.async: (raises).}` annotations for `protocols/secure` #1059

Closed etan-status closed 3 months ago

etan-status commented 3 months ago

Extend files in libp2p/protocols/secure with {.async: (raises).} annotations and also apply some minor cleanups such as removing unnecessary result usage, using min template and reordering secio variables to be closer to their usage, changing var to let etc.

This is somewhat intertwined due to method handshake* which spans across all three files and must be updated in all files simultaneously.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 29.93631% with 110 lines in your changes are missing coverage. Please review.

Project coverage is 82.56%. Comparing base (ca01ee0) to head (a4c58d7). Report is 1 commits behind head on unstable.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059/graphs/tree.svg?width=650&height=150&src=pr&token=UR5JRQ249W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) ```diff @@ Coverage Diff @@ ## unstable #1059 +/- ## ============================================ - Coverage 82.81% 82.56% -0.25% ============================================ Files 91 91 Lines 15750 15814 +64 ============================================ + Hits 13043 13057 +14 - Misses 2707 2757 +50 ``` | [Files](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [libp2p/protocols/secure/secure.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvc2VjdXJlLm5pbQ==) | `73.98% <100.00%> (+1.85%)` | :arrow_up: | | [libp2p/protocols/secure/noise.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvbm9pc2Uubmlt) | `87.31% <60.78%> (-2.78%)` | :arrow_down: | | [libp2p/protocols/secure/secio.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvc2VjaW8ubmlt) | `3.38% <0.00%> (-0.46%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1059/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)
etan-status commented 3 months ago