Skip to content

Commit 18de1cf

Browse files
committed
feat(test): invalid constructor args.
1 parent 6a7bb40 commit 18de1cf

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

test/protocol/integration/amm/ArrakisUniswapV3AmmAdapter.spec.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BigNumber } from "ethers";
33
import { ether } from "@utils/index";
44
import { Account } from "@utils/test/types";
55
import { Address } from "@utils/types";
6-
import { ZERO } from "@utils/constants";
6+
import { ZERO, ADDRESS_ZERO } from "@utils/constants";
77
import { ArrakisUniswapV3AmmAdapter } from "@utils/contracts";
88
import DeployHelper from "@utils/deploys";
99
import {
@@ -57,13 +57,30 @@ describe("ArrakisUniswapV3AmmAdapter", () => {
5757
addSnapshotBeforeRestoreAfterEach();
5858

5959
describe("constructor", async () => {
60-
async function subject(): Promise<ArrakisUniswapV3AmmAdapter> {
60+
async function subject(
61+
router?: Address,
62+
factory?: Address,
63+
): Promise<ArrakisUniswapV3AmmAdapter> {
6164
return await deployer.adapters.deployArrakisUniswapV3AmmAdapter(
62-
arrakisV1Setup.router.address,
63-
uniswapV3Setup.factory.address,
65+
router ? router : arrakisV1Setup.router.address,
66+
factory ? factory : uniswapV3Setup.factory.address,
6467
);
6568
}
6669

70+
it("Should revert when router address is 0", async () => {
71+
const invalidDeployment = subject(ADDRESS_ZERO);
72+
await expect(invalidDeployment).to.be.revertedWith(
73+
"_router address must not be zero address",
74+
);
75+
});
76+
77+
it("Should revert when factory address is 0", async () => {
78+
const invalidDeployment = subject(undefined, ADDRESS_ZERO);
79+
await expect(invalidDeployment).to.be.revertedWith(
80+
"_uniV3Factory address must not be zero address",
81+
);
82+
});
83+
6784
it("should have the correct router address", async () => {
6885
const deployedArrakisUniswapV3AmmAdapter = await subject();
6986

0 commit comments

Comments
 (0)