From 9f7c920d5c07df5db02845c962edbcbf07c503bd Mon Sep 17 00:00:00 2001 From: christopherbrumm Date: Fri, 31 Jan 2025 16:21:39 +0100 Subject: [PATCH] chore: run linter --- app/upgrades/v2_0/upgrade.go | 1 + x/bundles/keeper/getters_migration.go | 1 + x/bundles/keeper/keeper.go | 4 +- x/bundles/migration/migration.go | 19 +- x/bundles/module.go | 1 + x/delegation/types/query.pb.go | 538 ++++++ x/delegation/types/query.pb.gw.go | 153 ++ x/delegation/types/tx.pb.go | 2292 +++++++++++++++++++++++ x/query/types/delegation.pb.go | 2444 +++++++++++++++++++++++++ x/query/types/delegation.pb.gw.go | 449 +++++ 10 files changed, 5891 insertions(+), 11 deletions(-) create mode 100644 x/delegation/types/query.pb.go create mode 100644 x/delegation/types/query.pb.gw.go create mode 100644 x/delegation/types/tx.pb.go create mode 100644 x/query/types/delegation.pb.go create mode 100644 x/query/types/delegation.pb.gw.go diff --git a/app/upgrades/v2_0/upgrade.go b/app/upgrades/v2_0/upgrade.go index 45674b40..0692e1a7 100644 --- a/app/upgrades/v2_0/upgrade.go +++ b/app/upgrades/v2_0/upgrade.go @@ -3,6 +3,7 @@ package v2_0 import ( "context" "fmt" + bundleskeeper "github.com/KYVENetwork/chain/x/bundles/keeper" "github.com/KYVENetwork/chain/x/stakers/types" diff --git a/x/bundles/keeper/getters_migration.go b/x/bundles/keeper/getters_migration.go index 18f7f86e..255bd0ea 100644 --- a/x/bundles/keeper/getters_migration.go +++ b/x/bundles/keeper/getters_migration.go @@ -3,6 +3,7 @@ package keeper import ( "encoding/binary" "errors" + "github.com/KYVENetwork/chain/x/bundles/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/bundles/keeper/keeper.go b/x/bundles/keeper/keeper.go index f5ffcc7b..20437ad6 100644 --- a/x/bundles/keeper/keeper.go +++ b/x/bundles/keeper/keeper.go @@ -1,11 +1,13 @@ package keeper import ( + "fmt" + "cosmossdk.io/collections" "cosmossdk.io/core/store" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "fmt" + "github.com/KYVENetwork/chain/util" "github.com/KYVENetwork/chain/x/bundles/types" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/bundles/migration/migration.go b/x/bundles/migration/migration.go index 23fafaed..252c9f90 100644 --- a/x/bundles/migration/migration.go +++ b/x/bundles/migration/migration.go @@ -1,27 +1,27 @@ package migration import ( - "cosmossdk.io/log" - "cosmossdk.io/store/prefix" - storeTypes "cosmossdk.io/store/types" "embed" _ "embed" "encoding/hex" "fmt" + "strconv" + "strings" + + "cosmossdk.io/log" + "cosmossdk.io/store/prefix" "github.com/KYVENetwork/chain/util" bundleskeeper "github.com/KYVENetwork/chain/x/bundles/keeper" "github.com/KYVENetwork/chain/x/bundles/types" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "strconv" - "strings" ) var logger log.Logger const ( BundlesMigrationStepSizePerPool uint64 = 100 - WaitingBlockPeriod = 1 + WaitingBlockPeriod int64 = 1 ) //go:embed files/* @@ -71,8 +71,8 @@ func MigrateBundlesModule(sdkCtx sdk.Context, bundlesKeeper bundleskeeper.Keeper } for _, bundlesMigrationEntry := range bundlesMigration { - step := uint64(sdkCtx.BlockHeight()-upgradeHeight) - WaitingBlockPeriod - offset := step * BundlesMigrationStepSizePerPool + step := sdkCtx.BlockHeight() - upgradeHeight - WaitingBlockPeriod + offset := uint64(step) * BundlesMigrationStepSizePerPool // Skip if all bundles have already been migrated if offset > bundlesMigrationEntry.maxBundleId+BundlesMigrationStepSizePerPool { @@ -91,8 +91,7 @@ func migrateFinalizedBundles(ctx sdk.Context, bundlesKeeper bundleskeeper.Keeper storeAdapter := runtime.KVStoreAdapter(bundlesKeeper.Migration_GetStoreService().OpenKVStore(ctx)) store := prefix.NewStore(storeAdapter, util.GetByteKey(types.FinalizedBundlePrefix, bundlesMigrationEntry.poolId)) - var iterator storeTypes.Iterator - iterator = store.Iterator(util.GetByteKey(offset), util.GetByteKey(offset+BundlesMigrationStepSizePerPool)) + iterator := store.Iterator(util.GetByteKey(offset), util.GetByteKey(offset+BundlesMigrationStepSizePerPool)) var migratedBundles []types.FinalizedBundle diff --git a/x/bundles/module.go b/x/bundles/module.go index 2d01ecc9..b6f15bce 100644 --- a/x/bundles/module.go +++ b/x/bundles/module.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/KYVENetwork/chain/x/bundles/migration" "cosmossdk.io/core/appmodule" diff --git a/x/delegation/types/query.pb.go b/x/delegation/types/query.pb.go new file mode 100644 index 00000000..f7f53b58 --- /dev/null +++ b/x/delegation/types/query.pb.go @@ -0,0 +1,538 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/delegation/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +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_9afd23b59df61182, []int{0} +} +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 is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + 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_9afd23b59df61182, []int{1} +} +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() { + proto.RegisterType((*QueryParamsRequest)(nil), "kyve.delegation.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "kyve.delegation.v1beta1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("kyve/delegation/v1beta1/query.proto", fileDescriptor_9afd23b59df61182) +} + +var fileDescriptor_9afd23b59df61182 = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xce, 0xae, 0x2c, 0x4b, + 0xd5, 0x4f, 0x49, 0xcd, 0x49, 0x4d, 0x4f, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x07, 0x29, 0xd2, 0x43, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd1, 0x07, 0xb1, 0x20, 0xca, 0xa5, 0x64, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0x13, + 0x0b, 0x32, 0xf5, 0x13, 0xf3, 0xf2, 0xf2, 0x4b, 0xc0, 0x9a, 0x8a, 0xa1, 0xb2, 0x2a, 0xb8, 0x6c, + 0x2c, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0xaa, 0x52, 0x12, 0xe1, 0x12, 0x0a, 0x04, 0xb9, 0x20, 0x00, + 0x2c, 0x18, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0xa2, 0x14, 0xc2, 0x25, 0x8c, 0x22, 0x5a, 0x5c, + 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x64, 0xcb, 0xc5, 0x06, 0xd1, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, + 0x6d, 0x24, 0xaf, 0x87, 0xc3, 0xc1, 0x7a, 0x10, 0x8d, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, + 0x41, 0x35, 0x19, 0x4d, 0x63, 0xe4, 0x62, 0x05, 0x1b, 0x2b, 0xd4, 0xc3, 0xc8, 0xc5, 0x06, 0x51, + 0x22, 0xa4, 0x8d, 0xd3, 0x0c, 0x4c, 0x77, 0x49, 0xe9, 0x10, 0xa7, 0x18, 0xe2, 0x5c, 0x25, 0xf5, + 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x29, 0x0a, 0xc9, 0xeb, 0xe3, 0x0f, 0x0a, 0x27, 0xcf, 0x13, 0x8f, + 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, + 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, + 0x4b, 0xce, 0xcf, 0xd5, 0xf7, 0x8e, 0x0c, 0x73, 0xf5, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, + 0x4f, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0xaf, 0x40, 0x36, 0xb3, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, + 0x0d, 0x1c, 0xac, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x42, 0x41, 0xf5, 0x4d, 0xf0, 0x01, + 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Query/Params", 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. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +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) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/kyve.delegation.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{ + ServiceName: "kyve.delegation.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kyve/delegation/v1beta1/query.proto", +} + +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 { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +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) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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) || (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) || (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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go new file mode 100644 index 00000000..2702a9cd --- /dev/null +++ b/x/delegation/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: kyve/delegation/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +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". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +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) { + 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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + 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 +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kyve", "delegation", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/delegation/types/tx.pb.go b/x/delegation/types/tx.pb.go new file mode 100644 index 00000000..2c7f422e --- /dev/null +++ b/x/delegation/types/tx.pb.go @@ -0,0 +1,2292 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/delegation/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgDelegate ... +type MsgDelegate struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // staker ... + Staker string `protobuf:"bytes,2,opt,name=staker,proto3" json:"staker,omitempty"` + // amount ... + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } +func (m *MsgDelegate) String() string { return proto.CompactTextString(m) } +func (*MsgDelegate) ProtoMessage() {} +func (*MsgDelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{0} +} +func (m *MsgDelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegate.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 *MsgDelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegate.Merge(m, src) +} +func (m *MsgDelegate) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegate proto.InternalMessageInfo + +func (m *MsgDelegate) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgDelegate) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +func (m *MsgDelegate) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +// MsgDelegatePoolResponse defines the Msg/DelegatePool response type. +type MsgDelegateResponse struct { +} + +func (m *MsgDelegateResponse) Reset() { *m = MsgDelegateResponse{} } +func (m *MsgDelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateResponse) ProtoMessage() {} +func (*MsgDelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{1} +} +func (m *MsgDelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegateResponse.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 *MsgDelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateResponse.Merge(m, src) +} +func (m *MsgDelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo + +// MsgWithdrawPool defines a SDK message for withdrawing delegation rewards from a specific pool. +type MsgWithdrawRewards struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // staker ... + Staker string `protobuf:"bytes,2,opt,name=staker,proto3" json:"staker,omitempty"` +} + +func (m *MsgWithdrawRewards) Reset() { *m = MsgWithdrawRewards{} } +func (m *MsgWithdrawRewards) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawRewards) ProtoMessage() {} +func (*MsgWithdrawRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{2} +} +func (m *MsgWithdrawRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawRewards.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 *MsgWithdrawRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawRewards.Merge(m, src) +} +func (m *MsgWithdrawRewards) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawRewards) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawRewards proto.InternalMessageInfo + +func (m *MsgWithdrawRewards) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgWithdrawRewards) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +// MsgWithdrawPoolResponse defines the Msg/WithdrawPool response type. +type MsgWithdrawRewardsResponse struct { +} + +func (m *MsgWithdrawRewardsResponse) Reset() { *m = MsgWithdrawRewardsResponse{} } +func (m *MsgWithdrawRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawRewardsResponse) ProtoMessage() {} +func (*MsgWithdrawRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{3} +} +func (m *MsgWithdrawRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawRewardsResponse.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 *MsgWithdrawRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawRewardsResponse.Merge(m, src) +} +func (m *MsgWithdrawRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawRewardsResponse proto.InternalMessageInfo + +// MsgUndelegatePool defines a SDK message for undelegating from a specific pool. +type MsgUndelegate struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // staker ... + Staker string `protobuf:"bytes,2,opt,name=staker,proto3" json:"staker,omitempty"` + // amount ... + Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } +func (m *MsgUndelegate) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegate) ProtoMessage() {} +func (*MsgUndelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{4} +} +func (m *MsgUndelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegate.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 *MsgUndelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegate.Merge(m, src) +} +func (m *MsgUndelegate) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegate proto.InternalMessageInfo + +func (m *MsgUndelegate) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUndelegate) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +func (m *MsgUndelegate) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +// MsgUndelegatePoolResponse defines the Msg/UndelegatePool response type. +type MsgUndelegateResponse struct { +} + +func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} } +func (m *MsgUndelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateResponse) ProtoMessage() {} +func (*MsgUndelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{5} +} +func (m *MsgUndelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegateResponse.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 *MsgUndelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateResponse.Merge(m, src) +} +func (m *MsgUndelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateResponse proto.InternalMessageInfo + +// MsgRedelegatePool defines a SDK message for redelegating from a +// staker in a pool to another staker in the same or another pool +type MsgRedelegate struct { + // creator ... + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // staker ... + FromStaker string `protobuf:"bytes,2,opt,name=from_staker,json=fromStaker,proto3" json:"from_staker,omitempty"` + // staker ... + ToStaker string `protobuf:"bytes,3,opt,name=to_staker,json=toStaker,proto3" json:"to_staker,omitempty"` + // amount ... + Amount uint64 `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgRedelegate) Reset() { *m = MsgRedelegate{} } +func (m *MsgRedelegate) String() string { return proto.CompactTextString(m) } +func (*MsgRedelegate) ProtoMessage() {} +func (*MsgRedelegate) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{6} +} +func (m *MsgRedelegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRedelegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRedelegate.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 *MsgRedelegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRedelegate.Merge(m, src) +} +func (m *MsgRedelegate) XXX_Size() int { + return m.Size() +} +func (m *MsgRedelegate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRedelegate.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRedelegate proto.InternalMessageInfo + +func (m *MsgRedelegate) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgRedelegate) GetFromStaker() string { + if m != nil { + return m.FromStaker + } + return "" +} + +func (m *MsgRedelegate) GetToStaker() string { + if m != nil { + return m.ToStaker + } + return "" +} + +func (m *MsgRedelegate) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +// MsgUndelegatePoolResponse defines the Msg/UndelegatePool response type. +type MsgRedelegateResponse struct { +} + +func (m *MsgRedelegateResponse) Reset() { *m = MsgRedelegateResponse{} } +func (m *MsgRedelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRedelegateResponse) ProtoMessage() {} +func (*MsgRedelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{7} +} +func (m *MsgRedelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRedelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRedelegateResponse.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 *MsgRedelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRedelegateResponse.Merge(m, src) +} +func (m *MsgRedelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRedelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRedelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRedelegateResponse proto.InternalMessageInfo + +// MsgUpdateParams defines a SDK message for updating the module parameters. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // payload defines the x/delegation parameters to update. + Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{8} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetPayload() string { + if m != nil { + return m.Payload + } + return "" +} + +// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cfef676107453bda, []int{9} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgDelegate)(nil), "kyve.delegation.v1beta1.MsgDelegate") + proto.RegisterType((*MsgDelegateResponse)(nil), "kyve.delegation.v1beta1.MsgDelegateResponse") + proto.RegisterType((*MsgWithdrawRewards)(nil), "kyve.delegation.v1beta1.MsgWithdrawRewards") + proto.RegisterType((*MsgWithdrawRewardsResponse)(nil), "kyve.delegation.v1beta1.MsgWithdrawRewardsResponse") + proto.RegisterType((*MsgUndelegate)(nil), "kyve.delegation.v1beta1.MsgUndelegate") + proto.RegisterType((*MsgUndelegateResponse)(nil), "kyve.delegation.v1beta1.MsgUndelegateResponse") + proto.RegisterType((*MsgRedelegate)(nil), "kyve.delegation.v1beta1.MsgRedelegate") + proto.RegisterType((*MsgRedelegateResponse)(nil), "kyve.delegation.v1beta1.MsgRedelegateResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "kyve.delegation.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "kyve.delegation.v1beta1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("kyve/delegation/v1beta1/tx.proto", fileDescriptor_cfef676107453bda) } + +var fileDescriptor_cfef676107453bda = []byte{ + // 532 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x63, 0x12, 0x4a, 0xf3, 0xb6, 0x50, 0xc9, 0x50, 0x92, 0x1a, 0x64, 0xa2, 0x08, 0xa1, + 0xa8, 0x80, 0x8f, 0x50, 0x89, 0xa1, 0x1b, 0x15, 0x0c, 0x08, 0x05, 0x21, 0x87, 0x3f, 0x82, 0x81, + 0xea, 0x12, 0x1f, 0x17, 0x93, 0xda, 0x67, 0xdd, 0x5d, 0x92, 0x66, 0x43, 0xec, 0x48, 0xac, 0x7c, + 0x8b, 0x0e, 0x7c, 0x08, 0xc6, 0x8a, 0x89, 0x11, 0x25, 0x43, 0xbf, 0x06, 0xf2, 0x7f, 0xc7, 0x15, + 0x26, 0x1d, 0x3a, 0x59, 0xef, 0xbd, 0xcf, 0xbd, 0xcf, 0xef, 0x95, 0x1e, 0x1f, 0x34, 0x86, 0xd3, + 0x31, 0x41, 0x16, 0x39, 0x20, 0x14, 0x4b, 0x9b, 0xb9, 0x68, 0xdc, 0xee, 0x11, 0x89, 0xdb, 0x48, + 0x1e, 0x1a, 0x1e, 0x67, 0x92, 0xa9, 0x35, 0x5f, 0x61, 0xa4, 0x0a, 0x23, 0x52, 0x68, 0xb5, 0x3e, + 0x13, 0x0e, 0x13, 0xc8, 0x11, 0x14, 0x8d, 0xdb, 0xfe, 0x27, 0xbc, 0xa1, 0x6d, 0x85, 0x8d, 0xfd, + 0xa0, 0x42, 0x61, 0x11, 0xb6, 0x9a, 0x04, 0xd6, 0x3a, 0x82, 0x3e, 0x09, 0x87, 0x11, 0xb5, 0x0e, + 0x97, 0xfa, 0x9c, 0x60, 0xc9, 0x78, 0x5d, 0x69, 0x28, 0xad, 0xaa, 0x19, 0x97, 0xea, 0x75, 0x58, + 0x11, 0x12, 0x0f, 0x09, 0xaf, 0x5f, 0x08, 0x1a, 0x51, 0xe5, 0x9f, 0x63, 0x87, 0x8d, 0x5c, 0x59, + 0x2f, 0x37, 0x94, 0x56, 0xc5, 0x8c, 0xaa, 0xdd, 0xf5, 0x2f, 0x27, 0x47, 0xdb, 0xf1, 0xed, 0xe6, + 0x26, 0x5c, 0xcd, 0xd8, 0x98, 0x44, 0x78, 0xcc, 0x15, 0xa4, 0xf9, 0x0a, 0xd4, 0x8e, 0xa0, 0x6f, + 0x6d, 0x39, 0xb0, 0x38, 0x9e, 0x98, 0x64, 0x82, 0xb9, 0x25, 0xce, 0x0e, 0x91, 0x33, 0xbb, 0x09, + 0xda, 0xe9, 0xa9, 0x89, 0x27, 0x85, 0xcb, 0x1d, 0x41, 0x5f, 0xbb, 0xd6, 0x79, 0xef, 0x5c, 0x83, + 0xcd, 0x05, 0xa3, 0x84, 0xe0, 0xab, 0x12, 0x20, 0x98, 0x64, 0x09, 0x84, 0x5b, 0xb0, 0xf6, 0x91, + 0x33, 0x67, 0x7f, 0x81, 0x03, 0xfc, 0xa3, 0x6e, 0xc8, 0x72, 0x03, 0xaa, 0x92, 0xc5, 0xed, 0x72, + 0xd0, 0x5e, 0x95, 0xac, 0x9b, 0x07, 0xad, 0xfc, 0x17, 0x34, 0xc5, 0x49, 0x40, 0x05, 0x6c, 0xf8, + 0x1b, 0x78, 0x16, 0x96, 0xe4, 0x25, 0xe6, 0xd8, 0x11, 0xea, 0x23, 0xa8, 0xe2, 0x91, 0x1c, 0x30, + 0x6e, 0xcb, 0x69, 0xc8, 0xba, 0x57, 0xff, 0xf5, 0xe3, 0xfe, 0xb5, 0x28, 0x54, 0x8f, 0x2d, 0x8b, + 0x13, 0x21, 0xba, 0x92, 0xdb, 0x2e, 0x35, 0x53, 0xa9, 0xbf, 0xa1, 0x87, 0xa7, 0x07, 0x0c, 0x5b, + 0xd1, 0x0e, 0x71, 0xb9, 0x7b, 0xc5, 0x67, 0x49, 0x95, 0xcd, 0x2d, 0xa8, 0xe5, 0x4c, 0x63, 0x9e, + 0x87, 0xdf, 0x2b, 0x50, 0xee, 0x08, 0xaa, 0x7e, 0x80, 0xd5, 0x24, 0xb1, 0xb7, 0x8d, 0x7f, 0xfc, + 0x0e, 0x46, 0x26, 0x70, 0xda, 0xbd, 0x65, 0x54, 0xb1, 0x8f, 0x2a, 0x60, 0x23, 0x9f, 0xc9, 0xbb, + 0x45, 0x03, 0x72, 0x62, 0x6d, 0xe7, 0x0c, 0xe2, 0xc4, 0xd4, 0x02, 0xc8, 0x84, 0xf2, 0x4e, 0xd1, + 0x88, 0x54, 0xa7, 0x19, 0xcb, 0xe9, 0xb2, 0x2e, 0x99, 0xdc, 0x15, 0xba, 0xa4, 0xba, 0x62, 0x97, + 0xd3, 0xc1, 0x51, 0x3f, 0xc1, 0xfa, 0x42, 0x6a, 0x5a, 0x85, 0x94, 0x19, 0xa5, 0xf6, 0x60, 0x59, + 0x65, 0xec, 0xa5, 0x5d, 0xfc, 0x7c, 0x72, 0xb4, 0xad, 0xec, 0x3d, 0xfb, 0x39, 0xd3, 0x95, 0xe3, + 0x99, 0xae, 0xfc, 0x99, 0xe9, 0xca, 0xb7, 0xb9, 0x5e, 0x3a, 0x9e, 0xeb, 0xa5, 0xdf, 0x73, 0xbd, + 0xf4, 0x1e, 0x51, 0x5b, 0x0e, 0x46, 0x3d, 0xa3, 0xcf, 0x1c, 0xf4, 0xfc, 0xdd, 0x9b, 0xa7, 0x2f, + 0x88, 0x9c, 0x30, 0x3e, 0x44, 0xfd, 0x01, 0xb6, 0x5d, 0x74, 0x98, 0x7d, 0x6b, 0xe5, 0xd4, 0x23, + 0xa2, 0xb7, 0x12, 0x3c, 0x8d, 0x3b, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x04, 0xc0, 0xc0, 0x12, + 0x8b, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Delegate ... + Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) + // Withdraw ... + WithdrawRewards(ctx context.Context, in *MsgWithdrawRewards, opts ...grpc.CallOption) (*MsgWithdrawRewardsResponse, error) + // Undelegate ... + Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) + // Redelegate ... + Redelegate(ctx context.Context, in *MsgRedelegate, opts ...grpc.CallOption) (*MsgRedelegateResponse, error) + // UpdateParams defines a governance operation for updating the x/delegation module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) { + out := new(MsgDelegateResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Msg/Delegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawRewards(ctx context.Context, in *MsgWithdrawRewards, opts ...grpc.CallOption) (*MsgWithdrawRewardsResponse, error) { + out := new(MsgWithdrawRewardsResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Msg/WithdrawRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) { + out := new(MsgUndelegateResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Msg/Undelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Redelegate(ctx context.Context, in *MsgRedelegate, opts ...grpc.CallOption) (*MsgRedelegateResponse, error) { + out := new(MsgRedelegateResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Msg/Redelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/kyve.delegation.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Delegate ... + Delegate(context.Context, *MsgDelegate) (*MsgDelegateResponse, error) + // Withdraw ... + WithdrawRewards(context.Context, *MsgWithdrawRewards) (*MsgWithdrawRewardsResponse, error) + // Undelegate ... + Undelegate(context.Context, *MsgUndelegate) (*MsgUndelegateResponse, error) + // Redelegate ... + Redelegate(context.Context, *MsgRedelegate) (*MsgRedelegateResponse, error) + // UpdateParams defines a governance operation for updating the x/delegation module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Delegate(ctx context.Context, req *MsgDelegate) (*MsgDelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delegate not implemented") +} +func (*UnimplementedMsgServer) WithdrawRewards(ctx context.Context, req *MsgWithdrawRewards) (*MsgWithdrawRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawRewards not implemented") +} +func (*UnimplementedMsgServer) Undelegate(ctx context.Context, req *MsgUndelegate) (*MsgUndelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Undelegate not implemented") +} +func (*UnimplementedMsgServer) Redelegate(ctx context.Context, req *MsgRedelegate) (*MsgRedelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Redelegate not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Delegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Delegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.delegation.v1beta1.Msg/Delegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Delegate(ctx, req.(*MsgDelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawRewards) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.delegation.v1beta1.Msg/WithdrawRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawRewards(ctx, req.(*MsgWithdrawRewards)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Undelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Undelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.delegation.v1beta1.Msg/Undelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Undelegate(ctx, req.(*MsgUndelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Redelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRedelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Redelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.delegation.v1beta1.Msg/Redelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Redelegate(ctx, req.(*MsgRedelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.delegation.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kyve.delegation.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Delegate", + Handler: _Msg_Delegate_Handler, + }, + { + MethodName: "WithdrawRewards", + Handler: _Msg_WithdrawRewards_Handler, + }, + { + MethodName: "Undelegate", + Handler: _Msg_Undelegate_Handler, + }, + { + MethodName: "Redelegate", + Handler: _Msg_Redelegate_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kyve/delegation/v1beta1/tx.proto", +} + +func (m *MsgDelegate) 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 *MsgDelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x18 + } + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDelegateResponse) 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 *MsgDelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawRewards) 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 *MsgWithdrawRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawRewardsResponse) 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 *MsgWithdrawRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUndelegate) 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 *MsgUndelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x18 + } + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintTx(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUndelegateResponse) 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 *MsgUndelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRedelegate) 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 *MsgRedelegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x20 + } + if len(m.ToStaker) > 0 { + i -= len(m.ToStaker) + copy(dAtA[i:], m.ToStaker) + i = encodeVarintTx(dAtA, i, uint64(len(m.ToStaker))) + i-- + dAtA[i] = 0x1a + } + if len(m.FromStaker) > 0 { + i -= len(m.FromStaker) + copy(dAtA[i:], m.FromStaker) + i = encodeVarintTx(dAtA, i, uint64(len(m.FromStaker))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRedelegateResponse) 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 *MsgRedelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRedelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintTx(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgDelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovTx(uint64(m.Amount)) + } + return n +} + +func (m *MsgDelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUndelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovTx(uint64(m.Amount)) + } + return n +} + +func (m *MsgUndelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRedelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.FromStaker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ToStaker) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Amount != 0 { + n += 1 + sovTx(uint64(m.Amount)) + } + return n +} + +func (m *MsgRedelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgDelegate) 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 ErrIntOverflowTx + } + 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: MsgDelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegateResponse) 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 ErrIntOverflowTx + } + 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: MsgDelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawRewards) 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 ErrIntOverflowTx + } + 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: MsgWithdrawRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawRewardsResponse) 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 ErrIntOverflowTx + } + 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: MsgWithdrawRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegate) 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 ErrIntOverflowTx + } + 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: MsgUndelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUndelegateResponse) 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 ErrIntOverflowTx + } + 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: MsgUndelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRedelegate) 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 ErrIntOverflowTx + } + 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: MsgRedelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromStaker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FromStaker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ToStaker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ToStaker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRedelegateResponse) 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 ErrIntOverflowTx + } + 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: MsgRedelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/query/types/delegation.pb.go b/x/query/types/delegation.pb.go new file mode 100644 index 00000000..841e6f3a --- /dev/null +++ b/x/query/types/delegation.pb.go @@ -0,0 +1,2444 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kyve/query/v1beta1/delegation.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryDelegatorRequest is the request type for the Query/Delegator RPC method. +type QueryDelegatorRequest struct { + // staker ... + Staker string `protobuf:"bytes,1,opt,name=staker,proto3" json:"staker,omitempty"` + // delegator ... + Delegator string `protobuf:"bytes,2,opt,name=delegator,proto3" json:"delegator,omitempty"` +} + +func (m *QueryDelegatorRequest) Reset() { *m = QueryDelegatorRequest{} } +func (m *QueryDelegatorRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorRequest) ProtoMessage() {} +func (*QueryDelegatorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{0} +} +func (m *QueryDelegatorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorRequest.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 *QueryDelegatorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorRequest.Merge(m, src) +} +func (m *QueryDelegatorRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorRequest proto.InternalMessageInfo + +func (m *QueryDelegatorRequest) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +func (m *QueryDelegatorRequest) GetDelegator() string { + if m != nil { + return m.Delegator + } + return "" +} + +// QueryDelegatorResponse is the response type for the Query/Delegator RPC method. +type QueryDelegatorResponse struct { + // delegator ... + Delegator *StakerDelegatorResponse `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` +} + +func (m *QueryDelegatorResponse) Reset() { *m = QueryDelegatorResponse{} } +func (m *QueryDelegatorResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorResponse) ProtoMessage() {} +func (*QueryDelegatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{1} +} +func (m *QueryDelegatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorResponse.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 *QueryDelegatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorResponse.Merge(m, src) +} +func (m *QueryDelegatorResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorResponse proto.InternalMessageInfo + +func (m *QueryDelegatorResponse) GetDelegator() *StakerDelegatorResponse { + if m != nil { + return m.Delegator + } + return nil +} + +// StakerDelegatorResponse ... +type StakerDelegatorResponse struct { + // delegator ... + Delegator string `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` + // current_rewards ... + CurrentRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=current_rewards,json=currentRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"current_rewards"` + // delegation_amount ... + DelegationAmount uint64 `protobuf:"varint,3,opt,name=delegation_amount,json=delegationAmount,proto3" json:"delegation_amount,omitempty"` + // staker ... + Staker string `protobuf:"bytes,4,opt,name=staker,proto3" json:"staker,omitempty"` +} + +func (m *StakerDelegatorResponse) Reset() { *m = StakerDelegatorResponse{} } +func (m *StakerDelegatorResponse) String() string { return proto.CompactTextString(m) } +func (*StakerDelegatorResponse) ProtoMessage() {} +func (*StakerDelegatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{2} +} +func (m *StakerDelegatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StakerDelegatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StakerDelegatorResponse.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 *StakerDelegatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StakerDelegatorResponse.Merge(m, src) +} +func (m *StakerDelegatorResponse) XXX_Size() int { + return m.Size() +} +func (m *StakerDelegatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StakerDelegatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StakerDelegatorResponse proto.InternalMessageInfo + +func (m *StakerDelegatorResponse) GetDelegator() string { + if m != nil { + return m.Delegator + } + return "" +} + +func (m *StakerDelegatorResponse) GetCurrentRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.CurrentRewards + } + return nil +} + +func (m *StakerDelegatorResponse) GetDelegationAmount() uint64 { + if m != nil { + return m.DelegationAmount + } + return 0 +} + +func (m *StakerDelegatorResponse) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +// QueryDelegatorsByStakerRequest ... +type QueryDelegatorsByStakerRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // staker ... + Staker string `protobuf:"bytes,2,opt,name=staker,proto3" json:"staker,omitempty"` +} + +func (m *QueryDelegatorsByStakerRequest) Reset() { *m = QueryDelegatorsByStakerRequest{} } +func (m *QueryDelegatorsByStakerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorsByStakerRequest) ProtoMessage() {} +func (*QueryDelegatorsByStakerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{3} +} +func (m *QueryDelegatorsByStakerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorsByStakerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorsByStakerRequest.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 *QueryDelegatorsByStakerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorsByStakerRequest.Merge(m, src) +} +func (m *QueryDelegatorsByStakerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorsByStakerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorsByStakerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorsByStakerRequest proto.InternalMessageInfo + +func (m *QueryDelegatorsByStakerRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryDelegatorsByStakerRequest) GetStaker() string { + if m != nil { + return m.Staker + } + return "" +} + +// QueryDelegatorsByStakerResponse ... +type QueryDelegatorsByStakerResponse struct { + // delegators ... + Delegators []StakerDelegatorResponse `protobuf:"bytes,1,rep,name=delegators,proto3" json:"delegators"` + // total_delegation ... (consider metadata object) + TotalDelegation uint64 `protobuf:"varint,2,opt,name=total_delegation,json=totalDelegation,proto3" json:"total_delegation,omitempty"` + // total_delegation ... + TotalDelegatorCount uint64 `protobuf:"varint,3,opt,name=total_delegator_count,json=totalDelegatorCount,proto3" json:"total_delegator_count,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDelegatorsByStakerResponse) Reset() { *m = QueryDelegatorsByStakerResponse{} } +func (m *QueryDelegatorsByStakerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorsByStakerResponse) ProtoMessage() {} +func (*QueryDelegatorsByStakerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{4} +} +func (m *QueryDelegatorsByStakerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorsByStakerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorsByStakerResponse.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 *QueryDelegatorsByStakerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorsByStakerResponse.Merge(m, src) +} +func (m *QueryDelegatorsByStakerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorsByStakerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorsByStakerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorsByStakerResponse proto.InternalMessageInfo + +func (m *QueryDelegatorsByStakerResponse) GetDelegators() []StakerDelegatorResponse { + if m != nil { + return m.Delegators + } + return nil +} + +func (m *QueryDelegatorsByStakerResponse) GetTotalDelegation() uint64 { + if m != nil { + return m.TotalDelegation + } + return 0 +} + +func (m *QueryDelegatorsByStakerResponse) GetTotalDelegatorCount() uint64 { + if m != nil { + return m.TotalDelegatorCount + } + return 0 +} + +func (m *QueryDelegatorsByStakerResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryStakersByDelegatorRequest ... +type QueryStakersByDelegatorRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // delegator ... + Delegator string `protobuf:"bytes,2,opt,name=delegator,proto3" json:"delegator,omitempty"` +} + +func (m *QueryStakersByDelegatorRequest) Reset() { *m = QueryStakersByDelegatorRequest{} } +func (m *QueryStakersByDelegatorRequest) String() string { return proto.CompactTextString(m) } +func (*QueryStakersByDelegatorRequest) ProtoMessage() {} +func (*QueryStakersByDelegatorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{5} +} +func (m *QueryStakersByDelegatorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStakersByDelegatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStakersByDelegatorRequest.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 *QueryStakersByDelegatorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStakersByDelegatorRequest.Merge(m, src) +} +func (m *QueryStakersByDelegatorRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryStakersByDelegatorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStakersByDelegatorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStakersByDelegatorRequest proto.InternalMessageInfo + +func (m *QueryStakersByDelegatorRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryStakersByDelegatorRequest) GetDelegator() string { + if m != nil { + return m.Delegator + } + return "" +} + +// QueryStakersByDelegatorResponse ... +type QueryStakersByDelegatorResponse struct { + // delegator ... + Delegator string `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` + // stakers ... + Stakers []DelegationForStakerResponse `protobuf:"bytes,2,rep,name=stakers,proto3" json:"stakers"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryStakersByDelegatorResponse) Reset() { *m = QueryStakersByDelegatorResponse{} } +func (m *QueryStakersByDelegatorResponse) String() string { return proto.CompactTextString(m) } +func (*QueryStakersByDelegatorResponse) ProtoMessage() {} +func (*QueryStakersByDelegatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{6} +} +func (m *QueryStakersByDelegatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryStakersByDelegatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryStakersByDelegatorResponse.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 *QueryStakersByDelegatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryStakersByDelegatorResponse.Merge(m, src) +} +func (m *QueryStakersByDelegatorResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryStakersByDelegatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryStakersByDelegatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryStakersByDelegatorResponse proto.InternalMessageInfo + +func (m *QueryStakersByDelegatorResponse) GetDelegator() string { + if m != nil { + return m.Delegator + } + return "" +} + +func (m *QueryStakersByDelegatorResponse) GetStakers() []DelegationForStakerResponse { + if m != nil { + return m.Stakers + } + return nil +} + +func (m *QueryStakersByDelegatorResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// DelegationForStakerResponse ... +type DelegationForStakerResponse struct { + // staker ... + Staker *FullStaker `protobuf:"bytes,1,opt,name=staker,proto3" json:"staker,omitempty"` + // current_rewards ... + CurrentRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=current_rewards,json=currentRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"current_rewards"` + // delegation_amount ... + DelegationAmount uint64 `protobuf:"varint,3,opt,name=delegation_amount,json=delegationAmount,proto3" json:"delegation_amount,omitempty"` +} + +func (m *DelegationForStakerResponse) Reset() { *m = DelegationForStakerResponse{} } +func (m *DelegationForStakerResponse) String() string { return proto.CompactTextString(m) } +func (*DelegationForStakerResponse) ProtoMessage() {} +func (*DelegationForStakerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5e1c28c162a0498a, []int{7} +} +func (m *DelegationForStakerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegationForStakerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegationForStakerResponse.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 *DelegationForStakerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegationForStakerResponse.Merge(m, src) +} +func (m *DelegationForStakerResponse) XXX_Size() int { + return m.Size() +} +func (m *DelegationForStakerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DelegationForStakerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegationForStakerResponse proto.InternalMessageInfo + +func (m *DelegationForStakerResponse) GetStaker() *FullStaker { + if m != nil { + return m.Staker + } + return nil +} + +func (m *DelegationForStakerResponse) GetCurrentRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.CurrentRewards + } + return nil +} + +func (m *DelegationForStakerResponse) GetDelegationAmount() uint64 { + if m != nil { + return m.DelegationAmount + } + return 0 +} + +func init() { + proto.RegisterType((*QueryDelegatorRequest)(nil), "kyve.query.v1beta1.QueryDelegatorRequest") + proto.RegisterType((*QueryDelegatorResponse)(nil), "kyve.query.v1beta1.QueryDelegatorResponse") + proto.RegisterType((*StakerDelegatorResponse)(nil), "kyve.query.v1beta1.StakerDelegatorResponse") + proto.RegisterType((*QueryDelegatorsByStakerRequest)(nil), "kyve.query.v1beta1.QueryDelegatorsByStakerRequest") + proto.RegisterType((*QueryDelegatorsByStakerResponse)(nil), "kyve.query.v1beta1.QueryDelegatorsByStakerResponse") + proto.RegisterType((*QueryStakersByDelegatorRequest)(nil), "kyve.query.v1beta1.QueryStakersByDelegatorRequest") + proto.RegisterType((*QueryStakersByDelegatorResponse)(nil), "kyve.query.v1beta1.QueryStakersByDelegatorResponse") + proto.RegisterType((*DelegationForStakerResponse)(nil), "kyve.query.v1beta1.DelegationForStakerResponse") +} + +func init() { + proto.RegisterFile("kyve/query/v1beta1/delegation.proto", fileDescriptor_5e1c28c162a0498a) +} + +var fileDescriptor_5e1c28c162a0498a = []byte{ + // 769 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcf, 0x6b, 0x13, 0x4d, + 0x18, 0xce, 0xa4, 0xa1, 0x1f, 0x9d, 0xc2, 0xd7, 0x76, 0xbe, 0xaf, 0x35, 0xc6, 0xb2, 0x2d, 0x11, + 0x34, 0x4d, 0x71, 0x87, 0x6e, 0x6b, 0x41, 0xf1, 0x62, 0x5a, 0x2b, 0x22, 0xfe, 0xe8, 0x0a, 0x82, + 0x5e, 0xc2, 0x66, 0x33, 0x6c, 0x97, 0x24, 0x3b, 0xe9, 0xce, 0xa6, 0x35, 0x94, 0x82, 0x78, 0xf0, + 0x2c, 0x78, 0x15, 0xcf, 0xa2, 0x17, 0x8f, 0x82, 0xff, 0x40, 0x8f, 0x05, 0x2f, 0x7a, 0x51, 0x69, + 0x05, 0xff, 0x04, 0x4f, 0x82, 0xec, 0xec, 0x6c, 0x76, 0x36, 0xd9, 0xa4, 0xad, 0x78, 0xf1, 0x92, + 0xec, 0xce, 0xbc, 0x3f, 0x9e, 0xf7, 0x79, 0xde, 0xf7, 0x4d, 0xe0, 0xd9, 0x5a, 0x7b, 0x8b, 0xe0, + 0xcd, 0x16, 0x71, 0xdb, 0x78, 0x6b, 0xa1, 0x42, 0x3c, 0x63, 0x01, 0x57, 0x49, 0x9d, 0x58, 0x86, + 0x67, 0x53, 0x47, 0x6d, 0xba, 0xd4, 0xa3, 0x08, 0xf9, 0x46, 0x2a, 0x37, 0x52, 0x85, 0x51, 0x6e, + 0xc2, 0x68, 0xd8, 0x0e, 0xc5, 0xfc, 0x33, 0x30, 0xcb, 0x15, 0x4d, 0xca, 0x1a, 0x94, 0xe1, 0x8a, + 0xc1, 0xba, 0x43, 0x36, 0x0d, 0xcb, 0x76, 0xa4, 0x90, 0x39, 0x45, 0xb6, 0x0d, 0xad, 0x4c, 0x6a, + 0x87, 0xf7, 0xff, 0x5b, 0xd4, 0xa2, 0xfc, 0x11, 0xfb, 0x4f, 0xe2, 0x74, 0xda, 0xa2, 0xd4, 0xaa, + 0x13, 0x6c, 0x34, 0x6d, 0x6c, 0x38, 0x0e, 0xf5, 0x78, 0x48, 0x16, 0xc6, 0x4c, 0xa8, 0x25, 0x00, + 0xcd, 0xef, 0xf3, 0xb7, 0xe0, 0xe4, 0xba, 0xff, 0xba, 0x1a, 0xd4, 0x47, 0x5d, 0x9d, 0x6c, 0xb6, + 0x08, 0xf3, 0xd0, 0x14, 0x1c, 0x66, 0x9e, 0x51, 0x23, 0x6e, 0x16, 0xcc, 0x82, 0xc2, 0x88, 0x2e, + 0xde, 0xd0, 0x34, 0x1c, 0xa9, 0x86, 0xb6, 0xd9, 0x34, 0xbf, 0x8a, 0x0e, 0xf2, 0x26, 0x9c, 0xea, + 0x0e, 0xc7, 0x9a, 0xd4, 0x61, 0x04, 0xdd, 0x90, 0xfd, 0xfc, 0x90, 0xa3, 0xda, 0xbc, 0xda, 0xcb, + 0xa1, 0x7a, 0x8f, 0xa7, 0xe9, 0xf1, 0x97, 0x93, 0xfc, 0x00, 0xf0, 0x54, 0x1f, 0xb3, 0x38, 0x3c, + 0xd0, 0x05, 0x0f, 0xb5, 0xe1, 0x98, 0xd9, 0x72, 0x5d, 0xe2, 0x78, 0x65, 0x97, 0x6c, 0x1b, 0x6e, + 0x95, 0x65, 0x87, 0x67, 0x87, 0x0a, 0xa3, 0xda, 0x69, 0x35, 0xe0, 0x5e, 0xf5, 0xb9, 0xef, 0x60, + 0x59, 0xa1, 0xb6, 0x53, 0xba, 0xb8, 0xf7, 0x79, 0x26, 0xf5, 0xfa, 0xcb, 0x4c, 0xc1, 0xb2, 0xbd, + 0x8d, 0x56, 0x45, 0x35, 0x69, 0x03, 0x0b, 0xa1, 0x82, 0xaf, 0x0b, 0xac, 0x5a, 0xc3, 0x5e, 0xbb, + 0x49, 0x18, 0x77, 0x60, 0xaf, 0xbe, 0xbf, 0x2d, 0x02, 0xfd, 0x5f, 0x91, 0x48, 0x0f, 0xf2, 0xa0, + 0x79, 0x38, 0x11, 0xf5, 0x50, 0xd9, 0x68, 0xd0, 0x96, 0xe3, 0x65, 0x87, 0x66, 0x41, 0x21, 0xa3, + 0x8f, 0x47, 0x17, 0x57, 0xf9, 0xb9, 0x44, 0x7e, 0x46, 0x26, 0x3f, 0xff, 0x18, 0x40, 0x25, 0xce, + 0x2f, 0x2b, 0xb5, 0x03, 0x2a, 0x42, 0xdd, 0xd6, 0x20, 0x8c, 0x1a, 0x4b, 0x10, 0x7d, 0x2e, 0x56, + 0x5d, 0x9c, 0xef, 0xbb, 0x86, 0x45, 0x84, 0xaf, 0x2e, 0x79, 0x4a, 0x10, 0xd2, 0x31, 0x08, 0x2f, + 0xd2, 0x70, 0xa6, 0x2f, 0x04, 0x21, 0xc2, 0x3a, 0x84, 0x1d, 0xce, 0x59, 0x16, 0x70, 0x86, 0x4f, + 0x22, 0x76, 0x29, 0xe3, 0x73, 0xae, 0x4b, 0x41, 0xd0, 0x1c, 0x1c, 0xf7, 0xa8, 0x67, 0xd4, 0xcb, + 0x11, 0x57, 0x1c, 0x58, 0x46, 0x1f, 0xe3, 0xe7, 0xab, 0x9d, 0x63, 0xa4, 0xc1, 0xc9, 0x98, 0x29, + 0x75, 0xcb, 0xa6, 0xc4, 0xf6, 0x7f, 0xb2, 0x3d, 0x75, 0x57, 0x38, 0xe1, 0xd7, 0x63, 0xac, 0x65, + 0x38, 0x6b, 0xe7, 0x8f, 0x64, 0x4d, 0xb4, 0xa6, 0xe4, 0x9a, 0x7f, 0x1a, 0x2a, 0x14, 0x94, 0xc6, + 0x4a, 0xbd, 0x93, 0xf5, 0xa7, 0x14, 0x1a, 0x3c, 0x89, 0x9f, 0x80, 0xd0, 0x29, 0x09, 0xc8, 0xb1, + 0x86, 0xe5, 0x0e, 0xfc, 0x27, 0xd0, 0x9c, 0x65, 0xd3, 0x5c, 0x42, 0x9c, 0x24, 0x61, 0x44, 0xfc, + 0x1a, 0x75, 0xe3, 0x7d, 0x20, 0x64, 0x0c, 0xa3, 0x74, 0x91, 0x3c, 0xf4, 0xfb, 0x24, 0xff, 0x04, + 0xf0, 0xcc, 0x80, 0xbc, 0x68, 0x39, 0xb6, 0xbb, 0x46, 0x35, 0x25, 0x09, 0xf8, 0x5a, 0xab, 0x5e, + 0x17, 0x7e, 0xe1, 0x6e, 0xfb, 0x4b, 0xd6, 0x83, 0xf6, 0x26, 0x03, 0xc7, 0xe4, 0x19, 0xf4, 0xbb, + 0xe1, 0x25, 0x80, 0x23, 0x1d, 0x85, 0xd1, 0x5c, 0x52, 0xc5, 0x89, 0x8b, 0x3e, 0x57, 0x3c, 0x8e, + 0x69, 0x40, 0x6c, 0xfe, 0xf2, 0x93, 0x0f, 0xdf, 0x9e, 0xa7, 0x97, 0x90, 0x86, 0xfb, 0xff, 0x44, + 0x52, 0x17, 0xef, 0x04, 0x7c, 0xee, 0xe2, 0x9d, 0xce, 0xd9, 0x2e, 0x7a, 0x07, 0x20, 0xea, 0xdd, + 0x19, 0x48, 0x3b, 0x3a, 0x7d, 0xf7, 0x8e, 0xcb, 0x2d, 0x9e, 0xc8, 0x47, 0x60, 0xbf, 0xc4, 0xb1, + 0x2f, 0xa2, 0x85, 0x81, 0xd8, 0x59, 0xb9, 0xd2, 0x2e, 0x07, 0xf0, 0x3b, 0x65, 0xa0, 0xf7, 0x00, + 0xa2, 0xde, 0x31, 0x1a, 0x00, 0xbd, 0xef, 0xf0, 0x0f, 0x80, 0xde, 0x7f, 0x4e, 0xf3, 0x57, 0x38, + 0xf4, 0x65, 0xb4, 0x94, 0x04, 0x5d, 0x4c, 0x97, 0x8f, 0x5b, 0x52, 0x20, 0x22, 0xbe, 0xb4, 0xba, + 0x77, 0xa0, 0x80, 0xfd, 0x03, 0x05, 0x7c, 0x3d, 0x50, 0xc0, 0xb3, 0x43, 0x25, 0xb5, 0x7f, 0xa8, + 0xa4, 0x3e, 0x1e, 0x2a, 0xa9, 0x87, 0x45, 0xa9, 0x67, 0x6f, 0x3e, 0xb8, 0x7f, 0xed, 0x36, 0xf1, + 0xb6, 0xa9, 0x5b, 0xc3, 0xe6, 0x86, 0x61, 0x3b, 0xf8, 0x91, 0x48, 0xc4, 0x7b, 0xb7, 0x32, 0xcc, + 0xff, 0x2f, 0x2c, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x0e, 0x9f, 0xd2, 0x1d, 0x09, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryDelegationClient is the client API for QueryDelegation service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryDelegationClient interface { + // Delegator returns delegation information for a specific delegator of a specific staker. + Delegator(ctx context.Context, in *QueryDelegatorRequest, opts ...grpc.CallOption) (*QueryDelegatorResponse, error) + // DelegatorsByStaker returns all delegators that have delegated to the given staker + // This query is paginated. + DelegatorsByStaker(ctx context.Context, in *QueryDelegatorsByStakerRequest, opts ...grpc.CallOption) (*QueryDelegatorsByStakerResponse, error) + // StakersByPoolAndDelegator returns all stakers the given delegator has delegated to. + // This query is paginated. + StakersByDelegator(ctx context.Context, in *QueryStakersByDelegatorRequest, opts ...grpc.CallOption) (*QueryStakersByDelegatorResponse, error) +} + +type queryDelegationClient struct { + cc grpc1.ClientConn +} + +func NewQueryDelegationClient(cc grpc1.ClientConn) QueryDelegationClient { + return &queryDelegationClient{cc} +} + +func (c *queryDelegationClient) Delegator(ctx context.Context, in *QueryDelegatorRequest, opts ...grpc.CallOption) (*QueryDelegatorResponse, error) { + out := new(QueryDelegatorResponse) + err := c.cc.Invoke(ctx, "/kyve.query.v1beta1.QueryDelegation/Delegator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryDelegationClient) DelegatorsByStaker(ctx context.Context, in *QueryDelegatorsByStakerRequest, opts ...grpc.CallOption) (*QueryDelegatorsByStakerResponse, error) { + out := new(QueryDelegatorsByStakerResponse) + err := c.cc.Invoke(ctx, "/kyve.query.v1beta1.QueryDelegation/DelegatorsByStaker", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryDelegationClient) StakersByDelegator(ctx context.Context, in *QueryStakersByDelegatorRequest, opts ...grpc.CallOption) (*QueryStakersByDelegatorResponse, error) { + out := new(QueryStakersByDelegatorResponse) + err := c.cc.Invoke(ctx, "/kyve.query.v1beta1.QueryDelegation/StakersByDelegator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryDelegationServer is the server API for QueryDelegation service. +type QueryDelegationServer interface { + // Delegator returns delegation information for a specific delegator of a specific staker. + Delegator(context.Context, *QueryDelegatorRequest) (*QueryDelegatorResponse, error) + // DelegatorsByStaker returns all delegators that have delegated to the given staker + // This query is paginated. + DelegatorsByStaker(context.Context, *QueryDelegatorsByStakerRequest) (*QueryDelegatorsByStakerResponse, error) + // StakersByPoolAndDelegator returns all stakers the given delegator has delegated to. + // This query is paginated. + StakersByDelegator(context.Context, *QueryStakersByDelegatorRequest) (*QueryStakersByDelegatorResponse, error) +} + +// UnimplementedQueryDelegationServer can be embedded to have forward compatible implementations. +type UnimplementedQueryDelegationServer struct { +} + +func (*UnimplementedQueryDelegationServer) Delegator(ctx context.Context, req *QueryDelegatorRequest) (*QueryDelegatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delegator not implemented") +} +func (*UnimplementedQueryDelegationServer) DelegatorsByStaker(ctx context.Context, req *QueryDelegatorsByStakerRequest) (*QueryDelegatorsByStakerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorsByStaker not implemented") +} +func (*UnimplementedQueryDelegationServer) StakersByDelegator(ctx context.Context, req *QueryStakersByDelegatorRequest) (*QueryStakersByDelegatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StakersByDelegator not implemented") +} + +func RegisterQueryDelegationServer(s grpc1.Server, srv QueryDelegationServer) { + s.RegisterService(&_QueryDelegation_serviceDesc, srv) +} + +func _QueryDelegation_Delegator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryDelegationServer).Delegator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.query.v1beta1.QueryDelegation/Delegator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryDelegationServer).Delegator(ctx, req.(*QueryDelegatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QueryDelegation_DelegatorsByStaker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorsByStakerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryDelegationServer).DelegatorsByStaker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.query.v1beta1.QueryDelegation/DelegatorsByStaker", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryDelegationServer).DelegatorsByStaker(ctx, req.(*QueryDelegatorsByStakerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _QueryDelegation_StakersByDelegator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryStakersByDelegatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryDelegationServer).StakersByDelegator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kyve.query.v1beta1.QueryDelegation/StakersByDelegator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryDelegationServer).StakersByDelegator(ctx, req.(*QueryStakersByDelegatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _QueryDelegation_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kyve.query.v1beta1.QueryDelegation", + HandlerType: (*QueryDelegationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Delegator", + Handler: _QueryDelegation_Delegator_Handler, + }, + { + MethodName: "DelegatorsByStaker", + Handler: _QueryDelegation_DelegatorsByStaker_Handler, + }, + { + MethodName: "StakersByDelegator", + Handler: _QueryDelegation_StakersByDelegator_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kyve/query/v1beta1/delegation.proto", +} + +func (m *QueryDelegatorRequest) 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 *QueryDelegatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Delegator) > 0 { + i -= len(m.Delegator) + copy(dAtA[i:], m.Delegator) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Delegator))) + i-- + dAtA[i] = 0x12 + } + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorResponse) 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 *QueryDelegatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Delegator != nil { + { + size, err := m.Delegator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StakerDelegatorResponse) 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 *StakerDelegatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StakerDelegatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CurrentRewards) > 0 { + for iNdEx := len(m.CurrentRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CurrentRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0x22 + } + if m.DelegationAmount != 0 { + i = encodeVarintDelegation(dAtA, i, uint64(m.DelegationAmount)) + i-- + dAtA[i] = 0x18 + } + if len(m.Delegator) > 0 { + i -= len(m.Delegator) + copy(dAtA[i:], m.Delegator) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Delegator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorsByStakerRequest) 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 *QueryDelegatorsByStakerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorsByStakerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Staker) > 0 { + i -= len(m.Staker) + copy(dAtA[i:], m.Staker) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Staker))) + i-- + dAtA[i] = 0x12 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorsByStakerResponse) 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 *QueryDelegatorsByStakerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorsByStakerResponse) 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 = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.TotalDelegatorCount != 0 { + i = encodeVarintDelegation(dAtA, i, uint64(m.TotalDelegatorCount)) + i-- + dAtA[i] = 0x18 + } + if m.TotalDelegation != 0 { + i = encodeVarintDelegation(dAtA, i, uint64(m.TotalDelegation)) + i-- + dAtA[i] = 0x10 + } + if len(m.Delegators) > 0 { + for iNdEx := len(m.Delegators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Delegators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryStakersByDelegatorRequest) 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 *QueryStakersByDelegatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStakersByDelegatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Delegator) > 0 { + i -= len(m.Delegator) + copy(dAtA[i:], m.Delegator) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Delegator))) + i-- + dAtA[i] = 0x12 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryStakersByDelegatorResponse) 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 *QueryStakersByDelegatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryStakersByDelegatorResponse) 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 = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Stakers) > 0 { + for iNdEx := len(m.Stakers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Stakers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Delegator) > 0 { + i -= len(m.Delegator) + copy(dAtA[i:], m.Delegator) + i = encodeVarintDelegation(dAtA, i, uint64(len(m.Delegator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegationForStakerResponse) 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 *DelegationForStakerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegationForStakerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CurrentRewards) > 0 { + for iNdEx := len(m.CurrentRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CurrentRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.DelegationAmount != 0 { + i = encodeVarintDelegation(dAtA, i, uint64(m.DelegationAmount)) + i-- + dAtA[i] = 0x18 + } + if m.Staker != nil { + { + size, err := m.Staker.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDelegation(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDelegation(dAtA []byte, offset int, v uint64) int { + offset -= sovDelegation(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryDelegatorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + l = len(m.Delegator) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *QueryDelegatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delegator != nil { + l = m.Delegator.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *StakerDelegatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Delegator) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + if m.DelegationAmount != 0 { + n += 1 + sovDelegation(uint64(m.DelegationAmount)) + } + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + if len(m.CurrentRewards) > 0 { + for _, e := range m.CurrentRewards { + l = e.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + } + return n +} + +func (m *QueryDelegatorsByStakerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + l = len(m.Staker) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *QueryDelegatorsByStakerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Delegators) > 0 { + for _, e := range m.Delegators { + l = e.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + } + if m.TotalDelegation != 0 { + n += 1 + sovDelegation(uint64(m.TotalDelegation)) + } + if m.TotalDelegatorCount != 0 { + n += 1 + sovDelegation(uint64(m.TotalDelegatorCount)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *QueryStakersByDelegatorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + l = len(m.Delegator) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *QueryStakersByDelegatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Delegator) + if l > 0 { + n += 1 + l + sovDelegation(uint64(l)) + } + if len(m.Stakers) > 0 { + for _, e := range m.Stakers { + l = e.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + return n +} + +func (m *DelegationForStakerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Staker != nil { + l = m.Staker.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + if m.DelegationAmount != 0 { + n += 1 + sovDelegation(uint64(m.DelegationAmount)) + } + if len(m.CurrentRewards) > 0 { + for _, e := range m.CurrentRewards { + l = e.Size() + n += 1 + l + sovDelegation(uint64(l)) + } + } + return n +} + +func sovDelegation(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDelegation(x uint64) (n int) { + return sovDelegation(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryDelegatorRequest) 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 ErrIntOverflowDelegation + } + 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: QueryDelegatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorResponse) 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 ErrIntOverflowDelegation + } + 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: QueryDelegatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delegator == nil { + m.Delegator = &StakerDelegatorResponse{} + } + if err := m.Delegator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StakerDelegatorResponse) 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 ErrIntOverflowDelegation + } + 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: StakerDelegatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StakerDelegatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationAmount", wireType) + } + m.DelegationAmount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DelegationAmount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentRewards = append(m.CurrentRewards, types.Coin{}) + if err := m.CurrentRewards[len(m.CurrentRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorsByStakerRequest) 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 ErrIntOverflowDelegation + } + 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: QueryDelegatorsByStakerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorsByStakerRequest: 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 ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Staker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorsByStakerResponse) 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 ErrIntOverflowDelegation + } + 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: QueryDelegatorsByStakerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorsByStakerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegators = append(m.Delegators, StakerDelegatorResponse{}) + if err := m.Delegators[len(m.Delegators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDelegation", wireType) + } + m.TotalDelegation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalDelegation |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDelegatorCount", wireType) + } + m.TotalDelegatorCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalDelegatorCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + 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 := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryStakersByDelegatorRequest) 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 ErrIntOverflowDelegation + } + 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: QueryStakersByDelegatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStakersByDelegatorRequest: 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 ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryStakersByDelegatorResponse) 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 ErrIntOverflowDelegation + } + 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: QueryStakersByDelegatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryStakersByDelegatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Delegator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stakers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stakers = append(m.Stakers, DelegationForStakerResponse{}) + if err := m.Stakers[len(m.Stakers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + 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 ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + 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 := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegationForStakerResponse) 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 ErrIntOverflowDelegation + } + 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: DelegationForStakerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegationForStakerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Staker == nil { + m.Staker = &FullStaker{} + } + if err := m.Staker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationAmount", wireType) + } + m.DelegationAmount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DelegationAmount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDelegation + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDelegation + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDelegation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentRewards = append(m.CurrentRewards, types.Coin{}) + if err := m.CurrentRewards[len(m.CurrentRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDelegation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDelegation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDelegation(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDelegation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDelegation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDelegation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDelegation + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDelegation + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDelegation + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDelegation = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDelegation = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDelegation = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/query/types/delegation.pb.gw.go b/x/query/types/delegation.pb.gw.go new file mode 100644 index 00000000..11579c52 --- /dev/null +++ b/x/query/types/delegation.pb.gw.go @@ -0,0 +1,449 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: kyve/query/v1beta1/delegation.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_QueryDelegation_Delegator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryDelegationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["staker"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "staker") + } + + protoReq.Staker, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "staker", err) + } + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + msg, err := client.Delegator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_QueryDelegation_Delegator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryDelegationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["staker"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "staker") + } + + protoReq.Staker, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "staker", err) + } + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + msg, err := server.Delegator(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_QueryDelegation_DelegatorsByStaker_0 = &utilities.DoubleArray{Encoding: map[string]int{"staker": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_QueryDelegation_DelegatorsByStaker_0(ctx context.Context, marshaler runtime.Marshaler, client QueryDelegationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorsByStakerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["staker"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "staker") + } + + protoReq.Staker, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "staker", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_QueryDelegation_DelegatorsByStaker_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DelegatorsByStaker(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_QueryDelegation_DelegatorsByStaker_0(ctx context.Context, marshaler runtime.Marshaler, server QueryDelegationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorsByStakerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["staker"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "staker") + } + + protoReq.Staker, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "staker", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_QueryDelegation_DelegatorsByStaker_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DelegatorsByStaker(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_QueryDelegation_StakersByDelegator_0 = &utilities.DoubleArray{Encoding: map[string]int{"delegator": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_QueryDelegation_StakersByDelegator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryDelegationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryStakersByDelegatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_QueryDelegation_StakersByDelegator_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.StakersByDelegator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_QueryDelegation_StakersByDelegator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryDelegationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryStakersByDelegatorRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator") + } + + protoReq.Delegator, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_QueryDelegation_StakersByDelegator_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.StakersByDelegator(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryDelegationHandlerServer registers the http handlers for service QueryDelegation to "mux". +// UnaryRPC :call QueryDelegationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryDelegationHandlerFromEndpoint instead. +func RegisterQueryDelegationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryDelegationServer) error { + + mux.Handle("GET", pattern_QueryDelegation_Delegator_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_QueryDelegation_Delegator_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_QueryDelegation_Delegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_QueryDelegation_DelegatorsByStaker_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_QueryDelegation_DelegatorsByStaker_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_QueryDelegation_DelegatorsByStaker_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_QueryDelegation_StakersByDelegator_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_QueryDelegation_StakersByDelegator_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_QueryDelegation_StakersByDelegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryDelegationHandlerFromEndpoint is same as RegisterQueryDelegationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryDelegationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryDelegationHandler(ctx, mux, conn) +} + +// RegisterQueryDelegationHandler registers the http handlers for service QueryDelegation to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryDelegationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryDelegationHandlerClient(ctx, mux, NewQueryDelegationClient(conn)) +} + +// RegisterQueryDelegationHandlerClient registers the http handlers for service QueryDelegation +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryDelegationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryDelegationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryDelegationClient" to call the correct interceptors. +func RegisterQueryDelegationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryDelegationClient) error { + + mux.Handle("GET", pattern_QueryDelegation_Delegator_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_QueryDelegation_Delegator_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QueryDelegation_Delegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_QueryDelegation_DelegatorsByStaker_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_QueryDelegation_DelegatorsByStaker_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QueryDelegation_DelegatorsByStaker_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_QueryDelegation_StakersByDelegator_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_QueryDelegation_StakersByDelegator_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_QueryDelegation_StakersByDelegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_QueryDelegation_Delegator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 3}, []string{"kyve", "query", "v1beta1", "delegator", "staker"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_QueryDelegation_DelegatorsByStaker_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"kyve", "query", "v1beta1", "delegators_by_staker", "staker"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_QueryDelegation_StakersByDelegator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"kyve", "query", "v1beta1", "stakers_by_delegator", "delegator"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_QueryDelegation_Delegator_0 = runtime.ForwardResponseMessage + + forward_QueryDelegation_DelegatorsByStaker_0 = runtime.ForwardResponseMessage + + forward_QueryDelegation_StakersByDelegator_0 = runtime.ForwardResponseMessage +)