Skip to content

Commit

Permalink
refactor: remove useless check
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Dec 18, 2024
1 parent d3b057b commit e8efe5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,6 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
if (suppliedAssets == 0) continue;

uint256 supplyCap = config[id].cap;
if (supplyCap == 0) revert ErrorsLib.UnauthorizedMarket(id);

if (supplyAssets + suppliedAssets > supplyCap) revert ErrorsLib.SupplyCapExceeded(id);

// The market's loan asset is guaranteed to be the vault's asset because it has a non-zero supply cap.
Expand Down
2 changes: 1 addition & 1 deletion test/forge/ReallocateWithdrawTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ contract ReallocateWithdrawTest is IntegrationTest {
allocations.push(MarketAllocation(allMarkets[2], suppliedAssets[2]));

vm.prank(ALLOCATOR);
vm.expectRevert(abi.encodeWithSelector(ErrorsLib.UnauthorizedMarket.selector, allMarkets[1].id()));
vm.expectRevert(abi.encodeWithSelector(ErrorsLib.SupplyCapExceeded.selector, allMarkets[1].id()));
vault.reallocate(allocations);
}

Expand Down

0 comments on commit e8efe5e

Please sign in to comment.