2022-09-12 17:50:35 +00:00
|
|
|
package keeper
|
|
|
|
|
|
|
|
import (
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
"github.com/0glabs/0g-chain/x/earn/types"
|
2022-09-12 17:50:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Implements EarnHooks interface
|
|
|
|
var _ types.EarnHooks = Keeper{}
|
|
|
|
|
|
|
|
// AfterVaultDepositCreated - call hook if registered
|
|
|
|
func (k Keeper) AfterVaultDepositCreated(
|
|
|
|
ctx sdk.Context,
|
|
|
|
vaultDenom string,
|
|
|
|
depositor sdk.AccAddress,
|
|
|
|
sharesOwned sdk.Dec,
|
|
|
|
) {
|
|
|
|
if k.hooks != nil {
|
|
|
|
k.hooks.AfterVaultDepositCreated(ctx, vaultDenom, depositor, sharesOwned)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// BeforeVaultDepositModified - call hook if registered
|
|
|
|
func (k Keeper) BeforeVaultDepositModified(
|
|
|
|
ctx sdk.Context,
|
|
|
|
vaultDenom string,
|
|
|
|
depositor sdk.AccAddress,
|
|
|
|
sharesOwned sdk.Dec,
|
|
|
|
) {
|
|
|
|
if k.hooks != nil {
|
|
|
|
k.hooks.BeforeVaultDepositModified(ctx, vaultDenom, depositor, sharesOwned)
|
|
|
|
}
|
|
|
|
}
|