@@ -3,7 +3,7 @@ import { BigNumber } from "ethers";
3
3
import { ether } from "@utils/index" ;
4
4
import { Account } from "@utils/test/types" ;
5
5
import { Address } from "@utils/types" ;
6
- import { ZERO } from "@utils/constants" ;
6
+ import { ZERO , ADDRESS_ZERO } from "@utils/constants" ;
7
7
import { ArrakisUniswapV3AmmAdapter } from "@utils/contracts" ;
8
8
import DeployHelper from "@utils/deploys" ;
9
9
import {
@@ -57,13 +57,30 @@ describe("ArrakisUniswapV3AmmAdapter", () => {
57
57
addSnapshotBeforeRestoreAfterEach ( ) ;
58
58
59
59
describe ( "constructor" , async ( ) => {
60
- async function subject ( ) : Promise < ArrakisUniswapV3AmmAdapter > {
60
+ async function subject (
61
+ router ?: Address ,
62
+ factory ?: Address ,
63
+ ) : Promise < ArrakisUniswapV3AmmAdapter > {
61
64
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 ,
64
67
) ;
65
68
}
66
69
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
+
67
84
it ( "should have the correct router address" , async ( ) => {
68
85
const deployedArrakisUniswapV3AmmAdapter = await subject ( ) ;
69
86
0 commit comments