Skip to content

Commit

Permalink
Expand TransferDebt event with more info (#1653)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm authored Dec 15, 2023
1 parent ba5466c commit 8e3faab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions pallets/loans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ pub mod pallet {
pool_id: T::PoolId,
from_loan_id: T::LoanId,
to_loan_id: T::LoanId,
amount: T::Balance,
repaid_amount: RepaidInput<T>,
borrow_amount: PrincipalInput<T>,
},
}

Expand Down Expand Up @@ -826,21 +827,22 @@ pub mod pallet {
Err(Error::<T>::UnrelatedChangeId)?
};

let (amount, _count) = Self::transfer_debt_action(
let (_, _count) = Self::transfer_debt_action(
&who,
pool_id,
from_loan_id,
to_loan_id,
repaid_amount,
borrow_amount,
repaid_amount.clone(),
borrow_amount.clone(),
true,
)?;

Self::deposit_event(Event::<T>::DebtTransferred {
pool_id,
from_loan_id,
to_loan_id,
amount,
repaid_amount,
borrow_amount,
});

Ok(())
Expand Down

0 comments on commit 8e3faab

Please sign in to comment.