-
Notifications
You must be signed in to change notification settings - Fork 4
/
hooks.go
41 lines (34 loc) · 1.19 KB
/
hooks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package keeper
import (
"github.com/Carina-labs/nova/x/icacontrol/types"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
)
// Implements ICAHooks interface
var _ types.ICAHooks = Keeper{}
func (k Keeper) AfterDelegateEnd(ctx sdk.Context, delegateMsg stakingtypes.MsgDelegate) {
if k.hooks != nil {
k.hooks.AfterDelegateEnd(ctx, delegateMsg)
}
}
func (k Keeper) AfterUndelegateEnd(ctx sdk.Context, undelegateMsg stakingtypes.MsgUndelegate, response *stakingtypes.MsgUndelegateResponse) {
if k.hooks != nil {
k.hooks.AfterUndelegateEnd(ctx, undelegateMsg, response)
}
}
func (k Keeper) AfterDelegateFail(ctx sdk.Context, delegateMsg stakingtypes.MsgDelegate) {
if k.hooks != nil {
k.hooks.AfterDelegateFail(ctx, delegateMsg)
}
}
func (k Keeper) AfterUndelegateFail(ctx sdk.Context, undelegateMsg stakingtypes.MsgUndelegate) {
if k.hooks != nil {
k.hooks.AfterUndelegateFail(ctx, undelegateMsg)
}
}
func (k Keeper) AfterIcaWithdrawFail(ctx sdk.Context, transferMsg transfertypes.MsgTransfer) {
if k.hooks != nil {
k.hooks.AfterIcaWithdrawFail(ctx, transferMsg)
}
}