ignite scaffold query get_reissuances --paginated -r reissuance:Reissuance --module dao

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-10-06 11:50:31 +02:00
parent 4dc1485cd7
commit 44a851f5ef
No known key found for this signature in database
7 changed files with 841 additions and 40 deletions

View File

@ -46769,6 +46769,133 @@ paths:
format: uint64
tags:
- Query
/planetmint/planetmint-go/dao/get_reissuances:
get:
summary: Queries a list of GetReissuances items.
operationId: PlanetmintgoDaoGetReissuances
responses:
'200':
description: A successful response.
schema:
type: object
properties:
reissuance:
type: object
properties:
proposer:
type: string
rawtx:
type: string
txId:
type: string
blockHeight:
type: string
format: uint64
pagination:
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
PageResponse is to be embedded in gRPC response messages where
the
corresponding request message has used PageRequest.
message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key
should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include
a count of the total number of items available for pagination in
UIs.
count_total is only respected when offset is used. It is ignored
when key
is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.
Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
tags:
- Query
/planetmint/planetmint-go/dao/mint_requests_by_address/{address}:
get:
summary: Queries a list of MintRequestsByAddress items.
@ -75899,6 +76026,47 @@ definitions:
blockHeight:
type: string
format: uint64
planetmintgo.dao.QueryGetReissuancesResponse:
type: object
properties:
reissuance:
type: object
properties:
proposer:
type: string
rawtx:
type: string
txId:
type: string
blockHeight:
type: string
format: uint64
pagination:
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: |-
PageResponse is to be embedded in gRPC response messages where the
corresponding request message has used PageRequest.
message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
planetmintgo.dao.QueryMintRequestsByAddressResponse:
type: object
properties:

View File

@ -38,6 +38,12 @@ service Query {
option (google.api.http).get = "/planetmint/planetmint-go/dao/get_reissuance/{blockHeight}";
}
// Queries a list of GetReissuances items.
rpc GetReissuances (QueryGetReissuancesRequest) returns (QueryGetReissuancesResponse) {
option (google.api.http).get = "/planetmint/planetmint-go/dao/get_reissuances";
}
}
// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}
@ -73,3 +79,12 @@ message QueryGetReissuanceResponse {
Reissuance reissuance = 1;
}
message QueryGetReissuancesRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
message QueryGetReissuancesResponse {
Reissuance reissuance = 1;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

View File

@ -28,6 +28,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
cmd.AddCommand(CmdGetReissuance())
cmd.AddCommand(CmdGetReissuances())
// this line is used by starport scaffolding # 1
return cmd

View File

@ -0,0 +1,48 @@
package cli
import (
"strconv"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/planetmint/planetmint-go/x/dao/types"
"github.com/spf13/cobra"
)
var _ = strconv.Itoa(0)
func CmdGetReissuances() *cobra.Command {
cmd := &cobra.Command{
Use: "get-reissuances",
Short: "Query get_reissuances",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
params := &types.QueryGetReissuancesRequest{}
pageReq, err := client.ReadPageRequest(cmd.Flags())
if err != nil {
return err
}
params.Pagination = pageReq
res, err := queryClient.GetReissuances(cmd.Context(), params)
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}

View File

@ -0,0 +1,23 @@
package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/planetmint/planetmint-go/x/dao/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func (k Keeper) GetReissuances(goCtx context.Context, req *types.QueryGetReissuancesRequest) (*types.QueryGetReissuancesResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "invalid request")
}
ctx := sdk.UnwrapSDKContext(goCtx)
// TODO: Process the query
_ = ctx
return &types.QueryGetReissuancesResponse{}, nil
}

View File

@ -6,7 +6,7 @@ package types
import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types/query"
query "github.com/cosmos/cosmos-sdk/types/query"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
@ -377,6 +377,102 @@ func (m *QueryGetReissuanceResponse) GetReissuance() *Reissuance {
return nil
}
type QueryGetReissuancesRequest struct {
Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
func (m *QueryGetReissuancesRequest) Reset() { *m = QueryGetReissuancesRequest{} }
func (m *QueryGetReissuancesRequest) String() string { return proto.CompactTextString(m) }
func (*QueryGetReissuancesRequest) ProtoMessage() {}
func (*QueryGetReissuancesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_07bad0eeb5b27724, []int{8}
}
func (m *QueryGetReissuancesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetReissuancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetReissuancesRequest.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 *QueryGetReissuancesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetReissuancesRequest.Merge(m, src)
}
func (m *QueryGetReissuancesRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryGetReissuancesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetReissuancesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetReissuancesRequest proto.InternalMessageInfo
func (m *QueryGetReissuancesRequest) GetPagination() *query.PageRequest {
if m != nil {
return m.Pagination
}
return nil
}
type QueryGetReissuancesResponse struct {
Reissuance *Reissuance `protobuf:"bytes,1,opt,name=reissuance,proto3" json:"reissuance,omitempty"`
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
func (m *QueryGetReissuancesResponse) Reset() { *m = QueryGetReissuancesResponse{} }
func (m *QueryGetReissuancesResponse) String() string { return proto.CompactTextString(m) }
func (*QueryGetReissuancesResponse) ProtoMessage() {}
func (*QueryGetReissuancesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_07bad0eeb5b27724, []int{9}
}
func (m *QueryGetReissuancesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryGetReissuancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryGetReissuancesResponse.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 *QueryGetReissuancesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryGetReissuancesResponse.Merge(m, src)
}
func (m *QueryGetReissuancesResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryGetReissuancesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryGetReissuancesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryGetReissuancesResponse proto.InternalMessageInfo
func (m *QueryGetReissuancesResponse) GetReissuance() *Reissuance {
if m != nil {
return m.Reissuance
}
return nil
}
func (m *QueryGetReissuancesResponse) GetPagination() *query.PageResponse {
if m != nil {
return m.Pagination
}
return nil
}
func init() {
proto.RegisterType((*QueryParamsRequest)(nil), "planetmintgo.dao.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "planetmintgo.dao.QueryParamsResponse")
@ -386,50 +482,58 @@ func init() {
proto.RegisterType((*QueryMintRequestsByAddressResponse)(nil), "planetmintgo.dao.QueryMintRequestsByAddressResponse")
proto.RegisterType((*QueryGetReissuanceRequest)(nil), "planetmintgo.dao.QueryGetReissuanceRequest")
proto.RegisterType((*QueryGetReissuanceResponse)(nil), "planetmintgo.dao.QueryGetReissuanceResponse")
proto.RegisterType((*QueryGetReissuancesRequest)(nil), "planetmintgo.dao.QueryGetReissuancesRequest")
proto.RegisterType((*QueryGetReissuancesResponse)(nil), "planetmintgo.dao.QueryGetReissuancesResponse")
}
func init() { proto.RegisterFile("planetmintgo/dao/query.proto", fileDescriptor_07bad0eeb5b27724) }
var fileDescriptor_07bad0eeb5b27724 = []byte{
// 604 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xd3, 0x30,
0x18, 0xc6, 0x1b, 0xd4, 0x15, 0xe1, 0x82, 0x84, 0xcc, 0x26, 0x95, 0xa8, 0x0b, 0x9b, 0x19, 0x12,
0x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xee, 0x56, 0xe4, 0x5f, 0xf0, 0xce, 0xdf, 0x00,
0x00, 0x00, 0xff, 0xff, 0x15, 0x5b, 0x7d, 0x7f, 0xa1, 0x06, 0x00, 0x00,
// 689 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x4f, 0xd4, 0x40,
0x14, 0xc7, 0xb7, 0x04, 0x21, 0x3e, 0xd4, 0x98, 0x11, 0x12, 0x5c, 0xa1, 0xc2, 0x88, 0x3f, 0xa2,
0xd2, 0x09, 0xa0, 0x92, 0x18, 0x50, 0xdc, 0x03, 0xe0, 0x81, 0x04, 0x7b, 0xe4, 0xb2, 0x99, 0xdd,
0x9d, 0x74, 0x1b, 0xd9, 0x4e, 0xe9, 0xcc, 0x1a, 0x37, 0x84, 0x8b, 0x67, 0x63, 0x4c, 0xfc, 0x17,
0x38, 0xfb, 0x77, 0x10, 0xe3, 0x81, 0xc4, 0x8b, 0x27, 0x63, 0xc0, 0x3f, 0xc4, 0x74, 0x66, 0xca,
0xb6, 0x76, 0xb7, 0x2c, 0x89, 0x97, 0xcd, 0x74, 0xe6, 0x7d, 0xdf, 0xfb, 0xbc, 0xd7, 0x7e, 0x67,
0x61, 0x2a, 0xdc, 0xa5, 0x01, 0x93, 0x2d, 0x3f, 0x90, 0x1e, 0x27, 0x0d, 0xca, 0xc9, 0x5e, 0x9b,
0x45, 0x1d, 0x27, 0x8c, 0xb8, 0xe4, 0xe8, 0x7a, 0xfa, 0xd4, 0x69, 0x50, 0x5e, 0x1e, 0xf7, 0xb8,
0xc7, 0xd5, 0x21, 0x89, 0x57, 0x3a, 0xae, 0x3c, 0xe5, 0x71, 0xee, 0xed, 0x32, 0x42, 0x43, 0x9f,
0xd0, 0x20, 0xe0, 0x92, 0x4a, 0x9f, 0x07, 0xc2, 0x9c, 0x3e, 0xac, 0x73, 0xd1, 0xe2, 0x82, 0xd4,
0xa8, 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 0x99, 0x7b, 0xad, 0x5a, 0xeb, 0x54, 0xe3, 0x8b, 0x81, 0xec, 0xc7, 0xbf, 0x07, 0xe8,
0xbb, 0x05, 0x13, 0x3d, 0x5d, 0xd7, 0xb7, 0x99, 0x22, 0x8b, 0xf7, 0x6d, 0xa6, 0xd0, 0xd8, 0x78,
0x53, 0x35, 0x53, 0x41, 0x6b, 0xc5, 0xcd, 0xe4, 0x1a, 0x31, 0xd7, 0x07, 0xd9, 0x37, 0x8b, 0x03,
0xf4, 0xd5, 0x82, 0xab, 0x99, 0x0f, 0x1b, 0x3d, 0xea, 0x3f, 0xde, 0xdc, 0x05, 0x50, 0x7e, 0x3c,
0x58, 0xb0, 0xc1, 0xae, 0x28, 0xec, 0x15, 0xf4, 0xfc, 0xfc, 0x77, 0xd0, 0xb5, 0x08, 0xd9, 0x4f,
0xdd, 0x27, 0x07, 0xe8, 0xd0, 0x82, 0x6b, 0x59, 0x27, 0xa2, 0x81, 0x20, 0xce, 0x26, 0x3e, 0x3f,
0x60, 0xb4, 0x61, 0x7e, 0xaa, 0x98, 0x09, 0x9a, 0xbf, 0x08, 0xb3, 0xa8, 0xbc, 0x3e, 0x3a, 0xb1,
0xad, 0xe3, 0x13, 0xdb, 0xfa, 0x7d, 0x62, 0x5b, 0x9f, 0x4f, 0xed, 0xd2, 0xf1, 0xa9, 0x5d, 0xfa,
0x79, 0x6a, 0x97, 0x76, 0x06, 0x72, 0xcf, 0x7b, 0x95, 0x54, 0x76, 0x42, 0x26, 0x6a, 0x23, 0xea,
0x6f, 0x73, 0xe9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x73, 0x5c, 0x1c, 0x55, 0x08, 0x00,
0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -452,6 +556,8 @@ type QueryClient interface {
MintRequestsByAddress(ctx context.Context, in *QueryMintRequestsByAddressRequest, opts ...grpc.CallOption) (*QueryMintRequestsByAddressResponse, error)
// Queries a list of GetReissuance items.
GetReissuance(ctx context.Context, in *QueryGetReissuanceRequest, opts ...grpc.CallOption) (*QueryGetReissuanceResponse, error)
// Queries a list of GetReissuances items.
GetReissuances(ctx context.Context, in *QueryGetReissuancesRequest, opts ...grpc.CallOption) (*QueryGetReissuancesResponse, error)
}
type queryClient struct {
@ -498,6 +604,15 @@ func (c *queryClient) GetReissuance(ctx context.Context, in *QueryGetReissuanceR
return out, nil
}
func (c *queryClient) GetReissuances(ctx context.Context, in *QueryGetReissuancesRequest, opts ...grpc.CallOption) (*QueryGetReissuancesResponse, error) {
out := new(QueryGetReissuancesResponse)
err := c.cc.Invoke(ctx, "/planetmintgo.dao.Query/GetReissuances", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
type QueryServer interface {
// Parameters queries the parameters of the module.
@ -508,6 +623,8 @@ type QueryServer interface {
MintRequestsByAddress(context.Context, *QueryMintRequestsByAddressRequest) (*QueryMintRequestsByAddressResponse, error)
// Queries a list of GetReissuance items.
GetReissuance(context.Context, *QueryGetReissuanceRequest) (*QueryGetReissuanceResponse, error)
// Queries a list of GetReissuances items.
GetReissuances(context.Context, *QueryGetReissuancesRequest) (*QueryGetReissuancesResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@ -526,6 +643,9 @@ func (*UnimplementedQueryServer) MintRequestsByAddress(ctx context.Context, req
func (*UnimplementedQueryServer) GetReissuance(ctx context.Context, req *QueryGetReissuanceRequest) (*QueryGetReissuanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReissuance not implemented")
}
func (*UnimplementedQueryServer) GetReissuances(ctx context.Context, req *QueryGetReissuancesRequest) (*QueryGetReissuancesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReissuances not implemented")
}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
@ -603,6 +723,24 @@ func _Query_GetReissuance_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Query_GetReissuances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryGetReissuancesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).GetReissuances(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/planetmintgo.dao.Query/GetReissuances",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).GetReissuances(ctx, req.(*QueryGetReissuancesRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "planetmintgo.dao.Query",
HandlerType: (*QueryServer)(nil),
@ -623,6 +761,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "GetReissuance",
Handler: _Query_GetReissuance_Handler,
},
{
MethodName: "GetReissuances",
Handler: _Query_GetReissuances_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "planetmintgo/dao/query.proto",
@ -877,6 +1019,88 @@ func (m *QueryGetReissuanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, err
return len(dAtA) - i, nil
}
func (m *QueryGetReissuancesRequest) 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 *QueryGetReissuancesRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetReissuancesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Pagination != nil {
{
size, err := m.Pagination.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 (m *QueryGetReissuancesResponse) 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 *QueryGetReissuancesResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryGetReissuancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Pagination != nil {
{
size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintQuery(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
if m.Reissuance != nil {
{
size, err := m.Reissuance.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 {
offset -= sovQuery(v)
base := offset
@ -985,6 +1209,36 @@ func (m *QueryGetReissuanceResponse) Size() (n int) {
return n
}
func (m *QueryGetReissuancesRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Pagination != nil {
l = m.Pagination.Size()
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func (m *QueryGetReissuancesResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Reissuance != nil {
l = m.Reissuance.Size()
n += 1 + l + sovQuery(uint64(l))
}
if m.Pagination != nil {
l = m.Pagination.Size()
n += 1 + l + sovQuery(uint64(l))
}
return n
}
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@ -1615,6 +1869,214 @@ func (m *QueryGetReissuanceResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *QueryGetReissuancesRequest) 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: QueryGetReissuancesRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetReissuancesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil {
m.Pagination = &query.PageRequest{}
}
if err := m.Pagination.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) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthQuery
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *QueryGetReissuancesResponse) 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: QueryGetReissuancesResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryGetReissuancesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Reissuance", 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 m.Reissuance == nil {
m.Reissuance = &Reissuance{}
}
if err := m.Reissuance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil {
m.Pagination = &query.PageResponse{}
}
if err := m.Pagination.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) || (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) {
l := len(dAtA)
iNdEx := 0

View File

@ -213,6 +213,42 @@ func local_request_Query_GetReissuance_0(ctx context.Context, marshaler runtime.
}
var (
filter_Query_GetReissuances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_Query_GetReissuances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetReissuancesRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetReissuances_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetReissuances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_GetReissuances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryGetReissuancesRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetReissuances_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetReissuances(ctx, &protoReq)
return msg, metadata, err
}
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@ -311,6 +347,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
mux.Handle("GET", pattern_Query_GetReissuances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
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_GetReissuances_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_GetReissuances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@ -432,6 +491,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
mux.Handle("GET", pattern_Query_GetReissuances_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_GetReissuances_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_GetReissuances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@ -443,6 +522,8 @@ var (
pattern_Query_MintRequestsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"planetmint", "planetmint-go", "dao", "mint_requests_by_address", "address"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_GetReissuance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"planetmint", "planetmint-go", "dao", "get_reissuance", "blockHeight"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_GetReissuances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"planetmint", "planetmint-go", "dao", "get_reissuances"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
@ -453,4 +534,6 @@ var (
forward_Query_MintRequestsByAddress_0 = runtime.ForwardResponseMessage
forward_Query_GetReissuance_0 = runtime.ForwardResponseMessage
forward_Query_GetReissuances_0 = runtime.ForwardResponseMessage
)