forked from cerc-io/laconicd
e511051f3e
* Add message service with a create bond command * Add query proto file with bonds list query * Remove legacy amino coded registration * Add bond to auth module config * Use collections package for bond module state
33 lines
670 B
Go
33 lines
670 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.vdb.to/cerc-io/laconic2d/x/bond"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// TODO: Add remaining query methods
|
|
|
|
type queryServer struct {
|
|
k Keeper
|
|
}
|
|
|
|
var _ bond.QueryServer = queryServer{}
|
|
|
|
// NewQueryServerImpl returns an implementation of the module QueryServer.
|
|
func NewQueryServerImpl(k Keeper) bond.QueryServer {
|
|
return queryServer{k}
|
|
}
|
|
|
|
func (qs queryServer) Bonds(c context.Context, _ *bond.QueryGetBondsRequest) (*bond.QueryGetBondsResponse, error) {
|
|
ctx := sdk.UnwrapSDKContext(c)
|
|
|
|
resp, err := qs.k.ListBonds(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &bond.QueryGetBondsResponse{Bonds: resp}, nil
|
|
}
|