laconicd/x/onboarding/keeper/query_server.go
Isha Venikar f23f691646 Add lint config and fix lint errors (#7)
* Add config file for linter

* Fix lint errors

* Fix gofumpt errors

* Fix pre-allocate slices lint error

* Remove unused lint rule

* Disable style check ID error

* Add gomodguard section in yml file

* Remove trailing white spaces

* Remove unnecessary comments

---------

Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-07-16 09:25:39 +05:30

36 lines
802 B
Go

package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
onboardingtypes "git.vdb.to/cerc-io/laconicd/x/onboarding"
)
var _ onboardingtypes.QueryServer = queryServer{}
type queryServer struct {
k *Keeper
}
// NewQueryServerImpl returns an implementation of the module QueryServer.
func NewQueryServerImpl(k *Keeper) onboardingtypes.QueryServer {
return queryServer{k}
}
// Participants implements Participants.QueryServer.
func (qs queryServer) Participants(
c context.Context,
_ *onboardingtypes.QueryParticipantsRequest,
) (*onboardingtypes.QueryParticipantsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
resp, err := qs.k.ListParticipants(ctx)
if err != nil {
return nil, err
}
return &onboardingtypes.QueryParticipantsResponse{Participants: resp}, nil
}