Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No ticket] Rename functions for consistency #123

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/Loan.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ contract Loan is ILoan {
require(settings.loanType == ILoanType.Open);

fundingVault.withdraw(amount, _pool);
IPool(_pool).notifyLoanPrincipalReturned(amount);
IPool(_pool).onLoanPrincipalReturned(amount);

emit FundsReclaimed(amount, _pool);
}
Expand All @@ -323,7 +323,7 @@ contract Loan is ILoan {
_state
);
outstandingPrincipal += amount;
IPool(_pool).notifyLoanStateTransitioned();
IPool(_pool).onLoanStateTransitioned();
return amount;
}

Expand Down Expand Up @@ -449,12 +449,12 @@ contract Loan is ILoan {
_fees.latePaymentFee
)
);
IPool(_pool).notifyLoanPrincipalReturned(outstandingPrincipal);
IPool(_pool).onLoanPrincipalReturned(outstandingPrincipal);

paymentsRemaining = 0;
_state = ILoanLifeCycleState.Matured;

IPool(_pool).notifyLoanStateTransitioned();
IPool(_pool).onLoanStateTransitioned();
return payment;
}

Expand All @@ -469,7 +469,7 @@ contract Loan is ILoan {
returns (ILoanLifeCycleState)
{
_state = ILoanLifeCycleState.Defaulted;
IPool(_pool).notifyLoanStateTransitioned();
IPool(_pool).onLoanStateTransitioned();
emit LifeCycleStateTransition(_state);
return _state;
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ contract Pool is IPool, ERC20 {
/**
* @inheritdoc IPool
*/
function notifyLoanPrincipalReturned(uint256 amount) external {
function onLoanPrincipalReturned(uint256 amount) external {
require(_fundedLoans[msg.sender], "Pool: not funded loan");
_accountings.outstandingLoanPrincipals -= amount;
}

/**
* @inheritdoc IPool
*/
function notifyLoanStateTransitioned() external override {
function onLoanStateTransitioned() external override {
require(_fundedLoans[msg.sender], "Pool: not funded loan");

ILoanLifeCycleState loanState = ILoan(msg.sender).state();
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ interface IPool is IERC4626 {
* @dev Called by a loan, it notifies the pool that the loan has returned
* principal to the pool.
*/
function notifyLoanPrincipalReturned(uint256 amount) external;
function onLoanPrincipalReturned(uint256 amount) external;

/**
* @dev Called by a loan, it notifies the pool that the loan has transitioned stated.
*/
function notifyLoanStateTransitioned() external;
function onLoanStateTransitioned() external;

/**
* @dev Called by the Pool Controller, it transfers the fixed fee
Expand Down