-
Notifications
You must be signed in to change notification settings - Fork 22
/
hooks.go
45 lines (38 loc) · 1.39 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
42
43
44
45
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
stratos "github.com/stratosnet/stratos-chain/types"
"github.com/stratosnet/stratos-chain/x/register/types"
)
// Implements RegisterHooks interface
var _ types.RegisterHooks = Keeper{}
// AfterNodeCreated - call hook if registered
func (k Keeper) AfterNodeCreated(ctx sdk.Context, networkAddr stratos.SdsAddress, isMetaNode bool) {
if k.hooks != nil {
k.hooks.AfterNodeCreated(ctx, networkAddr, isMetaNode)
}
}
// BeforeNodeModified - call hook if registered
func (k Keeper) BeforeNodeModified(ctx sdk.Context, network stratos.SdsAddress, isMetaNode bool) {
if k.hooks != nil {
k.hooks.BeforeNodeModified(ctx, network, isMetaNode)
}
}
// AfterNodeRemoved - call hook if registered
func (k Keeper) AfterNodeRemoved(ctx sdk.Context, networkAddr stratos.SdsAddress, isMetaNode bool) {
if k.hooks != nil {
k.hooks.AfterNodeRemoved(ctx, networkAddr, isMetaNode)
}
}
// AfterNodeBonded - call hook if registered
func (k Keeper) AfterNodeBonded(ctx sdk.Context, networkAddr stratos.SdsAddress, isMetaNode bool) {
if k.hooks != nil {
k.hooks.AfterNodeBonded(ctx, networkAddr, isMetaNode)
}
}
// AfterNodeBeginUnbonding - call hook if registered
func (k Keeper) AfterNodeBeginUnbonding(ctx sdk.Context, networkAddr stratos.SdsAddress, isMetaNode bool) {
if k.hooks != nil {
k.hooks.AfterNodeBeginUnbonding(ctx, networkAddr, isMetaNode)
}
}