-
Notifications
You must be signed in to change notification settings - Fork 18
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
System tests for KEEP<>T staking contracts interactions #33
Conversation
The following scenarios are tested: 1. Given I am KEEP network managed grant staker and I have not undelegated my stake, when I authorize T staking contract, I can copy my delegation to T staking contract. 2. Given I am KEEP network managed grant staker and I have undelegated my stake, when I authorize T staking contract, I can not copy my delegation to T staking contract. 3. Given I am KEEP network non-managed grant staker and I have not undelegated my stake, when I authorize T staking contract, I can copy my delegation to T staking contract. 4. Given I am KEEP network non-managed grant staker and I have undelegated my stake, when I authorize T staking contract, I can not copy my delegation to T staking contract. 5. Given I am KEEP network liquid token staker and I have not undelegated my stake, when I authorize T staking contract, I can copy my delegation to T staking contract. 6. Given I am KEEP network liquid token staker and I have undelegated my stake, when I authorize T staking contract, I can not copy my delegation to T staking contract.
The following scenarios are tested: 1. Given I am KEEP network liquid token staker and I copied my stake to T staking contract, when I executed top-up of my legacy stake, `topUpKeep` should top-up my stake in T staking contract. 2. Given I am KEEP network non-managed grant staker and I copied my stake to T staking contract, when I executed top-up of my legacy stake, `topUpKeep` should top-up my stake in T staking contract. 3. Given I am KEEP network managed grant staker and I copied my stake to T staking contract, when I executed top-up of my legacy stake, `topUpKeep` should top-up my stake in T staking contract.
The following scenarios are tested: 1. Given I am KEEP network liquid token staker, when I copied my stake to T staking contract, when I authorized and deauthorized application, `unstakeKeep` should release and let me undelegate my KEEP stake. 2. Given I am KEEP network managed grant staker, when I copied my stake to T staking contract, when I authorized and deauthorized application, `unstakeKeep` should release and let me undelegate my KEEP stake. 3. Given I am KEEP network non-managed grant staker, when I copied my stake to T staking contract, when I authorized and deauthorized application, `unstakeKeep` should release and let me undelegate my KEEP stake.
The following scenarios are tested: 1. Given I am KEEP network liquid token staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `processSlashing` should slash my KEEP stake. 2. Given I am KEEP network liquid token staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `notifyKeepStakeDiscrepancy` should revert. 3. Given I am KEEP network liquid token staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `processSlashing` should seize my KEEP stake. 4. Given I am KEEP network liquid token staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `notifyKeepStakeDiscrepancy` should revert. 5. Given I am KEEP network managed grant staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `processSlashing` should slash my KEEP stake. 6. Given I am KEEP network managed grant staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `notifyKeepStakeDiscrepancy` should revert. 7. Given I am KEEP network managed grant staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `processSlashing` should seize my KEEP stake. 8. Given I am KEEP network managed grant staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `notifyKeepStakeDiscrepancy` should revert. 9. Given I am KEEP network non-managed grant staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `processSlashing` should slash my KEEP stake. 10. Given I am KEEP network non-managed grant staker, when I copied my stake to T staking contract, when I authorized application, when I got slashed by the application, `notifyKeepStakeDiscrepancy` should revert. 11. Given I am KEEP network non-managed grant staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `processSlashing` should seize my KEEP stake. 12. Given I am KEEP network non-managed grant staker, when I copied my stake to T staking contract, when I authorized application, when the application seized my stake, `notifyKeepStakeDiscrepancy` should revert.
@pdyraga, what do you think about adding a test checking if "Given I am KEEP network [...], when I copied my stake to T staking contract, when I authorized application, |
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.
Can we migrate system tests to TS?
Not a bad idea but I'd do that later for all tests. This is captured in #5. |
This logic in solidity-contracts/contracts/staking/TokenStaking.sol Lines 758 to 772 in a70d05c
|
LGTM! |
System tests are performed on mainnet block 13619810 fork chain using three real stakers from KEEP network: liquid token staker, managed grant staker, and non-managed grant staker.
Stake delegation
stakeKeep
should copy my stake to T staking contract.stakeKeep
should revert.Top-ups
topUpKeep
should top-up my stake in T staking contract.Stake undelegation
unstakeKeep
should release my KEEP stake.unstakeKeep
should let me undelegate my KEEP stake.Slashing
processSlashing
should slash my KEEP stake.notifyKeepStakeDiscrepancy
should revert.processSlashing
should seize my KEEP stake.notifyKeepStakeDiscrepancy
should revert.Exactly the same tests are repeated for two other types of actors: