Skip to content

Commit

Permalink
✨ Prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders committed Jan 12, 2024
1 parent c1658bf commit dfec846
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
24 changes: 12 additions & 12 deletions src/Engine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ contract Engine is
}

/// @inheritdoc IEngine
function modifyCollateralZap(
uint128 _accountId,
int256 _amount
) external override {
function modifyCollateralZap(uint128 _accountId, int256 _amount)
external
override
{
if (_amount > 0) {
// zap $USDC -> $sUSD
/// @dev given the amount is positive,
Expand Down Expand Up @@ -489,10 +489,10 @@ contract Engine is
}

/// @inheritdoc IEngine
function creditAccountZap(
uint128 _accountId,
uint256 _amount
) external override {
function creditAccountZap(uint128 _accountId, uint256 _amount)
external
override
{
// zap $USDC -> $sUSD
uint256 usdcAmount = _zapIn(_amount);

Check warning on line 497 in src/Engine.sol

View check run for this annotation

Codecov / codecov/patch

src/Engine.sol#L497

Added line #L497 was not covered by tests

Expand All @@ -514,10 +514,10 @@ contract Engine is
}

/// @inheritdoc IEngine
function debitAccountZap(
uint128 _accountId,
uint256 _amount
) external override {
function debitAccountZap(uint128 _accountId, uint256 _amount)
external
override
{
if (!isAccountOwner(_accountId, msg.sender)) revert Unauthorized();

// decrement account credit prior to transfer
Expand Down
15 changes: 3 additions & 12 deletions src/interfaces/IEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ interface IEngine {
/// @param _accountId the account to modify
/// @param _amount the amount of collateral
/// to add or remove (negative to remove)
function modifyCollateralZap(
uint128 _accountId,
int256 _amount
) external;
function modifyCollateralZap(uint128 _accountId, int256 _amount) external;

/*//////////////////////////////////////////////////////////////
ASYNC ORDER MANAGEMENT
Expand Down Expand Up @@ -286,10 +283,7 @@ interface IEngine {
/// (i.e. ERC-20 decimal discrepancies)
/// @param _accountId the id of the account to credit
/// @param _amount the amount of $USDC to transfer and zap
function creditAccountZap(
uint128 _accountId,
uint256 _amount
) external;
function creditAccountZap(uint128 _accountId, uint256 _amount) external;

/// @notice withdraw $sUSD from the engine and
/// debit the account identified by the accountId
Expand All @@ -306,10 +300,7 @@ interface IEngine {
/// (i.e. ERC-20 decimal discrepancies)
/// @param _accountId the id of the account to debit
/// @param _amount the amount of $sUSD to debit
function debitAccountZap(
uint128 _accountId,
uint256 _amount
) external;
function debitAccountZap(uint128 _accountId, uint256 _amount) external;

/*//////////////////////////////////////////////////////////////
CONDITIONAL ORDER MANAGEMENT
Expand Down
5 changes: 1 addition & 4 deletions test/Credit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ contract Debit is CreditTest {

vm.prank(BAD_ACTOR);

engine.debitAccountZap({
_accountId: accountId,
_amount: AMOUNT
});
engine.debitAccountZap({_accountId: accountId, _amount: AMOUNT});
}

function test_debit_Unauthorized() public {
Expand Down

0 comments on commit dfec846

Please sign in to comment.