Implement adapter and test templates
This commit is contained in:
@@ -95,7 +95,8 @@ contract BalancerV2SwapAdapterTest is Test, ISwapAdapterTypes {
|
||||
if (side == OrderSide.Buy) {
|
||||
vm.assume(specifiedAmount < limits[1]);
|
||||
|
||||
// TODO calculate the amountIn by using price function as in testPriceDecreasing
|
||||
// TODO calculate the amountIn by using price function as in
|
||||
// testPriceDecreasing
|
||||
deal(address(BAL), address(this), type(uint256).max);
|
||||
BAL.approve(address(adapter), type(uint256).max);
|
||||
} else {
|
||||
|
||||
18
evm/test/TemplateSwapAdapter.t.sol
Normal file
18
evm/test/TemplateSwapAdapter.t.sol
Normal file
@@ -0,0 +1,18 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import "forge-std/Test.sol";
|
||||
import "src/interfaces/ISwapAdapterTypes.sol";
|
||||
import "src/libraries/FractionMath.sol";
|
||||
|
||||
/// @title TemplateSwapAdapterTest
|
||||
/// @dev This is a template for a swap adapter test.
|
||||
/// Test all functions that are implemented in your swap adapter, the two test included here are just an example.
|
||||
/// Feel free to use UniswapV2SwapAdapterTest and BalancerV2SwapAdapterTest as a reference.
|
||||
contract TemplateSwapAdapterTest is Test, ISwapAdapterTypes {
|
||||
using FractionMath for Fraction;
|
||||
|
||||
function testPriceFuzz(uint256 amount0, uint256 amount1) public {}
|
||||
|
||||
function testSwapFuzz(uint256 specifiedAmount) public {}
|
||||
}
|
||||
@@ -73,7 +73,8 @@ contract UniswapV2PairFunctionTest is Test, ISwapAdapterTypes {
|
||||
if (side == OrderSide.Buy) {
|
||||
vm.assume(specifiedAmount < limits[1]);
|
||||
|
||||
// TODO calculate the amountIn by using price function as in BalancerV2 testPriceDecreasing
|
||||
// TODO calculate the amountIn by using price function as in
|
||||
// BalancerV2 testPriceDecreasing
|
||||
deal(address(USDC), address(this), type(uint256).max);
|
||||
USDC.approve(address(adapter), type(uint256).max);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user