Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R4R: Minor changes on slashing logs and gov Querier #2259

Merged
merged 7 commits into from
Sep 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions x/stake/keeper/slash.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,25 @@ func (k Keeper) Slash(ctx sdk.Context, pubkey crypto.PubKey, infractionHeight in
// jail a validator
func (k Keeper) Jail(ctx sdk.Context, pubkey crypto.PubKey) {
k.setJailed(ctx, pubkey, true)
validatorAddr, err := sdk.ValAddressFromHex(pubkey.Address().String())
if err != nil {
panic(err.Error())
}
logger := ctx.Logger().With("module", "x/stake")
logger.Info(fmt.Sprintf("validator %s jailed", pubkey.Address()))
logger.Info(fmt.Sprintf("validator %s jailed", validatorAddr.String()))
fedekunze marked this conversation as resolved.
Show resolved Hide resolved
// TODO Return event(s), blocked on https://github.com/tendermint/tendermint/pull/1803
return
}

// unjail a validator
func (k Keeper) Unjail(ctx sdk.Context, pubkey crypto.PubKey) {
k.setJailed(ctx, pubkey, false)
validatorAddr, err := sdk.ValAddressFromHex(pubkey.Address().String())
if err != nil {
panic(err.Error())
}
logger := ctx.Logger().With("module", "x/stake")
logger.Info(fmt.Sprintf("validator %s unjailed", pubkey.Address()))
logger.Info(fmt.Sprintf("validator %s unjailed", validatorAddr.String()))
// TODO Return event(s), blocked on https://github.com/tendermint/tendermint/pull/1803
return
}
Expand Down