mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
call both incentive hooks (#804)
This commit is contained in:
parent
0edbdf968e
commit
c60365f12e
@ -23,15 +23,19 @@ func (k Keeper) Deposit(ctx sdk.Context, depositor sdk.AccAddress, coins sdk.Coi
|
||||
}
|
||||
}
|
||||
|
||||
// Call incentive hook
|
||||
// Call incentive hooks
|
||||
existingDeposit, hasExistingDeposit := k.GetDeposit(ctx, depositor)
|
||||
if hasExistingDeposit {
|
||||
k.BeforeDepositModified(ctx, existingDeposit)
|
||||
}
|
||||
existingBorrow, hasExistingBorrow := k.GetBorrow(ctx, depositor)
|
||||
if hasExistingBorrow {
|
||||
k.BeforeBorrowModified(ctx, existingBorrow)
|
||||
}
|
||||
|
||||
// Sync any outstanding interest
|
||||
k.SyncBorrowInterest(ctx, depositor)
|
||||
k.SyncSupplyInterest(ctx, depositor)
|
||||
k.SyncBorrowInterest(ctx, depositor)
|
||||
|
||||
err := k.ValidateDeposit(ctx, coins)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user