Skip to content

Commit

Permalink
✅ Update AccountExposed for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders committed Jul 11, 2023
1 parent d901d27 commit 2fdc9fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
8 changes: 8 additions & 0 deletions test/integration/order.public.behavior.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ contract OrderPublicBehaviorTest is Test, ConsolidatedEvents {
assertEq(conditionalOrder.sizeDelta, 0);
}

function test_UpdatePythPrice() public {
/// @custom:todo will likely need to mock
}

function test_PayExecutorFee() public {
/// @custom:todo
}

function test_ExecuteConditionalOrderWithPriceUpdate() public {
/// @custom:todo
}
Expand Down
12 changes: 6 additions & 6 deletions test/unit/Account.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ contract AccountTest is Test, ConsolidatedEvents {
);

(address tokenIn, address tokenOut) =
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);
assertEq(tokenIn, address(0xA));
assertEq(tokenOut, address(0xB));
}
Expand All @@ -902,7 +902,7 @@ contract AccountTest is Test, ConsolidatedEvents {
);

(address tokenIn, address tokenOut) =
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);
assertEq(tokenIn, address(0xA));
assertEq(tokenOut, address(0x10));
}
Expand All @@ -913,7 +913,7 @@ contract AccountTest is Test, ConsolidatedEvents {
vm.expectRevert(
abi.encodeWithSelector(BytesLib.SliceOutOfBounds.selector)
);
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);
}

function test_GetTokenInTokenOut_Invalid_TokenIn() public {
Expand All @@ -922,7 +922,7 @@ contract AccountTest is Test, ConsolidatedEvents {
vm.expectRevert(
abi.encodeWithSelector(BytesLib.SliceOutOfBounds.selector)
);
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);
}

function test_GetTokenInTokenOut_Invalid_Fee() public {
Expand All @@ -932,7 +932,7 @@ contract AccountTest is Test, ConsolidatedEvents {
vm.expectRevert(
abi.encodeWithSelector(BytesLib.SliceOutOfBounds.selector)
);
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);
}

function test_GetTokenInTokenOut_Invalid_Pools_No_Revert(
Expand All @@ -941,7 +941,7 @@ contract AccountTest is Test, ConsolidatedEvents {
vm.assume(path.length >= MULTIPLE_V3_POOLS_MIN_LENGTH);

(address tokenIn, address tokenOut) =
accountExposed.expose__getTokenInTokenOut(path);
accountExposed.expose_getTokenInTokenOut(path);

// _getTokenInTokenOut makes no assurances about the validity of the tokenIn/tokenOut;
// it only checks that the path length is valid.
Expand Down
10 changes: 9 additions & 1 deletion test/utils/AccountExposed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,19 @@ contract AccountExposed is Account {
return locked;
}

function expose__getTokenInTokenOut(bytes calldata _path)
function expose_getTokenInTokenOut(bytes calldata _path)
public
pure
returns (address, address)
{
return _getTokenInTokenOut(_path);
}

function expose_updatePythPrice(bytes[] calldata priceUpdateData) public {
_updatePythPrice(priceUpdateData);
}

function expose_payExecutorFee() public returns (uint256) {
return _payExecutorFee();
}
}

0 comments on commit 2fdc9fd

Please sign in to comment.