-
Notifications
You must be signed in to change notification settings - Fork 127
/
grpc_query.go
43 lines (34 loc) · 1.06 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
36
37
38
39
40
41
42
43
package keeper
import (
"context"
// "google.golang.org/grpc/codes"
// "google.golang.org/grpc/status"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/haqq-network/haqq/x/coinomics/types"
)
var _ types.QueryServer = Keeper{}
func (k Keeper) RewardCoefficient(
c context.Context,
_ *types.QueryRewardCoefficientRequest,
) (*types.QueryRewardCoefficientResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := k.GetParams(ctx)
return &types.QueryRewardCoefficientResponse{RewardCoefficient: params.RewardCoefficient}, nil
}
func (k Keeper) MaxSupply(
c context.Context,
_ *types.QueryMaxSupplyRequest,
) (*types.QueryMaxSupplyResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
maxSupply := k.GetMaxSupply(ctx)
return &types.QueryMaxSupplyResponse{MaxSupply: maxSupply}, nil
}
// Params returns params of the mint module.
func (k Keeper) Params(
c context.Context,
_ *types.QueryParamsRequest,
) (*types.QueryParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := k.GetParams(ctx)
return &types.QueryParamsResponse{Params: params}, nil
}