Skip to content

Commit

Permalink
Merge pull request #371 from morpho-org/chore/update-blue-2
Browse files Browse the repository at this point in the history
Update blue
  • Loading branch information
MerlinEgalite authored Nov 15, 2023
2 parents b82b1d8 + a9d3ca3 commit 5099e5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions test/forge/ethereum/migration/helpers/EthereumMigrationTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {SafeTransferLib, ERC20} from "../../../../../lib/solmate/src/utils/SafeT
import {ErrorsLib} from "../../../../../src/libraries/ErrorsLib.sol";
import {MarketParamsLib} from "../../../../../lib/morpho-blue/src/libraries/MarketParamsLib.sol";
import {MorphoLib} from "../../../../../lib/morpho-blue/src/libraries/periphery/MorphoLib.sol";
import {Market} from "../../../../../lib/morpho-blue/src/interfaces/IMorpho.sol";
import {MorphoBalancesLib} from "../../../../../lib/morpho-blue/src/libraries/periphery/MorphoBalancesLib.sol";

import "../../helpers/EthereumTest.sol";
Expand All @@ -31,8 +32,8 @@ contract EthereumMigrationTest is EthereumTest {
marketParams.irm = address(irm);
marketParams.lltv = 0.8 ether;

(,,,, uint128 lastUpdate,) = morpho.market(marketParams.id());
if (lastUpdate == 0) {
Market memory market = morpho.market(marketParams.id());
if (market.lastUpdate == 0) {
morpho.createMarket(marketParams);
}

Expand All @@ -49,16 +50,16 @@ contract EthereumMigrationTest is EthereumTest {
function _assertBorrowerPosition(uint256 collateralSupplied, uint256 borrowed, address user, address bundler)
internal
{
assertEq(morpho.expectedSupplyBalance(marketParams, user), 0, "supply != 0");
assertEq(morpho.expectedSupplyAssets(marketParams, user), 0, "supply != 0");
assertEq(morpho.collateral(marketParams.id(), user), collateralSupplied, "wrong collateral supply amount");
assertEq(morpho.expectedBorrowBalance(marketParams, user), borrowed, "wrong borrow amount");
assertEq(morpho.expectedBorrowAssets(marketParams, user), borrowed, "wrong borrow amount");
assertFalse(morpho.isAuthorized(user, bundler), "authorization not revoked");
}

function _assertSupplierPosition(uint256 supplied, address user, address bundler) internal {
assertEq(morpho.expectedSupplyBalance(marketParams, user), supplied, "wrong supply amount");
assertEq(morpho.expectedSupplyAssets(marketParams, user), supplied, "wrong supply amount");
assertEq(morpho.collateral(marketParams.id(), user), 0, "collateral supplied != 0");
assertEq(morpho.expectedBorrowBalance(marketParams, user), 0, "borrow != 0");
assertEq(morpho.expectedBorrowAssets(marketParams, user), 0, "borrow != 0");
assertFalse(morpho.isAuthorized(user, bundler), "authorization not revoked");
}

Expand Down

0 comments on commit 5099e5f

Please sign in to comment.