|
1 | 1 | import "module-alias/register";
|
| 2 | +import { BigNumber } from "ethers"; |
| 3 | +import { ether } from "@utils/index"; |
2 | 4 | import { Account } from "@utils/test/types";
|
3 | 5 | import { Address } from "@utils/types";
|
4 | 6 | import { AmmModule, ArrakisUniswapV3AmmAdapter } from "@utils/contracts";
|
@@ -184,4 +186,58 @@ describe("ArrakisUniswapV3AmmAdapter", () => {
|
184 | 186 |
|
185 | 187 | });
|
186 | 188 |
|
| 189 | + describe("getProvideLiquiditySingleAssetCalldata", async () => { |
| 190 | + let subjectAmmPool: Address; |
| 191 | + let subjectComponent: Address; |
| 192 | + let subjectMaxTokenIn: BigNumber; |
| 193 | + let subjectMinLiquidity: BigNumber; |
| 194 | + |
| 195 | + before(async () => { |
| 196 | + subjectAmmPool = arrakisV1Setup.wethDaiPool.address; |
| 197 | + subjectComponent = setup.weth.address; |
| 198 | + subjectMaxTokenIn = ether(1); |
| 199 | + subjectMinLiquidity = ether(1); |
| 200 | + }); |
| 201 | + |
| 202 | + async function subject(): Promise<any> { |
| 203 | + return await arrakisUniswapV3AmmAdapter.getProvideLiquiditySingleAssetCalldata( |
| 204 | + owner.address, |
| 205 | + subjectAmmPool, |
| 206 | + subjectComponent, |
| 207 | + subjectMaxTokenIn, |
| 208 | + subjectMinLiquidity); |
| 209 | + } |
| 210 | + |
| 211 | + it("should revert", async () => { |
| 212 | + await expect(subject()).to.be.revertedWith("Arrakis single asset addition is not supported"); |
| 213 | + }); |
| 214 | + }); |
| 215 | + |
| 216 | + describe("getRemoveLiquiditySingleAssetCalldata", async () => { |
| 217 | + let subjectAmmPool: Address; |
| 218 | + let subjectComponent: Address; |
| 219 | + let subjectMinTokenOut: BigNumber; |
| 220 | + let subjectLiquidity: BigNumber; |
| 221 | + |
| 222 | + before(async () => { |
| 223 | + subjectAmmPool = uniswapV3Setup.wethDaiPool.address; |
| 224 | + subjectComponent = setup.weth.address; |
| 225 | + subjectMinTokenOut = ether(1); |
| 226 | + subjectLiquidity = ether(1); |
| 227 | + }); |
| 228 | + |
| 229 | + async function subject(): Promise<any> { |
| 230 | + return await arrakisUniswapV3AmmAdapter.getRemoveLiquiditySingleAssetCalldata( |
| 231 | + owner.address, |
| 232 | + subjectAmmPool, |
| 233 | + subjectComponent, |
| 234 | + subjectMinTokenOut, |
| 235 | + subjectLiquidity); |
| 236 | + } |
| 237 | + |
| 238 | + it("should revert", async () => { |
| 239 | + await expect(subject()).to.be.revertedWith("Arrakis single asset removal is not supported"); |
| 240 | + }); |
| 241 | + }); |
| 242 | + |
187 | 243 | });
|
0 commit comments