mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-11 18:29:51 +00:00
* adjusted to an array of distributions
* added test cases Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
2a7e82bcbe
commit
074b10948a
@ -188,7 +188,7 @@ message QueryDistributionsRequest {
|
||||
}
|
||||
|
||||
message QueryDistributionsResponse {
|
||||
DistributionOrder distributions = 1;
|
||||
repeated DistributionOrder distributions = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,10 @@ package keeper
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
"github.com/planetmint/planetmint-go/errormsg"
|
||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@ -11,13 +14,22 @@ import (
|
||||
|
||||
func (k Keeper) Distributions(goCtx context.Context, req *types.QueryDistributionsRequest) (*types.QueryDistributionsResponse, error) {
|
||||
if req == nil {
|
||||
return nil, status.Error(codes.InvalidArgument, "invalid request")
|
||||
return nil, status.Error(codes.InvalidArgument, errormsg.InvalidRequest)
|
||||
}
|
||||
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
// TODO: Process the query
|
||||
_ = ctx
|
||||
distributions := make([]types.DistributionOrder, 0)
|
||||
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DistributionKey))
|
||||
pageRes, err := query.Paginate(store, req.Pagination, func(_ []byte, value []byte) (err error) {
|
||||
var distribution types.DistributionOrder
|
||||
err = distribution.Unmarshal(value)
|
||||
distributions = append(distributions, distribution)
|
||||
return
|
||||
})
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err)
|
||||
}
|
||||
|
||||
return &types.QueryDistributionsResponse{}, nil
|
||||
return &types.QueryDistributionsResponse{Distributions: distributions, Pagination: pageRes}, nil
|
||||
}
|
||||
|
87
x/dao/keeper/query_distributions_test.go
Normal file
87
x/dao/keeper/query_distributions_test.go
Normal file
@ -0,0 +1,87 @@
|
||||
package keeper_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/query"
|
||||
keepertest "github.com/planetmint/planetmint-go/testutil/keeper"
|
||||
"github.com/planetmint/planetmint-go/util"
|
||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestQueryDistribtions(t *testing.T) {
|
||||
keeper, ctx := keepertest.DaoKeeper(t)
|
||||
wctx := sdk.WrapSDKContext(ctx)
|
||||
//var popEpochs int64 = 24
|
||||
distributions := createNDistributionOrder(keeper, ctx, 20)
|
||||
for _, tc := range []struct {
|
||||
desc string
|
||||
request *types.QueryDistributionsRequest
|
||||
responseDistributions []types.DistributionOrder
|
||||
err error
|
||||
}{
|
||||
{
|
||||
desc: "query 0 offset 10 limit",
|
||||
request: &types.QueryDistributionsRequest{
|
||||
Pagination: &query.PageRequest{
|
||||
Key: nil,
|
||||
Offset: 0,
|
||||
Limit: 10,
|
||||
CountTotal: true,
|
||||
Reverse: false,
|
||||
},
|
||||
},
|
||||
responseDistributions: distributions[:10],
|
||||
},
|
||||
{
|
||||
desc: "query 1 offset 5 limit",
|
||||
request: &types.QueryDistributionsRequest{
|
||||
Pagination: &query.PageRequest{
|
||||
Key: nil,
|
||||
Offset: 1,
|
||||
Limit: 5,
|
||||
CountTotal: true,
|
||||
Reverse: false,
|
||||
},
|
||||
},
|
||||
responseDistributions: distributions[1:6],
|
||||
},
|
||||
{
|
||||
desc: "query 5*1000 key 0 offset 10 limit",
|
||||
request: &types.QueryDistributionsRequest{
|
||||
Pagination: &query.PageRequest{
|
||||
Key: util.SerializeInt64(5 * 1000),
|
||||
Offset: 0,
|
||||
Limit: 10,
|
||||
CountTotal: true,
|
||||
Reverse: false,
|
||||
},
|
||||
},
|
||||
responseDistributions: distributions[4:14],
|
||||
},
|
||||
{
|
||||
desc: "query 2*1000 key 0 offset 10 limit",
|
||||
request: &types.QueryDistributionsRequest{
|
||||
Pagination: &query.PageRequest{
|
||||
Key: util.SerializeInt64(2 * 1000),
|
||||
Offset: 0,
|
||||
Limit: 10,
|
||||
CountTotal: true,
|
||||
Reverse: false,
|
||||
},
|
||||
},
|
||||
responseDistributions: distributions[1:11],
|
||||
},
|
||||
} {
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
res, err := keeper.Distributions(wctx, tc.request)
|
||||
if tc.err != nil {
|
||||
require.ErrorIs(t, tc.err, err)
|
||||
} else {
|
||||
require.Equal(t, tc.responseDistributions, res.Distributions)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1073,7 +1073,7 @@ func (m *QueryDistributionsRequest) GetPagination() *query.PageRequest {
|
||||
}
|
||||
|
||||
type QueryDistributionsResponse struct {
|
||||
Distributions *DistributionOrder `protobuf:"bytes,1,opt,name=distributions,proto3" json:"distributions,omitempty"`
|
||||
Distributions []DistributionOrder `protobuf:"bytes,1,rep,name=distributions,proto3" json:"distributions"`
|
||||
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||
}
|
||||
|
||||
@ -1110,7 +1110,7 @@ func (m *QueryDistributionsResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_QueryDistributionsResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *QueryDistributionsResponse) GetDistributions() *DistributionOrder {
|
||||
func (m *QueryDistributionsResponse) GetDistributions() []DistributionOrder {
|
||||
if m != nil {
|
||||
return m.Distributions
|
||||
}
|
||||
@ -1154,86 +1154,86 @@ func init() {
|
||||
func init() { proto.RegisterFile("planetmintgo/dao/query.proto", fileDescriptor_07bad0eeb5b27724) }
|
||||
|
||||
var fileDescriptor_07bad0eeb5b27724 = []byte{
|
||||
// 1255 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0xcf, 0x6f, 0xdc, 0x44,
|
||||
0x14, 0xc7, 0xe3, 0xb4, 0x04, 0xe5, 0x25, 0x69, 0x61, 0x68, 0x43, 0xea, 0x6c, 0x96, 0x74, 0x92,
|
||||
0xb4, 0xc9, 0x86, 0xac, 0x49, 0x02, 0x04, 0x24, 0xa2, 0x2a, 0x29, 0x6d, 0x5a, 0x41, 0xa1, 0xac,
|
||||
0x10, 0x87, 0x5e, 0x16, 0xef, 0x7a, 0xf0, 0x5a, 0x78, 0xed, 0x8d, 0xed, 0x45, 0x59, 0xad, 0xf6,
|
||||
0x82, 0xc4, 0x81, 0x1b, 0x52, 0xc5, 0x0d, 0x89, 0x03, 0x17, 0x84, 0x04, 0xea, 0x85, 0x13, 0xff,
|
||||
0x40, 0x8f, 0x95, 0x10, 0x12, 0x27, 0x84, 0x12, 0x24, 0xfe, 0x0d, 0xe4, 0xf1, 0xf3, 0x7a, 0xbc,
|
||||
0xfe, 0xb1, 0x1b, 0xb4, 0x97, 0xc8, 0x1e, 0xbf, 0xf7, 0xe6, 0xf3, 0xde, 0xcc, 0xbc, 0xf9, 0x66,
|
||||
0xa1, 0xd0, 0x32, 0x55, 0x8b, 0x79, 0x4d, 0xc3, 0xf2, 0x74, 0x5b, 0xd1, 0x54, 0x5b, 0x39, 0x6e,
|
||||
0x33, 0xa7, 0x53, 0x6e, 0x39, 0xb6, 0x67, 0x93, 0x17, 0xc4, 0xaf, 0x65, 0x4d, 0xb5, 0xe5, 0x2b,
|
||||
0xba, 0xad, 0xdb, 0xfc, 0xa3, 0xe2, 0x3f, 0x05, 0x76, 0x72, 0x41, 0xb7, 0x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f, 0x12, 0x5c, 0x4d, 0x95, 0x44, 0x64, 0x37, 0x63, 0x82, 0x3c, 0xe5, 0x25, 0xbf,
|
||||
0x7e, 0x3e, 0x27, 0x84, 0xdc, 0xe6, 0x90, 0x9b, 0x64, 0x63, 0x10, 0x32, 0x26, 0x87, 0x15, 0x5f,
|
||||
0xc7, 0x29, 0x5d, 0xff, 0x6f, 0x8f, 0xfc, 0x26, 0xc1, 0xd5, 0x54, 0x91, 0x94, 0xc9, 0x9d, 0xa7,
|
||||
0xc8, 0x32, 0xb9, 0x73, 0x75, 0x18, 0xdd, 0xe3, 0xdc, 0xdb, 0x44, 0xc9, 0xe7, 0x46, 0x71, 0xa7,
|
||||
0x74, 0xf1, 0xa1, 0x47, 0xbe, 0x93, 0x60, 0x2e, 0xa6, 0x9c, 0xc8, 0x66, 0x76, 0xe1, 0x12, 0xf2,
|
||||
0x4c, 0x7e, 0x75, 0x34, 0x63, 0xa4, 0x7c, 0x8d, 0x53, 0x96, 0xc8, 0xfa, 0x20, 0x65, 0x24, 0x54,
|
||||
0x94, 0xae, 0xa0, 0xed, 0x7a, 0xe4, 0x6b, 0x09, 0x66, 0x04, 0x61, 0x44, 0x36, 0x32, 0xe6, 0x4b,
|
||||
0x0a, 0x34, 0xb9, 0x34, 0x8a, 0x29, 0x82, 0xad, 0x70, 0xb0, 0x25, 0xb2, 0x98, 0x0d, 0xe6, 0x92,
|
||||
0xc7, 0x12, 0xcc, 0x8a, 0x02, 0x86, 0x94, 0xb2, 0x93, 0x1f, 0x54, 0x46, 0xf2, 0xe6, 0x48, 0xb6,
|
||||
0x88, 0x53, 0xe2, 0x38, 0xab, 0x84, 0x0e, 0xe2, 0xf4, 0x45, 0x83, 0xd2, 0x6d, 0x60, 0x85, 0xbe,
|
||||
0x92, 0x00, 0x22, 0x6d, 0x42, 0xd6, 0x33, 0xe6, 0x49, 0x28, 0x24, 0x79, 0x63, 0x04, 0x4b, 0xe4,
|
||||
0xa1, 0x9c, 0xa7, 0x40,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x8b, 0xd2, 0x37, 0x67, 0xc5, 0x89, 0x67, 0x67, 0xc5, 0x89, 0x3f, 0xcf, 0x8a, 0x13,
|
||||
0x8f, 0x14, 0xdd, 0xf0, 0x1a, 0xed, 0x5a, 0xb9, 0x6e, 0x37, 0xb3, 0x03, 0x9e, 0xf0, 0x90, 0x5e,
|
||||
0xa7, 0xc5, 0xdc, 0xda, 0x14, 0xff, 0x75, 0x64, 0xf7, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3,
|
||||
0x4c, 0xcf, 0xed, 0xc1, 0x12, 0x00, 0x00,
|
||||
// 1262 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x98, 0x4f, 0x6f, 0xdc, 0xc4,
|
||||
0x1b, 0xc7, 0xe3, 0xb4, 0xbf, 0xfc, 0x94, 0x27, 0x49, 0x0b, 0x43, 0x1b, 0x52, 0x67, 0xb3, 0xa4,
|
||||
0x93, 0xa4, 0x4d, 0x36, 0x64, 0x4d, 0x12, 0x20, 0x20, 0x11, 0x55, 0x49, 0x69, 0xd3, 0x0a, 0x0a,
|
||||
0x65, 0x55, 0x71, 0xe8, 0x65, 0xf1, 0xae, 0x07, 0xaf, 0x85, 0xd7, 0xde, 0xd8, 0x5e, 0x94, 0xd5,
|
||||
0x6a, 0x2f, 0x48, 0x1c, 0xb8, 0x21, 0x55, 0xdc, 0x90, 0x38, 0x70, 0x41, 0x48, 0x20, 0x2e, 0x9c,
|
||||
0xfa, 0x06, 0x7a, 0xac, 0x84, 0x90, 0x38, 0x21, 0x94, 0x20, 0xf1, 0x36, 0x90, 0xc7, 0x8f, 0xd7,
|
||||
0xe3, 0xf5, 0x9f, 0xdd, 0xa0, 0xbd, 0x44, 0xf6, 0xcc, 0xf3, 0x3c, 0xf3, 0x79, 0x9e, 0x99, 0x79,
|
||||
0xfc, 0xcd, 0x42, 0xa1, 0x65, 0xaa, 0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f9, 0x35, 0x7b, 0xc8, 0xeb, 0x50, 0x09, 0x92, 0xa0, 0x0f, 0xe0, 0xa5, 0xd8,
|
||||
0xa8, 0xdb, 0xb2, 0x2d, 0x97, 0x91, 0x37, 0x61, 0x2a, 0xa8, 0xd7, 0x82, 0xb4, 0x2c, 0xad, 0xcf,
|
||||
0xec, 0x2c, 0x94, 0x07, 0x77, 0xb0, 0x1c, 0x78, 0x1c, 0x5e, 0x7c, 0xf6, 0xe7, 0x2b, 0x13, 0x15,
|
||||
0xb4, 0xa6, 0x7b, 0x70, 0x9d, 0x87, 0x3b, 0x62, 0xde, 0x03, 0xc3, 0xf2, 0x70, 0x15, 0xf7, 0xb0,
|
||||
0x73, 0x4f, 0x75, 0x1b, 0xf8, 0x46, 0x08, 0x5c, 0x6c, 0xa8, 0x6e, 0x83, 0x87, 0x9e, 0xae, 0xf0,
|
||||
0x67, 0xca, 0x80, 0xe6, 0x39, 0x22, 0xd6, 0x2d, 0x98, 0x69, 0x46, 0xb3, 0xc8, 0xb6, 0x94, 0x64,
|
||||
0x13, 0x42, 0x54, 0x44, 0x0f, 0xba, 0x8f, 0x7c, 0xf1, 0x35, 0x0e, 0x34, 0xcd, 0x61, 0x6e, 0x58,
|
||||
0x13, 0xb2, 0x00, 0xff, 0x57, 0x83, 0x11, 0x44, 0x0c, 0x5f, 0x69, 0x03, 0x29, 0x33, 0xdc, 0x91,
|
||||
0xf2, 0x10, 0x66, 0x85, 0x35, 0xc3, 0x12, 0x16, 0x73, 0x31, 0xdd, 0x4a, 0xcc, 0x87, 0xee, 0xc3,
|
||||
0xb5, 0xb0, 0x1e, 0x95, 0xfe, 0x71, 0x0a, 0x01, 0x97, 0x61, 0xa6, 0x66, 0xda, 0xf5, 0xcf, 0xee,
|
||||
0x31, 0x43, 0x6f, 0x04, 0x65, 0xb8, 0x50, 0x11, 0x87, 0xe8, 0x63, 0x90, 0xd3, 0xdc, 0x11, 0xf0,
|
||||
0x1d, 0x80, 0xe8, 0x8c, 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, 0x6d,
|
||||
0xed, 0xce, 0x37, 0x97, 0xe1, 0x7f, 0x9c, 0x9e, 0xb4, 0x61, 0x2a, 0xd0, 0x3e, 0x64, 0x35, 0xc9,
|
||||
0x96, 0x94, 0x58, 0xf2, 0xda, 0x10, 0xab, 0x60, 0x31, 0x5a, 0xfc, 0xe2, 0xb7, 0xbf, 0x9f, 0x4c,
|
||||
0x2e, 0x90, 0x79, 0x25, 0x32, 0x17, 0x84, 0x2b, 0xf9, 0x55, 0x82, 0xab, 0xa9, 0xea, 0x88, 0xec,
|
||||
0x66, 0x2c, 0x90, 0x27, 0xc2, 0xe4, 0xd7, 0xcf, 0xe7, 0x84, 0x90, 0xdb, 0x1c, 0x72, 0x93, 0x6c,
|
||||
0x0c, 0x42, 0xc6, 0x94, 0xb1, 0xe2, 0x4b, 0x3a, 0xa5, 0xeb, 0xff, 0xed, 0x91, 0xa7, 0x12, 0x5c,
|
||||
0x4d, 0xd5, 0x4b, 0x99, 0xdc, 0x79, 0xe2, 0x2c, 0x93, 0x3b, 0x57, 0x92, 0xd1, 0x3d, 0xce, 0xbd,
|
||||
0x4d, 0x94, 0x7c, 0x6e, 0xd4, 0x79, 0x4a, 0x17, 0x1f, 0x7a, 0xe4, 0x5b, 0x09, 0xe6, 0x62, 0x22,
|
||||
0x8a, 0x6c, 0x66, 0x17, 0x2e, 0xa1, 0xd4, 0xe4, 0x57, 0x47, 0x33, 0x46, 0xca, 0xd7, 0x38, 0x65,
|
||||
0x89, 0xac, 0x0f, 0x52, 0x46, 0x9a, 0x45, 0xe9, 0x0a, 0x32, 0xaf, 0x47, 0xbe, 0x92, 0x60, 0x46,
|
||||
0xd0, 0x48, 0x64, 0x23, 0x63, 0xbd, 0xa4, 0x56, 0x93, 0x4b, 0xa3, 0x98, 0x22, 0xd8, 0x0a, 0x07,
|
||||
0x5b, 0x22, 0x8b, 0xd9, 0x60, 0x2e, 0x79, 0x22, 0xc1, 0xac, 0xa8, 0x65, 0x48, 0x29, 0x3b, 0xf9,
|
||||
0x41, 0x91, 0x24, 0x6f, 0x8e, 0x64, 0x8b, 0x38, 0x25, 0x8e, 0xb3, 0x4a, 0xe8, 0x20, 0x4e, 0x5f,
|
||||
0x3f, 0x28, 0xdd, 0x06, 0x56, 0xe8, 0x4b, 0x09, 0x20, 0x92, 0x29, 0x64, 0x3d, 0x63, 0x9d, 0x84,
|
||||
0x58, 0x92, 0x37, 0x46, 0xb0, 0x44, 0x1e, 0xca, 0x79, 0x0a, 0x44, 0xce, 0xe4, 0x71, 0xc9, 0x77,
|
||||
0x12, 0x5c, 0x1e, 0xd0, 0x12, 0x64, 0x2b, 0x3b, 0xe9, 0x14, 0xa9, 0x22, 0x97, 0x47, 0x35, 0x47,
|
||||
0xac, 0x2d, 0x8e, 0x75, 0x93, 0xac, 0x0d, 0x62, 0x89, 0x2d, 0x32, 0xaa, 0xd4, 0xf7, 0xfc, 0x2c,
|
||||
0x45, 0x5f, 0xc5, 0xdc, 0xb3, 0x3b, 0xf8, 0xc9, 0x97, 0xb7, 0x46, 0xb4, 0x1e, 0x76, 0x21, 0xc5,
|
||||
0xff, 0x5c, 0x95, 0xae, 0x20, 0x74, 0x7a, 0x4a, 0xd7, 0xd0, 0x7a, 0xfe, 0x29, 0xbb, 0x24, 0x04,
|
||||
0x3c, 0x30, 0xcd, 0x4c, 0xd0, 0x54, 0x6d, 0x92, 0x09, 0x9a, 0x2e, 0x31, 0xe8, 0x2a, 0x07, 0x2d,
|
||||
0x92, 0x42, 0x1e, 0x28, 0xf9, 0x5d, 0x82, 0x6b, 0x99, 0xdf, 0x69, 0xb2, 0x97, 0x79, 0xd5, 0xf2,
|
||||
0x65, 0x82, 0xfc, 0xd6, 0xf9, 0x1d, 0x11, 0xfb, 0x0e, 0xc7, 0xbe, 0x45, 0xf6, 0xf3, 0xb0, 0xab,
|
||||
0xb5, 0x4e, 0x35, 0x90, 0x1c, 0x55, 0xef, 0xa4, 0x1a, 0x34, 0x6d, 0x51, 0x82, 0xf4, 0xfc, 0x53,
|
||||
0x3b, 0x17, 0xfb, 0x5c, 0x67, 0xb6, 0xbf, 0x34, 0xe9, 0x90, 0xd9, 0xfe, 0x52, 0x15, 0x00, 0xdd,
|
||||
0xe5, 0xcc, 0x5b, 0x64, 0x53, 0x64, 0x8e, 0x1e, 0xb7, 0x52, 0x7e, 0x06, 0x71, 0x0f, 0xef, 0x3f,
|
||||
0x3b, 0x2d, 0x4a, 0xcf, 0x4f, 0x8b, 0xd2, 0x5f, 0xa7, 0x45, 0xe9, 0xeb, 0xb3, 0xe2, 0xc4, 0xf3,
|
||||
0xb3, 0xe2, 0xc4, 0x1f, 0x67, 0xc5, 0x89, 0xc7, 0x8a, 0x6e, 0x78, 0x8d, 0x76, 0xad, 0x5c, 0xb7,
|
||||
0x9b, 0xd9, 0x01, 0x4f, 0x78, 0x48, 0xaf, 0xd3, 0x62, 0x6e, 0x6d, 0x8a, 0xff, 0x50, 0xb2, 0xfb,
|
||||
0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x0e, 0x23, 0x9b, 0xcc, 0x12, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@ -2562,17 +2562,19 @@ func (m *QueryDistributionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Distributions != nil {
|
||||
{
|
||||
size, err := m.Distributions.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
if len(m.Distributions) > 0 {
|
||||
for iNdEx := len(m.Distributions) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Distributions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
@ -2903,9 +2905,11 @@ func (m *QueryDistributionsResponse) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Distributions != nil {
|
||||
l = m.Distributions.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
if len(m.Distributions) > 0 {
|
||||
for _, e := range m.Distributions {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.Pagination != nil {
|
||||
l = m.Pagination.Size()
|
||||
@ -4968,10 +4972,8 @@ func (m *QueryDistributionsResponse) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Distributions == nil {
|
||||
m.Distributions = &DistributionOrder{}
|
||||
}
|
||||
if err := m.Distributions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
m.Distributions = append(m.Distributions, DistributionOrder{})
|
||||
if err := m.Distributions[len(m.Distributions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
Loading…
x
Reference in New Issue
Block a user