Skip to content

Commit

Permalink
continue in favour of returning an error on query PacketAcknowledgements
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Sep 6, 2021
1 parent d4ee672 commit 800b9cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/core/04-channel/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ func (q Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacket
acks := []*types.PacketState{}
store := prefix.NewStore(ctx.KVStore(q.storeKey), []byte(host.PacketAcknowledgementPrefixPath(req.PortId, req.ChannelId)))

// if a list of packet sequences is provided then query for each specific ack and return
// if a list of packet sequences is provided then query for each specific ack and return a list <= len(req.PacketCommitmentSequences)
// otherwise, maintain previous behaviour and perform paginated query
for _, seq := range req.PacketCommitmentSequences {
acknowledgementBz, found := q.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, seq)
if !found || len(acknowledgementBz) == 0 {
return nil, status.Error(codes.NotFound, "packet acknowledgement hash not found")
continue
}

ack := types.NewPacketState(req.PortId, req.ChannelId, seq, acknowledgementBz)
Expand Down

0 comments on commit 800b9cd

Please sign in to comment.