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

Coverage for genesis package #5301

Merged
merged 6 commits into from Jun 7, 2023
Merged

Coverage for genesis package #5301

merged 6 commits into from Jun 7, 2023

Conversation

sstanculeanu
Copy link
Contributor

Reasoning behind the pull request

  • increase code coverage

Proposed changes

  • added extra coverage on genesis package

Testing procedure

  • standard system test

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.14 ⚠️

Comparison is base (e7da54b) 80.16% compared to head (25304b0) 80.02%.

❗ Current head 25304b0 differs from pull request most recent head 3452951. Consider uploading reports for the commit 3452951 to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##           rc/v1.6.0    #5301      +/-   ##
=============================================
- Coverage      80.16%   80.02%   -0.14%     
=============================================
  Files            695      695              
  Lines          90070    90053      -17     
=============================================
- Hits           72203    72069     -134     
- Misses         12667    12809     +142     
+ Partials        5200     5175      -25     
Impacted Files Coverage Δ
factory/processing/processComponents.go 82.50% <ø> (-0.02%) ⬇️
genesis/process/genesisBlockCreator.go 66.12% <ø> (+17.04%) ⬆️

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ssd04 ssd04 self-requested a review May 31, 2023 08:38
ssd04
ssd04 previously approved these changes Jun 2, 2023
@@ -167,18 +167,12 @@ func checkArgumentsForBlockCreator(arg ArgsGenesisBlockCreator) error {
if check.IfNil(arg.Data.StorageService()) {
return process.ErrNilStore
}
if check.IfNil(arg.Data.Blockchain()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


ap := parsing.NewTestAccountsParser(createMockHexPubkeyConverter())
addr := ap.GenesisMintingAddress()
assert.Equal(t, hex.EncodeToString([]byte("erd17rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rcqqkhty3")), addr)
Copy link
Contributor

@ssd04 ssd04 Jun 2, 2023

Choose a reason for hiding this comment

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

maybe extract minting address into a const since we have it in multiple places in this package

Copy link
Contributor

Choose a reason for hiding this comment

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

[]byte("erd1...") is confusing. maybe use the real bech32 converter or use a hex / dummy address here

@bogdan-rosianu bogdan-rosianu self-requested a review June 2, 2023 11:50

ap := parsing.NewTestAccountsParser(createMockHexPubkeyConverter())
addr := ap.GenesisMintingAddress()
assert.Equal(t, hex.EncodeToString([]byte("erd17rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rc0pu8s7rcqqkhty3")), addr)
Copy link
Contributor

Choose a reason for hiding this comment

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

[]byte("erd1...") is confusing. maybe use the real bech32 converter or use a hex / dummy address here

t.Run("nil GasSchedule should error", func(t *testing.T) {
t.Parallel()

arg := createMockArgument(t, "testdata/genesisTest1.json", &mock.InitialNodesHandlerStub{}, big.NewInt(22000))
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicated test

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.
@@ Log scanner @@

genesis_tests

================================================================================

  • Known Warnings 8
  • New Warnings 1
  • Known Errors 1
  • New Errors 0
  • Panics 0
    ================================================================================
  • block hash does not match 10909
  • wrong nonce in block 3759
  • miniblocks does not match 0
  • num miniblocks does not match 0
  • miniblock hash does not match 0
  • block bodies does not match 0
  • receipts hash missmatch 0
    ================================================================================
  • No jailed nodes on the testnet
    ================================================================================

@gabi-vuls gabi-vuls merged commit 6cfb278 into rc/v1.6.0 Jun 7, 2023
5 checks passed
@gabi-vuls gabi-vuls deleted the genesis_tests branch June 7, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants