Skip to content

Commit

Permalink
Merge pull request #101 from Fairblock/fix/grpc-query-commitments
Browse files Browse the repository at this point in the history
Update to return active commitments when queued commitments not exists
  • Loading branch information
p0p3yee authored Feb 9, 2024
2 parents fd1d52d + 174550e commit 55dac1b
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 55dac1b

Please sign in to comment.