From 174550e9a48fe81ac024fbfe0eba8489f41bea73 Mon Sep 17 00:00:00 2001 From: p0p3yee Date: Mon, 5 Feb 2024 21:47:00 -0500 Subject: [PATCH] Update to return active commitments when queued commitments not exists --- x/keyshare/keeper/grpc_query_commitments.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x/keyshare/keeper/grpc_query_commitments.go b/x/keyshare/keeper/grpc_query_commitments.go index 5f301748..17d8e3dc 100644 --- a/x/keyshare/keeper/grpc_query_commitments.go +++ b/x/keyshare/keeper/grpc_query_commitments.go @@ -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 }