Skip to content

Commit

Permalink
chore: fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlee42 committed Aug 27, 2024
1 parent 876694d commit 1306c61
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions ts-src/test/LockingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ describe("locking", async () => {
});

it("setSequencerOwner", async () => {
const { lockingInfo, lockingPool, whitelised, unwhitelist } = await loadFixture(fixture);
const { lockingInfo, lockingPool, whitelised, unwhitelist } =
await loadFixture(fixture);

const [wallet0, wallet1, wallet2] = whitelised;
const [wallet3] = unwhitelist;
Expand All @@ -587,20 +588,29 @@ describe("locking", async () => {
// seq2
await lockingPool.connect(wallet1).lockFor(wallet1, minLock, wallet1Pubkey);

await expect(lockingPool.connect(wallet0).setSequencerOwner(1, ethers.ZeroAddress)).revertedWithCustomError(lockingPool, "NullAddress")
await expect(lockingPool.connect(wallet0).setSequencerOwner(1, wallet3)).revertedWithCustomError(lockingPool, "NotWhitelisted")
await expect(lockingPool.connect(wallet0).setSequencerOwner(1, wallet1)).revertedWithCustomError(lockingPool, "OwnedSequencer")
await expect(lockingPool.connect(wallet1).setSequencerOwner(1, wallet2)).revertedWithCustomError(lockingPool, "NotSeqOwner")
await expect(
lockingPool.connect(wallet0).setSequencerOwner(1, ethers.ZeroAddress),
).revertedWithCustomError(lockingPool, "NullAddress");
await expect(
lockingPool.connect(wallet0).setSequencerOwner(1, wallet3),
).revertedWithCustomError(lockingPool, "NotWhitelisted");
await expect(
lockingPool.connect(wallet0).setSequencerOwner(1, wallet1),
).revertedWithCustomError(lockingPool, "OwnedSequencer");
await expect(
lockingPool.connect(wallet1).setSequencerOwner(1, wallet2),
).revertedWithCustomError(lockingPool, "NotSeqOwner");

await lockingPool.setWhitelist(wallet0, false)
expect(await lockingPool.connect(wallet0).setSequencerOwner(1, wallet2)).emit(lockingPool, "SequencerOwnerChanged").withArgs(1n, wallet2.address)
await lockingPool.setWhitelist(wallet0, false);
expect(await lockingPool.connect(wallet0).setSequencerOwner(1, wallet2))
.emit(lockingPool, "SequencerOwnerChanged")
.withArgs(1n, wallet2.address);

const { owner } =
await lockingPool.sequencers(1);
const { owner } = await lockingPool.sequencers(1);
expect(owner).eq(wallet2.address);

expect(await lockingPool.seqOwners(wallet2.address)).eq(1)
expect(await lockingPool.seqOwners(wallet0.address)).eq(0)
expect(await lockingPool.seqOwners(wallet2.address)).eq(1);
expect(await lockingPool.seqOwners(wallet0.address)).eq(0);
});

it("relock/withoutReward", async () => {
Expand Down

0 comments on commit 1306c61

Please sign in to comment.