Skip to content

Commit

Permalink
fix address conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke committed Nov 25, 2022
1 parent c396b3f commit e772dfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/ccv/provider/keeper/key_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,11 @@ func (k Keeper) AssignConsumerKey(
}

// check whether the validator is valid, i.e., its power is positive
if power := k.stakingKeeper.GetLastValidatorPower(ctx, sdk.ValAddress(validator.OperatorAddress)); power > 0 {
providerValidatorAddr, err := sdk.ValAddressFromBech32(validator.OperatorAddress)
if err != nil {
return err
}
if power := k.stakingKeeper.GetLastValidatorPower(ctx, providerValidatorAddr); power > 0 {
// to enable multiple calls of AssignConsumerKey in the same block by the same validator
// the key assignment replacement should not be overwritten
if _, _, found := k.GetKeyAssignmentReplacement(ctx, chainID, providerAddr); !found {
Expand Down

0 comments on commit e772dfb

Please sign in to comment.