gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source
https://gno.land/
Other
839 stars 342 forks source link

Add missing unit tests for tm2/pkg/crypto/client #2350

Open linhpn99 opened 1 week ago

linhpn99 commented 1 week ago

Blocked by https://github.com/gnolang/gno/pull/2309

From @moul 's request to add unit tests, I realized there are many code sections (maketx, call, query, etc.) that are not covered by unit tests. Obviously, this PR is created to address all of them :)

Contributors' checklist... - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 54.67%. Comparing base (6ec4bb8) to head (3eb67b5).

Files Patch % Lines
tm2/pkg/crypto/keys/client/maketx.go 0.00% 5 Missing :warning:
tm2/pkg/crypto/keys/client/broadcast.go 57.14% 2 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2350 +/- ## ========================================== + Coverage 54.61% 54.67% +0.05% ========================================== Files 581 581 Lines 77963 77965 +2 ========================================== + Hits 42578 42625 +47 + Misses 32209 32161 -48 - Partials 3176 3179 +3 ``` | [Flag](https://app.codecov.io/gh/gnolang/gno/pull/2350/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | Coverage Δ | | |---|---|---| | [tm2](https://app.codecov.io/gh/gnolang/gno/pull/2350/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang) | `54.51% <33.33%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gnolang#carryforward-flags-in-the-pull-request-comment) to find out more.

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