mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 08:45:19 +00:00
4e6f6d1e9c
* spike: incentive/types * spike: incentive/types tests * spike: incentive/types/expected_keepers.go * spike: incentive/keeper * spike: incentive/keeper tests * spike: incentive/sims and incentive/sims tests * spike: incentive/module * spike: incentive/module tests * spike: hard/types * spike: hard/types hooks * spike: hard/types * spike: hard/keeper basics * spike: hard/keeper hooks * integrate hard/keeper/borrow.go * integrate hard/keeper/deposit.go * integrate hard/keeper/liquidation.go * integrate hard/keeper/withdraw.go * integrate hard/keeper/repay.go * spike: hard/sims * spike: hard/sims tests * spike: hard/client * spike: hard/module * integrate app.go * spike: x/hard/keeper compile tests * incentive/keeper test clean up * validate usdx incentive types in genesis * refactoring & fix deposit test * fix liquidaton tests * fix incentive tests for hard supply rewards * fix hard genesis tests * update incentive genesis state and params * update cdp rewards accumulation * update app init order and begin blocker order Co-authored-by: karzak <kjydavis3@gmail.com>
53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package keeper
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
"github.com/kava-labs/kava/x/hard/types"
|
|
)
|
|
|
|
// Implements StakingHooks interface
|
|
var _ types.HARDHooks = Keeper{}
|
|
|
|
// AfterDepositCreated - call hook if registered
|
|
func (k Keeper) AfterDepositCreated(ctx sdk.Context, deposit types.Deposit) {
|
|
if k.hooks != nil {
|
|
k.hooks.AfterDepositCreated(ctx, deposit)
|
|
}
|
|
}
|
|
|
|
// BeforeDepositModified - call hook if registered
|
|
func (k Keeper) BeforeDepositModified(ctx sdk.Context, deposit types.Deposit) {
|
|
if k.hooks != nil {
|
|
k.hooks.BeforeDepositModified(ctx, deposit)
|
|
}
|
|
}
|
|
|
|
// AfterDepositModified - call hook if registered
|
|
func (k Keeper) AfterDepositModified(ctx sdk.Context, deposit types.Deposit) {
|
|
if k.hooks != nil {
|
|
k.hooks.AfterDepositModified(ctx, deposit)
|
|
}
|
|
}
|
|
|
|
// AfterBorrowCreated - call hook if registered
|
|
func (k Keeper) AfterBorrowCreated(ctx sdk.Context, borrow types.Borrow) {
|
|
if k.hooks != nil {
|
|
k.hooks.AfterBorrowCreated(ctx, borrow)
|
|
}
|
|
}
|
|
|
|
// BeforeBorrowModified - call hook if registered
|
|
func (k Keeper) BeforeBorrowModified(ctx sdk.Context, borrow types.Borrow) {
|
|
if k.hooks != nil {
|
|
k.hooks.BeforeBorrowModified(ctx, borrow)
|
|
}
|
|
}
|
|
|
|
// AfterBorrowModified - call hook if registered
|
|
func (k Keeper) AfterBorrowModified(ctx sdk.Context, borrow types.Borrow) {
|
|
if k.hooks != nil {
|
|
k.hooks.AfterBorrowModified(ctx, borrow)
|
|
}
|
|
}
|