Skip to content

Commit

Permalink
Update to return active commitments when queued commitments not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
p0p3yee committed Feb 6, 2024
1 parent a4d6ba1 commit 174550e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions x/keyshare/keeper/grpc_query_commitments.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ func (k Keeper) Commitments(c context.Context, req *types.QueryCommitmentsReques
k.cdc.MustUnmarshal(activeCommitmentBytes, &activeCommitments)

queuedCommitmentBytes := store.Get(types.KeyPrefix(types.QueuedCommitmentsPrefix))
if queuedCommitmentBytes == nil {
return nil, status.Error(codes.Internal, "Queued Commitments does not exists")
if queuedCommitmentBytes != nil {
k.cdc.MustUnmarshal(queuedCommitmentBytes, &queuedCommitments)
}

k.cdc.MustUnmarshal(queuedCommitmentBytes, &queuedCommitments)

return &types.QueryCommitmentsResponse{ActiveCommitments: &activeCommitments, QueuedCommitments: &queuedCommitments}, nil
}

0 comments on commit 174550e

Please sign in to comment.