Finschia / ostracon

Ostracon, a consensus algorithm, is forked from Tendermint Core. We have added VRF to Tendermint BFT. It adds randomness to PoS Validator elections and improves security.
Apache License 2.0
70 stars 28 forks source link

fix: remove unnecessary condition #766

Closed ulbqb closed 6 months ago

ulbqb commented 6 months ago

Description

This PR removes unnecessary condition.

Issue

Regarding the connection side, the NewSignerListener supports the tcp and unix protocols.

https://github.com/Finschia/ostracon/blob/08c34d4f52caa73faacabcab092b6ad65a35e6c2/privval/utils.go#L29-L53

Therefore, in the context of the if statement, there should not be any instances where the protocol field is empty, indicated by len(protocol) == 0.

https://github.com/Finschia/ostracon/blob/08c34d4f52caa73faacabcab092b6ad65a35e6c2/privval/signer_listener_endpoint.go#L30-L38

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 66.56%. Comparing base (2aa7d4c) to head (5144c7b). Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #766 +/- ## ========================================== + Coverage 66.54% 66.56% +0.02% ========================================== Files 285 285 Lines 37919 37918 -1 ========================================== + Hits 25232 25239 +7 + Misses 10883 10880 -3 + Partials 1804 1799 -5 ``` | [Files](https://app.codecov.io/gh/Finschia/ostracon/pull/766?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [privval/signer\_listener\_endpoint.go](https://app.codecov.io/gh/Finschia/ostracon/pull/766?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-cHJpdnZhbC9zaWduZXJfbGlzdGVuZXJfZW5kcG9pbnQuZ28=) | `88.81% <100.00%> (+2.09%)` | :arrow_up: | ... and [15 files with indirect coverage changes](https://app.codecov.io/gh/Finschia/ostracon/pull/766/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)