Skip to content

Commit

Permalink
chg: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
twygod committed Jul 25, 2024
1 parent 752b106 commit f16ae2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/foundry/uToken/TestMintRedeem.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ contract TestMintRedeem is TestUTokenBase {
erc20Mock.approve(address(uToken), mintAmount);
uToken.mint(mintAmount);
uint256 exchangeRateStored = uToken.exchangeRateStored();
if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals);
uint256 uBalance = uToken.balanceOf(ALICE);
uint256 ercBalance = erc20Mock.balanceOf(ALICE);
uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18;
Expand All @@ -83,6 +84,7 @@ contract TestMintRedeem is TestUTokenBase {
erc20Mock.approve(address(uToken), mintAmount);
uToken.mint(mintAmount);
uint256 exchangeRateStored = uToken.exchangeRateStored();
if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals);

uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18;
uint256 totalRedeemable = uToken.totalRedeemable();
Expand All @@ -105,6 +107,7 @@ contract TestMintRedeem is TestUTokenBase {
erc20Mock.approve(address(uToken), mintAmount);
uToken.mint(mintAmount);
uint256 exchangeRateStored = uToken.exchangeRateStored();
if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals);
uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18;

uint256 uBalance = uToken.balanceOf(ALICE);
Expand All @@ -129,6 +132,7 @@ contract TestMintRedeem is TestUTokenBase {
uint256 utokenBal = uToken.balanceOf(ALICE);

uint256 exchangeRateStored = uToken.exchangeRateStored();
if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals);
assertEq((utokenBal * exchangeRateStored) / 1e18, uToken.balanceOfUnderlying(ALICE));

uToken.borrow(ALICE, borrowAmount);
Expand Down

0 comments on commit f16ae2b

Please sign in to comment.