Skip to content

Commit

Permalink
fix: return err when client, channel not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaru Wang committed Aug 4, 2023
1 parent c1e8c3f commit d8edc2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions x/ccv/consumer/keeper/provider_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ func (k Keeper) GetProviderChainInfo(ctx sdk.Context) (*types.QueryProviderInfoR
// get the channelID for the channel to the provider.
consumerChannelID, found := k.GetProviderChannel(ctx)
if !found {
return nil, nil
return nil, ccvtypes.ErrChannelNotFound
}
consumerChannel, found := k.channelKeeper.GetChannel(ctx, ccvtypes.ConsumerPortID, consumerChannelID)
if !found {
return nil, nil
return nil, ccvtypes.ErrChannelNotFound
}

// from channel get connection
Expand All @@ -29,8 +29,7 @@ func (k Keeper) GetProviderChainInfo(ctx sdk.Context) (*types.QueryProviderInfoR

consumerClientState, found := k.clientKeeper.GetClientState(ctx, consumerConnection.GetClientID())
if !found {
// todo if return err?
return nil, nil
return nil, ccvtypes.ErrClientNotFound
}
providerChainID := consumerClientState.(*ibctm.ClientState).ChainId

Expand Down

0 comments on commit d8edc2a

Please sign in to comment.