Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Apr 22, 2024
1 parent dde1375 commit 8560573
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
4 changes: 0 additions & 4 deletions contracts/test/_fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -1454,10 +1454,6 @@ async function nativeStakingSSVStrategyFixture() {
await nativeStakingSSVStrategy
.connect(sGovernor)
.setAccountingGovernor(governorAddr);

await nativeStakingSSVStrategy
.connect(sGovernor)
.setStrategist(strategist.address);
}

return fixture;
Expand Down
34 changes: 2 additions & 32 deletions contracts/test/strategies/nativeSSVStaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,6 @@ describe("Unit test: Native SSV Staking Strategy", function () {
).to.be.revertedWith("Caller is not the Governor");
});

it("Only governor can change the strategist", async () => {
const { nativeStakingSSVStrategy, strategist } = fixture;

await expect(
nativeStakingSSVStrategy
.connect(strategist)
.setStrategist(strategist.address)
).to.be.revertedWith("Caller is not the Governor");
});

it("Change the accounting governor", async () => {
const { nativeStakingSSVStrategy, governor, strategist } = fixture;

Expand All @@ -217,26 +207,6 @@ describe("Unit test: Native SSV Staking Strategy", function () {
strategist.address
);
});

it("Change the strategist", async () => {
const { nativeStakingSSVStrategy, governor, strategist } = fixture;

const tx = await nativeStakingSSVStrategy
.connect(governor)
.setStrategist(governor.address);

const events = (await tx.wait()).events || [];
const strategistAddressChanged = events.find(
(e) => e.event === "StrategistAddressChanged"
);

expect(strategistAddressChanged).to.not.be.undefined;
expect(strategistAddressChanged.event).to.equal(
"StrategistAddressChanged"
);
expect(strategistAddressChanged.args[0]).to.equal(strategist.address);
expect(strategistAddressChanged.args[1]).to.equal(governor.address);
});
});

describe("Accounting", function () {
Expand Down Expand Up @@ -345,7 +315,7 @@ describe("Unit test: Native SSV Staking Strategy", function () {
}

const WithdrawnEvent = events.find(
(e) => e.event === "AccuntingFullyWithdrawnValidator"
(e) => e.event === "AccountingFullyWithdrawnValidator"
);
if (expectedValidatorsFullWithdrawals > 0) {
expect(WithdrawnEvent).to.not.be.undefined;
Expand Down Expand Up @@ -374,7 +344,7 @@ describe("Unit test: Native SSV Staking Strategy", function () {
}

const SlashEvent = events.find(
(e) => e.event === "AccuntingValidatorSlashed"
(e) => e.event === "AccountingValidatorSlashed"
);
if (slashDetected) {
expect(SlashEvent).to.not.be.undefined;
Expand Down

0 comments on commit 8560573

Please sign in to comment.