test: add tests to generate runtime bytecode for the executors
This commit is contained in:
1
foundry/test/.gitignore
vendored
Normal file
1
foundry/test/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.runtime.json
|
||||
@@ -136,7 +136,6 @@ contract BalancerV2ExecutorTest is Constants, TestUtils {
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
vm.skip(true);
|
||||
exportRuntimeBytecode(address(balancerV2Exposed), "BalancerV2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,10 @@ contract BalancerV3ExecutorTest is Constants, TestUtils {
|
||||
assertGt(balanceAfter, balanceBefore);
|
||||
assertEq(balanceAfter - balanceBefore, amountOut);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(balancerV3Exposed), "BalancerV3");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
@@ -46,7 +46,7 @@ contract CurveExecutorExposed is CurveExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
contract CurveExecutorTest is Test, Constants {
|
||||
contract CurveExecutorTest is Test, TestUtils, Constants {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
CurveExecutorExposed curveExecutorExposed;
|
||||
@@ -393,6 +393,10 @@ contract CurveExecutorTest is Test, Constants {
|
||||
metaRegistry.get_coin_indices(pool, tokenIn, tokenOut);
|
||||
return (coinInIndex, coinOutIndex);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(curveExecutorExposed), "Curve");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
@@ -202,6 +202,10 @@ contract EkuboExecutorTest is Constants, TestUtils {
|
||||
function testMultiHopSwapIntegration() public setUpFork(22082754) {
|
||||
multiHopSwap(loadCallDataFromFile("test_ekubo_encode_swap_multi"));
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(executor), "Ekubo");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
@@ -41,7 +41,7 @@ contract HashflowUtils is Test {
|
||||
}
|
||||
}
|
||||
|
||||
contract HashflowExecutorECR20Test is Constants, HashflowUtils {
|
||||
contract HashflowExecutorECR20Test is Constants, TestUtils, HashflowUtils {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
HashflowExecutorExposed executor;
|
||||
|
||||
@@ -126,6 +126,10 @@ contract MaverickV2ExecutorTest is TestUtils, Constants {
|
||||
assertGt(balanceAfter, balanceBefore);
|
||||
assertEq(balanceAfter - balanceBefore, amountOut);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(maverickV2Exposed), "MaverickV2");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
@@ -263,4 +263,8 @@ contract UniswapV2ExecutorTest is Constants, Permit2TestHelper, TestUtils {
|
||||
|
||||
assertEq(IERC20(BASE_MAG7).balanceOf(BOB), 1379830606);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(uniswapV2Exposed), "UniswapV2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,12 @@ contract UniswapV3ExecutorExposed is UniswapV3Executor {
|
||||
}
|
||||
}
|
||||
|
||||
contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
|
||||
contract UniswapV3ExecutorTest is
|
||||
Test,
|
||||
TestUtils,
|
||||
Constants,
|
||||
Permit2TestHelper
|
||||
{
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
UniswapV3ExecutorExposed uniswapV3Exposed;
|
||||
@@ -210,6 +215,10 @@ contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
|
||||
transferType
|
||||
);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(uniswapV3Exposed), "UniswapV3");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
@@ -261,6 +261,10 @@ contract UniswapV4ExecutorTest is Constants, TestUtils {
|
||||
);
|
||||
assertTrue(IERC20(WETH_ADDR).balanceOf(ALICE) == amountOut);
|
||||
}
|
||||
|
||||
function testExportContract() public {
|
||||
exportRuntimeBytecode(address(uniswapV4Exposed), "UniswapV4");
|
||||
}
|
||||
}
|
||||
|
||||
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {
|
||||
|
||||
Reference in New Issue
Block a user