dropped USE_ from Funding constants
This commit is contained in:
@@ -238,7 +238,7 @@ contract GasTest is Test {
|
||||
|
||||
/// @notice Helper function: perform 10 swaps back-and-forth between the first two _tokens.
|
||||
function _performSwapGasTest(IPartyPool testPool) internal {
|
||||
_performSwapGasTest(testPool, Funding.USE_APPROVALS);
|
||||
_performSwapGasTest(testPool, Funding.APPROVALS);
|
||||
}
|
||||
|
||||
function sendTokensCallback(IERC20 token, uint256 amount) external {
|
||||
@@ -253,11 +253,11 @@ contract GasTest is Test {
|
||||
address payer;
|
||||
address spender;
|
||||
|
||||
if (fundingSelector == Funding.USE_PREFUNDING) {
|
||||
if (fundingSelector == Funding.PREFUNDING) {
|
||||
payer = address(this);
|
||||
spender = address(this);
|
||||
}
|
||||
else if (fundingSelector == Funding.USE_APPROVALS) {
|
||||
else if (fundingSelector == Funding.APPROVALS) {
|
||||
payer = alice;
|
||||
spender = address(testPool);
|
||||
}
|
||||
@@ -278,13 +278,13 @@ contract GasTest is Test {
|
||||
vm.startPrank(alice);
|
||||
for (uint256 i = 0; i < 20; i++) {
|
||||
if (i % 2 == 0) {
|
||||
if (fundingSelector == Funding.USE_PREFUNDING)
|
||||
if (fundingSelector == Funding.PREFUNDING)
|
||||
token0.transfer(address(testPool), maxIn);
|
||||
// swap token0 -> token1
|
||||
testPool.swap(payer, fundingSelector, alice, 0, 1, maxIn, 0, 0, false);
|
||||
} else {
|
||||
// swap token1 -> token0
|
||||
if (fundingSelector == Funding.USE_PREFUNDING)
|
||||
if (fundingSelector == Funding.PREFUNDING)
|
||||
token1.transfer(address(testPool), maxIn);
|
||||
testPool.swap(payer, fundingSelector, alice, 1, 0, maxIn, 0, 0, false);
|
||||
}
|
||||
@@ -312,7 +312,7 @@ contract GasTest is Test {
|
||||
|
||||
/// @notice Gas measurement: perform 10 swaps back-and-forth between first two _tokens in the 10-token pool using the callback funding method.
|
||||
function testSwapGasPrefunding() public {
|
||||
_performSwapGasTest(pool10, Funding.USE_PREFUNDING);
|
||||
_performSwapGasTest(pool10, Funding.PREFUNDING);
|
||||
}
|
||||
|
||||
/// @notice Gas measurement: perform 10 swaps back-and-forth between first two _tokens in the 20-token pool.
|
||||
|
||||
Reference in New Issue
Block a user