Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Nov 12, 2023
1 parent c05c2d3 commit 1304d85
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x/keyrotation/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ func (k Keeper) handleMsgRotateConsPubKey(ctx sdk.Context, valAddress sdk.ValAdd
}

// wrap pubkey to types any
pkAny, err := codectypes.NewAnyWithValue(pubKey)
newPkAny, err := codectypes.NewAnyWithValue(pubKey)
if err != nil {
return err
}

oldpkAny := validator.ConsensusPubkey
oldPkAny := validator.ConsensusPubkey

// replace pubkey
validator.ConsensusPubkey = pkAny
validator.ConsensusPubkey = newPkAny

// NOTE: staking module do not support DeleteValidatorByConsAddr method for Validator types
// we need to record all the rotated pubkey in keyrotation store so when we can delete later
Expand All @@ -93,8 +93,8 @@ func (k Keeper) handleMsgRotateConsPubKey(ctx sdk.Context, valAddress sdk.ValAdd
// Set rotation history
consPubKeyRotationHistory := types.ConsPubKeyRotationHistory{
OperatorAddress: valAddress.String(),
OldKey: oldpkAny,
NewKey: pkAny,
OldKey: oldPkAny,
NewKey: newPkAny,
BlockHeight: uint64(ctx.BlockHeight()),
}

Expand Down

0 comments on commit 1304d85

Please sign in to comment.