Skip to content

Commit

Permalink
rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabasco committed Sep 27, 2023
1 parent bf0c51d commit feb8e3e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/validators/others.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ describe('Other Validator Tests', () => {
)).to.be.revertedWithCustomError(ssvNetworkContract, 'ValidatorDoesNotExist');
});

it('Exiting a validator with the wrong operator setup reverts "IncorrectValidatorState"', async () => {
it('Exiting a validator with incorrect operators (unsorted list) reverts with "IncorrectValidatorState"', async () => {
await expect(ssvNetworkContract.connect(helpers.DB.owners[1]).exitValidator(
helpers.DataGenerator.publicKey(1),
[4, 3, 2, 1]
)).to.be.revertedWithCustomError(ssvNetworkContract, 'IncorrectValidatorState');
});

it('Exiting a validator with the wrong operator setup reverts "IncorrectValidatorState"', async () => {
it('Exiting a validator with incorrect operators (too many operators) reverts with "IncorrectValidatorState"', async () => {
minDepositAmount = (helpers.CONFIG.minimalBlocksBeforeLiquidation + 10) * helpers.CONFIG.minimalOperatorFee * 13;

await helpers.DB.ssvToken.connect(helpers.DB.owners[2]).approve(ssvNetworkContract.address, minDepositAmount);
Expand All @@ -144,4 +144,11 @@ describe('Other Validator Tests', () => {
)).to.emit(ssvNetworkContract, 'ValidatorExited')
.withArgs(helpers.DataGenerator.publicKey(2), secondCluster.operatorIds);
});

it('Exiting a validator with incorrect operators reverts with "IncorrectValidatorState"', async () => {
await expect(ssvNetworkContract.connect(helpers.DB.owners[1]).exitValidator(
helpers.DataGenerator.publicKey(1),
[1, 2, 3, 5]
)).to.be.revertedWithCustomError(ssvNetworkContract, 'IncorrectValidatorState');
});
});

0 comments on commit feb8e3e

Please sign in to comment.