Skip to content

Commit

Permalink
fix: modify repayAction to reorder expectEmit calls (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedephrase authored May 17, 2023
1 parent a834938 commit ce49fb0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/test/TestGhoBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ contract TestGhoBase is Test, Constants, Events {
expectedBurnOffset = amount - bs.userInterestsBeforeAction + computedInterest;
}

// Action
vm.startPrank(user);
GHO_TOKEN.approve(address(POOL), amount);

if (newDiscountRate != bs.discountPercent) {
vm.expectEmit(true, true, true, true, address(GHO_DEBT_TOKEN));
emit DiscountPercentUpdated(user, bs.discountPercent, newDiscountRate);
Expand All @@ -329,9 +333,6 @@ contract TestGhoBase is Test, Constants, Events {
emit Transfer(user, address(0), amount - computedInterest);
}

// Action
vm.startPrank(user);
GHO_TOKEN.approve(address(POOL), amount);
POOL.repay(address(GHO_TOKEN), amount, 2, user);
vm.stopPrank();

Expand Down

0 comments on commit ce49fb0

Please sign in to comment.