Skip to content

Commit

Permalink
feat: update function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Rickk137 committed Aug 9, 2023
1 parent 214eb9b commit 9e937b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion protocol/synthetix/contracts/modules/core/VaultModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ contract VaultModule is IVaultModule {
newCollateralAmountD18 - currentCollateralAmount
);

Pool.loadExisting(poolId).requireSufficientCollateralCapacity(
Pool.loadExisting(poolId).checkPoolCollateralLimit(
collateralType,
newCollateralAmountD18 - currentCollateralAmount
);
Expand Down
6 changes: 3 additions & 3 deletions protocol/synthetix/contracts/storage/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ library Pool {
/**
* @dev Thrown when pool has surpassed max collateral deposit
*/
error SurpassedPoolMaxCollateralDeposit(
error PoolCollateralLimitExceeded(
uint128 poolId,
address collateralType,
uint256 currentCollateral,
Expand Down Expand Up @@ -526,7 +526,7 @@ library Pool {
}
}

function requireSufficientCollateralCapacity(
function checkPoolCollateralLimit(
Data storage self,
address collateralType,
uint256 collateralAmountD18
Expand All @@ -537,7 +537,7 @@ library Pool {
maxDeposit > 0 &&
self.vaults[collateralType].currentCollateral() + collateralAmountD18 > maxDeposit
) {
revert SurpassedPoolMaxCollateralDeposit(
revert PoolCollateralLimitExceeded(
self.id,
collateralType,
self.vaults[collateralType].currentCollateral() + collateralAmountD18,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ describe('VaultModule', function () {
depositAmount.mul(2),
ethers.utils.parseEther('1')
),
`SurpassedPoolMaxCollateralDeposit("${poolId}", "${collateralAddress()}", "${depositAmount
`PoolCollateralLimitExceeded("${poolId}", "${collateralAddress()}", "${depositAmount
.mul(2)
.toString()}", "${depositAmount.div(2).toString()}")`,
systems().Core
Expand Down

0 comments on commit 9e937b6

Please sign in to comment.