Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup Integration tests #97

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

cleanup Integration tests #97

wants to merge 5 commits into from

Conversation

zhongeric
Copy link
Collaborator

No description provided.

Copy link

Forge code coverage:

File % Lines % Statements % Branches % Funcs
script/DeployRelayOrderReactor.s.sol 100.00% (4/4) 100.00% (4/4) 100.00% (0/0) 50.00% (1/2)
src/base/Multicall.sol 100.00% (6/6) 100.00% (8/8) 100.00% (2/2) 100.00% (1/1)
src/lib/FeeEscalatorLib.sol 0.00% (0/15) 0.00% (0/19) 0.00% (0/8) 0.00% (0/4)
src/lib/InputLib.sol 0.00% (0/1) 0.00% (0/2) 100.00% (0/0) 0.00% (0/1)
src/lib/OrderInfoLib.sol 0.00% (0/1) 0.00% (0/2) 100.00% (0/0) 0.00% (0/1)
src/lib/RelayOrderLib.sol 85.71% (12/14) 84.21% (16/19) 75.00% (3/4) 80.00% (4/5)
src/reactors/RelayOrderReactor.sol 100.00% (10/10) 100.00% (13/13) 100.00% (4/4) 100.00% (3/3)
Total 32.71% (35/107) 30.99% (44/142) 50.00% (9/18) 27.66% (13/47)

ERC20 tokenIn = DAI;
ERC20 tokenOut = USDC;
// gas token diff than tokenIn to test the sweep
ERC20 gasToken = USDC;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a note but its definitely odd UX to have exact output swap where gasToken is in the same output token cause the end balance won't be the specified "exact"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but nice test 👍

@@ -28,7 +28,7 @@ contract FeeEscalatorLibTest is Test {
assertEq(FeeEscalatorLib.resolve(1 ether, 2 ether, 100, 200), 1 ether);
}

function testRelayFeeEscalation() public {
function test_resolve() public {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_resolve_midwayEscalation?

vm.expectRevert(ReactorErrors.EndTimeBeforeStartTime.selector);
FeeEscalatorLib.resolve(1 ether, 2 ether, 200, 100);
}

function testRelayFeeEscalationEqualAmounts(uint256 amount, uint256 startTime, uint256 endTime) public {
function test_resolve_equalAmounts(uint256 amount, uint256 startTime, uint256 endTime) public {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_fuzz_resolve_equalAmounts_doesNotEscalate

function testRelayFeeEscalationBounded(uint256 startAmount, uint256 endAmount, uint256 startTime, uint256 endTime)
public
{
function test_resolve_bounded(uint256 startAmount, uint256 endAmount, uint256 startTime, uint256 endTime) public {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_fuzz_resolve_bounded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants