From 1ab96ce292bb2aba8a7358b8320d40c1e2a024c3 Mon Sep 17 00:00:00 2001 From: czanella Date: Mon, 5 Aug 2024 10:32:43 +0100 Subject: [PATCH] Update other failing tests --- evm/test/AdapterTest.sol | 7 ++++--- evm/test/BalancerV2SwapAdapter.t.sol | 4 ++-- evm/test/UniswapV2SwapAdapter.t.sol | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/evm/test/AdapterTest.sol b/evm/test/AdapterTest.sol index 188eab3..76950ea 100644 --- a/evm/test/AdapterTest.sol +++ b/evm/test/AdapterTest.sol @@ -19,9 +19,10 @@ contract AdapterTest is Test, ISwapAdapterTypes { // sell amounts. Asserts that the prices behaves as expected. // @param adapter The swap adapter to test // @param poolIds The list of pool ids to test - function testPoolBehaviour(ISwapAdapter adapter, bytes32[] memory poolIds) - public - { + function runPoolBehaviourTest( + ISwapAdapter adapter, + bytes32[] memory poolIds + ) public { bool hasPriceImpact = !hasCapability( adapter.getCapabilities(poolIds[0], address(0), address(0)), Capability.ConstantPrice diff --git a/evm/test/BalancerV2SwapAdapter.t.sol b/evm/test/BalancerV2SwapAdapter.t.sol index e4cb188..e75933a 100644 --- a/evm/test/BalancerV2SwapAdapter.t.sol +++ b/evm/test/BalancerV2SwapAdapter.t.sol @@ -207,7 +207,7 @@ contract BalancerV2SwapAdapterTest is AdapterTest { { Capability[] memory res = adapter.getCapabilities(pool, t0, t1); - assertEq(res.length, 3); + assertEq(res.length, 4); assertEq(uint256(res[0]), uint256(Capability.SellOrder)); assertEq(uint256(res[1]), uint256(Capability.BuyOrder)); assertEq(uint256(res[2]), uint256(Capability.PriceFunction)); @@ -232,6 +232,6 @@ contract BalancerV2SwapAdapterTest is AdapterTest { function testBalancerV2PoolBehaviour() public { bytes32[] memory poolIds = new bytes32[](1); poolIds[0] = B_80BAL_20WETH_POOL_ID; - testPoolBehaviour(adapter, poolIds); + runPoolBehaviourTest(adapter, poolIds); } } diff --git a/evm/test/UniswapV2SwapAdapter.t.sol b/evm/test/UniswapV2SwapAdapter.t.sol index d3aebbd..4ed3eb7 100644 --- a/evm/test/UniswapV2SwapAdapter.t.sol +++ b/evm/test/UniswapV2SwapAdapter.t.sol @@ -151,7 +151,7 @@ contract UniswapV2PairFunctionTest is AdapterTest { function testGetCapabilities(bytes32 pair, address t0, address t1) public { Capability[] memory res = adapter.getCapabilities(pair, t0, t1); - assertEq(res.length, 3); + assertEq(res.length, 4); } function testGetLimits() public { @@ -164,6 +164,6 @@ contract UniswapV2PairFunctionTest is AdapterTest { function testUsv2PoolBehaviour() public { bytes32[] memory poolIds = new bytes32[](1); poolIds[0] = bytes32(bytes20(USDC_WETH_PAIR)); - testPoolBehaviour(adapter, poolIds); + runPoolBehaviourTest(adapter, poolIds); } }