From a42f3440c08e1839a6cfd66eb202d12bea520687 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 11 Nov 2024 19:55:44 +0100 Subject: [PATCH] feat!: enable unjail on pre-ccv chains --- x/ccv/consumer/keeper/validators.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index 4386bb7b86..859434a95b 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -179,7 +179,13 @@ func (k Keeper) Jail(context.Context, sdk.ConsAddress) error { return nil } // This method should be a no-op even during a standalone to consumer changeover. // Once the upgrade has happened as a part of the changeover, // the provider validator set will soon be in effect, and jailing is n/a. -func (k Keeper) Unjail(context.Context, sdk.ConsAddress) error { return nil } +func (k Keeper) Unjail(sdkCtx context.Context, addr sdk.ConsAddress) error { + ctx := sdk.UnwrapSDKContext(sdkCtx) + if k.IsPrevStandaloneChain(ctx) && k.ChangeoverIsComplete(ctx) && k.standaloneStakingKeeper != nil { + return k.standaloneStakingKeeper.Unjail(ctx, addr) + } + return nil +} // Delegation - unimplemented on CCV keeper func (k Keeper) Delegation(ctx context.Context, addr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.DelegationI, error) {