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 with custom scenarios #4045
Staking v4 - Integration tests with custom scenarios #4045
Conversation
…959-staking-v4-integration-tests-custom-scenarios
…ation-tests-custom-scenarios
Codecov Report
@@ Coverage Diff @@
## feat/liquid-staking #4045 +/- ##
=======================================================
- Coverage 75.38% 75.38% -0.01%
=======================================================
Files 622 622
Lines 83275 83275
=======================================================
- Hits 62779 62778 -1
- Misses 15773 15774 +1
Partials 4723 4723
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## feat/liquid-staking #4045 +/- ##
=======================================================
- Coverage 75.38% 75.38% -0.01%
=======================================================
Files 622 622
Lines 83275 83275
=======================================================
- Hits 62779 62777 -2
- Misses 15773 15774 +1
- Partials 4723 4724 +1
Continue to review full report at Codecov.
|
…on-tests-custom-scenarios
) *TestMetaProcessor { | ||
gasScheduleNotifier := createGasScheduleNotifier() | ||
blockChainHook := createBlockChainHook( | ||
dataComponents, coreComponents, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coreComponents
on new line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, missed it;
Added new line
@@ -65,7 +73,37 @@ func requireMapDoesNotContain(t *testing.T, m map[uint32][][]byte, s [][]byte) { | |||
} | |||
} | |||
|
|||
// TODO: Staking v4: more tests to check exactly which nodes have been selected/unselected from previous nodes config auction | |||
func remove(s [][]byte, elem []byte) [][]byte { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename and use better names for variables. a better name would be removeItemFromSliceWithoutKeepingOrder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this name is a bit too lengthy and maybe not worth describing its behavior for a test. Added a comm to highlight its behavior. Also, renamed s
-> slice
@@ -320,7 +320,7 @@ func calcNormRand(randomness []byte, expectedLen int) []byte { | |||
randLen := len(rand) | |||
|
|||
if expectedLen > randLen { | |||
repeatedCt := expectedLen/randLen + 1 | |||
repeatedCt := expectedLen/randLen + 1 // todo: fix possible div by 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a //todo
there so I can fix it in the next PR in which I will create a separate component for auction selection.
This is going to be fixed in the next PR, along with the new subcomp, so we don't "clutter" this PR with anymore changes.
Bug fixes
AddValidatorData
Refactor
GetAllNodeKeys
fromsystemSCs.go
to a new file to be used in tests as wellProcessSCOutputAccounts
fromTestNodeProcessor
to be used in staking v4 testsbaseTestMetaProcessor.go
which handles creation of aTestMetaProcessor
regardless ofNewTestMetaProcessor
/NewTestMetaProcessorWithCustomNodes
. Most of the functionality in this file is taken fromtestMetaProcessor.go
New tests
StakingToPeer
to handle staking new nodes after staking v4 epoch, which should save new peer accounts in auctionTestStakingV4_UnStakeNodesWithNotEnoughFunds
which tests how nodes are unstaked at the end of the epoch in case they don't have enough funds. Before staking v4(including staking v4 init epoch), nodes should be unstaked based on prority: queue -> waiting -> eligible. After staking v4, priority should be auction -> waiting -> eligibleTestStakingV4_StakeNewNodes
tests functionality of staking new nodes after staking v4(they should be sent to auction)