github.com/cosmos/cosmos-sdk@v0.50.10/x/gov/types/v1/query.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: cosmos/gov/v1/query.proto 3 4 /* 5 Package v1 is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package v1 10 11 import ( 12 "context" 13 "io" 14 "net/http" 15 16 "github.com/golang/protobuf/descriptor" 17 "github.com/golang/protobuf/proto" 18 "github.com/grpc-ecosystem/grpc-gateway/runtime" 19 "github.com/grpc-ecosystem/grpc-gateway/utilities" 20 "google.golang.org/grpc" 21 "google.golang.org/grpc/codes" 22 "google.golang.org/grpc/grpclog" 23 "google.golang.org/grpc/metadata" 24 "google.golang.org/grpc/status" 25 ) 26 27 // Suppress "imported and not used" errors 28 var _ codes.Code 29 var _ io.Reader 30 var _ status.Status 31 var _ = runtime.String 32 var _ = utilities.NewDoubleArray 33 var _ = descriptor.ForMessage 34 var _ = metadata.Join 35 36 func request_Query_Constitution_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 37 var protoReq QueryConstitutionRequest 38 var metadata runtime.ServerMetadata 39 40 msg, err := client.Constitution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 41 return msg, metadata, err 42 43 } 44 45 func local_request_Query_Constitution_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 46 var protoReq QueryConstitutionRequest 47 var metadata runtime.ServerMetadata 48 49 msg, err := server.Constitution(ctx, &protoReq) 50 return msg, metadata, err 51 52 } 53 54 func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 55 var protoReq QueryProposalRequest 56 var metadata runtime.ServerMetadata 57 58 var ( 59 val string 60 ok bool 61 err error 62 _ = err 63 ) 64 65 val, ok = pathParams["proposal_id"] 66 if !ok { 67 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 68 } 69 70 protoReq.ProposalId, err = runtime.Uint64(val) 71 72 if err != nil { 73 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 74 } 75 76 msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 77 return msg, metadata, err 78 79 } 80 81 func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 82 var protoReq QueryProposalRequest 83 var metadata runtime.ServerMetadata 84 85 var ( 86 val string 87 ok bool 88 err error 89 _ = err 90 ) 91 92 val, ok = pathParams["proposal_id"] 93 if !ok { 94 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 95 } 96 97 protoReq.ProposalId, err = runtime.Uint64(val) 98 99 if err != nil { 100 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 101 } 102 103 msg, err := server.Proposal(ctx, &protoReq) 104 return msg, metadata, err 105 106 } 107 108 var ( 109 filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} 110 ) 111 112 func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 113 var protoReq QueryProposalsRequest 114 var metadata runtime.ServerMetadata 115 116 if err := req.ParseForm(); err != nil { 117 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 118 } 119 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { 120 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 121 } 122 123 msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 124 return msg, metadata, err 125 126 } 127 128 func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 129 var protoReq QueryProposalsRequest 130 var metadata runtime.ServerMetadata 131 132 if err := req.ParseForm(); err != nil { 133 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 134 } 135 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { 136 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 137 } 138 139 msg, err := server.Proposals(ctx, &protoReq) 140 return msg, metadata, err 141 142 } 143 144 func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 145 var protoReq QueryVoteRequest 146 var metadata runtime.ServerMetadata 147 148 var ( 149 val string 150 ok bool 151 err error 152 _ = err 153 ) 154 155 val, ok = pathParams["proposal_id"] 156 if !ok { 157 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 158 } 159 160 protoReq.ProposalId, err = runtime.Uint64(val) 161 162 if err != nil { 163 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 164 } 165 166 val, ok = pathParams["voter"] 167 if !ok { 168 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") 169 } 170 171 protoReq.Voter, err = runtime.String(val) 172 173 if err != nil { 174 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) 175 } 176 177 msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 178 return msg, metadata, err 179 180 } 181 182 func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 183 var protoReq QueryVoteRequest 184 var metadata runtime.ServerMetadata 185 186 var ( 187 val string 188 ok bool 189 err error 190 _ = err 191 ) 192 193 val, ok = pathParams["proposal_id"] 194 if !ok { 195 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 196 } 197 198 protoReq.ProposalId, err = runtime.Uint64(val) 199 200 if err != nil { 201 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 202 } 203 204 val, ok = pathParams["voter"] 205 if !ok { 206 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") 207 } 208 209 protoReq.Voter, err = runtime.String(val) 210 211 if err != nil { 212 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) 213 } 214 215 msg, err := server.Vote(ctx, &protoReq) 216 return msg, metadata, err 217 218 } 219 220 var ( 221 filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 222 ) 223 224 func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 225 var protoReq QueryVotesRequest 226 var metadata runtime.ServerMetadata 227 228 var ( 229 val string 230 ok bool 231 err error 232 _ = err 233 ) 234 235 val, ok = pathParams["proposal_id"] 236 if !ok { 237 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 238 } 239 240 protoReq.ProposalId, err = runtime.Uint64(val) 241 242 if err != nil { 243 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 244 } 245 246 if err := req.ParseForm(); err != nil { 247 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 248 } 249 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { 250 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 251 } 252 253 msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 254 return msg, metadata, err 255 256 } 257 258 func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 259 var protoReq QueryVotesRequest 260 var metadata runtime.ServerMetadata 261 262 var ( 263 val string 264 ok bool 265 err error 266 _ = err 267 ) 268 269 val, ok = pathParams["proposal_id"] 270 if !ok { 271 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 272 } 273 274 protoReq.ProposalId, err = runtime.Uint64(val) 275 276 if err != nil { 277 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 278 } 279 280 if err := req.ParseForm(); err != nil { 281 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 282 } 283 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { 284 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 285 } 286 287 msg, err := server.Votes(ctx, &protoReq) 288 return msg, metadata, err 289 290 } 291 292 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) { 293 var protoReq QueryParamsRequest 294 var metadata runtime.ServerMetadata 295 296 var ( 297 val string 298 ok bool 299 err error 300 _ = err 301 ) 302 303 val, ok = pathParams["params_type"] 304 if !ok { 305 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") 306 } 307 308 protoReq.ParamsType, err = runtime.String(val) 309 310 if err != nil { 311 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) 312 } 313 314 msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 315 return msg, metadata, err 316 317 } 318 319 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) { 320 var protoReq QueryParamsRequest 321 var metadata runtime.ServerMetadata 322 323 var ( 324 val string 325 ok bool 326 err error 327 _ = err 328 ) 329 330 val, ok = pathParams["params_type"] 331 if !ok { 332 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") 333 } 334 335 protoReq.ParamsType, err = runtime.String(val) 336 337 if err != nil { 338 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) 339 } 340 341 msg, err := server.Params(ctx, &protoReq) 342 return msg, metadata, err 343 344 } 345 346 func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 347 var protoReq QueryDepositRequest 348 var metadata runtime.ServerMetadata 349 350 var ( 351 val string 352 ok bool 353 err error 354 _ = err 355 ) 356 357 val, ok = pathParams["proposal_id"] 358 if !ok { 359 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 360 } 361 362 protoReq.ProposalId, err = runtime.Uint64(val) 363 364 if err != nil { 365 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 366 } 367 368 val, ok = pathParams["depositor"] 369 if !ok { 370 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") 371 } 372 373 protoReq.Depositor, err = runtime.String(val) 374 375 if err != nil { 376 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) 377 } 378 379 msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 380 return msg, metadata, err 381 382 } 383 384 func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 385 var protoReq QueryDepositRequest 386 var metadata runtime.ServerMetadata 387 388 var ( 389 val string 390 ok bool 391 err error 392 _ = err 393 ) 394 395 val, ok = pathParams["proposal_id"] 396 if !ok { 397 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 398 } 399 400 protoReq.ProposalId, err = runtime.Uint64(val) 401 402 if err != nil { 403 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 404 } 405 406 val, ok = pathParams["depositor"] 407 if !ok { 408 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") 409 } 410 411 protoReq.Depositor, err = runtime.String(val) 412 413 if err != nil { 414 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) 415 } 416 417 msg, err := server.Deposit(ctx, &protoReq) 418 return msg, metadata, err 419 420 } 421 422 var ( 423 filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} 424 ) 425 426 func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 427 var protoReq QueryDepositsRequest 428 var metadata runtime.ServerMetadata 429 430 var ( 431 val string 432 ok bool 433 err error 434 _ = err 435 ) 436 437 val, ok = pathParams["proposal_id"] 438 if !ok { 439 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 440 } 441 442 protoReq.ProposalId, err = runtime.Uint64(val) 443 444 if err != nil { 445 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 446 } 447 448 if err := req.ParseForm(); err != nil { 449 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 450 } 451 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { 452 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 453 } 454 455 msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 456 return msg, metadata, err 457 458 } 459 460 func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 461 var protoReq QueryDepositsRequest 462 var metadata runtime.ServerMetadata 463 464 var ( 465 val string 466 ok bool 467 err error 468 _ = err 469 ) 470 471 val, ok = pathParams["proposal_id"] 472 if !ok { 473 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 474 } 475 476 protoReq.ProposalId, err = runtime.Uint64(val) 477 478 if err != nil { 479 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 480 } 481 482 if err := req.ParseForm(); err != nil { 483 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 484 } 485 if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { 486 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 487 } 488 489 msg, err := server.Deposits(ctx, &protoReq) 490 return msg, metadata, err 491 492 } 493 494 func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 495 var protoReq QueryTallyResultRequest 496 var metadata runtime.ServerMetadata 497 498 var ( 499 val string 500 ok bool 501 err error 502 _ = err 503 ) 504 505 val, ok = pathParams["proposal_id"] 506 if !ok { 507 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 508 } 509 510 protoReq.ProposalId, err = runtime.Uint64(val) 511 512 if err != nil { 513 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 514 } 515 516 msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 517 return msg, metadata, err 518 519 } 520 521 func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 522 var protoReq QueryTallyResultRequest 523 var metadata runtime.ServerMetadata 524 525 var ( 526 val string 527 ok bool 528 err error 529 _ = err 530 ) 531 532 val, ok = pathParams["proposal_id"] 533 if !ok { 534 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") 535 } 536 537 protoReq.ProposalId, err = runtime.Uint64(val) 538 539 if err != nil { 540 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) 541 } 542 543 msg, err := server.TallyResult(ctx, &protoReq) 544 return msg, metadata, err 545 546 } 547 548 // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". 549 // UnaryRPC :call QueryServer directly. 550 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 551 // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. 552 func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { 553 554 mux.Handle("GET", pattern_Query_Constitution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 555 ctx, cancel := context.WithCancel(req.Context()) 556 defer cancel() 557 var stream runtime.ServerTransportStream 558 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 559 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 560 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 561 if err != nil { 562 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 563 return 564 } 565 resp, md, err := local_request_Query_Constitution_0(rctx, inboundMarshaler, server, req, pathParams) 566 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 567 ctx = runtime.NewServerMetadataContext(ctx, md) 568 if err != nil { 569 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 570 return 571 } 572 573 forward_Query_Constitution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 574 575 }) 576 577 mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 578 ctx, cancel := context.WithCancel(req.Context()) 579 defer cancel() 580 var stream runtime.ServerTransportStream 581 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 582 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 583 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 584 if err != nil { 585 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 586 return 587 } 588 resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) 589 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 590 ctx = runtime.NewServerMetadataContext(ctx, md) 591 if err != nil { 592 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 593 return 594 } 595 596 forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 597 598 }) 599 600 mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 601 ctx, cancel := context.WithCancel(req.Context()) 602 defer cancel() 603 var stream runtime.ServerTransportStream 604 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 605 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 606 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 607 if err != nil { 608 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 609 return 610 } 611 resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) 612 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 613 ctx = runtime.NewServerMetadataContext(ctx, md) 614 if err != nil { 615 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 616 return 617 } 618 619 forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 620 621 }) 622 623 mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 624 ctx, cancel := context.WithCancel(req.Context()) 625 defer cancel() 626 var stream runtime.ServerTransportStream 627 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 628 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 629 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 630 if err != nil { 631 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 632 return 633 } 634 resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) 635 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 636 ctx = runtime.NewServerMetadataContext(ctx, md) 637 if err != nil { 638 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 639 return 640 } 641 642 forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 643 644 }) 645 646 mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 647 ctx, cancel := context.WithCancel(req.Context()) 648 defer cancel() 649 var stream runtime.ServerTransportStream 650 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 651 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 652 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 653 if err != nil { 654 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 655 return 656 } 657 resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) 658 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 659 ctx = runtime.NewServerMetadataContext(ctx, md) 660 if err != nil { 661 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 662 return 663 } 664 665 forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 666 667 }) 668 669 mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 670 ctx, cancel := context.WithCancel(req.Context()) 671 defer cancel() 672 var stream runtime.ServerTransportStream 673 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 674 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 675 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 676 if err != nil { 677 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 678 return 679 } 680 resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) 681 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 682 ctx = runtime.NewServerMetadataContext(ctx, md) 683 if err != nil { 684 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 685 return 686 } 687 688 forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 689 690 }) 691 692 mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 693 ctx, cancel := context.WithCancel(req.Context()) 694 defer cancel() 695 var stream runtime.ServerTransportStream 696 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 697 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 698 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 699 if err != nil { 700 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 701 return 702 } 703 resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) 704 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 705 ctx = runtime.NewServerMetadataContext(ctx, md) 706 if err != nil { 707 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 708 return 709 } 710 711 forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 712 713 }) 714 715 mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 716 ctx, cancel := context.WithCancel(req.Context()) 717 defer cancel() 718 var stream runtime.ServerTransportStream 719 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 720 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 721 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 722 if err != nil { 723 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 724 return 725 } 726 resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) 727 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 728 ctx = runtime.NewServerMetadataContext(ctx, md) 729 if err != nil { 730 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 731 return 732 } 733 734 forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 735 736 }) 737 738 mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 739 ctx, cancel := context.WithCancel(req.Context()) 740 defer cancel() 741 var stream runtime.ServerTransportStream 742 ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) 743 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 744 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 745 if err != nil { 746 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 747 return 748 } 749 resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) 750 md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) 751 ctx = runtime.NewServerMetadataContext(ctx, md) 752 if err != nil { 753 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 754 return 755 } 756 757 forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 758 759 }) 760 761 return nil 762 } 763 764 // RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but 765 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 766 func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 767 conn, err := grpc.Dial(endpoint, opts...) 768 if err != nil { 769 return err 770 } 771 defer func() { 772 if err != nil { 773 if cerr := conn.Close(); cerr != nil { 774 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 775 } 776 return 777 } 778 go func() { 779 <-ctx.Done() 780 if cerr := conn.Close(); cerr != nil { 781 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 782 } 783 }() 784 }() 785 786 return RegisterQueryHandler(ctx, mux, conn) 787 } 788 789 // RegisterQueryHandler registers the http handlers for service Query to "mux". 790 // The handlers forward requests to the grpc endpoint over "conn". 791 func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 792 return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) 793 } 794 795 // RegisterQueryHandlerClient registers the http handlers for service Query 796 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". 797 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" 798 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 799 // "QueryClient" to call the correct interceptors. 800 func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { 801 802 mux.Handle("GET", pattern_Query_Constitution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 803 ctx, cancel := context.WithCancel(req.Context()) 804 defer cancel() 805 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 806 rctx, err := runtime.AnnotateContext(ctx, mux, req) 807 if err != nil { 808 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 809 return 810 } 811 resp, md, err := request_Query_Constitution_0(rctx, inboundMarshaler, client, req, pathParams) 812 ctx = runtime.NewServerMetadataContext(ctx, md) 813 if err != nil { 814 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 815 return 816 } 817 818 forward_Query_Constitution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 819 820 }) 821 822 mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 823 ctx, cancel := context.WithCancel(req.Context()) 824 defer cancel() 825 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 826 rctx, err := runtime.AnnotateContext(ctx, mux, req) 827 if err != nil { 828 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 829 return 830 } 831 resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) 832 ctx = runtime.NewServerMetadataContext(ctx, md) 833 if err != nil { 834 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 835 return 836 } 837 838 forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 839 840 }) 841 842 mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 843 ctx, cancel := context.WithCancel(req.Context()) 844 defer cancel() 845 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 846 rctx, err := runtime.AnnotateContext(ctx, mux, req) 847 if err != nil { 848 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 849 return 850 } 851 resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) 852 ctx = runtime.NewServerMetadataContext(ctx, md) 853 if err != nil { 854 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 855 return 856 } 857 858 forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 859 860 }) 861 862 mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 863 ctx, cancel := context.WithCancel(req.Context()) 864 defer cancel() 865 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 866 rctx, err := runtime.AnnotateContext(ctx, mux, req) 867 if err != nil { 868 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 869 return 870 } 871 resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) 872 ctx = runtime.NewServerMetadataContext(ctx, md) 873 if err != nil { 874 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 875 return 876 } 877 878 forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 879 880 }) 881 882 mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 883 ctx, cancel := context.WithCancel(req.Context()) 884 defer cancel() 885 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 886 rctx, err := runtime.AnnotateContext(ctx, mux, req) 887 if err != nil { 888 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 889 return 890 } 891 resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) 892 ctx = runtime.NewServerMetadataContext(ctx, md) 893 if err != nil { 894 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 895 return 896 } 897 898 forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 899 900 }) 901 902 mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 903 ctx, cancel := context.WithCancel(req.Context()) 904 defer cancel() 905 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 906 rctx, err := runtime.AnnotateContext(ctx, mux, req) 907 if err != nil { 908 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 909 return 910 } 911 resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) 912 ctx = runtime.NewServerMetadataContext(ctx, md) 913 if err != nil { 914 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 915 return 916 } 917 918 forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 919 920 }) 921 922 mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 923 ctx, cancel := context.WithCancel(req.Context()) 924 defer cancel() 925 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 926 rctx, err := runtime.AnnotateContext(ctx, mux, req) 927 if err != nil { 928 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 929 return 930 } 931 resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) 932 ctx = runtime.NewServerMetadataContext(ctx, md) 933 if err != nil { 934 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 935 return 936 } 937 938 forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 939 940 }) 941 942 mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 943 ctx, cancel := context.WithCancel(req.Context()) 944 defer cancel() 945 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 946 rctx, err := runtime.AnnotateContext(ctx, mux, req) 947 if err != nil { 948 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 949 return 950 } 951 resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) 952 ctx = runtime.NewServerMetadataContext(ctx, md) 953 if err != nil { 954 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 955 return 956 } 957 958 forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 959 960 }) 961 962 mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 963 ctx, cancel := context.WithCancel(req.Context()) 964 defer cancel() 965 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 966 rctx, err := runtime.AnnotateContext(ctx, mux, req) 967 if err != nil { 968 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 969 return 970 } 971 resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) 972 ctx = runtime.NewServerMetadataContext(ctx, md) 973 if err != nil { 974 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 975 return 976 } 977 978 forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 979 980 }) 981 982 return nil 983 } 984 985 var ( 986 pattern_Query_Constitution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "constitution"}, "", runtime.AssumeColonVerbOpt(false))) 987 988 pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) 989 990 pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) 991 992 pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) 993 994 pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) 995 996 pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) 997 998 pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) 999 1000 pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) 1001 1002 pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) 1003 ) 1004 1005 var ( 1006 forward_Query_Constitution_0 = runtime.ForwardResponseMessage 1007 1008 forward_Query_Proposal_0 = runtime.ForwardResponseMessage 1009 1010 forward_Query_Proposals_0 = runtime.ForwardResponseMessage 1011 1012 forward_Query_Vote_0 = runtime.ForwardResponseMessage 1013 1014 forward_Query_Votes_0 = runtime.ForwardResponseMessage 1015 1016 forward_Query_Params_0 = runtime.ForwardResponseMessage 1017 1018 forward_Query_Deposit_0 = runtime.ForwardResponseMessage 1019 1020 forward_Query_Deposits_0 = runtime.ForwardResponseMessage 1021 1022 forward_Query_TallyResult_0 = runtime.ForwardResponseMessage 1023 )