-
Notifications
You must be signed in to change notification settings - Fork 1
/
grpc_query.go
35 lines (25 loc) · 1.11 KB
/
grpc_query.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/Timwood0x10/sei-chain/x/tokenfactory/types"
)
var _ types.QueryServer = Keeper{}
func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
params := k.GetParams(sdkCtx)
return &types.QueryParamsResponse{Params: params}, nil
}
func (k Keeper) DenomAuthorityMetadata(ctx context.Context, req *types.QueryDenomAuthorityMetadataRequest) (*types.QueryDenomAuthorityMetadataResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom())
if err != nil {
return nil, err
}
return &types.QueryDenomAuthorityMetadataResponse{AuthorityMetadata: authorityMetadata}, nil
}
func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFromCreatorRequest) (*types.QueryDenomsFromCreatorResponse, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)
denoms := k.getDenomsFromCreator(sdkCtx, req.GetCreator())
return &types.QueryDenomsFromCreatorResponse{Denoms: denoms}, nil
}