vacp2p / nim-libp2p

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

annotate `upgrademngrs` with `{.async: (raises).}` #1068

Closed etan-status closed 3 months ago

etan-status commented 3 months ago

The next layer of modules that can get {.async: (raises).} annotations are the upgrademngrs. This is the first layer that mixes so many error types that it makes sense to start with {.async: (raises: [LPError]).} especially because the callers add raw LPError as well. It may be worthwhile to try and wrap inner exceptions in a proper outer type, but as this pattern spans large parts of the library, such wrapping should be investigated separately from initial annotation work.

codecov-commenter commented 3 months ago

Codecov Report

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

Project coverage is 82.58%. Comparing base (48a3ac0) to head (ecc6d2b).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068/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/1068?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p) ```diff @@ Coverage Diff @@ ## unstable #1068 +/- ## ============================================ + Coverage 82.50% 82.58% +0.07% ============================================ Files 91 91 Lines 15847 15859 +12 ============================================ + Hits 13075 13097 +22 + Misses 2772 2762 -10 ``` | [Files](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p) | Coverage Δ | | |---|---|---| | [libp2p/transports/transport.nim](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p#diff-bGlicDJwL3RyYW5zcG9ydHMvdHJhbnNwb3J0Lm5pbQ==) | `88.46% <100.00%> (-0.22%)` | :arrow_down: | | [libp2p/upgrademngrs/upgrade.nim](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p#diff-bGlicDJwL3VwZ3JhZGVtbmdycy91cGdyYWRlLm5pbQ==) | `100.00% <100.00%> (ø)` | | | [libp2p/upgrademngrs/muxedupgrade.nim](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p#diff-bGlicDJwL3VwZ3JhZGVtbmdycy9tdXhlZHVwZ3JhZGUubmlt) | `92.75% <93.33%> (+5.86%)` | :arrow_up: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/vacp2p/nim-libp2p/pull/1068/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacp2p)
diegomrsantos commented 3 months ago

@etan-status it'd be good to track what has been done regarding this topic in this issue https://github.com/vacp2p/nim-libp2p/issues/962

etan-status commented 3 months ago

Thanks, have put comments linking to that issue to the relevant PRs so far, so that they appear in #962