-
Notifications
You must be signed in to change notification settings - Fork 0
/
grpc_query.go
43 lines (31 loc) · 1.42 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"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/exfury/furya/v18/x/mint/types"
)
var _ types.QueryServer = Keeper{}
// 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
}
// Inflation returns minter.Inflation of the mint module.
func (k Keeper) Inflation(c context.Context, _ *types.QueryInflationRequest) (*types.QueryInflationResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
minter := k.GetMinter(ctx)
return &types.QueryInflationResponse{Inflation: minter.Inflation}, nil
}
// AnnualProvisions returns minter.AnnualProvisions of the mint module.
func (k Keeper) AnnualProvisions(c context.Context, _ *types.QueryAnnualProvisionsRequest) (*types.QueryAnnualProvisionsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
minter := k.GetMinter(ctx)
return &types.QueryAnnualProvisionsResponse{AnnualProvisions: minter.AnnualProvisions}, nil
}
// Target supply returns minter.TargetSupply of the mint module.
func (k Keeper) TargetSupply(c context.Context, _ *types.QueryTargetSupplyRequest) (*types.QueryTargetSupplyResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
minter := k.GetMinter(ctx)
return &types.QueryTargetSupplyResponse{TargetSupply: minter.TargetSupply}, nil
}