spacemeshos / go-spacemesh

Go Implementation of the Spacemesh protocol full node. 💾⏰💪
https://spacemesh.io
MIT License
760 stars 211 forks source link

[Merged by Bors] - Do not return empty address on not found #6463

Closed fasmat closed 5 days ago

fasmat commented 6 days ago

Motivation

Instead of returning an empty account when an address wasn't found in the DB return sql.ErrNotFound

Description

At the moment Latest and Get always return a types.Account{} and nil error if the given address wasn't found. With this change the two functions instead return sql.ErrNotFound as error.

Test Plan

existing tests pass

TODO

codecov[bot] commented 6 days ago

Codecov Report

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

Project coverage is 79.9%. Comparing base (f4de865) to head (72a9e80). Report is 2 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #6463 +/- ## ======================================= Coverage 79.9% 79.9% ======================================= Files 353 353 Lines 46424 46432 +8 ======================================= + Hits 37122 37144 +22 + Misses 7197 7186 -11 + Partials 2105 2102 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

fasmat commented 5 days ago

bors merge

spacemesh-bors[bot] commented 5 days ago

Pull request successfully merged into develop.

Build succeeded: