Skip to content

Commit

Permalink
Use GetValidator instead of GetValidatorByConsAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed May 17, 2024
1 parent 569c3b7 commit 01a06f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions x/ccv/provider/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) {

i := 0
for ; validatorIterator.Valid() && i < int(maxTotalValidators); validatorIterator.Next() {
address := sdk.ConsAddress(validatorIterator.Value())
validator, found := k.stakingKeeper.GetValidatorByConsAddr(ctx, address)
address := validatorIterator.Value()
validator, found := k.stakingKeeper.GetValidator(ctx, address)
if !found {
k.Logger(ctx).Error("validator not found", "address", address.String())
k.Logger(ctx).Error("validator not found", "address", address)
continue
}

Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ func MockAllValidatorsAsLastValidators(mocks testkeeper.MockedKeepers, validator
mocks.MockStakingKeeper.EXPECT().ValidatorsPowerStoreIterator(gomock.Any()).Return(teststore.NewMockIterator(keySlice, valsSlice)).AnyTimes()

for i, val := range validators {
mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(gomock.Any(), sdk.ConsAddress(val.GetOperator())).Return(validators[i], true).AnyTimes()
mocks.MockStakingKeeper.EXPECT().GetValidator(gomock.Any(), val.GetOperator()).Return(validators[i], true).AnyTimes()
}
}

Expand Down

0 comments on commit 01a06f7

Please sign in to comment.