Skip to content

Commit

Permalink
fix: redundant tests, reserve cant be zero
Browse files Browse the repository at this point in the history
  • Loading branch information
RyRy79261 committed Nov 25, 2024
1 parent 10b0ab4 commit ec3b97f
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions test/unit/goodDollar/BancorExchangeProvider.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -452,19 +452,6 @@ contract BancorExchangeProviderTest_getAmountIn is BancorExchangeProviderTest {
});
}

function test_getAmountIn_whenTokenInIsTokenAndReserveBalanceIsZero_shouldRevert() public {
poolExchange1.reserveBalance = 0;
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);

vm.expectRevert("ERR_INVALID_RESERVE_BALANCE");
bancorExchangeProvider.getAmountIn({
exchangeId: exchangeId,
tokenIn: address(token),
tokenOut: address(reserveToken),
amountOut: 1e18
});
}

function test_getAmountIn_whenTokenInIsTokenAndAmountOutLargerThanReserveBalance_shouldRevert() public {
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
vm.expectRevert("ERR_INVALID_AMOUNT");
Expand Down Expand Up @@ -533,19 +520,6 @@ contract BancorExchangeProviderTest_getAmountIn is BancorExchangeProviderTest {
});
}

function test_getAmountIn_whenTokenInIsReserveAssetAndReserveBalanceIsZero_shouldRevert() public {
poolExchange1.reserveBalance = 0;
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);

vm.expectRevert("ERR_INVALID_RESERVE_BALANCE");
bancorExchangeProvider.getAmountIn({
exchangeId: exchangeId,
tokenIn: address(reserveToken),
tokenOut: address(token),
amountOut: 1e18
});
}

function test_getAmountIn_whenTokenInIsReserveAssetAndAmountOutIsZero_shouldReturnZero() public {
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
uint256 amountIn = bancorExchangeProvider.getAmountIn({
Expand Down Expand Up @@ -998,18 +972,6 @@ contract BancorExchangeProviderTest_getAmountOut is BancorExchangeProviderTest {
});
}

function test_getAmountOut_whenTokenInIsReserveAssetAndReserveBalanceIsZero_shouldRevert() public {
poolExchange1.reserveBalance = 0;
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
vm.expectRevert("ERR_INVALID_RESERVE_BALANCE");
bancorExchangeProvider.getAmountOut({
exchangeId: exchangeId,
tokenIn: address(reserveToken),
tokenOut: address(token),
amountIn: 1e18
});
}

function test_getAmountOut_whenTokenInIsReserveAssetAndAmountInIsZero_shouldReturnZero() public {
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
uint256 amountOut = bancorExchangeProvider.getAmountOut({
Expand Down Expand Up @@ -1049,18 +1011,6 @@ contract BancorExchangeProviderTest_getAmountOut is BancorExchangeProviderTest {
});
}

function test_getAmountOut_whenTokenInIsTokenAndReserveBalanceIsZero_shouldRevert() public {
poolExchange1.reserveBalance = 0;
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
vm.expectRevert("ERR_INVALID_RESERVE_BALANCE");
bancorExchangeProvider.getAmountOut({
exchangeId: exchangeId,
tokenIn: address(token),
tokenOut: address(reserveToken),
amountIn: 1e18
});
}

function test_getAmountOut_whenTokenInIsTokenAndAmountLargerSupply_shouldRevert() public {
bytes32 exchangeId = bancorExchangeProvider.createExchange(poolExchange1);
vm.expectRevert("ERR_INVALID_AMOUNT");
Expand Down

0 comments on commit ec3b97f

Please sign in to comment.