-
Notifications
You must be signed in to change notification settings - Fork 194
/
grpc_query.go
37 lines (27 loc) · 1007 Bytes
/
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
package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/Stride-Labs/stride/v10/x/mint/types"
)
var _ types.QueryServer = Querier{}
// Querier defines a wrapper around the x/mint keeper providing gRPC method
// handlers.
type Querier struct {
Keeper
}
func NewQuerier(k Keeper) Querier {
return Querier{Keeper: k}
}
// Params returns params of the mint module.
func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
params := q.Keeper.GetParams(ctx)
return &types.QueryParamsResponse{Params: params}, nil
}
// EpochProvisions returns minter.EpochProvisions of the mint module.
func (q Querier) EpochProvisions(c context.Context, _ *types.QueryEpochProvisionsRequest) (*types.QueryEpochProvisionsResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
minter := q.Keeper.GetMinter(ctx)
return &types.QueryEpochProvisionsResponse{EpochProvisions: minter.EpochProvisions}, nil
}