Skip to content

Commit

Permalink
Refactor GetUnbondingValidators method
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Aug 9, 2023
1 parent 39c8888 commit 3258760
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions module/x/gravity/keeper/slashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ func (k Keeper) GetUnbondingValidatorSlashingInfos(ctx sdk.Context) ([]stakingty
unbondingValIterator := k.StakingKeeper.ValidatorQueueIterator(ctx, blockTime, blockHeight)
defer unbondingValIterator.Close()
for ; unbondingValIterator.Valid(); unbondingValIterator.Next() {
unbondingValidatorsAddr := k.GetUnbondingValidators(unbondingValIterator.Value()).Addresses
for _, valAddr := range unbondingValidatorsAddr {
unbondingValidatorsAddr := stakingtypes.ValAddresses{}
k.cdc.MustUnmarshal(unbondingValIterator.Value(), &unbondingValidatorsAddr)
for _, valAddr := range unbondingValidatorsAddr.Addresses {
addr, err := sdk.ValAddressFromBech32(valAddr)
if err != nil {
panic(fmt.Sprintf("failed to bech32 decode validator address: %s", err))
Expand Down

0 comments on commit 3258760

Please sign in to comment.