forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.go
54 lines (46 loc) · 1.46 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
46
47
48
49
50
51
52
53
54
//nolint
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Expose the hooks if present
func (k Keeper) OnValidatorCreated(ctx sdk.Context, address sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnValidatorCreated(ctx, address)
}
}
func (k Keeper) OnValidatorModified(ctx sdk.Context, address sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnValidatorModified(ctx, address)
}
}
func (k Keeper) OnValidatorRemoved(ctx sdk.Context, address sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnValidatorRemoved(ctx, address)
}
}
func (k Keeper) OnValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnValidatorBonded(ctx, address, operator)
}
}
func (k Keeper) OnValidatorBeginUnbonding(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnValidatorBeginUnbonding(ctx, address, operator)
}
}
func (k Keeper) OnDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnDelegationCreated(ctx, delAddr, valAddr)
}
}
func (k Keeper) OnDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnDelegationSharesModified(ctx, delAddr, valAddr)
}
}
func (k Keeper) OnDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) {
if k.hooks != nil {
k.hooks.OnDelegationRemoved(ctx, delAddr, valAddr)
}
}