diff --git a/test/access/MultiOwnable.test.ts b/test/access/MultiOwnable.test.ts index 02d35634..49b37fef 100644 --- a/test/access/MultiOwnable.test.ts +++ b/test/access/MultiOwnable.test.ts @@ -31,11 +31,10 @@ describe("MultiOwnable", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(multiOwnable.mockInit()).to.be.revertedWithCustomError(multiOwnable, "NotInitializing"); - await expect(multiOwnable.__MultiOwnableMock_init()).to.be.revertedWithCustomError( - multiOwnable, - "InvalidInitialization", - ); + await expect(multiOwnable.mockInit()).to.be.revertedWithCustomError(multiOwnable, "NotInitializing").withArgs(); + await expect(multiOwnable.__MultiOwnableMock_init()) + .to.be.revertedWithCustomError(multiOwnable, "InvalidInitialization") + .withArgs(); }); it("only owner should call these functions", async () => { diff --git a/test/access/PermanentOwnable.test.ts b/test/access/PermanentOwnable.test.ts index 6709f1bc..f4f75b15 100644 --- a/test/access/PermanentOwnable.test.ts +++ b/test/access/PermanentOwnable.test.ts @@ -34,10 +34,9 @@ describe("PermanentOwnable", () => { it("should reject zero address during the owner initialization", async () => { const permanentOwnableMock = await ethers.getContractFactory("PermanentOwnableMock"); - await expect(permanentOwnableMock.deploy(ethers.ZeroAddress)).to.be.revertedWithCustomError( - permanentOwnable, - "InvalidOwner", - ); + await expect(permanentOwnableMock.deploy(ethers.ZeroAddress)) + .to.be.revertedWithCustomError(permanentOwnable, "InvalidOwner") + .withArgs(); }); it("only owner should call this function", async () => { diff --git a/test/access/RBAC.test.ts b/test/access/RBAC.test.ts index 67300757..6e8f3396 100644 --- a/test/access/RBAC.test.ts +++ b/test/access/RBAC.test.ts @@ -29,7 +29,7 @@ describe("RBAC", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(rbac.mockInit()).to.be.revertedWithCustomError(rbac, "NotInitializing"); + await expect(rbac.mockInit()).to.be.revertedWithCustomError(rbac, "NotInitializing").withArgs(); }); }); diff --git a/test/contracts-registry/ContractsRegistry.test.ts b/test/contracts-registry/ContractsRegistry.test.ts index 79b86e1d..58564d5c 100644 --- a/test/contracts-registry/ContractsRegistry.test.ts +++ b/test/contracts-registry/ContractsRegistry.test.ts @@ -30,12 +30,13 @@ describe("ContractsRegistry", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(contractsRegistry.mockInit()).to.be.revertedWithCustomError(contractsRegistry, "NotInitializing"); + await expect(contractsRegistry.mockInit()) + .to.be.revertedWithCustomError(contractsRegistry, "NotInitializing") + .withArgs(); - await expect(contractsRegistry.__OwnableContractsRegistry_init()).to.be.revertedWithCustomError( - contractsRegistry, - "InvalidInitialization", - ); + await expect(contractsRegistry.__OwnableContractsRegistry_init()) + .to.be.revertedWithCustomError(contractsRegistry, "InvalidInitialization") + .withArgs(); }); it("should get proxy upgrader", async () => { @@ -43,44 +44,41 @@ describe("ContractsRegistry", () => { }); it("only owner should call these functions", async () => { - await expect(contractsRegistry.connect(SECOND).injectDependencies("")).to.be.revertedWithCustomError( - contractsRegistry, - "OwnableUnauthorizedAccount", - ); + await expect(contractsRegistry.connect(SECOND).injectDependencies("")) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).injectDependenciesWithData("", "0x"), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).injectDependenciesWithData("", "0x")) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).upgradeContract("", ethers.ZeroAddress), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).upgradeContract("", ethers.ZeroAddress)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).upgradeContractAndCall("", ethers.ZeroAddress, "0x"), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).upgradeContractAndCall("", ethers.ZeroAddress, "0x")) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect(contractsRegistry.connect(SECOND).addContract("", ethers.ZeroAddress)).to.be.revertedWithCustomError( - contractsRegistry, - "OwnableUnauthorizedAccount", - ); + await expect(contractsRegistry.connect(SECOND).addContract("", ethers.ZeroAddress)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).addProxyContract("", ethers.ZeroAddress), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).addProxyContract("", ethers.ZeroAddress)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).addProxyContractAndCall("", ethers.ZeroAddress, "0x"), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).addProxyContractAndCall("", ethers.ZeroAddress, "0x")) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect( - contractsRegistry.connect(SECOND).justAddProxyContract("", ethers.ZeroAddress), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(contractsRegistry.connect(SECOND).justAddProxyContract("", ethers.ZeroAddress)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect(contractsRegistry.connect(SECOND).removeContract("")).to.be.revertedWithCustomError( - contractsRegistry, - "OwnableUnauthorizedAccount", - ); + await expect(contractsRegistry.connect(SECOND).removeContract("")) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); }); }); diff --git a/test/contracts-registry/pools/PoolContractsRegistry.test.ts b/test/contracts-registry/pools/PoolContractsRegistry.test.ts index da0e1c37..5ccb4dda 100644 --- a/test/contracts-registry/pools/PoolContractsRegistry.test.ts +++ b/test/contracts-registry/pools/PoolContractsRegistry.test.ts @@ -61,15 +61,13 @@ describe("PoolContractsRegistry", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(poolContractsRegistry.__OwnablePoolContractsRegistry_init()).to.be.revertedWithCustomError( - poolContractsRegistry, - "InvalidInitialization", - ); - - await expect(poolContractsRegistry.mockInit()).to.be.revertedWithCustomError( - poolContractsRegistry, - "NotInitializing", - ); + await expect(poolContractsRegistry.__OwnablePoolContractsRegistry_init()) + .to.be.revertedWithCustomError(poolContractsRegistry, "InvalidInitialization") + .withArgs(); + + await expect(poolContractsRegistry.mockInit()) + .to.be.revertedWithCustomError(poolContractsRegistry, "NotInitializing") + .withArgs(); }); it("should not set dependencies from non dependant", async () => { @@ -81,18 +79,17 @@ describe("PoolContractsRegistry", () => { }); it("only owner should call these functions", async () => { - await expect(poolContractsRegistry.connect(SECOND).setNewImplementations([], [])).to.be.revertedWithCustomError( - contractsRegistry, - "OwnableUnauthorizedAccount", - ); - - await expect( - poolContractsRegistry.connect(SECOND).injectDependenciesToExistingPools("", 0, 0), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); - - await expect( - poolContractsRegistry.connect(SECOND).injectDependenciesToExistingPoolsWithData("", "0x", 0, 0), - ).to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount"); + await expect(poolContractsRegistry.connect(SECOND).setNewImplementations([], [])) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); + + await expect(poolContractsRegistry.connect(SECOND).injectDependenciesToExistingPools("", 0, 0)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); + + await expect(poolContractsRegistry.connect(SECOND).injectDependenciesToExistingPoolsWithData("", "0x", 0, 0)) + .to.be.revertedWithCustomError(contractsRegistry, "OwnableUnauthorizedAccount") + .withArgs(SECOND); }); }); diff --git a/test/contracts-registry/presets/MultiOwnableContractsRegistry.test.ts b/test/contracts-registry/presets/MultiOwnableContractsRegistry.test.ts index 8d5da915..0133f914 100644 --- a/test/contracts-registry/presets/MultiOwnableContractsRegistry.test.ts +++ b/test/contracts-registry/presets/MultiOwnableContractsRegistry.test.ts @@ -29,10 +29,9 @@ describe("MultiOwnableContractsRegistry", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(contractsRegistry.__MultiOwnableContractsRegistry_init()).to.be.revertedWithCustomError( - contractsRegistry, - "InvalidInitialization", - ); + await expect(contractsRegistry.__MultiOwnableContractsRegistry_init()) + .to.be.revertedWithCustomError(contractsRegistry, "InvalidInitialization") + .withArgs(); }); it("only owner should call these functions", async () => { diff --git a/test/diamond/DiamondERC721.test.ts b/test/diamond/DiamondERC721.test.ts index a5e6643b..26b8de60 100644 --- a/test/diamond/DiamondERC721.test.ts +++ b/test/diamond/DiamondERC721.test.ts @@ -66,17 +66,15 @@ describe("DiamondERC721 and InitializableStorage", () => { describe("access", () => { it("should initialize only once", async () => { - await expect(erc721.__DiamondERC721Mock_init("Mock Token", "MT")).to.be.revertedWithCustomError( - erc721, - "AlreadyInitialized", - ); + await expect(erc721.__DiamondERC721Mock_init("Mock Token", "MT")) + .to.be.revertedWithCustomError(erc721, "AlreadyInitialized") + .withArgs(); }); it("should initialize only by top level contract", async () => { - await expect(erc721.__DiamondERC721Direct_init("Mock Token", "MT")).to.be.revertedWithCustomError( - erc721, - "NotInitializing", - ); + await expect(erc721.__DiamondERC721Direct_init("Mock Token", "MT")) + .to.be.revertedWithCustomError(erc721, "NotInitializing") + .withArgs(); }); it("should disable implementation initialization", async () => { diff --git a/test/finance/compound-rate-keeper/CompoundRateKeeper.test.ts b/test/finance/compound-rate-keeper/CompoundRateKeeper.test.ts index 1bb70210..347441af 100644 --- a/test/finance/compound-rate-keeper/CompoundRateKeeper.test.ts +++ b/test/finance/compound-rate-keeper/CompoundRateKeeper.test.ts @@ -34,22 +34,19 @@ describe("CompoundRateKeeper", () => { describe("access", () => { it("should not initialize twice", async () => { await expect(keeper.mockInit(precision(1), 31536000)).to.be.revertedWithCustomError(keeper, "NotInitializing"); - await expect(keeper.__OwnableCompoundRateKeeper_init(precision(1), 31536000)).to.be.revertedWithCustomError( - keeper, - "InvalidInitialization", - ); + await expect(keeper.__OwnableCompoundRateKeeper_init(precision(1), 31536000)) + .to.be.revertedWithCustomError(keeper, "InvalidInitialization") + .withArgs(); }); it("only owner should call these functions", async () => { - await expect(keeper.connect(SECOND).setCapitalizationRate(precision(1))).to.be.revertedWithCustomError( - keeper, - "OwnableUnauthorizedAccount", - ); + await expect(keeper.connect(SECOND).setCapitalizationRate(precision(1))) + .to.be.revertedWithCustomError(keeper, "OwnableUnauthorizedAccount") + .withArgs(SECOND); - await expect(keeper.connect(SECOND).setCapitalizationPeriod(31536000)).to.be.revertedWithCustomError( - keeper, - "OwnableUnauthorizedAccount", - ); + await expect(keeper.connect(SECOND).setCapitalizationPeriod(31536000)) + .to.be.revertedWithCustomError(keeper, "OwnableUnauthorizedAccount") + .withArgs(SECOND); }); }); diff --git a/test/finance/staking/AbstractStaking.test.ts b/test/finance/staking/AbstractStaking.test.ts index 441ea54b..f72e8f8f 100644 --- a/test/finance/staking/AbstractStaking.test.ts +++ b/test/finance/staking/AbstractStaking.test.ts @@ -147,12 +147,13 @@ describe("AbstractStaking", () => { describe("AbstractStaking initialization", () => { it("should not initialize twice", async () => { - await expect( - abstractStaking.mockInit(sharesToken, rewardsToken, rate, stakingStartTime), - ).to.be.revertedWithCustomError(abstractStaking, "NotInitializing"); - await expect( - abstractStaking.__AbstractStakingMock_init(sharesToken, rewardsToken, rate, stakingStartTime), - ).to.be.revertedWithCustomError(abstractStaking, "InvalidInitialization"); + await expect(abstractStaking.mockInit(sharesToken, rewardsToken, rate, stakingStartTime)) + .to.be.revertedWithCustomError(abstractStaking, "NotInitializing") + .withArgs(); + + await expect(abstractStaking.__AbstractStakingMock_init(sharesToken, rewardsToken, rate, stakingStartTime)) + .to.be.revertedWithCustomError(abstractStaking, "InvalidInitialization") + .withArgs(); }); it("should set the initial values correctly", async () => { diff --git a/test/finance/vesting/Vesting.test.ts b/test/finance/vesting/Vesting.test.ts index 3e32b7f6..87b9b81b 100644 --- a/test/finance/vesting/Vesting.test.ts +++ b/test/finance/vesting/Vesting.test.ts @@ -57,8 +57,10 @@ describe("Vesting", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(vesting.__VestingMock_init()).to.be.revertedWithCustomError(vesting, "InvalidInitialization"); - await expect(vesting.vestingInit()).to.be.revertedWithCustomError(vesting, "NotInitializing"); + await expect(vesting.__VestingMock_init()) + .to.be.revertedWithCustomError(vesting, "InvalidInitialization") + .withArgs(); + await expect(vesting.vestingInit()).to.be.revertedWithCustomError(vesting, "NotInitializing").withArgs(); }); }); diff --git a/test/oracles/UniswapV2Oracle.test.ts b/test/oracles/UniswapV2Oracle.test.ts index 3af6e6e7..4442b498 100644 --- a/test/oracles/UniswapV2Oracle.test.ts +++ b/test/oracles/UniswapV2Oracle.test.ts @@ -53,12 +53,13 @@ describe("UniswapV2Oracle", () => { }); it("should not initialize twice", async () => { - await expect( - oracle.mockInit(await uniswapV2Factory.getAddress(), ORACLE_TIME_WINDOW), - ).to.be.revertedWithCustomError(oracle, "NotInitializing"); - await expect( - oracle.__OracleV2Mock_init(await uniswapV2Factory.getAddress(), ORACLE_TIME_WINDOW), - ).to.be.revertedWithCustomError(oracle, "InvalidInitialization"); + await expect(oracle.mockInit(await uniswapV2Factory.getAddress(), ORACLE_TIME_WINDOW)) + .to.be.revertedWithCustomError(oracle, "NotInitializing") + .withArgs(); + + await expect(oracle.__OracleV2Mock_init(await uniswapV2Factory.getAddress(), ORACLE_TIME_WINDOW)) + .to.be.revertedWithCustomError(oracle, "InvalidInitialization") + .withArgs(); }); }); diff --git a/test/proxy/transparent/TransparentUpgradeableProxy.test.ts b/test/proxy/transparent/TransparentUpgradeableProxy.test.ts index 196bd506..5f4d88e3 100644 --- a/test/proxy/transparent/TransparentUpgradeableProxy.test.ts +++ b/test/proxy/transparent/TransparentUpgradeableProxy.test.ts @@ -48,10 +48,9 @@ describe("SolarityTransparentProxy", () => { const AMOUNT = 10; it("proxy admin cannot call delegated functions", async () => { - await expect(tokenProxy.connect(PROXY_UPGRADER).mint(OWNER.address, AMOUNT)).to.be.revertedWithCustomError( - proxy, - "ProxyDeniedAdminAccess", - ); + await expect(tokenProxy.connect(PROXY_UPGRADER).mint(OWNER.address, AMOUNT)) + .to.be.revertedWithCustomError(proxy, "ProxyDeniedAdminAccess") + .withArgs(); }); it("everyone except proxy admin can call delegated functions", async () => { diff --git a/test/token/SBT.test.ts b/test/token/SBT.test.ts index b230b8d9..eb6a392d 100644 --- a/test/token/SBT.test.ts +++ b/test/token/SBT.test.ts @@ -32,8 +32,10 @@ describe("SBT", () => { describe("access", () => { it("should not initialize twice", async () => { - await expect(sbt.__SBTMock_init(name, symbol)).to.be.revertedWithCustomError(sbt, "InvalidInitialization"); - await expect(sbt.mockInit(name, symbol)).to.be.revertedWithCustomError(sbt, "NotInitializing"); + await expect(sbt.__SBTMock_init(name, symbol)) + .to.be.revertedWithCustomError(sbt, "InvalidInitialization") + .withArgs(); + await expect(sbt.mockInit(name, symbol)).to.be.revertedWithCustomError(sbt, "NotInitializing").withArgs(); }); });