mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-11-10 10: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)
|
existingDeposit, hasExistingDeposit := k.GetDeposit(ctx, depositor)
|
||||||
if hasExistingDeposit {
|
if hasExistingDeposit {
|
||||||
k.BeforeDepositModified(ctx, existingDeposit)
|
k.BeforeDepositModified(ctx, existingDeposit)
|
||||||
}
|
}
|
||||||
|
existingBorrow, hasExistingBorrow := k.GetBorrow(ctx, depositor)
|
||||||
|
if hasExistingBorrow {
|
||||||
|
k.BeforeBorrowModified(ctx, existingBorrow)
|
||||||
|
}
|
||||||
|
|
||||||
// Sync any outstanding interest
|
// Sync any outstanding interest
|
||||||
k.SyncBorrowInterest(ctx, depositor)
|
|
||||||
k.SyncSupplyInterest(ctx, depositor)
|
k.SyncSupplyInterest(ctx, depositor)
|
||||||
|
k.SyncBorrowInterest(ctx, depositor)
|
||||||
|
|
||||||
err := k.ValidateDeposit(ctx, coins)
|
err := k.ValidateDeposit(ctx, coins)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user