func (k Keeper) Unjail(ctx sdk.Context, valAccountID types.AccountID) error {
	validator := k.sk.Validator(ctx, valAccountID)
	if validator == nil {
		return types.ErrNoValidatorForAddress
	}
	if !validator.IsJailed() {
		return types.ErrValidatorNotJailed
	}
	consAddr := sdk.ConsAddress(validator.GetConsPubKey().Address())
	info, found := k.GetValidatorSigningInfo(ctx, consAddr)
	if !found {
		return types.ErrNoValidatorForAddress
	}
	if info.Tombstoned {
		return types.ErrValidatorJailed
	}
	if ctx.BlockHeader().Time.Before(info.JailedUntil) {
		return types.ErrValidatorJailed
	}
	k.sk.Unjail(ctx, consAddr)
	return nil
}
Unjail calls the staking Unjail function to unjail a validator if the
jailed period has concluded
package keeper
import (
	"github.com/KuChainNetwork/kuchain/x/slashing/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
)