/
grpc_query.go
83 lines (59 loc) · 2.31 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package keeper
import (
"context"
"github.com/furya-official/fury-blockchain/x/entity/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
var _ types.QueryServer = Keeper{}
func (k Keeper) EntityDoc(c context.Context, req *types.QueryEntityDocRequest) (*types.QueryEntityDocResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
// ctx := sdk.UnwrapSDKContext(c)
// storedDoc, err := k.GetProjectDoc(ctx, req.ProjectDid)
// if err != nil {
// return nil, err
// }
return &types.QueryEntityDocResponse{}, nil
}
func (k Keeper) EntityList(c context.Context, req *types.QueryEntityListRequest) (*types.QueryEntityListResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
// ctx := sdk.UnwrapSDKContext(c)
// wasmkeeper.Querier(&k.WasmKeeper).SmartContractState()
// k.WasmKeeper.Execute()
// storedDoc, err := k.GetProjectDoc(ctx, req.ProjectDid)
// if err != nil {
// return nil, err
// }
return &types.QueryEntityListResponse{}, nil
}
func (k Keeper) EntityConfig(c context.Context, req *types.QueryEntityConfigRequest) (*types.QueryEntityConfigResponse, error) {
return &types.QueryEntityConfigResponse{}, nil
}
// func (k Keeper) ProjectAccounts(c context.Context, req *types.QueryProjectAccountsRequest) (*types.QueryProjectAccountsResponse, error) {
// if req == nil {
// return nil, status.Error(codes.InvalidArgument, "invalid request")
// }
// ctx := sdk.UnwrapSDKContext(c)
// resp := k.GetAccountMap(ctx, req.ProjectDid)
// return &types.QueryProjectAccountsResponse{AccountMap: &resp}, nil
// }
// func (k Keeper) ProjectTx(c context.Context, req *types.QueryProjectTxRequest) (*types.QueryProjectTxResponse, error) {
// if req == nil {
// return nil, status.Error(codes.InvalidArgument, "invalid request")
// }
// ctx := sdk.UnwrapSDKContext(c)
// info, err := k.GetProjectWithdrawalTransactions(ctx, req.ProjectDid)
// if err != nil {
// return nil, err
// }
// return &types.QueryProjectTxResponse{Txs: &info}, nil
// }
// func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
// ctx := sdk.UnwrapSDKContext(c)
// params := k.GetParams(ctx)
// return &types.QueryParamsResponse{Params: params}, nil
// }