-
Notifications
You must be signed in to change notification settings - Fork 370
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
test: improve slashing invariants and refactor user generation logic #1149
test: improve slashing invariants and refactor user generation logic #1149
Conversation
|
||
print.user(name, assetType, userType, strategies, tokenBalances); | ||
return (user, strategies, tokenBalances); | ||
} | ||
|
||
function _randUser( |
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.
Note: this and _newStaker(strategies)
can generate assets for specified strategies vs just random
@@ -349,7 +355,7 @@ contract IntegrationCheckUtils is IntegrationBase { | |||
if (operator != staker) { | |||
assert_Snap_Unchanged_TokenBalances(operator, "operator should not have any change in underlying token balances"); | |||
} | |||
assert_Snap_Added_OperatorShares(operator, withdrawal.strategies, withdrawal.scaledShares, "operator should have received shares"); | |||
assert_Snap_Added_OperatorShares(operator, strategies, shares, "operator should have received shares"); |
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.
Maybe in followup PR, but the check_Withdrawal_AsShares_*
functions could probably include this call
uint[] memory expectedShares = _calculateExpectedShares(withdrawals[i]);
and not have to pass in shares as input. Since we are already passing in the withdrawal
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.
yep, good callout. there's a decent bit of cleanup to be done in these assertions
* also fix a bunch of compiler errors
02b13f0
into
test/slashing-integration-testing
Motivation:
Improve slashing invariants, fix existing DM/ALM invariants, and refactor user generation logic
Modifications:
IntegrationDeployer._randUser
generation logic so that additional helpers can be implemented to generate users with specific assetsSlashingWithdrawals
Followup:
SlashingWithdrawals