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

MX-15168: MaxDelegationCap tests #5953

Merged
merged 13 commits into from Apr 24, 2024
Merged

MX-15168: MaxDelegationCap tests #5953

merged 13 commits into from Apr 24, 2024

Conversation

dragos-rebegea
Copy link
Contributor

Reasoning behind the pull request

  • add tests for MaxDelegationCap(

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?

Base automatically changed from MX-15154 to feat/staking-v4 February 13, 2024 11:09
# Conflicts:
#	integrationTests/chainSimulator/staking/delegation_test.go
@mariusmihaic mariusmihaic self-requested a review February 13, 2024 11:53
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.17%. Comparing base (9361efa) to head (0a752e8).

Additional details and impacted files
@@              Coverage Diff              @@
##           rc/v1.7.0    #5953      +/-   ##
=============================================
- Coverage      80.17%   80.17%   -0.01%     
=============================================
  Files            752      752              
  Lines          97907    97907              
=============================================
- Hits           78498    78495       -3     
- Misses         14039    14042       +3     
  Partials        5370     5370              

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

integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
if actionListSize != 0 {
require.Equal(t, 1, len(auctionList[0].Nodes))
require.Equal(t, topUpInAuctionList.String(), auctionList[0].TopUpPerNode)
require.Equal(t, expectedActionListOwnersSize, len(auctionList))
Copy link
Contributor

Choose a reason for hiding this comment

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

so, in all other epochs, next after common.StakingV4Step3Flag we have both the expectedNodesInWaitingList and expectedActionListOwnersSize set to 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, the tests passes because we dont call this in other epochs, fixed to also work for epochs after common.StakingV4Step3Flag

Copy link
Contributor

Choose a reason for hiding this comment

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

The way this test is written yes, which is wrong.
We should check exactly which nodes we expect them to be in auction, not making assumptions. If someone with a different config will call these funcs, they would fail, since these conditions are very specific to a single nodes config

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so now I see that the condition is changed to >= which make more sense to me

integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
if actionListSize != 0 {
require.Equal(t, 1, len(auctionList[0].Nodes))
require.Equal(t, topUpInAuctionList.String(), auctionList[0].TopUpPerNode)
require.Equal(t, expectedActionListOwnersSize, len(auctionList))
Copy link
Contributor

Choose a reason for hiding this comment

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

The way this test is written yes, which is wrong.
We should check exactly which nodes we expect them to be in auction, not making assumptions. If someone with a different config will call these funcs, they would fail, since these conditions are very specific to a single nodes config

integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
integrationTests/chainSimulator/staking/delegation_test.go Outdated Show resolved Hide resolved
iulianpascalau
iulianpascalau previously approved these changes Feb 13, 2024
dragos-rebegea and others added 2 commits February 14, 2024 15:51
Co-authored-by: mariusmihaic <82832880+mariusmihaic@users.noreply.github.com>
Co-authored-by: mariusmihaic <82832880+mariusmihaic@users.noreply.github.com>
iulianpascalau
iulianpascalau previously approved these changes Feb 14, 2024
mariusmihaic
mariusmihaic previously approved these changes Feb 14, 2024
Base automatically changed from feat/staking-v4 to rc/v1.7.0 March 7, 2024 12:05
@mariusmihaic mariusmihaic dismissed stale reviews from iulianpascalau and themself March 7, 2024 12:05

The base branch was changed.

dragos-rebegea and others added 3 commits March 16, 2024 16:22
# Conflicts:
#	integrationTests/chainSimulator/staking/delegation_test.go
# Conflicts:
#	integrationTests/chainSimulator/staking/stakingProvider/delegation_test.go
@dragos-rebegea dragos-rebegea merged commit 11f6f05 into rc/v1.7.0 Apr 24, 2024
8 checks passed
@dragos-rebegea dragos-rebegea deleted the MX-15168 branch April 24, 2024 09:37
@KritsanaVeingin
Copy link

KritsanaVeingin commented Apr 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants