github.com/cosmos/cosmos-sdk@v0.50.10/x/params/types/proposal/query.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: cosmos/params/v1beta1/query.proto 3 4 package proposal 5 6 import ( 7 context "context" 8 fmt "fmt" 9 _ "github.com/cosmos/cosmos-sdk/types/tx/amino" 10 _ "github.com/cosmos/gogoproto/gogoproto" 11 grpc1 "github.com/cosmos/gogoproto/grpc" 12 proto "github.com/cosmos/gogoproto/proto" 13 _ "google.golang.org/genproto/googleapis/api/annotations" 14 grpc "google.golang.org/grpc" 15 codes "google.golang.org/grpc/codes" 16 status "google.golang.org/grpc/status" 17 io "io" 18 math "math" 19 math_bits "math/bits" 20 ) 21 22 // Reference imports to suppress errors if they are not otherwise used. 23 var _ = proto.Marshal 24 var _ = fmt.Errorf 25 var _ = math.Inf 26 27 // This is a compile-time assertion to ensure that this generated file 28 // is compatible with the proto package it is being compiled against. 29 // A compilation error at this line likely means your copy of the 30 // proto package needs to be updated. 31 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 32 33 // QueryParamsRequest is request type for the Query/Params RPC method. 34 type QueryParamsRequest struct { 35 // subspace defines the module to query the parameter for. 36 Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` 37 // key defines the key of the parameter in the subspace. 38 Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` 39 } 40 41 func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } 42 func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } 43 func (*QueryParamsRequest) ProtoMessage() {} 44 func (*QueryParamsRequest) Descriptor() ([]byte, []int) { 45 return fileDescriptor_2b32979c1792ccc4, []int{0} 46 } 47 func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { 48 return m.Unmarshal(b) 49 } 50 func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 51 if deterministic { 52 return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) 53 } else { 54 b = b[:cap(b)] 55 n, err := m.MarshalToSizedBuffer(b) 56 if err != nil { 57 return nil, err 58 } 59 return b[:n], nil 60 } 61 } 62 func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { 63 xxx_messageInfo_QueryParamsRequest.Merge(m, src) 64 } 65 func (m *QueryParamsRequest) XXX_Size() int { 66 return m.Size() 67 } 68 func (m *QueryParamsRequest) XXX_DiscardUnknown() { 69 xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) 70 } 71 72 var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo 73 74 func (m *QueryParamsRequest) GetSubspace() string { 75 if m != nil { 76 return m.Subspace 77 } 78 return "" 79 } 80 81 func (m *QueryParamsRequest) GetKey() string { 82 if m != nil { 83 return m.Key 84 } 85 return "" 86 } 87 88 // QueryParamsResponse is response type for the Query/Params RPC method. 89 type QueryParamsResponse struct { 90 // param defines the queried parameter. 91 Param ParamChange `protobuf:"bytes,1,opt,name=param,proto3" json:"param"` 92 } 93 94 func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } 95 func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } 96 func (*QueryParamsResponse) ProtoMessage() {} 97 func (*QueryParamsResponse) Descriptor() ([]byte, []int) { 98 return fileDescriptor_2b32979c1792ccc4, []int{1} 99 } 100 func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { 101 return m.Unmarshal(b) 102 } 103 func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 104 if deterministic { 105 return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) 106 } else { 107 b = b[:cap(b)] 108 n, err := m.MarshalToSizedBuffer(b) 109 if err != nil { 110 return nil, err 111 } 112 return b[:n], nil 113 } 114 } 115 func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { 116 xxx_messageInfo_QueryParamsResponse.Merge(m, src) 117 } 118 func (m *QueryParamsResponse) XXX_Size() int { 119 return m.Size() 120 } 121 func (m *QueryParamsResponse) XXX_DiscardUnknown() { 122 xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) 123 } 124 125 var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo 126 127 func (m *QueryParamsResponse) GetParam() ParamChange { 128 if m != nil { 129 return m.Param 130 } 131 return ParamChange{} 132 } 133 134 // QuerySubspacesRequest defines a request type for querying for all registered 135 // subspaces and all keys for a subspace. 136 // 137 // Since: cosmos-sdk 0.46 138 type QuerySubspacesRequest struct { 139 } 140 141 func (m *QuerySubspacesRequest) Reset() { *m = QuerySubspacesRequest{} } 142 func (m *QuerySubspacesRequest) String() string { return proto.CompactTextString(m) } 143 func (*QuerySubspacesRequest) ProtoMessage() {} 144 func (*QuerySubspacesRequest) Descriptor() ([]byte, []int) { 145 return fileDescriptor_2b32979c1792ccc4, []int{2} 146 } 147 func (m *QuerySubspacesRequest) XXX_Unmarshal(b []byte) error { 148 return m.Unmarshal(b) 149 } 150 func (m *QuerySubspacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 151 if deterministic { 152 return xxx_messageInfo_QuerySubspacesRequest.Marshal(b, m, deterministic) 153 } else { 154 b = b[:cap(b)] 155 n, err := m.MarshalToSizedBuffer(b) 156 if err != nil { 157 return nil, err 158 } 159 return b[:n], nil 160 } 161 } 162 func (m *QuerySubspacesRequest) XXX_Merge(src proto.Message) { 163 xxx_messageInfo_QuerySubspacesRequest.Merge(m, src) 164 } 165 func (m *QuerySubspacesRequest) XXX_Size() int { 166 return m.Size() 167 } 168 func (m *QuerySubspacesRequest) XXX_DiscardUnknown() { 169 xxx_messageInfo_QuerySubspacesRequest.DiscardUnknown(m) 170 } 171 172 var xxx_messageInfo_QuerySubspacesRequest proto.InternalMessageInfo 173 174 // QuerySubspacesResponse defines the response types for querying for all 175 // registered subspaces and all keys for a subspace. 176 // 177 // Since: cosmos-sdk 0.46 178 type QuerySubspacesResponse struct { 179 Subspaces []*Subspace `protobuf:"bytes,1,rep,name=subspaces,proto3" json:"subspaces,omitempty"` 180 } 181 182 func (m *QuerySubspacesResponse) Reset() { *m = QuerySubspacesResponse{} } 183 func (m *QuerySubspacesResponse) String() string { return proto.CompactTextString(m) } 184 func (*QuerySubspacesResponse) ProtoMessage() {} 185 func (*QuerySubspacesResponse) Descriptor() ([]byte, []int) { 186 return fileDescriptor_2b32979c1792ccc4, []int{3} 187 } 188 func (m *QuerySubspacesResponse) XXX_Unmarshal(b []byte) error { 189 return m.Unmarshal(b) 190 } 191 func (m *QuerySubspacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 192 if deterministic { 193 return xxx_messageInfo_QuerySubspacesResponse.Marshal(b, m, deterministic) 194 } else { 195 b = b[:cap(b)] 196 n, err := m.MarshalToSizedBuffer(b) 197 if err != nil { 198 return nil, err 199 } 200 return b[:n], nil 201 } 202 } 203 func (m *QuerySubspacesResponse) XXX_Merge(src proto.Message) { 204 xxx_messageInfo_QuerySubspacesResponse.Merge(m, src) 205 } 206 func (m *QuerySubspacesResponse) XXX_Size() int { 207 return m.Size() 208 } 209 func (m *QuerySubspacesResponse) XXX_DiscardUnknown() { 210 xxx_messageInfo_QuerySubspacesResponse.DiscardUnknown(m) 211 } 212 213 var xxx_messageInfo_QuerySubspacesResponse proto.InternalMessageInfo 214 215 func (m *QuerySubspacesResponse) GetSubspaces() []*Subspace { 216 if m != nil { 217 return m.Subspaces 218 } 219 return nil 220 } 221 222 // Subspace defines a parameter subspace name and all the keys that exist for 223 // the subspace. 224 // 225 // Since: cosmos-sdk 0.46 226 type Subspace struct { 227 Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` 228 Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` 229 } 230 231 func (m *Subspace) Reset() { *m = Subspace{} } 232 func (m *Subspace) String() string { return proto.CompactTextString(m) } 233 func (*Subspace) ProtoMessage() {} 234 func (*Subspace) Descriptor() ([]byte, []int) { 235 return fileDescriptor_2b32979c1792ccc4, []int{4} 236 } 237 func (m *Subspace) XXX_Unmarshal(b []byte) error { 238 return m.Unmarshal(b) 239 } 240 func (m *Subspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 241 if deterministic { 242 return xxx_messageInfo_Subspace.Marshal(b, m, deterministic) 243 } else { 244 b = b[:cap(b)] 245 n, err := m.MarshalToSizedBuffer(b) 246 if err != nil { 247 return nil, err 248 } 249 return b[:n], nil 250 } 251 } 252 func (m *Subspace) XXX_Merge(src proto.Message) { 253 xxx_messageInfo_Subspace.Merge(m, src) 254 } 255 func (m *Subspace) XXX_Size() int { 256 return m.Size() 257 } 258 func (m *Subspace) XXX_DiscardUnknown() { 259 xxx_messageInfo_Subspace.DiscardUnknown(m) 260 } 261 262 var xxx_messageInfo_Subspace proto.InternalMessageInfo 263 264 func (m *Subspace) GetSubspace() string { 265 if m != nil { 266 return m.Subspace 267 } 268 return "" 269 } 270 271 func (m *Subspace) GetKeys() []string { 272 if m != nil { 273 return m.Keys 274 } 275 return nil 276 } 277 278 func init() { 279 proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.params.v1beta1.QueryParamsRequest") 280 proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.params.v1beta1.QueryParamsResponse") 281 proto.RegisterType((*QuerySubspacesRequest)(nil), "cosmos.params.v1beta1.QuerySubspacesRequest") 282 proto.RegisterType((*QuerySubspacesResponse)(nil), "cosmos.params.v1beta1.QuerySubspacesResponse") 283 proto.RegisterType((*Subspace)(nil), "cosmos.params.v1beta1.Subspace") 284 } 285 286 func init() { proto.RegisterFile("cosmos/params/v1beta1/query.proto", fileDescriptor_2b32979c1792ccc4) } 287 288 var fileDescriptor_2b32979c1792ccc4 = []byte{ 289 // 431 bytes of a gzipped FileDescriptorProto 290 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x8b, 0xd3, 0x40, 291 0x18, 0xcd, 0xa4, 0xee, 0xb2, 0x99, 0xbd, 0xe8, 0xe8, 0x6a, 0x08, 0x9a, 0xc6, 0x01, 0x21, 0x2e, 292 0x36, 0x43, 0xab, 0x27, 0xc1, 0x4b, 0x7b, 0x17, 0x8d, 0x07, 0xa1, 0xb7, 0x49, 0x1d, 0xd2, 0xd0, 293 0x26, 0x33, 0xcd, 0x24, 0x62, 0xae, 0x1e, 0x3c, 0x8b, 0xfe, 0x06, 0xc1, 0xa3, 0x3f, 0xa3, 0xc7, 294 0x82, 0x17, 0x4f, 0x22, 0xad, 0xe0, 0xdf, 0x90, 0xce, 0x24, 0x15, 0xbb, 0x6d, 0xe9, 0x25, 0xf9, 295 0xf2, 0xcd, 0xfb, 0xde, 0x7b, 0xdf, 0xcb, 0xc0, 0xfb, 0x23, 0x2e, 0x53, 0x2e, 0x89, 0xa0, 0x39, 296 0x4d, 0x25, 0x79, 0xdb, 0x8d, 0x58, 0x41, 0xbb, 0x64, 0x56, 0xb2, 0xbc, 0x0a, 0x44, 0xce, 0x0b, 297 0x8e, 0x2e, 0x34, 0x24, 0xd0, 0x90, 0xa0, 0x86, 0x38, 0xb7, 0x62, 0x1e, 0x73, 0x85, 0x20, 0xeb, 298 0x4a, 0x83, 0x9d, 0xbb, 0x31, 0xe7, 0xf1, 0x94, 0x11, 0x2a, 0x12, 0x42, 0xb3, 0x8c, 0x17, 0xb4, 299 0x48, 0x78, 0x26, 0xeb, 0x53, 0xbc, 0x5b, 0xad, 0x66, 0xd6, 0x98, 0x1b, 0x34, 0x4d, 0x32, 0x4e, 300 0xd4, 0x53, 0xb7, 0x70, 0x1f, 0xa2, 0x97, 0x6b, 0x43, 0x2f, 0x14, 0x2e, 0x64, 0xb3, 0x92, 0xc9, 301 0x02, 0x39, 0xf0, 0x4c, 0x96, 0x91, 0x14, 0x74, 0xc4, 0x6c, 0xe0, 0x01, 0xdf, 0x0a, 0x37, 0xdf, 302 0xe8, 0x3a, 0x6c, 0x4d, 0x58, 0x65, 0x9b, 0xaa, 0xbd, 0x2e, 0xf1, 0x10, 0xde, 0xfc, 0x8f, 0x43, 303 0x0a, 0x9e, 0x49, 0x86, 0x06, 0xf0, 0x44, 0xa9, 0x2b, 0x86, 0xf3, 0x1e, 0x0e, 0x76, 0x2e, 0x1b, 304 0xa8, 0xa9, 0xc1, 0x98, 0x66, 0x31, 0xeb, 0x5b, 0xf3, 0x9f, 0x6d, 0xe3, 0xeb, 0x9f, 0x6f, 0x97, 305 0x20, 0xd4, 0xb3, 0xf8, 0x0e, 0xbc, 0x50, 0xdc, 0xaf, 0x6a, 0xf9, 0xc6, 0x22, 0x7e, 0x0d, 0x6f, 306 0x6f, 0x1f, 0xd4, 0xba, 0xcf, 0xa0, 0xd5, 0x98, 0x95, 0x36, 0xf0, 0x5a, 0xfe, 0x79, 0xaf, 0xbd, 307 0x47, 0xbb, 0x19, 0x0e, 0xff, 0x4d, 0xe0, 0xa7, 0xf0, 0xac, 0x69, 0x1f, 0xcc, 0x01, 0xc1, 0x6b, 308 0x13, 0x56, 0x49, 0xdb, 0xf4, 0x5a, 0xbe, 0x15, 0xaa, 0xba, 0xf7, 0xc5, 0x84, 0x27, 0xca, 0x15, 309 0xfa, 0x00, 0xe0, 0xa9, 0xce, 0x03, 0x3d, 0xdc, 0x23, 0x7e, 0x35, 0x77, 0xe7, 0xf2, 0x18, 0xa8, 310 0x5e, 0x13, 0x3f, 0x78, 0xff, 0xfd, 0xf7, 0x67, 0xb3, 0x8d, 0xee, 0x91, 0x43, 0x7f, 0x1e, 0x7d, 311 0x02, 0xd0, 0xda, 0x64, 0x84, 0x1e, 0x1d, 0x12, 0xd8, 0xce, 0xd8, 0xe9, 0x1c, 0x89, 0xae, 0x1d, 312 0xf9, 0xca, 0x11, 0x46, 0xde, 0x1e, 0x47, 0x9b, 0x8c, 0xfb, 0xcf, 0xe7, 0x4b, 0x17, 0x2c, 0x96, 313 0x2e, 0xf8, 0xb5, 0x74, 0xc1, 0xc7, 0x95, 0x6b, 0x2c, 0x56, 0xae, 0xf1, 0x63, 0xe5, 0x1a, 0xc3, 314 0x27, 0x71, 0x52, 0x8c, 0xcb, 0x28, 0x18, 0xf1, 0xb4, 0x61, 0xd1, 0xaf, 0x8e, 0x7c, 0x33, 0x21, 315 0xef, 0x1a, 0xca, 0xa2, 0x12, 0x4c, 0x12, 0x91, 0x73, 0xc1, 0x25, 0x9d, 0x46, 0xa7, 0xea, 0x32, 316 0x3f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x8f, 0x2d, 0x28, 0x73, 0x03, 0x00, 0x00, 317 } 318 319 // Reference imports to suppress errors if they are not otherwise used. 320 var _ context.Context 321 var _ grpc.ClientConn 322 323 // This is a compile-time assertion to ensure that this generated file 324 // is compatible with the grpc package it is being compiled against. 325 const _ = grpc.SupportPackageIsVersion4 326 327 // QueryClient is the client API for Query service. 328 // 329 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 330 type QueryClient interface { 331 // Params queries a specific parameter of a module, given its subspace and 332 // key. 333 Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) 334 // Subspaces queries for all registered subspaces and all keys for a subspace. 335 // 336 // Since: cosmos-sdk 0.46 337 Subspaces(ctx context.Context, in *QuerySubspacesRequest, opts ...grpc.CallOption) (*QuerySubspacesResponse, error) 338 } 339 340 type queryClient struct { 341 cc grpc1.ClientConn 342 } 343 344 func NewQueryClient(cc grpc1.ClientConn) QueryClient { 345 return &queryClient{cc} 346 } 347 348 func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { 349 out := new(QueryParamsResponse) 350 err := c.cc.Invoke(ctx, "/cosmos.params.v1beta1.Query/Params", in, out, opts...) 351 if err != nil { 352 return nil, err 353 } 354 return out, nil 355 } 356 357 func (c *queryClient) Subspaces(ctx context.Context, in *QuerySubspacesRequest, opts ...grpc.CallOption) (*QuerySubspacesResponse, error) { 358 out := new(QuerySubspacesResponse) 359 err := c.cc.Invoke(ctx, "/cosmos.params.v1beta1.Query/Subspaces", in, out, opts...) 360 if err != nil { 361 return nil, err 362 } 363 return out, nil 364 } 365 366 // QueryServer is the server API for Query service. 367 type QueryServer interface { 368 // Params queries a specific parameter of a module, given its subspace and 369 // key. 370 Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) 371 // Subspaces queries for all registered subspaces and all keys for a subspace. 372 // 373 // Since: cosmos-sdk 0.46 374 Subspaces(context.Context, *QuerySubspacesRequest) (*QuerySubspacesResponse, error) 375 } 376 377 // UnimplementedQueryServer can be embedded to have forward compatible implementations. 378 type UnimplementedQueryServer struct { 379 } 380 381 func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { 382 return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") 383 } 384 func (*UnimplementedQueryServer) Subspaces(ctx context.Context, req *QuerySubspacesRequest) (*QuerySubspacesResponse, error) { 385 return nil, status.Errorf(codes.Unimplemented, "method Subspaces not implemented") 386 } 387 388 func RegisterQueryServer(s grpc1.Server, srv QueryServer) { 389 s.RegisterService(&_Query_serviceDesc, srv) 390 } 391 392 func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 393 in := new(QueryParamsRequest) 394 if err := dec(in); err != nil { 395 return nil, err 396 } 397 if interceptor == nil { 398 return srv.(QueryServer).Params(ctx, in) 399 } 400 info := &grpc.UnaryServerInfo{ 401 Server: srv, 402 FullMethod: "/cosmos.params.v1beta1.Query/Params", 403 } 404 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 405 return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) 406 } 407 return interceptor(ctx, in, info, handler) 408 } 409 410 func _Query_Subspaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 411 in := new(QuerySubspacesRequest) 412 if err := dec(in); err != nil { 413 return nil, err 414 } 415 if interceptor == nil { 416 return srv.(QueryServer).Subspaces(ctx, in) 417 } 418 info := &grpc.UnaryServerInfo{ 419 Server: srv, 420 FullMethod: "/cosmos.params.v1beta1.Query/Subspaces", 421 } 422 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 423 return srv.(QueryServer).Subspaces(ctx, req.(*QuerySubspacesRequest)) 424 } 425 return interceptor(ctx, in, info, handler) 426 } 427 428 var _Query_serviceDesc = grpc.ServiceDesc{ 429 ServiceName: "cosmos.params.v1beta1.Query", 430 HandlerType: (*QueryServer)(nil), 431 Methods: []grpc.MethodDesc{ 432 { 433 MethodName: "Params", 434 Handler: _Query_Params_Handler, 435 }, 436 { 437 MethodName: "Subspaces", 438 Handler: _Query_Subspaces_Handler, 439 }, 440 }, 441 Streams: []grpc.StreamDesc{}, 442 Metadata: "cosmos/params/v1beta1/query.proto", 443 } 444 445 func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { 446 size := m.Size() 447 dAtA = make([]byte, size) 448 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 449 if err != nil { 450 return nil, err 451 } 452 return dAtA[:n], nil 453 } 454 455 func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { 456 size := m.Size() 457 return m.MarshalToSizedBuffer(dAtA[:size]) 458 } 459 460 func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 461 i := len(dAtA) 462 _ = i 463 var l int 464 _ = l 465 if len(m.Key) > 0 { 466 i -= len(m.Key) 467 copy(dAtA[i:], m.Key) 468 i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) 469 i-- 470 dAtA[i] = 0x12 471 } 472 if len(m.Subspace) > 0 { 473 i -= len(m.Subspace) 474 copy(dAtA[i:], m.Subspace) 475 i = encodeVarintQuery(dAtA, i, uint64(len(m.Subspace))) 476 i-- 477 dAtA[i] = 0xa 478 } 479 return len(dAtA) - i, nil 480 } 481 482 func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { 483 size := m.Size() 484 dAtA = make([]byte, size) 485 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 486 if err != nil { 487 return nil, err 488 } 489 return dAtA[:n], nil 490 } 491 492 func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { 493 size := m.Size() 494 return m.MarshalToSizedBuffer(dAtA[:size]) 495 } 496 497 func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 498 i := len(dAtA) 499 _ = i 500 var l int 501 _ = l 502 { 503 size, err := m.Param.MarshalToSizedBuffer(dAtA[:i]) 504 if err != nil { 505 return 0, err 506 } 507 i -= size 508 i = encodeVarintQuery(dAtA, i, uint64(size)) 509 } 510 i-- 511 dAtA[i] = 0xa 512 return len(dAtA) - i, nil 513 } 514 515 func (m *QuerySubspacesRequest) Marshal() (dAtA []byte, err error) { 516 size := m.Size() 517 dAtA = make([]byte, size) 518 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 519 if err != nil { 520 return nil, err 521 } 522 return dAtA[:n], nil 523 } 524 525 func (m *QuerySubspacesRequest) MarshalTo(dAtA []byte) (int, error) { 526 size := m.Size() 527 return m.MarshalToSizedBuffer(dAtA[:size]) 528 } 529 530 func (m *QuerySubspacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 531 i := len(dAtA) 532 _ = i 533 var l int 534 _ = l 535 return len(dAtA) - i, nil 536 } 537 538 func (m *QuerySubspacesResponse) Marshal() (dAtA []byte, err error) { 539 size := m.Size() 540 dAtA = make([]byte, size) 541 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 542 if err != nil { 543 return nil, err 544 } 545 return dAtA[:n], nil 546 } 547 548 func (m *QuerySubspacesResponse) MarshalTo(dAtA []byte) (int, error) { 549 size := m.Size() 550 return m.MarshalToSizedBuffer(dAtA[:size]) 551 } 552 553 func (m *QuerySubspacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 554 i := len(dAtA) 555 _ = i 556 var l int 557 _ = l 558 if len(m.Subspaces) > 0 { 559 for iNdEx := len(m.Subspaces) - 1; iNdEx >= 0; iNdEx-- { 560 { 561 size, err := m.Subspaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 562 if err != nil { 563 return 0, err 564 } 565 i -= size 566 i = encodeVarintQuery(dAtA, i, uint64(size)) 567 } 568 i-- 569 dAtA[i] = 0xa 570 } 571 } 572 return len(dAtA) - i, nil 573 } 574 575 func (m *Subspace) Marshal() (dAtA []byte, err error) { 576 size := m.Size() 577 dAtA = make([]byte, size) 578 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 579 if err != nil { 580 return nil, err 581 } 582 return dAtA[:n], nil 583 } 584 585 func (m *Subspace) MarshalTo(dAtA []byte) (int, error) { 586 size := m.Size() 587 return m.MarshalToSizedBuffer(dAtA[:size]) 588 } 589 590 func (m *Subspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { 591 i := len(dAtA) 592 _ = i 593 var l int 594 _ = l 595 if len(m.Keys) > 0 { 596 for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { 597 i -= len(m.Keys[iNdEx]) 598 copy(dAtA[i:], m.Keys[iNdEx]) 599 i = encodeVarintQuery(dAtA, i, uint64(len(m.Keys[iNdEx]))) 600 i-- 601 dAtA[i] = 0x12 602 } 603 } 604 if len(m.Subspace) > 0 { 605 i -= len(m.Subspace) 606 copy(dAtA[i:], m.Subspace) 607 i = encodeVarintQuery(dAtA, i, uint64(len(m.Subspace))) 608 i-- 609 dAtA[i] = 0xa 610 } 611 return len(dAtA) - i, nil 612 } 613 614 func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { 615 offset -= sovQuery(v) 616 base := offset 617 for v >= 1<<7 { 618 dAtA[offset] = uint8(v&0x7f | 0x80) 619 v >>= 7 620 offset++ 621 } 622 dAtA[offset] = uint8(v) 623 return base 624 } 625 func (m *QueryParamsRequest) Size() (n int) { 626 if m == nil { 627 return 0 628 } 629 var l int 630 _ = l 631 l = len(m.Subspace) 632 if l > 0 { 633 n += 1 + l + sovQuery(uint64(l)) 634 } 635 l = len(m.Key) 636 if l > 0 { 637 n += 1 + l + sovQuery(uint64(l)) 638 } 639 return n 640 } 641 642 func (m *QueryParamsResponse) Size() (n int) { 643 if m == nil { 644 return 0 645 } 646 var l int 647 _ = l 648 l = m.Param.Size() 649 n += 1 + l + sovQuery(uint64(l)) 650 return n 651 } 652 653 func (m *QuerySubspacesRequest) Size() (n int) { 654 if m == nil { 655 return 0 656 } 657 var l int 658 _ = l 659 return n 660 } 661 662 func (m *QuerySubspacesResponse) Size() (n int) { 663 if m == nil { 664 return 0 665 } 666 var l int 667 _ = l 668 if len(m.Subspaces) > 0 { 669 for _, e := range m.Subspaces { 670 l = e.Size() 671 n += 1 + l + sovQuery(uint64(l)) 672 } 673 } 674 return n 675 } 676 677 func (m *Subspace) Size() (n int) { 678 if m == nil { 679 return 0 680 } 681 var l int 682 _ = l 683 l = len(m.Subspace) 684 if l > 0 { 685 n += 1 + l + sovQuery(uint64(l)) 686 } 687 if len(m.Keys) > 0 { 688 for _, s := range m.Keys { 689 l = len(s) 690 n += 1 + l + sovQuery(uint64(l)) 691 } 692 } 693 return n 694 } 695 696 func sovQuery(x uint64) (n int) { 697 return (math_bits.Len64(x|1) + 6) / 7 698 } 699 func sozQuery(x uint64) (n int) { 700 return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 701 } 702 func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { 703 l := len(dAtA) 704 iNdEx := 0 705 for iNdEx < l { 706 preIndex := iNdEx 707 var wire uint64 708 for shift := uint(0); ; shift += 7 { 709 if shift >= 64 { 710 return ErrIntOverflowQuery 711 } 712 if iNdEx >= l { 713 return io.ErrUnexpectedEOF 714 } 715 b := dAtA[iNdEx] 716 iNdEx++ 717 wire |= uint64(b&0x7F) << shift 718 if b < 0x80 { 719 break 720 } 721 } 722 fieldNum := int32(wire >> 3) 723 wireType := int(wire & 0x7) 724 if wireType == 4 { 725 return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") 726 } 727 if fieldNum <= 0 { 728 return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) 729 } 730 switch fieldNum { 731 case 1: 732 if wireType != 2 { 733 return fmt.Errorf("proto: wrong wireType = %d for field Subspace", wireType) 734 } 735 var stringLen uint64 736 for shift := uint(0); ; shift += 7 { 737 if shift >= 64 { 738 return ErrIntOverflowQuery 739 } 740 if iNdEx >= l { 741 return io.ErrUnexpectedEOF 742 } 743 b := dAtA[iNdEx] 744 iNdEx++ 745 stringLen |= uint64(b&0x7F) << shift 746 if b < 0x80 { 747 break 748 } 749 } 750 intStringLen := int(stringLen) 751 if intStringLen < 0 { 752 return ErrInvalidLengthQuery 753 } 754 postIndex := iNdEx + intStringLen 755 if postIndex < 0 { 756 return ErrInvalidLengthQuery 757 } 758 if postIndex > l { 759 return io.ErrUnexpectedEOF 760 } 761 m.Subspace = string(dAtA[iNdEx:postIndex]) 762 iNdEx = postIndex 763 case 2: 764 if wireType != 2 { 765 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 766 } 767 var stringLen uint64 768 for shift := uint(0); ; shift += 7 { 769 if shift >= 64 { 770 return ErrIntOverflowQuery 771 } 772 if iNdEx >= l { 773 return io.ErrUnexpectedEOF 774 } 775 b := dAtA[iNdEx] 776 iNdEx++ 777 stringLen |= uint64(b&0x7F) << shift 778 if b < 0x80 { 779 break 780 } 781 } 782 intStringLen := int(stringLen) 783 if intStringLen < 0 { 784 return ErrInvalidLengthQuery 785 } 786 postIndex := iNdEx + intStringLen 787 if postIndex < 0 { 788 return ErrInvalidLengthQuery 789 } 790 if postIndex > l { 791 return io.ErrUnexpectedEOF 792 } 793 m.Key = string(dAtA[iNdEx:postIndex]) 794 iNdEx = postIndex 795 default: 796 iNdEx = preIndex 797 skippy, err := skipQuery(dAtA[iNdEx:]) 798 if err != nil { 799 return err 800 } 801 if (skippy < 0) || (iNdEx+skippy) < 0 { 802 return ErrInvalidLengthQuery 803 } 804 if (iNdEx + skippy) > l { 805 return io.ErrUnexpectedEOF 806 } 807 iNdEx += skippy 808 } 809 } 810 811 if iNdEx > l { 812 return io.ErrUnexpectedEOF 813 } 814 return nil 815 } 816 func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { 817 l := len(dAtA) 818 iNdEx := 0 819 for iNdEx < l { 820 preIndex := iNdEx 821 var wire uint64 822 for shift := uint(0); ; shift += 7 { 823 if shift >= 64 { 824 return ErrIntOverflowQuery 825 } 826 if iNdEx >= l { 827 return io.ErrUnexpectedEOF 828 } 829 b := dAtA[iNdEx] 830 iNdEx++ 831 wire |= uint64(b&0x7F) << shift 832 if b < 0x80 { 833 break 834 } 835 } 836 fieldNum := int32(wire >> 3) 837 wireType := int(wire & 0x7) 838 if wireType == 4 { 839 return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") 840 } 841 if fieldNum <= 0 { 842 return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) 843 } 844 switch fieldNum { 845 case 1: 846 if wireType != 2 { 847 return fmt.Errorf("proto: wrong wireType = %d for field Param", wireType) 848 } 849 var msglen int 850 for shift := uint(0); ; shift += 7 { 851 if shift >= 64 { 852 return ErrIntOverflowQuery 853 } 854 if iNdEx >= l { 855 return io.ErrUnexpectedEOF 856 } 857 b := dAtA[iNdEx] 858 iNdEx++ 859 msglen |= int(b&0x7F) << shift 860 if b < 0x80 { 861 break 862 } 863 } 864 if msglen < 0 { 865 return ErrInvalidLengthQuery 866 } 867 postIndex := iNdEx + msglen 868 if postIndex < 0 { 869 return ErrInvalidLengthQuery 870 } 871 if postIndex > l { 872 return io.ErrUnexpectedEOF 873 } 874 if err := m.Param.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 875 return err 876 } 877 iNdEx = postIndex 878 default: 879 iNdEx = preIndex 880 skippy, err := skipQuery(dAtA[iNdEx:]) 881 if err != nil { 882 return err 883 } 884 if (skippy < 0) || (iNdEx+skippy) < 0 { 885 return ErrInvalidLengthQuery 886 } 887 if (iNdEx + skippy) > l { 888 return io.ErrUnexpectedEOF 889 } 890 iNdEx += skippy 891 } 892 } 893 894 if iNdEx > l { 895 return io.ErrUnexpectedEOF 896 } 897 return nil 898 } 899 func (m *QuerySubspacesRequest) Unmarshal(dAtA []byte) error { 900 l := len(dAtA) 901 iNdEx := 0 902 for iNdEx < l { 903 preIndex := iNdEx 904 var wire uint64 905 for shift := uint(0); ; shift += 7 { 906 if shift >= 64 { 907 return ErrIntOverflowQuery 908 } 909 if iNdEx >= l { 910 return io.ErrUnexpectedEOF 911 } 912 b := dAtA[iNdEx] 913 iNdEx++ 914 wire |= uint64(b&0x7F) << shift 915 if b < 0x80 { 916 break 917 } 918 } 919 fieldNum := int32(wire >> 3) 920 wireType := int(wire & 0x7) 921 if wireType == 4 { 922 return fmt.Errorf("proto: QuerySubspacesRequest: wiretype end group for non-group") 923 } 924 if fieldNum <= 0 { 925 return fmt.Errorf("proto: QuerySubspacesRequest: illegal tag %d (wire type %d)", fieldNum, wire) 926 } 927 switch fieldNum { 928 default: 929 iNdEx = preIndex 930 skippy, err := skipQuery(dAtA[iNdEx:]) 931 if err != nil { 932 return err 933 } 934 if (skippy < 0) || (iNdEx+skippy) < 0 { 935 return ErrInvalidLengthQuery 936 } 937 if (iNdEx + skippy) > l { 938 return io.ErrUnexpectedEOF 939 } 940 iNdEx += skippy 941 } 942 } 943 944 if iNdEx > l { 945 return io.ErrUnexpectedEOF 946 } 947 return nil 948 } 949 func (m *QuerySubspacesResponse) Unmarshal(dAtA []byte) error { 950 l := len(dAtA) 951 iNdEx := 0 952 for iNdEx < l { 953 preIndex := iNdEx 954 var wire uint64 955 for shift := uint(0); ; shift += 7 { 956 if shift >= 64 { 957 return ErrIntOverflowQuery 958 } 959 if iNdEx >= l { 960 return io.ErrUnexpectedEOF 961 } 962 b := dAtA[iNdEx] 963 iNdEx++ 964 wire |= uint64(b&0x7F) << shift 965 if b < 0x80 { 966 break 967 } 968 } 969 fieldNum := int32(wire >> 3) 970 wireType := int(wire & 0x7) 971 if wireType == 4 { 972 return fmt.Errorf("proto: QuerySubspacesResponse: wiretype end group for non-group") 973 } 974 if fieldNum <= 0 { 975 return fmt.Errorf("proto: QuerySubspacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) 976 } 977 switch fieldNum { 978 case 1: 979 if wireType != 2 { 980 return fmt.Errorf("proto: wrong wireType = %d for field Subspaces", wireType) 981 } 982 var msglen int 983 for shift := uint(0); ; shift += 7 { 984 if shift >= 64 { 985 return ErrIntOverflowQuery 986 } 987 if iNdEx >= l { 988 return io.ErrUnexpectedEOF 989 } 990 b := dAtA[iNdEx] 991 iNdEx++ 992 msglen |= int(b&0x7F) << shift 993 if b < 0x80 { 994 break 995 } 996 } 997 if msglen < 0 { 998 return ErrInvalidLengthQuery 999 } 1000 postIndex := iNdEx + msglen 1001 if postIndex < 0 { 1002 return ErrInvalidLengthQuery 1003 } 1004 if postIndex > l { 1005 return io.ErrUnexpectedEOF 1006 } 1007 m.Subspaces = append(m.Subspaces, &Subspace{}) 1008 if err := m.Subspaces[len(m.Subspaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1009 return err 1010 } 1011 iNdEx = postIndex 1012 default: 1013 iNdEx = preIndex 1014 skippy, err := skipQuery(dAtA[iNdEx:]) 1015 if err != nil { 1016 return err 1017 } 1018 if (skippy < 0) || (iNdEx+skippy) < 0 { 1019 return ErrInvalidLengthQuery 1020 } 1021 if (iNdEx + skippy) > l { 1022 return io.ErrUnexpectedEOF 1023 } 1024 iNdEx += skippy 1025 } 1026 } 1027 1028 if iNdEx > l { 1029 return io.ErrUnexpectedEOF 1030 } 1031 return nil 1032 } 1033 func (m *Subspace) Unmarshal(dAtA []byte) error { 1034 l := len(dAtA) 1035 iNdEx := 0 1036 for iNdEx < l { 1037 preIndex := iNdEx 1038 var wire uint64 1039 for shift := uint(0); ; shift += 7 { 1040 if shift >= 64 { 1041 return ErrIntOverflowQuery 1042 } 1043 if iNdEx >= l { 1044 return io.ErrUnexpectedEOF 1045 } 1046 b := dAtA[iNdEx] 1047 iNdEx++ 1048 wire |= uint64(b&0x7F) << shift 1049 if b < 0x80 { 1050 break 1051 } 1052 } 1053 fieldNum := int32(wire >> 3) 1054 wireType := int(wire & 0x7) 1055 if wireType == 4 { 1056 return fmt.Errorf("proto: Subspace: wiretype end group for non-group") 1057 } 1058 if fieldNum <= 0 { 1059 return fmt.Errorf("proto: Subspace: illegal tag %d (wire type %d)", fieldNum, wire) 1060 } 1061 switch fieldNum { 1062 case 1: 1063 if wireType != 2 { 1064 return fmt.Errorf("proto: wrong wireType = %d for field Subspace", wireType) 1065 } 1066 var stringLen uint64 1067 for shift := uint(0); ; shift += 7 { 1068 if shift >= 64 { 1069 return ErrIntOverflowQuery 1070 } 1071 if iNdEx >= l { 1072 return io.ErrUnexpectedEOF 1073 } 1074 b := dAtA[iNdEx] 1075 iNdEx++ 1076 stringLen |= uint64(b&0x7F) << shift 1077 if b < 0x80 { 1078 break 1079 } 1080 } 1081 intStringLen := int(stringLen) 1082 if intStringLen < 0 { 1083 return ErrInvalidLengthQuery 1084 } 1085 postIndex := iNdEx + intStringLen 1086 if postIndex < 0 { 1087 return ErrInvalidLengthQuery 1088 } 1089 if postIndex > l { 1090 return io.ErrUnexpectedEOF 1091 } 1092 m.Subspace = string(dAtA[iNdEx:postIndex]) 1093 iNdEx = postIndex 1094 case 2: 1095 if wireType != 2 { 1096 return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) 1097 } 1098 var stringLen uint64 1099 for shift := uint(0); ; shift += 7 { 1100 if shift >= 64 { 1101 return ErrIntOverflowQuery 1102 } 1103 if iNdEx >= l { 1104 return io.ErrUnexpectedEOF 1105 } 1106 b := dAtA[iNdEx] 1107 iNdEx++ 1108 stringLen |= uint64(b&0x7F) << shift 1109 if b < 0x80 { 1110 break 1111 } 1112 } 1113 intStringLen := int(stringLen) 1114 if intStringLen < 0 { 1115 return ErrInvalidLengthQuery 1116 } 1117 postIndex := iNdEx + intStringLen 1118 if postIndex < 0 { 1119 return ErrInvalidLengthQuery 1120 } 1121 if postIndex > l { 1122 return io.ErrUnexpectedEOF 1123 } 1124 m.Keys = append(m.Keys, string(dAtA[iNdEx:postIndex])) 1125 iNdEx = postIndex 1126 default: 1127 iNdEx = preIndex 1128 skippy, err := skipQuery(dAtA[iNdEx:]) 1129 if err != nil { 1130 return err 1131 } 1132 if (skippy < 0) || (iNdEx+skippy) < 0 { 1133 return ErrInvalidLengthQuery 1134 } 1135 if (iNdEx + skippy) > l { 1136 return io.ErrUnexpectedEOF 1137 } 1138 iNdEx += skippy 1139 } 1140 } 1141 1142 if iNdEx > l { 1143 return io.ErrUnexpectedEOF 1144 } 1145 return nil 1146 } 1147 func skipQuery(dAtA []byte) (n int, err error) { 1148 l := len(dAtA) 1149 iNdEx := 0 1150 depth := 0 1151 for iNdEx < l { 1152 var wire uint64 1153 for shift := uint(0); ; shift += 7 { 1154 if shift >= 64 { 1155 return 0, ErrIntOverflowQuery 1156 } 1157 if iNdEx >= l { 1158 return 0, io.ErrUnexpectedEOF 1159 } 1160 b := dAtA[iNdEx] 1161 iNdEx++ 1162 wire |= (uint64(b) & 0x7F) << shift 1163 if b < 0x80 { 1164 break 1165 } 1166 } 1167 wireType := int(wire & 0x7) 1168 switch wireType { 1169 case 0: 1170 for shift := uint(0); ; shift += 7 { 1171 if shift >= 64 { 1172 return 0, ErrIntOverflowQuery 1173 } 1174 if iNdEx >= l { 1175 return 0, io.ErrUnexpectedEOF 1176 } 1177 iNdEx++ 1178 if dAtA[iNdEx-1] < 0x80 { 1179 break 1180 } 1181 } 1182 case 1: 1183 iNdEx += 8 1184 case 2: 1185 var length int 1186 for shift := uint(0); ; shift += 7 { 1187 if shift >= 64 { 1188 return 0, ErrIntOverflowQuery 1189 } 1190 if iNdEx >= l { 1191 return 0, io.ErrUnexpectedEOF 1192 } 1193 b := dAtA[iNdEx] 1194 iNdEx++ 1195 length |= (int(b) & 0x7F) << shift 1196 if b < 0x80 { 1197 break 1198 } 1199 } 1200 if length < 0 { 1201 return 0, ErrInvalidLengthQuery 1202 } 1203 iNdEx += length 1204 case 3: 1205 depth++ 1206 case 4: 1207 if depth == 0 { 1208 return 0, ErrUnexpectedEndOfGroupQuery 1209 } 1210 depth-- 1211 case 5: 1212 iNdEx += 4 1213 default: 1214 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1215 } 1216 if iNdEx < 0 { 1217 return 0, ErrInvalidLengthQuery 1218 } 1219 if depth == 0 { 1220 return iNdEx, nil 1221 } 1222 } 1223 return 0, io.ErrUnexpectedEOF 1224 } 1225 1226 var ( 1227 ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") 1228 ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") 1229 ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") 1230 )