x/bank: gRPC Params Route (#7070)
* update x/bank proto gRPC query service * fix path * update keeper * add godoc * add test * lint++
This commit is contained in:
parent
77124da21a
commit
7d2062b674
2
go.sum
2
go.sum
|
@ -154,6 +154,7 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB
|
||||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
|
@ -170,6 +171,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
|
||||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||||
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
|
|
|
@ -9,28 +9,24 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
|
||||||
|
|
||||||
// Params defines the set of bank parameters.
|
// Params defines the set of bank parameters.
|
||||||
message Params {
|
message Params {
|
||||||
option (gogoproto.goproto_stringer) = false;
|
option (gogoproto.goproto_stringer) = false;
|
||||||
repeated SendEnabled send_enabled = 1[
|
repeated SendEnabled send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""];
|
||||||
(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""
|
bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""];
|
||||||
];
|
|
||||||
bool default_send_enabled = 2[
|
|
||||||
(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send enabled configuration properties for each denomination
|
// Send enabled configuration properties for each denomination
|
||||||
message SendEnabled {
|
message SendEnabled {
|
||||||
option (gogoproto.equal) = true;
|
option (gogoproto.equal) = true;
|
||||||
option (gogoproto.goproto_stringer) = false;
|
option (gogoproto.goproto_stringer) = false;
|
||||||
string denom = 1;
|
string denom = 1;
|
||||||
bool enabled = 2;
|
bool enabled = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input models transaction input
|
// Input models transaction input
|
||||||
message Input {
|
message Input {
|
||||||
option (gogoproto.equal) = true;
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
||||||
repeated cosmos.base.v1beta1.Coin coins = 2
|
repeated cosmos.base.v1beta1.Coin coins = 2
|
||||||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||||
}
|
}
|
||||||
|
@ -39,7 +35,7 @@ message Input {
|
||||||
message Output {
|
message Output {
|
||||||
option (gogoproto.equal) = true;
|
option (gogoproto.equal) = true;
|
||||||
|
|
||||||
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
||||||
repeated cosmos.base.v1beta1.Coin coins = 2
|
repeated cosmos.base.v1beta1.Coin coins = 2
|
||||||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||||
}
|
}
|
||||||
|
@ -47,28 +43,28 @@ message Output {
|
||||||
// Supply represents a struct that passively keeps track of the total supply
|
// Supply represents a struct that passively keeps track of the total supply
|
||||||
// amounts in the network.
|
// amounts in the network.
|
||||||
message Supply {
|
message Supply {
|
||||||
option (gogoproto.equal) = true;
|
option (gogoproto.equal) = true;
|
||||||
option (gogoproto.goproto_getters) = false;
|
option (gogoproto.goproto_getters) = false;
|
||||||
option (gogoproto.goproto_stringer) = false;
|
option (gogoproto.goproto_stringer) = false;
|
||||||
option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/exported.SupplyI";
|
option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/exported.SupplyI";
|
||||||
|
|
||||||
repeated cosmos.base.v1beta1.Coin total = 1
|
repeated cosmos.base.v1beta1.Coin total = 1
|
||||||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// DenomUnits represents a struct that describes different
|
// DenomUnits represents a struct that describes different
|
||||||
// denominations units of the basic token
|
// denominations units of the basic token
|
||||||
message DenomUnits {
|
message DenomUnits {
|
||||||
string denom = 1;
|
string denom = 1;
|
||||||
uint32 exponent = 2;
|
uint32 exponent = 2;
|
||||||
repeated string aliases = 3;
|
repeated string aliases = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Metadata represents a struct that describes
|
// Metadata represents a struct that describes
|
||||||
// a basic token
|
// a basic token
|
||||||
message Metadata {
|
message Metadata {
|
||||||
string description = 1;
|
string description = 1;
|
||||||
repeated DenomUnits denom_units = 2;
|
repeated DenomUnits denom_units = 2;
|
||||||
string base = 3;
|
string base = 3;
|
||||||
string display = 4;
|
string display = 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
import "google/api/annotations.proto";
|
import "google/api/annotations.proto";
|
||||||
import "cosmos/base/v1beta1/coin.proto";
|
import "cosmos/base/v1beta1/coin.proto";
|
||||||
|
import "cosmos/bank/v1beta1/bank.proto";
|
||||||
|
|
||||||
option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
|
option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types";
|
||||||
|
|
||||||
|
@ -30,7 +31,10 @@ service Query {
|
||||||
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}";
|
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Params
|
// Params queries the parameters of x/bank module.
|
||||||
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||||
|
option (google.api.http).get = "/cosmos/bank/v1beta1/params";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
|
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
|
||||||
|
@ -51,10 +55,8 @@ message QueryBalanceResponse {
|
||||||
// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
|
// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
|
||||||
message QueryAllBalancesRequest {
|
message QueryAllBalancesRequest {
|
||||||
// address is the address to query balances for.
|
// address is the address to query balances for.
|
||||||
bytes address = 1
|
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
||||||
[(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
|
|
||||||
|
|
||||||
|
|
||||||
// pagination defines an optional pagination for the request.
|
// pagination defines an optional pagination for the request.
|
||||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +90,13 @@ message QuerySupplyOfRequest {
|
||||||
// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
|
// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method.
|
||||||
message QuerySupplyOfResponse {
|
message QuerySupplyOfResponse {
|
||||||
// amount is the supply of the coin.
|
// amount is the supply of the coin.
|
||||||
cosmos.base.v1beta1.Coin amount = 1 [
|
cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false];
|
||||||
(gogoproto.nullable) = false
|
}
|
||||||
];
|
|
||||||
|
// QueryParamsRequest defines the request type for querying x/bank parameters.
|
||||||
|
message QueryParamsRequest {}
|
||||||
|
|
||||||
|
// QueryParamsResponse defines the response type for querying x/bank parameters.
|
||||||
|
message QueryParamsResponse {
|
||||||
|
Params params = 1 [(gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,50 +10,50 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types";
|
||||||
|
|
||||||
// Query provides defines the gRPC querier service
|
// Query provides defines the gRPC querier service
|
||||||
service Query {
|
service Query {
|
||||||
// Params queries the parameters of slashing module
|
// Params queries the parameters of slashing module
|
||||||
rpc Params (QueryParamsRequest) returns (QueryParamsResponse){
|
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
|
||||||
option (google.api.http).get = "/cosmos/slashing/v1beta1/params";
|
option (google.api.http).get = "/cosmos/slashing/v1beta1/params";
|
||||||
}
|
}
|
||||||
|
|
||||||
// SigningInfo queries the signing info of given cons address
|
// SigningInfo queries the signing info of given cons address
|
||||||
rpc SigningInfo (QuerySigningInfoRequest) returns (QuerySigningInfoResponse) {
|
rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) {
|
||||||
option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}";
|
option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}";
|
||||||
}
|
}
|
||||||
|
|
||||||
// SigningInfos queries signing info of all validators
|
// SigningInfos queries signing info of all validators
|
||||||
rpc SigningInfos (QuerySigningInfosRequest) returns (QuerySigningInfosResponse) {
|
rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) {
|
||||||
option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos";
|
option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryParamsRequest is the request type for the Query/Params RPC method
|
// QueryParamsRequest is the request type for the Query/Params RPC method
|
||||||
message QueryParamsRequest{}
|
message QueryParamsRequest {}
|
||||||
|
|
||||||
// QueryParamsResponse is the response type for the Query/Params RPC method
|
// QueryParamsResponse is the response type for the Query/Params RPC method
|
||||||
message QueryParamsResponse{
|
message QueryParamsResponse {
|
||||||
Params params = 1[(gogoproto.nullable) = false];
|
Params params = 1 [(gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method
|
// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method
|
||||||
message QuerySigningInfoRequest{
|
message QuerySigningInfoRequest {
|
||||||
// cons_address is the address to query signing info of
|
// cons_address is the address to query signing info of
|
||||||
bytes cons_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"];
|
bytes cons_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method
|
// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method
|
||||||
message QuerySigningInfoResponse{
|
message QuerySigningInfoResponse {
|
||||||
// val_signing_info is the signing info of requested val cons address
|
// val_signing_info is the signing info of requested val cons address
|
||||||
ValidatorSigningInfo val_signing_info = 1[(gogoproto.nullable)= false];
|
ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method
|
// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method
|
||||||
message QuerySigningInfosRequest{
|
message QuerySigningInfosRequest {
|
||||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method
|
// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method
|
||||||
message QuerySigningInfosResponse{
|
message QuerySigningInfosResponse {
|
||||||
// info is the signing info of all validators
|
// info is the signing info of all validators
|
||||||
repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1[(gogoproto.nullable)= false];
|
repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false];
|
||||||
cosmos.base.query.v1beta1.PageResponse pagination =2;
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
var _ types.QueryServer = BaseKeeper{}
|
var _ types.QueryServer = BaseKeeper{}
|
||||||
|
|
||||||
// Balance implements the Query/Balance gRPC method
|
// Balance implements the Query/Balance gRPC method
|
||||||
func (q BaseKeeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error) {
|
func (k BaseKeeper) Balance(ctx context.Context, req *types.QueryBalanceRequest) (*types.QueryBalanceResponse, error) {
|
||||||
if req == nil {
|
if req == nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, "empty request")
|
return nil, status.Error(codes.InvalidArgument, "empty request")
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,14 @@ func (q BaseKeeper) Balance(c context.Context, req *types.QueryBalanceRequest) (
|
||||||
return nil, status.Error(codes.InvalidArgument, "invalid denom")
|
return nil, status.Error(codes.InvalidArgument, "invalid denom")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||||
balance := q.GetBalance(ctx, req.Address, req.Denom)
|
balance := k.GetBalance(sdkCtx, req.Address, req.Denom)
|
||||||
|
|
||||||
return &types.QueryBalanceResponse{Balance: &balance}, nil
|
return &types.QueryBalanceResponse{Balance: &balance}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllBalances implements the Query/AllBalances gRPC method
|
// AllBalances implements the Query/AllBalances gRPC method
|
||||||
func (q BaseKeeper) AllBalances(c context.Context, req *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error) {
|
func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error) {
|
||||||
if req == nil {
|
if req == nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, "empty request")
|
return nil, status.Error(codes.InvalidArgument, "empty request")
|
||||||
}
|
}
|
||||||
|
@ -45,16 +45,16 @@ func (q BaseKeeper) AllBalances(c context.Context, req *types.QueryAllBalancesRe
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "address cannot be empty")
|
return nil, status.Errorf(codes.InvalidArgument, "address cannot be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||||
|
|
||||||
balances := sdk.NewCoins()
|
balances := sdk.NewCoins()
|
||||||
store := ctx.KVStore(q.storeKey)
|
store := sdkCtx.KVStore(k.storeKey)
|
||||||
balancesStore := prefix.NewStore(store, types.BalancesPrefix)
|
balancesStore := prefix.NewStore(store, types.BalancesPrefix)
|
||||||
accountStore := prefix.NewStore(balancesStore, addr.Bytes())
|
accountStore := prefix.NewStore(balancesStore, addr.Bytes())
|
||||||
|
|
||||||
pageRes, err := query.Paginate(accountStore, req.Pagination, func(key []byte, value []byte) error {
|
pageRes, err := query.Paginate(accountStore, req.Pagination, func(key []byte, value []byte) error {
|
||||||
var result sdk.Coin
|
var result sdk.Coin
|
||||||
err := q.cdc.UnmarshalBinaryBare(value, &result)
|
err := k.cdc.UnmarshalBinaryBare(value, &result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -70,15 +70,15 @@ func (q BaseKeeper) AllBalances(c context.Context, req *types.QueryAllBalancesRe
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalSupply implements the Query/TotalSupply gRPC method
|
// TotalSupply implements the Query/TotalSupply gRPC method
|
||||||
func (q BaseKeeper) TotalSupply(c context.Context, _ *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) {
|
func (k BaseKeeper) TotalSupply(ctx context.Context, _ *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||||
totalSupply := q.GetSupply(ctx).GetTotal()
|
totalSupply := k.GetSupply(sdkCtx).GetTotal()
|
||||||
|
|
||||||
return &types.QueryTotalSupplyResponse{Supply: totalSupply}, nil
|
return &types.QueryTotalSupplyResponse{Supply: totalSupply}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupplyOf implements the Query/SupplyOf gRPC method
|
// SupplyOf implements the Query/SupplyOf gRPC method
|
||||||
func (q BaseKeeper) SupplyOf(c context.Context, req *types.QuerySupplyOfRequest) (*types.QuerySupplyOfResponse, error) {
|
func (k BaseKeeper) SupplyOf(c context.Context, req *types.QuerySupplyOfRequest) (*types.QuerySupplyOfResponse, error) {
|
||||||
if req == nil {
|
if req == nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, "empty request")
|
return nil, status.Error(codes.InvalidArgument, "empty request")
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,19 @@ func (q BaseKeeper) SupplyOf(c context.Context, req *types.QuerySupplyOfRequest)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
supply := q.GetSupply(ctx).GetTotal().AmountOf(req.Denom)
|
supply := k.GetSupply(ctx).GetTotal().AmountOf(req.Denom)
|
||||||
|
|
||||||
return &types.QuerySupplyOfResponse{Amount: sdk.NewCoin(req.Denom, supply)}, nil
|
return &types.QuerySupplyOfResponse{Amount: sdk.NewCoin(req.Denom, supply)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Params implements the gRPC service handler for querying x/bank parameters.
|
||||||
|
func (k BaseKeeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||||
|
if req == nil {
|
||||||
|
return nil, status.Errorf(codes.InvalidArgument, "empty request")
|
||||||
|
}
|
||||||
|
|
||||||
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||||
|
params := k.GetParams(sdkCtx)
|
||||||
|
|
||||||
|
return &types.QueryParamsResponse{Params: params}, nil
|
||||||
|
}
|
||||||
|
|
|
@ -3,10 +3,9 @@ package keeper_test
|
||||||
import (
|
import (
|
||||||
gocontext "context"
|
gocontext "context"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/types/query"
|
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -111,3 +110,10 @@ func (suite *IntegrationTestSuite) TestQueryTotalSupplyOf() {
|
||||||
|
|
||||||
suite.Require().Equal(test1Supply, res.Amount)
|
suite.Require().Equal(test1Supply, res.Amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *IntegrationTestSuite) TestQueryParams() {
|
||||||
|
res, err := suite.queryClient.Params(gocontext.Background(), &types.QueryParamsRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
suite.Require().NotNil(res)
|
||||||
|
suite.Require().Equal(suite.app.BankKeeper.GetParams(suite.ctx), res.GetParams())
|
||||||
|
}
|
||||||
|
|
|
@ -418,6 +418,88 @@ func (m *QuerySupplyOfResponse) GetAmount() types.Coin {
|
||||||
return types.Coin{}
|
return types.Coin{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QueryParamsRequest defines the request type for querying x/bank parameters.
|
||||||
|
type QueryParamsRequest struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||||
|
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsRequest) ProtoMessage() {}
|
||||||
|
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_9c6fc1939682df13, []int{8}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsRequest) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
|
// QueryParamsResponse defines the response type for querying x/bank parameters.
|
||||||
|
type QueryParamsResponse struct {
|
||||||
|
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||||
|
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*QueryParamsResponse) ProtoMessage() {}
|
||||||
|
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_9c6fc1939682df13, []int{9}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) GetParams() Params {
|
||||||
|
if m != nil {
|
||||||
|
return m.Params
|
||||||
|
}
|
||||||
|
return Params{}
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest")
|
proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest")
|
||||||
proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse")
|
proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse")
|
||||||
|
@ -427,51 +509,57 @@ func init() {
|
||||||
proto.RegisterType((*QueryTotalSupplyResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyResponse")
|
proto.RegisterType((*QueryTotalSupplyResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyResponse")
|
||||||
proto.RegisterType((*QuerySupplyOfRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfRequest")
|
proto.RegisterType((*QuerySupplyOfRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfRequest")
|
||||||
proto.RegisterType((*QuerySupplyOfResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfResponse")
|
proto.RegisterType((*QuerySupplyOfResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfResponse")
|
||||||
|
proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.bank.v1beta1.QueryParamsRequest")
|
||||||
|
proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.bank.v1beta1.QueryParamsResponse")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) }
|
func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) }
|
||||||
|
|
||||||
var fileDescriptor_9c6fc1939682df13 = []byte{
|
var fileDescriptor_9c6fc1939682df13 = []byte{
|
||||||
// 618 bytes of a gzipped FileDescriptorProto
|
// 680 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x3f, 0x6f, 0xd3, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x41, 0x53, 0xd3, 0x40,
|
||||||
0x1c, 0xcd, 0x95, 0x36, 0x29, 0x17, 0xa6, 0x6b, 0x10, 0x69, 0x00, 0xa7, 0x72, 0x05, 0x4d, 0x4a,
|
0x18, 0xed, 0xa2, 0x14, 0xdc, 0x7a, 0x5a, 0xea, 0x08, 0x41, 0x53, 0x26, 0x8c, 0x52, 0x10, 0xb2,
|
||||||
0xe3, 0x23, 0xe9, 0xd0, 0x39, 0xa9, 0x04, 0x43, 0x07, 0x8a, 0x61, 0x62, 0xbb, 0x38, 0x87, 0xb1,
|
0x16, 0x0e, 0x8c, 0x47, 0xca, 0x8c, 0x1e, 0x38, 0x58, 0xa3, 0x27, 0x6f, 0xdb, 0x74, 0x8d, 0x19,
|
||||||
0xea, 0xf8, 0xdc, 0x9c, 0x83, 0x1a, 0x55, 0x15, 0x12, 0x1f, 0x00, 0x90, 0x18, 0x18, 0xf8, 0x06,
|
0xd2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, 0x15, 0xaa, 0x67,
|
||||||
0xfd, 0xbf, 0xe7, 0xec, 0x0d, 0x2b, 0xd5, 0xe6, 0x44, 0x2b, 0x95, 0x58, 0xa8, 0xac, 0xa2, 0x8d,
|
0x12, 0x64, 0xdc, 0x79, 0x6d, 0xb9, 0x00, 0x52, 0xaa, 0x34, 0x36, 0xdf, 0x7e, 0xff, 0xfd, 0x71,
|
||||||
0x39, 0x55, 0xa2, 0xf7, 0x00, 0xe6, 0x27, 0xe2, 0x93, 0xa6, 0x6e, 0x36, 0x80, 0x69, 0xea, 0x12,
|
0xa2, 0x81, 0x30, 0xce, 0x7e, 0x5e, 0x64, 0xbc, 0xf0, 0xa1, 0xba, 0x35, 0x47, 0xf8, 0x50, 0x0c,
|
||||||
0x32, 0x69, 0xae, 0x0b, 0x75, 0x77, 0xd1, 0xed, 0x44, 0x75, 0x32, 0x53, 0xe8, 0x1d, 0x80, 0xcb,
|
0xf7, 0x08, 0x7d, 0x06, 0xb0, 0x92, 0x4a, 0x3c, 0x5a, 0xbd, 0xb8, 0xe7, 0xe8, 0x4d, 0xd6, 0xd6,
|
||||||
0x3a, 0x21, 0x28, 0x65, 0x41, 0x17, 0x32, 0x57, 0xda, 0x9c, 0x07, 0xaa, 0x84, 0x3c, 0x10, 0x42,
|
0x0a, 0xa2, 0x95, 0x4a, 0x2c, 0x54, 0x2e, 0xa3, 0xa5, 0x82, 0x2a, 0xd1, 0x7b, 0x00, 0x2b, 0xa9,
|
||||||
0xee, 0xa1, 0xf5, 0x14, 0x21, 0x7a, 0x81, 0xad, 0xdd, 0xd3, 0xa1, 0x01, 0xce, 0x86, 0x06, 0xf8,
|
0x98, 0xe6, 0xa9, 0x1b, 0x0d, 0x7a, 0x9e, 0xba, 0x8c, 0xec, 0x1b, 0x8b, 0x42, 0xdd, 0x6d, 0x34,
|
||||||
0x35, 0x34, 0xc0, 0x87, 0x91, 0x91, 0x39, 0x1b, 0x19, 0x99, 0x1f, 0x23, 0x23, 0xf3, 0xa2, 0x9a,
|
0x9f, 0xa9, 0x4e, 0x66, 0x17, 0xbd, 0x03, 0x70, 0x3a, 0x4e, 0x22, 0xca, 0x39, 0xa0, 0x73, 0xd9,
|
||||||
0x7a, 0x61, 0x8e, 0x24, 0xab, 0xb8, 0x37, 0xed, 0xac, 0xf8, 0x4d, 0xd8, 0xfe, 0x1b, 0x00, 0x00,
|
0xd6, 0x56, 0x8a, 0x40, 0x95, 0x90, 0x7b, 0x42, 0xc8, 0x1d, 0xb4, 0x98, 0x23, 0x24, 0x39, 0xc0,
|
||||||
0xff, 0xff, 0xbc, 0x42, 0x05, 0xb8, 0xcb, 0x06, 0x00, 0x00,
|
0x37, 0x00, 0x96, 0x65, 0xfa, 0xd0, 0xd2, 0xc5, 0x3d, 0x86, 0xa2, 0xae, 0xd5, 0xc7, 0x03, 0x0b,
|
||||||
|
0xcd, 0x44, 0xe6, 0xbc, 0xb9, 0x7d, 0x7c, 0xa6, 0x83, 0x93, 0x33, 0x1d, 0xfc, 0x3a, 0xd3, 0xc1,
|
||||||
|
0x87, 0x81, 0x5e, 0x3a, 0x19, 0xe8, 0xa5, 0x1f, 0x03, 0xbd, 0xf4, 0x7c, 0x39, 0xf7, 0x6d, 0xd8,
|
||||||
|
0x97, 0x6c, 0xe2, 0x89, 0x68, 0x97, 0xc5, 0xcf, 0xdf, 0xc6, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||||
|
0xda, 0x1b, 0x35, 0x7f, 0xd6, 0x07, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
@ -494,6 +582,8 @@ type QueryClient interface {
|
||||||
TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error)
|
TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error)
|
||||||
// SupplyOf queries the supply of a single coin.
|
// SupplyOf queries the supply of a single coin.
|
||||||
SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error)
|
SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error)
|
||||||
|
// Params queries the parameters of x/bank module.
|
||||||
|
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type queryClient struct {
|
type queryClient struct {
|
||||||
|
@ -540,6 +630,15 @@ func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, op
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||||
|
out := new(QueryParamsResponse)
|
||||||
|
err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/Params", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// QueryServer is the server API for Query service.
|
// QueryServer is the server API for Query service.
|
||||||
type QueryServer interface {
|
type QueryServer interface {
|
||||||
// Balance queries the balance of a single coin for a single account.
|
// Balance queries the balance of a single coin for a single account.
|
||||||
|
@ -550,6 +649,8 @@ type QueryServer interface {
|
||||||
TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error)
|
TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error)
|
||||||
// SupplyOf queries the supply of a single coin.
|
// SupplyOf queries the supply of a single coin.
|
||||||
SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error)
|
SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error)
|
||||||
|
// Params queries the parameters of x/bank module.
|
||||||
|
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
|
||||||
|
@ -568,6 +669,9 @@ func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTota
|
||||||
func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) {
|
func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented")
|
||||||
}
|
}
|
||||||
|
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
|
||||||
s.RegisterService(&_Query_serviceDesc, srv)
|
s.RegisterService(&_Query_serviceDesc, srv)
|
||||||
|
@ -645,6 +749,24 @@ func _Query_SupplyOf_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(QueryParamsRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(QueryServer).Params(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/cosmos.bank.v1beta1.Query/Params",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "cosmos.bank.v1beta1.Query",
|
ServiceName: "cosmos.bank.v1beta1.Query",
|
||||||
HandlerType: (*QueryServer)(nil),
|
HandlerType: (*QueryServer)(nil),
|
||||||
|
@ -665,6 +787,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||||
MethodName: "SupplyOf",
|
MethodName: "SupplyOf",
|
||||||
Handler: _Query_SupplyOf_Handler,
|
Handler: _Query_SupplyOf_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "Params",
|
||||||
|
Handler: _Query_Params_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "cosmos/bank/v1beta1/query.proto",
|
Metadata: "cosmos/bank/v1beta1/query.proto",
|
||||||
|
@ -956,6 +1082,62 @@ func (m *QuerySupplyOfResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
size := m.Size()
|
||||||
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
|
i := len(dAtA)
|
||||||
|
_ = i
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
{
|
||||||
|
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0xa
|
||||||
|
return len(dAtA) - i, nil
|
||||||
|
}
|
||||||
|
|
||||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||||
offset -= sovQuery(v)
|
offset -= sovQuery(v)
|
||||||
base := offset
|
base := offset
|
||||||
|
@ -1081,6 +1263,26 @@ func (m *QuerySupplyOfResponse) Size() (n int) {
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsRequest) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *QueryParamsResponse) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = m.Params.Size()
|
||||||
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
func sovQuery(x uint64) (n int) {
|
func sovQuery(x uint64) (n int) {
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
return (math_bits.Len64(x|1) + 6) / 7
|
||||||
}
|
}
|
||||||
|
@ -1852,6 +2054,145 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func skipQuery(dAtA []byte) (n int, err error) {
|
func skipQuery(dAtA []byte) (n int, err error) {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
|
|
|
@ -251,9 +251,28 @@ func local_request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marsh
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
|
var protoReq QueryParamsRequest
|
||||||
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
|
msg, err := server.Params(ctx, &protoReq)
|
||||||
|
return msg, metadata, err
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
@ -336,6 +355,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +496,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
|
defer cancel()
|
||||||
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
|
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
|
if err != nil {
|
||||||
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,6 +527,8 @@ var (
|
||||||
pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "denom"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "denom"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
|
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -478,4 +539,6 @@ var (
|
||||||
forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage
|
forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage
|
forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
forward_Query_Params_0 = runtime.ForwardResponseMessage
|
||||||
)
|
)
|
||||||
|
|
|
@ -488,6 +488,7 @@ func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -124,6 +124,7 @@ func local_request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Ma
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -528,6 +528,7 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -304,6 +304,7 @@ func local_request_Query_ConnectionConsensusState_0(ctx context.Context, marshal
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Connection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Connection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -878,6 +878,7 @@ func local_request_Query_NextSequenceReceive_0(ctx context.Context, marshaler ru
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Channel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Channel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -88,6 +88,7 @@ func local_request_Query_AnnualProvisions_0(ctx context.Context, marshaler runti
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -142,6 +142,7 @@ func local_request_Query_SigningInfos_0(ctx context.Context, marshaler runtime.M
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
|
@ -874,6 +874,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,8 +6,8 @@ package types
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
proto "github.com/gogo/protobuf/proto"
|
|
||||||
grpc1 "github.com/gogo/protobuf/grpc"
|
grpc1 "github.com/gogo/protobuf/grpc"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
codes "google.golang.org/grpc/codes"
|
codes "google.golang.org/grpc/codes"
|
||||||
|
|
|
@ -106,6 +106,7 @@ func local_request_Query_AppliedPlan_0(ctx context.Context, marshaler runtime.Ma
|
||||||
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
|
||||||
// UnaryRPC :call QueryServer directly.
|
// UnaryRPC :call QueryServer directly.
|
||||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||||
|
// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
|
||||||
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_CurrentPlan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_CurrentPlan_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
|
|
Loading…
Reference in New Issue