-
Notifications
You must be signed in to change notification settings - Fork 182
/
slash.go
29 lines (23 loc) · 956 Bytes
/
slash.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
package keeper
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec) {
}
// Jail sents a validator to jail
func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress) {
validator := k.mustGetValidatorByConsAddr(ctx, consAddr)
k.jailValidator(ctx, validator)
logger := k.Logger(ctx)
logger.Info(fmt.Sprintf("validator %s jailed", consAddr))
// TODO Return event(s), blocked on https://github.com/tendermint/tendermint/pull/1803
}
// Unjail discharges a validator by unjailing
func (k Keeper) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress) {
validator := k.mustGetValidatorByConsAddr(ctx, consAddr)
k.unjailValidator(ctx, validator)
logger := k.Logger(ctx)
logger.Info(fmt.Sprintf("validator %s unjailed", consAddr))
// TODO Return event(s), blocked on https://github.com/tendermint/tendermint/pull/1803
}