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

Staking v4: integration tests for unStake nodes #4121

Merged

Conversation

mariusmihaic
Copy link
Contributor

@mariusmihaic mariusmihaic commented May 27, 2022

What's new

  • Added TestStakingV4_UnStakeNodes test which tests unstaking nodes along the staking v4 activation chain
  • Added new nodes list table in staking v4 tests displayer
  • Added SaveDelegationManagerConfig test func which saves systemSmartContracts.DelegationManagement config in testscommon/stakingcommon/stakingCommon.go

Bugfixes

  • Changed RegisterValidatorKey & AddKeysToWaitingList execution order to set Staked flag to false
  • Removed w_ prefix in getWaitingListKeys when saving the staking queue in current nodes config in tests

Refactor

  • Created createSCRsFromStakingSCOutput func which generates scrs related to staking instead of "hard-codding" them

@mariusmihaic mariusmihaic changed the base branch from EN-12196-implement-soft-auction to EN-12197-staking-v4-save-nodes-config May 27, 2022 13:44
@mariusmihaic mariusmihaic marked this pull request as ready for review June 9, 2022 10:59
for _, blsKey := range nodesData.BLSKeys {
signature := append([]byte("signature-"), blsKey...)
//TODO:
// - Do the same for unJail
Copy link
Contributor

Choose a reason for hiding this comment

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

do not forget to implement the TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already implemented in #4170

MinDelegationAmount: big.NewInt(1),
}
marshaledData, err := marshaller.Marshal(managementData)
log.LogIfError(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of logging the error maybe you can pass the t *testing.T in order to stop the execution

Copy link
Contributor

Choose a reason for hiding this comment

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

or return error and stop the test where the call happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When creating a newTestMetaProcessor I do not have any t *testing.T pointer to pass, so I'll leave it as it is

@sstanculeanu sstanculeanu self-requested a review June 10, 2022 07:07
Base automatically changed from EN-12197-staking-v4-save-nodes-config to feat/liquid-staking June 16, 2022 11:02
@mariusmihaic mariusmihaic merged commit 45b5d03 into feat/liquid-staking Jun 16, 2022
@mariusmihaic mariusmihaic deleted the EN-12197-staking-v4-integration-tests-unstake branch June 16, 2022 11:16
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

3 participants