Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tm2): Add additional unit tests for tm2/pkg/std #2739

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

linhpn99
Copy link
Contributor

Add necessary unit tests to increase test coverage for this package

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, if any. More info here.

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.54%. Comparing base (f04ec89) to head (83f205e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2739      +/-   ##
==========================================
+ Coverage   60.44%   60.54%   +0.10%     
==========================================
  Files         563      563              
  Lines       75159    75159              
==========================================
+ Hits        45427    45507      +80     
+ Misses      26343    26260      -83     
- Partials     3389     3392       +3     
Flag Coverage Δ
contribs/gnodev 61.46% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (-0.86%) ⬇️
gno.land 67.21% <ø> (ø)
gnovm 64.46% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 20.23% <ø> (+0.35%) ⬆️
tm2 62.34% <ø> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@linhpn99 linhpn99 changed the title Add additional unit tests for tm2/pkg/std feat(tm2): Add additional unit tests for tm2/pkg/std Aug 28, 2024
@leohhhn
Copy link
Contributor

leohhhn commented Sep 11, 2024

#2333 (comment)

name string
input string
expected GasPrice
hasError bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better errorIs / errorContains

name string
input string
expected []GasPrice
hasError bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

}
}

func Test_CountSubKeys(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why underscore?

tm2/pkg/std/gasprice_test.go Show resolved Hide resolved
Comment on lines +213 to +215
signBytes, err := tx.GetSignBytes(chainID, accountNumber, sequence)
require.NoError(t, err)
require.NotEmpty(t, signBytes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a golden test (match signBytes against a known example output)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: No status
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants