Skip to content

Commit

Permalink
Fix: add missing unit tests for LockingProcessor (partly failing)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Feb 28, 2024
1 parent 8f04487 commit fe200d3
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ contract LockingProcessorTest is AbstractProcessorTest {
factory.deployLockingProcessor(address(icToken), address(0));
}

function test_calculateSwap_exactlyProcessorBalance() public {
assertEq(processor.calculateSwap(0, 1, START_BALANCE), START_BALANCE);
assertEq(processor.calculateSwap(1, 0, START_BALANCE), START_BALANCE);
}

function test_calculateSwap_overProcessorBalance() public {
// Should not be possible to unlock more than the processor balance
assertEq(processor.calculateSwap(0, 1, START_BALANCE + 1), 0);
// Could lock any amount of tokens
assertEq(processor.calculateSwap(1, 0, START_BALANCE + 1), START_BALANCE + 1);
}

// Lock token: token (1) -> icToken (0)
function test_swap_lockUnderlyingToken() public {
uint256 amount = 100;
Expand Down

0 comments on commit fe200d3

Please sign in to comment.