Skip to content

Commit

Permalink
Make upgrade on implementation by owner
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Nov 28, 2024
1 parent 4efcdfc commit bc10b0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Genesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,21 +222,21 @@ describe('Genesis initialization', () => {
it('Should revert when SFC upgrade made on implementation', async function () {
const sfc: SFC = await ethers.getContractAt('SFC', this.sfc);
await expect(
sfc.connect(this.user).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
sfc.connect(this.owner).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
).to.be.revertedWithCustomError(sfc, 'UUPSUnauthorizedCallContext');
});

it('Should revert when NodeDriver upgrade made on implementation', async function () {
const nodeDriver: NodeDriver = await ethers.getContractAt('NodeDriver', this.nodeDriver);
await expect(
nodeDriver.connect(this.user).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
nodeDriver.connect(this.owner).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
).to.be.revertedWithCustomError(nodeDriver, 'UUPSUnauthorizedCallContext');
});

it('Should revert when NodeDriverAuth upgrade made on implementation', async function () {
const nodeDriverAuth: NodeDriverAuth = await ethers.getContractAt('NodeDriverAuth', this.nodeDriverAuth);
await expect(
nodeDriverAuth.connect(this.user).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
nodeDriverAuth.connect(this.owner).upgradeToAndCall(ethers.Wallet.createRandom(), '0x'),
).to.be.revertedWithCustomError(nodeDriverAuth, 'UUPSUnauthorizedCallContext');
});

Expand Down

0 comments on commit bc10b0a

Please sign in to comment.