@@ -3,7 +3,7 @@ import { BigNumber } from "ethers";
33import { ether } from "@utils/index" ;
44import { Account } from "@utils/test/types" ;
55import { Address } from "@utils/types" ;
6- import { ZERO } from "@utils/constants" ;
6+ import { ZERO , ADDRESS_ZERO } from "@utils/constants" ;
77import { ArrakisUniswapV3AmmAdapter } from "@utils/contracts" ;
88import DeployHelper from "@utils/deploys" ;
99import {
@@ -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