From 8676847bf18c8caf444bc54b915c92f39e11fe15 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 7 Feb 2022 13:35:58 -0800 Subject: [PATCH] fix: generate all v1beta1 codes in their own packages, fix core servers --- api/regen/data/v1alpha2/events.pulsar.go | 2 +- api/regen/data/v1alpha2/genesis.pulsar.go | 2 +- api/regen/data/v1alpha2/query.pulsar.go | 2 +- api/regen/data/v1alpha2/query_grpc.pb.go | 2 +- api/regen/data/v1alpha2/tx.pulsar.go | 2 +- api/regen/data/v1alpha2/tx_grpc.pb.go | 2 +- api/regen/data/v1alpha2/types.pulsar.go | 2 +- .../ecocredit/basket/v1beta1/events.pulsar.go | 2 +- .../ecocredit/basket/v1beta1/query.pulsar.go | 2 +- .../ecocredit/basket/v1beta1/query_grpc.pb.go | 2 +- .../ecocredit/basket/v1beta1/state.pulsar.go | 2 +- .../ecocredit/basket/v1beta1/tx.pulsar.go | 2 +- .../ecocredit/basket/v1beta1/tx_grpc.pb.go | 2 +- .../ecocredit/basket/v1beta1/types.pulsar.go | 2 +- .../marketplace/v1beta1/events.pulsar.go | 2 +- .../marketplace/v1beta1/query.pulsar.go | 2 +- .../marketplace/v1beta1/query_grpc.pb.go | 2 +- .../marketplace/v1beta1/state.pulsar.go | 2 +- .../marketplace/v1beta1/tx.pulsar.go | 2 +- .../marketplace/v1beta1/tx_grpc.pb.go | 2 +- .../marketplace/v1beta1/types.pulsar.go | 2 +- .../orderbook/v1beta1/memory.pulsar.go | 2 +- api/regen/ecocredit/v1alpha1/events.pulsar.go | 2 +- .../ecocredit/v1alpha1/genesis.pulsar.go | 2 +- api/regen/ecocredit/v1alpha1/query.pulsar.go | 2 +- api/regen/ecocredit/v1alpha1/query_grpc.pb.go | 2 +- api/regen/ecocredit/v1alpha1/tx.pulsar.go | 2 +- api/regen/ecocredit/v1alpha1/tx_grpc.pb.go | 2 +- api/regen/ecocredit/v1alpha1/types.pulsar.go | 2 +- api/regen/ecocredit/v1alpha2/events.pulsar.go | 2 +- .../ecocredit/v1alpha2/genesis.pulsar.go | 2 +- api/regen/ecocredit/v1alpha2/query.pulsar.go | 2 +- api/regen/ecocredit/v1alpha2/query_grpc.pb.go | 2 +- api/regen/ecocredit/v1alpha2/tx.pulsar.go | 2 +- api/regen/ecocredit/v1alpha2/tx_grpc.pb.go | 2 +- api/regen/ecocredit/v1alpha2/types.pulsar.go | 2 +- api/regen/ecocredit/v1beta1/events.pulsar.go | 2 +- api/regen/ecocredit/v1beta1/query.pulsar.go | 1910 ++++++-- api/regen/ecocredit/v1beta1/query_grpc.pb.go | 40 +- api/regen/ecocredit/v1beta1/state.pulsar.go | 2 +- api/regen/ecocredit/v1beta1/tx.pulsar.go | 2 +- api/regen/ecocredit/v1beta1/tx_grpc.pb.go | 2 +- api/regen/ecocredit/v1beta1/types.pulsar.go | 2 +- api/regen/group/v1alpha1/events.pulsar.go | 2 +- api/regen/group/v1alpha1/genesis.pulsar.go | 2 +- api/regen/group/v1alpha1/query.pulsar.go | 2 +- api/regen/group/v1alpha1/query_grpc.pb.go | 2 +- api/regen/group/v1alpha1/tx.pulsar.go | 2 +- api/regen/group/v1alpha1/tx_grpc.pb.go | 2 +- api/regen/group/v1alpha1/types.pulsar.go | 2 +- go.sum | 1 - .../ecocredit/basket/v1beta1/events.proto | 2 +- .../ecocredit/basket/v1beta1/query.proto | 2 +- .../ecocredit/basket/v1beta1/state.proto | 2 +- proto/regen/ecocredit/basket/v1beta1/tx.proto | 2 +- .../ecocredit/basket/v1beta1/types.proto | 2 +- .../marketplace/v1beta1/events.proto | 2 +- .../ecocredit/marketplace/v1beta1/query.proto | 2 +- .../ecocredit/marketplace/v1beta1/state.proto | 2 +- .../ecocredit/marketplace/v1beta1/tx.proto | 2 +- .../ecocredit/marketplace/v1beta1/types.proto | 2 +- proto/regen/ecocredit/v1beta1/query.proto | 31 +- types/math/dec.go | 4 +- x/data/query.pb.gw.go | 13 +- x/ecocredit/basket/v1beta1/events.pb.go | 39 + x/ecocredit/basket/v1beta1/query.pb.go | 2029 +++++++++ x/ecocredit/basket/v1beta1/query.pb.gw.go | 373 ++ x/ecocredit/basket/v1beta1/state.pb.go | 417 ++ x/ecocredit/basket/v1beta1/tx.pb.go | 2513 +++++++++++ x/ecocredit/basket/v1beta1/types.pb.go | 2291 ++++++++++ x/ecocredit/denom.go | 22 +- x/ecocredit/go.mod | 4 +- x/ecocredit/go.sum | 9 +- x/ecocredit/marketplace/v1beta1/events.pb.go | 2233 +++++++++ x/ecocredit/marketplace/v1beta1/query.pb.go | 3975 +++++++++++++++++ .../marketplace/v1beta1/query.pb.gw.go | 896 ++++ x/ecocredit/marketplace/v1beta1/state.pb.go | 2232 +++++++++ x/ecocredit/marketplace/v1beta1/tx.pb.go | 3716 +++++++++++++++ x/ecocredit/marketplace/v1beta1/types.pb.go | 1549 +++++++ x/ecocredit/query.pb.gw.go | 67 +- x/ecocredit/server/core/denom.go | 16 + x/ecocredit/server/core/genesis.go | 30 + x/ecocredit/server/core/invariants.go | 217 + x/ecocredit/server/core/invariants_test.go | 494 ++ x/ecocredit/server/core/msg_server.go | 1199 +++++ x/ecocredit/server/core/operations.go | 20 + x/ecocredit/server/core/query_server.go | 619 +++ x/ecocredit/server/core/server.go | 83 + x/ecocredit/v1beta1/query.pb.go | 728 ++- x/ecocredit/v1beta1/query.pb.gw.go | 153 +- x/group/query.pb.gw.go | 37 +- 91 files changed, 27605 insertions(+), 471 deletions(-) create mode 100644 x/ecocredit/basket/v1beta1/events.pb.go create mode 100644 x/ecocredit/basket/v1beta1/query.pb.go create mode 100644 x/ecocredit/basket/v1beta1/query.pb.gw.go create mode 100644 x/ecocredit/basket/v1beta1/state.pb.go create mode 100644 x/ecocredit/basket/v1beta1/tx.pb.go create mode 100644 x/ecocredit/basket/v1beta1/types.pb.go create mode 100644 x/ecocredit/marketplace/v1beta1/events.pb.go create mode 100644 x/ecocredit/marketplace/v1beta1/query.pb.go create mode 100644 x/ecocredit/marketplace/v1beta1/query.pb.gw.go create mode 100644 x/ecocredit/marketplace/v1beta1/state.pb.go create mode 100644 x/ecocredit/marketplace/v1beta1/tx.pb.go create mode 100644 x/ecocredit/marketplace/v1beta1/types.pb.go create mode 100644 x/ecocredit/server/core/denom.go create mode 100644 x/ecocredit/server/core/genesis.go create mode 100644 x/ecocredit/server/core/invariants.go create mode 100644 x/ecocredit/server/core/invariants_test.go create mode 100644 x/ecocredit/server/core/msg_server.go create mode 100644 x/ecocredit/server/core/operations.go create mode 100644 x/ecocredit/server/core/query_server.go create mode 100644 x/ecocredit/server/core/server.go diff --git a/api/regen/data/v1alpha2/events.pulsar.go b/api/regen/data/v1alpha2/events.pulsar.go index 97ad006f1d..69823a9e27 100644 --- a/api/regen/data/v1alpha2/events.pulsar.go +++ b/api/regen/data/v1alpha2/events.pulsar.go @@ -1399,7 +1399,7 @@ func (x *fastReflection_EventStoreRawData) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/data/v1alpha2/events.proto const ( diff --git a/api/regen/data/v1alpha2/genesis.pulsar.go b/api/regen/data/v1alpha2/genesis.pulsar.go index a9c12afd09..eff418f8f3 100644 --- a/api/regen/data/v1alpha2/genesis.pulsar.go +++ b/api/regen/data/v1alpha2/genesis.pulsar.go @@ -1162,7 +1162,7 @@ func (x *fastReflection_GenesisContentEntry) ProtoMethods() *protoiface.Methods // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/data/v1alpha2/genesis.proto const ( diff --git a/api/regen/data/v1alpha2/query.pulsar.go b/api/regen/data/v1alpha2/query.pulsar.go index 2bb83f73b2..e9314cce76 100644 --- a/api/regen/data/v1alpha2/query.pulsar.go +++ b/api/regen/data/v1alpha2/query.pulsar.go @@ -3581,7 +3581,7 @@ func (x *fastReflection_QuerySignersResponse) ProtoMethods() *protoiface.Methods // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/data/v1alpha2/query.proto const ( diff --git a/api/regen/data/v1alpha2/query_grpc.pb.go b/api/regen/data/v1alpha2/query_grpc.pb.go index 8fe0ad8164..b7c1b83118 100644 --- a/api/regen/data/v1alpha2/query_grpc.pb.go +++ b/api/regen/data/v1alpha2/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/data/v1alpha2/query.proto package datav1alpha2 diff --git a/api/regen/data/v1alpha2/tx.pulsar.go b/api/regen/data/v1alpha2/tx.pulsar.go index 826eeeb720..bbb0312b6c 100644 --- a/api/regen/data/v1alpha2/tx.pulsar.go +++ b/api/regen/data/v1alpha2/tx.pulsar.go @@ -1930,7 +1930,7 @@ func (x *fastReflection_MsgSignDataResponse) ProtoMethods() *protoiface.Methods // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/data/v1alpha2/tx.proto const ( diff --git a/api/regen/data/v1alpha2/tx_grpc.pb.go b/api/regen/data/v1alpha2/tx_grpc.pb.go index d289db00fb..c2d0636238 100644 --- a/api/regen/data/v1alpha2/tx_grpc.pb.go +++ b/api/regen/data/v1alpha2/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/data/v1alpha2/tx.proto package datav1alpha2 diff --git a/api/regen/data/v1alpha2/types.pulsar.go b/api/regen/data/v1alpha2/types.pulsar.go index 6f3a106d4d..1ae5e14093 100644 --- a/api/regen/data/v1alpha2/types.pulsar.go +++ b/api/regen/data/v1alpha2/types.pulsar.go @@ -2177,7 +2177,7 @@ func (x *fastReflection_SignerEntry) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/data/v1alpha2/types.proto const ( diff --git a/api/regen/ecocredit/basket/v1beta1/events.pulsar.go b/api/regen/ecocredit/basket/v1beta1/events.pulsar.go index 4d89e0903a..263aacf37d 100644 --- a/api/regen/ecocredit/basket/v1beta1/events.pulsar.go +++ b/api/regen/ecocredit/basket/v1beta1/events.pulsar.go @@ -10,7 +10,7 @@ import ( // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/events.proto const ( diff --git a/api/regen/ecocredit/basket/v1beta1/query.pulsar.go b/api/regen/ecocredit/basket/v1beta1/query.pulsar.go index 4cd2914467..83119060ec 100644 --- a/api/regen/ecocredit/basket/v1beta1/query.pulsar.go +++ b/api/regen/ecocredit/basket/v1beta1/query.pulsar.go @@ -3715,7 +3715,7 @@ func (x *fastReflection_QueryBasketCreditsResponse) ProtoMethods() *protoiface.M // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/query.proto const ( diff --git a/api/regen/ecocredit/basket/v1beta1/query_grpc.pb.go b/api/regen/ecocredit/basket/v1beta1/query_grpc.pb.go index 7be59359ad..60d3f69360 100644 --- a/api/regen/ecocredit/basket/v1beta1/query_grpc.pb.go +++ b/api/regen/ecocredit/basket/v1beta1/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/query.proto package basketv1beta1 diff --git a/api/regen/ecocredit/basket/v1beta1/state.pulsar.go b/api/regen/ecocredit/basket/v1beta1/state.pulsar.go index b3d3adccc4..7efee6be8a 100644 --- a/api/regen/ecocredit/basket/v1beta1/state.pulsar.go +++ b/api/regen/ecocredit/basket/v1beta1/state.pulsar.go @@ -548,7 +548,7 @@ func (x *fastReflection_BasketBalance) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/state.proto const ( diff --git a/api/regen/ecocredit/basket/v1beta1/tx.pulsar.go b/api/regen/ecocredit/basket/v1beta1/tx.pulsar.go index f295c6cded..064b2b1ac2 100644 --- a/api/regen/ecocredit/basket/v1beta1/tx.pulsar.go +++ b/api/regen/ecocredit/basket/v1beta1/tx.pulsar.go @@ -4467,7 +4467,7 @@ func (x *fastReflection_MsgPickFromBasketResponse) ProtoMethods() *protoiface.Me // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/tx.proto const ( diff --git a/api/regen/ecocredit/basket/v1beta1/tx_grpc.pb.go b/api/regen/ecocredit/basket/v1beta1/tx_grpc.pb.go index 7449d0eb02..c8ccf8e92b 100644 --- a/api/regen/ecocredit/basket/v1beta1/tx_grpc.pb.go +++ b/api/regen/ecocredit/basket/v1beta1/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/tx.proto package basketv1beta1 diff --git a/api/regen/ecocredit/basket/v1beta1/types.pulsar.go b/api/regen/ecocredit/basket/v1beta1/types.pulsar.go index f68bb0f9b1..d1798bb6f9 100644 --- a/api/regen/ecocredit/basket/v1beta1/types.pulsar.go +++ b/api/regen/ecocredit/basket/v1beta1/types.pulsar.go @@ -3895,7 +3895,7 @@ func (x *fastReflection_Filter_DateRange) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/basket/v1beta1/types.proto const ( diff --git a/api/regen/ecocredit/marketplace/v1beta1/events.pulsar.go b/api/regen/ecocredit/marketplace/v1beta1/events.pulsar.go index ebe152cd53..3e982f4622 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/events.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1beta1/events.pulsar.go @@ -3607,7 +3607,7 @@ func (x *fastReflection_EventAllowAskDenom) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/events.proto const ( diff --git a/api/regen/ecocredit/marketplace/v1beta1/query.pulsar.go b/api/regen/ecocredit/marketplace/v1beta1/query.pulsar.go index 08239bbf28..ee60f0b413 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/query.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1beta1/query.pulsar.go @@ -7935,7 +7935,7 @@ func (x *fastReflection_QueryAllowedDenomsResponse) ProtoMethods() *protoiface.M // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/query.proto const ( diff --git a/api/regen/ecocredit/marketplace/v1beta1/query_grpc.pb.go b/api/regen/ecocredit/marketplace/v1beta1/query_grpc.pb.go index 5fe4f720ff..87c0e04adc 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/query_grpc.pb.go +++ b/api/regen/ecocredit/marketplace/v1beta1/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/query.proto package marketplacev1beta1 diff --git a/api/regen/ecocredit/marketplace/v1beta1/state.pulsar.go b/api/regen/ecocredit/marketplace/v1beta1/state.pulsar.go index 35f15ba5fc..4caf68586d 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/state.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1beta1/state.pulsar.go @@ -3514,7 +3514,7 @@ func (x *fastReflection_Market) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/state.proto const ( diff --git a/api/regen/ecocredit/marketplace/v1beta1/tx.pulsar.go b/api/regen/ecocredit/marketplace/v1beta1/tx.pulsar.go index ed8b0fec2d..113378d272 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/tx.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1beta1/tx.pulsar.go @@ -6815,7 +6815,7 @@ func (x *fastReflection_MsgAllowAskDenomResponse) ProtoMethods() *protoiface.Met // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/tx.proto const ( diff --git a/api/regen/ecocredit/marketplace/v1beta1/tx_grpc.pb.go b/api/regen/ecocredit/marketplace/v1beta1/tx_grpc.pb.go index 36cba096d4..631d4637c7 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/tx_grpc.pb.go +++ b/api/regen/ecocredit/marketplace/v1beta1/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/tx.proto package marketplacev1beta1 diff --git a/api/regen/ecocredit/marketplace/v1beta1/types.pulsar.go b/api/regen/ecocredit/marketplace/v1beta1/types.pulsar.go index 91b22313ac..ea7eb4811d 100644 --- a/api/regen/ecocredit/marketplace/v1beta1/types.pulsar.go +++ b/api/regen/ecocredit/marketplace/v1beta1/types.pulsar.go @@ -2784,7 +2784,7 @@ func (x *fastReflection_BatchSelector) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/marketplace/v1beta1/types.proto const ( diff --git a/api/regen/ecocredit/orderbook/v1beta1/memory.pulsar.go b/api/regen/ecocredit/orderbook/v1beta1/memory.pulsar.go index b48adb1c68..c272e4152c 100644 --- a/api/regen/ecocredit/orderbook/v1beta1/memory.pulsar.go +++ b/api/regen/ecocredit/orderbook/v1beta1/memory.pulsar.go @@ -2334,7 +2334,7 @@ func (x *fastReflection_BuyOrderBatchSelector) ProtoMethods() *protoiface.Method // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/orderbook/v1beta1/memory.proto const ( diff --git a/api/regen/ecocredit/v1alpha1/events.pulsar.go b/api/regen/ecocredit/v1alpha1/events.pulsar.go index e15bc3a94c..4635c4438e 100644 --- a/api/regen/ecocredit/v1alpha1/events.pulsar.go +++ b/api/regen/ecocredit/v1alpha1/events.pulsar.go @@ -3139,7 +3139,7 @@ func (x *fastReflection_EventCancel) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha1/events.proto const ( diff --git a/api/regen/ecocredit/v1alpha1/genesis.pulsar.go b/api/regen/ecocredit/v1alpha1/genesis.pulsar.go index 09f1120f46..b64aae54a5 100644 --- a/api/regen/ecocredit/v1alpha1/genesis.pulsar.go +++ b/api/regen/ecocredit/v1alpha1/genesis.pulsar.go @@ -2301,7 +2301,7 @@ func (x *fastReflection_Supply) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha1/genesis.proto const ( diff --git a/api/regen/ecocredit/v1alpha1/query.pulsar.go b/api/regen/ecocredit/v1alpha1/query.pulsar.go index 2ff97794f6..28bc365f31 100644 --- a/api/regen/ecocredit/v1alpha1/query.pulsar.go +++ b/api/regen/ecocredit/v1alpha1/query.pulsar.go @@ -7320,7 +7320,7 @@ func (x *fastReflection_QueryCreditTypesResponse) ProtoMethods() *protoiface.Met // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha1/query.proto const ( diff --git a/api/regen/ecocredit/v1alpha1/query_grpc.pb.go b/api/regen/ecocredit/v1alpha1/query_grpc.pb.go index f450d1b608..fe40ca4762 100644 --- a/api/regen/ecocredit/v1alpha1/query_grpc.pb.go +++ b/api/regen/ecocredit/v1alpha1/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1alpha1/query.proto package ecocreditv1alpha1 diff --git a/api/regen/ecocredit/v1alpha1/tx.pulsar.go b/api/regen/ecocredit/v1alpha1/tx.pulsar.go index 45340e027d..6b0bee5bc1 100644 --- a/api/regen/ecocredit/v1alpha1/tx.pulsar.go +++ b/api/regen/ecocredit/v1alpha1/tx.pulsar.go @@ -10277,7 +10277,7 @@ func (x *fastReflection_MsgUpdateClassMetadataResponse) ProtoMethods() *protoifa // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha1/tx.proto const ( diff --git a/api/regen/ecocredit/v1alpha1/tx_grpc.pb.go b/api/regen/ecocredit/v1alpha1/tx_grpc.pb.go index 5138b45ff6..f6266ea893 100644 --- a/api/regen/ecocredit/v1alpha1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1alpha1/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1alpha1/tx.proto package ecocreditv1alpha1 diff --git a/api/regen/ecocredit/v1alpha1/types.pulsar.go b/api/regen/ecocredit/v1alpha1/types.pulsar.go index 4a27e40c58..54e0c2fa5c 100644 --- a/api/regen/ecocredit/v1alpha1/types.pulsar.go +++ b/api/regen/ecocredit/v1alpha1/types.pulsar.go @@ -3657,7 +3657,7 @@ func (x *fastReflection_CreditTypeSeq) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha1/types.proto const ( diff --git a/api/regen/ecocredit/v1alpha2/events.pulsar.go b/api/regen/ecocredit/v1alpha2/events.pulsar.go index 013cdfad32..f55040df92 100644 --- a/api/regen/ecocredit/v1alpha2/events.pulsar.go +++ b/api/regen/ecocredit/v1alpha2/events.pulsar.go @@ -7407,7 +7407,7 @@ func (x *fastReflection_EventAllowAskDenom) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha2/events.proto const ( diff --git a/api/regen/ecocredit/v1alpha2/genesis.pulsar.go b/api/regen/ecocredit/v1alpha2/genesis.pulsar.go index 348c3d05c5..9e49f8973a 100644 --- a/api/regen/ecocredit/v1alpha2/genesis.pulsar.go +++ b/api/regen/ecocredit/v1alpha2/genesis.pulsar.go @@ -2487,7 +2487,7 @@ func (x *fastReflection_Supply) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha2/genesis.proto const ( diff --git a/api/regen/ecocredit/v1alpha2/query.pulsar.go b/api/regen/ecocredit/v1alpha2/query.pulsar.go index b939cfbede..a51e7434a8 100644 --- a/api/regen/ecocredit/v1alpha2/query.pulsar.go +++ b/api/regen/ecocredit/v1alpha2/query.pulsar.go @@ -20863,7 +20863,7 @@ func (x *fastReflection_QueryBasketCreditsResponse) ProtoMethods() *protoiface.M // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha2/query.proto const ( diff --git a/api/regen/ecocredit/v1alpha2/query_grpc.pb.go b/api/regen/ecocredit/v1alpha2/query_grpc.pb.go index 3701982d3a..7a7a00a7f3 100644 --- a/api/regen/ecocredit/v1alpha2/query_grpc.pb.go +++ b/api/regen/ecocredit/v1alpha2/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1alpha2/query.proto package ecocreditv1alpha2 diff --git a/api/regen/ecocredit/v1alpha2/tx.pulsar.go b/api/regen/ecocredit/v1alpha2/tx.pulsar.go index b72f47f304..bcca86290d 100644 --- a/api/regen/ecocredit/v1alpha2/tx.pulsar.go +++ b/api/regen/ecocredit/v1alpha2/tx.pulsar.go @@ -22457,7 +22457,7 @@ func (x *fastReflection_MsgPickFromBasketResponse) ProtoMethods() *protoiface.Me // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha2/tx.proto const ( diff --git a/api/regen/ecocredit/v1alpha2/tx_grpc.pb.go b/api/regen/ecocredit/v1alpha2/tx_grpc.pb.go index a6e468b977..acd3faede7 100644 --- a/api/regen/ecocredit/v1alpha2/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1alpha2/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1alpha2/tx.proto package ecocreditv1alpha2 diff --git a/api/regen/ecocredit/v1alpha2/types.pulsar.go b/api/regen/ecocredit/v1alpha2/types.pulsar.go index a3a12443ef..28082001fe 100644 --- a/api/regen/ecocredit/v1alpha2/types.pulsar.go +++ b/api/regen/ecocredit/v1alpha2/types.pulsar.go @@ -10736,7 +10736,7 @@ func (x *fastReflection_Filter_DateRange) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1alpha2/types.proto const ( diff --git a/api/regen/ecocredit/v1beta1/events.pulsar.go b/api/regen/ecocredit/v1beta1/events.pulsar.go index cb5b86c726..309f62eef2 100644 --- a/api/regen/ecocredit/v1beta1/events.pulsar.go +++ b/api/regen/ecocredit/v1beta1/events.pulsar.go @@ -3815,7 +3815,7 @@ func (x *fastReflection_EventCancel) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1beta1/events.proto const ( diff --git a/api/regen/ecocredit/v1beta1/query.pulsar.go b/api/regen/ecocredit/v1beta1/query.pulsar.go index 9e7efd2487..ea363a6727 100644 --- a/api/regen/ecocredit/v1beta1/query.pulsar.go +++ b/api/regen/ecocredit/v1beta1/query.pulsar.go @@ -2668,6 +2668,1064 @@ func (x *fastReflection_QueryClassInfoResponse) ProtoMethods() *protoiface.Metho } } +var ( + md_QueryClassIssuersRequest protoreflect.MessageDescriptor + fd_QueryClassIssuersRequest_class_id protoreflect.FieldDescriptor + fd_QueryClassIssuersRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_regen_ecocredit_v1beta1_query_proto_init() + md_QueryClassIssuersRequest = File_regen_ecocredit_v1beta1_query_proto.Messages().ByName("QueryClassIssuersRequest") + fd_QueryClassIssuersRequest_class_id = md_QueryClassIssuersRequest.Fields().ByName("class_id") + fd_QueryClassIssuersRequest_pagination = md_QueryClassIssuersRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryClassIssuersRequest)(nil) + +type fastReflection_QueryClassIssuersRequest QueryClassIssuersRequest + +func (x *QueryClassIssuersRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryClassIssuersRequest)(x) +} + +func (x *QueryClassIssuersRequest) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryClassIssuersRequest_messageType fastReflection_QueryClassIssuersRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryClassIssuersRequest_messageType{} + +type fastReflection_QueryClassIssuersRequest_messageType struct{} + +func (x fastReflection_QueryClassIssuersRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryClassIssuersRequest)(nil) +} +func (x fastReflection_QueryClassIssuersRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryClassIssuersRequest) +} +func (x fastReflection_QueryClassIssuersRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryClassIssuersRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryClassIssuersRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryClassIssuersRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryClassIssuersRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryClassIssuersRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryClassIssuersRequest) New() protoreflect.Message { + return new(fastReflection_QueryClassIssuersRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryClassIssuersRequest) Interface() protoreflect.ProtoMessage { + return (*QueryClassIssuersRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryClassIssuersRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ClassId != "" { + value := protoreflect.ValueOfString(x.ClassId) + if !f(fd_QueryClassIssuersRequest_class_id, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryClassIssuersRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryClassIssuersRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + return x.ClassId != "" + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + x.ClassId = "" + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryClassIssuersRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + value := x.ClassId + return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + x.ClassId = value.Interface().(string) + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + panic(fmt.Errorf("field class_id of message regen.ecocredit.v1beta1.QueryClassIssuersRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryClassIssuersRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.class_id": + return protoreflect.ValueOfString("") + case "regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersRequest")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryClassIssuersRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1beta1.QueryClassIssuersRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryClassIssuersRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryClassIssuersRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryClassIssuersRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryClassIssuersRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ClassId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryClassIssuersRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.ClassId) > 0 { + i -= len(x.ClassId) + copy(dAtA[i:], x.ClassId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ClassId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryClassIssuersRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryClassIssuersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryClassIssuersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryClassIssuersResponse_1_list)(nil) + +type _QueryClassIssuersResponse_1_list struct { + list *[]string +} + +func (x *_QueryClassIssuersResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryClassIssuersResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_QueryClassIssuersResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_QueryClassIssuersResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryClassIssuersResponse_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message QueryClassIssuersResponse at list field Issuers as it is not of Message kind")) +} + +func (x *_QueryClassIssuersResponse_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_QueryClassIssuersResponse_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_QueryClassIssuersResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryClassIssuersResponse protoreflect.MessageDescriptor + fd_QueryClassIssuersResponse_issuers protoreflect.FieldDescriptor + fd_QueryClassIssuersResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_regen_ecocredit_v1beta1_query_proto_init() + md_QueryClassIssuersResponse = File_regen_ecocredit_v1beta1_query_proto.Messages().ByName("QueryClassIssuersResponse") + fd_QueryClassIssuersResponse_issuers = md_QueryClassIssuersResponse.Fields().ByName("issuers") + fd_QueryClassIssuersResponse_pagination = md_QueryClassIssuersResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryClassIssuersResponse)(nil) + +type fastReflection_QueryClassIssuersResponse QueryClassIssuersResponse + +func (x *QueryClassIssuersResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryClassIssuersResponse)(x) +} + +func (x *QueryClassIssuersResponse) slowProtoReflect() protoreflect.Message { + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryClassIssuersResponse_messageType fastReflection_QueryClassIssuersResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryClassIssuersResponse_messageType{} + +type fastReflection_QueryClassIssuersResponse_messageType struct{} + +func (x fastReflection_QueryClassIssuersResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryClassIssuersResponse)(nil) +} +func (x fastReflection_QueryClassIssuersResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryClassIssuersResponse) +} +func (x fastReflection_QueryClassIssuersResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryClassIssuersResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryClassIssuersResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryClassIssuersResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryClassIssuersResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryClassIssuersResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryClassIssuersResponse) New() protoreflect.Message { + return new(fastReflection_QueryClassIssuersResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryClassIssuersResponse) Interface() protoreflect.ProtoMessage { + return (*QueryClassIssuersResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryClassIssuersResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Issuers) != 0 { + value := protoreflect.ValueOfList(&_QueryClassIssuersResponse_1_list{list: &x.Issuers}) + if !f(fd_QueryClassIssuersResponse_issuers, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryClassIssuersResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryClassIssuersResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + return len(x.Issuers) != 0 + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + x.Issuers = nil + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryClassIssuersResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + if len(x.Issuers) == 0 { + return protoreflect.ValueOfList(&_QueryClassIssuersResponse_1_list{}) + } + listValue := &_QueryClassIssuersResponse_1_list{list: &x.Issuers} + return protoreflect.ValueOfList(listValue) + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + lv := value.List() + clv := lv.(*_QueryClassIssuersResponse_1_list) + x.Issuers = *clv.list + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + if x.Issuers == nil { + x.Issuers = []string{} + } + value := &_QueryClassIssuersResponse_1_list{list: &x.Issuers} + return protoreflect.ValueOfList(value) + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryClassIssuersResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.issuers": + list := []string{} + return protoreflect.ValueOfList(&_QueryClassIssuersResponse_1_list{list: &list}) + case "regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QueryClassIssuersResponse")) + } + panic(fmt.Errorf("message regen.ecocredit.v1beta1.QueryClassIssuersResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryClassIssuersResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in regen.ecocredit.v1beta1.QueryClassIssuersResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryClassIssuersResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryClassIssuersResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryClassIssuersResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryClassIssuersResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryClassIssuersResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Issuers) > 0 { + for _, s := range x.Issuers { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryClassIssuersResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Issuers) > 0 { + for iNdEx := len(x.Issuers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Issuers[iNdEx]) + copy(dAtA[i:], x.Issuers[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Issuers[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryClassIssuersResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryClassIssuersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryClassIssuersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Issuers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Issuers = append(x.Issuers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_QueryProjectsRequest protoreflect.MessageDescriptor fd_QueryProjectsRequest_class_id protoreflect.FieldDescriptor @@ -2690,7 +3748,7 @@ func (x *QueryProjectsRequest) ProtoReflect() protoreflect.Message { } func (x *QueryProjectsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[6] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3240,7 +4298,7 @@ func (x *QueryProjectsResponse) ProtoReflect() protoreflect.Message { } func (x *QueryProjectsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[7] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3760,7 +4818,7 @@ func (x *QueryProjectInfoRequest) ProtoReflect() protoreflect.Message { } func (x *QueryProjectInfoRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[8] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4180,7 +5238,7 @@ func (x *QueryProjectInfoResponse) ProtoReflect() protoreflect.Message { } func (x *QueryProjectInfoResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[9] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4617,7 +5675,7 @@ func (x *QueryBatchesRequest) ProtoReflect() protoreflect.Message { } func (x *QueryBatchesRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[10] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5167,7 +6225,7 @@ func (x *QueryBatchesResponse) ProtoReflect() protoreflect.Message { } func (x *QueryBatchesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[11] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5687,7 +6745,7 @@ func (x *QueryBatchInfoRequest) ProtoReflect() protoreflect.Message { } func (x *QueryBatchInfoRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[12] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6107,7 +7165,7 @@ func (x *QueryBatchInfoResponse) ProtoReflect() protoreflect.Message { } func (x *QueryBatchInfoResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[13] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6544,7 +7602,7 @@ func (x *QueryBalanceRequest) ProtoReflect() protoreflect.Message { } func (x *QueryBalanceRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[14] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7028,7 +8086,7 @@ func (x *QueryBalanceResponse) ProtoReflect() protoreflect.Message { } func (x *QueryBalanceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[15] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7510,7 +8568,7 @@ func (x *QuerySupplyRequest) ProtoReflect() protoreflect.Message { } func (x *QuerySupplyRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[16] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7911,9 +8969,10 @@ func (x *fastReflection_QuerySupplyRequest) ProtoMethods() *protoiface.Methods { } var ( - md_QuerySupplyResponse protoreflect.MessageDescriptor - fd_QuerySupplyResponse_tradable_supply protoreflect.FieldDescriptor - fd_QuerySupplyResponse_retired_supply protoreflect.FieldDescriptor + md_QuerySupplyResponse protoreflect.MessageDescriptor + fd_QuerySupplyResponse_tradable_supply protoreflect.FieldDescriptor + fd_QuerySupplyResponse_retired_supply protoreflect.FieldDescriptor + fd_QuerySupplyResponse_cancelled_amount protoreflect.FieldDescriptor ) func init() { @@ -7921,6 +8980,7 @@ func init() { md_QuerySupplyResponse = File_regen_ecocredit_v1beta1_query_proto.Messages().ByName("QuerySupplyResponse") fd_QuerySupplyResponse_tradable_supply = md_QuerySupplyResponse.Fields().ByName("tradable_supply") fd_QuerySupplyResponse_retired_supply = md_QuerySupplyResponse.Fields().ByName("retired_supply") + fd_QuerySupplyResponse_cancelled_amount = md_QuerySupplyResponse.Fields().ByName("cancelled_amount") } var _ protoreflect.Message = (*fastReflection_QuerySupplyResponse)(nil) @@ -7932,7 +8992,7 @@ func (x *QuerySupplyResponse) ProtoReflect() protoreflect.Message { } func (x *QuerySupplyResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[17] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8000,6 +9060,12 @@ func (x *fastReflection_QuerySupplyResponse) Range(f func(protoreflect.FieldDesc return } } + if x.CancelledAmount != "" { + value := protoreflect.ValueOfString(x.CancelledAmount) + if !f(fd_QuerySupplyResponse_cancelled_amount, value) { + return + } + } } // Has reports whether a field is populated. @@ -8019,6 +9085,8 @@ func (x *fastReflection_QuerySupplyResponse) Has(fd protoreflect.FieldDescriptor return x.TradableSupply != "" case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": return x.RetiredSupply != "" + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + return x.CancelledAmount != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8039,6 +9107,8 @@ func (x *fastReflection_QuerySupplyResponse) Clear(fd protoreflect.FieldDescript x.TradableSupply = "" case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": x.RetiredSupply = "" + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + x.CancelledAmount = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8061,6 +9131,9 @@ func (x *fastReflection_QuerySupplyResponse) Get(descriptor protoreflect.FieldDe case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": value := x.RetiredSupply return protoreflect.ValueOfString(value) + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + value := x.CancelledAmount + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8085,6 +9158,8 @@ func (x *fastReflection_QuerySupplyResponse) Set(fd protoreflect.FieldDescriptor x.TradableSupply = value.Interface().(string) case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": x.RetiredSupply = value.Interface().(string) + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + x.CancelledAmount = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8109,6 +9184,8 @@ func (x *fastReflection_QuerySupplyResponse) Mutable(fd protoreflect.FieldDescri panic(fmt.Errorf("field tradable_supply of message regen.ecocredit.v1beta1.QuerySupplyResponse is not mutable")) case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": panic(fmt.Errorf("field retired_supply of message regen.ecocredit.v1beta1.QuerySupplyResponse is not mutable")) + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + panic(fmt.Errorf("field cancelled_amount of message regen.ecocredit.v1beta1.QuerySupplyResponse is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8126,6 +9203,8 @@ func (x *fastReflection_QuerySupplyResponse) NewField(fd protoreflect.FieldDescr return protoreflect.ValueOfString("") case "regen.ecocredit.v1beta1.QuerySupplyResponse.retired_supply": return protoreflect.ValueOfString("") + case "regen.ecocredit.v1beta1.QuerySupplyResponse.cancelled_amount": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: regen.ecocredit.v1beta1.QuerySupplyResponse")) @@ -8203,6 +9282,10 @@ func (x *fastReflection_QuerySupplyResponse) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.CancelledAmount) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -8232,6 +9315,13 @@ func (x *fastReflection_QuerySupplyResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.CancelledAmount) > 0 { + i -= len(x.CancelledAmount) + copy(dAtA[i:], x.CancelledAmount) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CancelledAmount))) + i-- + dAtA[i] = 0x1a + } if len(x.RetiredSupply) > 0 { i -= len(x.RetiredSupply) copy(dAtA[i:], x.RetiredSupply) @@ -8359,6 +9449,38 @@ func (x *fastReflection_QuerySupplyResponse) ProtoMethods() *protoiface.Methods } x.RetiredSupply = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CancelledAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.CancelledAmount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -8412,7 +9534,7 @@ func (x *QueryCreditTypesRequest) ProtoReflect() protoreflect.Message { } func (x *QueryCreditTypesRequest) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[18] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8821,7 +9943,7 @@ func (x *QueryCreditTypesResponse) ProtoReflect() protoreflect.Message { } func (x *QueryCreditTypesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[19] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9247,7 +10369,7 @@ func (x *fastReflection_QueryCreditTypesResponse) ProtoMethods() *protoiface.Met // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1beta1/query.proto const ( @@ -9478,6 +10600,98 @@ func (x *QueryClassInfoResponse) GetInfo() *ClassInfo { return nil } +// QueryClassIssuersRequest is the Query/ClassIssuers request type. +type QueryClassIssuersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // class_id is the unique ID of credit class to query. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *v1beta1.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryClassIssuersRequest) Reset() { + *x = QueryClassIssuersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryClassIssuersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryClassIssuersRequest) ProtoMessage() {} + +// Deprecated: Use QueryClassIssuersRequest.ProtoReflect.Descriptor instead. +func (*QueryClassIssuersRequest) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryClassIssuersRequest) GetClassId() string { + if x != nil { + return x.ClassId + } + return "" +} + +func (x *QueryClassIssuersRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +// QueryClassIssuersRequest is the Query/ClassIssuers response type. +type QueryClassIssuersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // issuers is a list of issuers for the credit class + Issuers []string `protobuf:"bytes,1,rep,name=issuers,proto3" json:"issuers,omitempty"` + // pagination defines the pagination in the response. + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryClassIssuersResponse) Reset() { + *x = QueryClassIssuersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryClassIssuersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryClassIssuersResponse) ProtoMessage() {} + +// Deprecated: Use QueryClassIssuersResponse.ProtoReflect.Descriptor instead. +func (*QueryClassIssuersResponse) Descriptor() ([]byte, []int) { + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryClassIssuersResponse) GetIssuers() []string { + if x != nil { + return x.Issuers + } + return nil +} + +func (x *QueryClassIssuersResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + // QueryProjectsRequest is the Query/Projects request type. type QueryProjectsRequest struct { state protoimpl.MessageState @@ -9493,7 +10707,7 @@ type QueryProjectsRequest struct { func (x *QueryProjectsRequest) Reset() { *x = QueryProjectsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[6] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9507,7 +10721,7 @@ func (*QueryProjectsRequest) ProtoMessage() {} // Deprecated: Use QueryProjectsRequest.ProtoReflect.Descriptor instead. func (*QueryProjectsRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{6} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{8} } func (x *QueryProjectsRequest) GetClassId() string { @@ -9539,7 +10753,7 @@ type QueryProjectsResponse struct { func (x *QueryProjectsResponse) Reset() { *x = QueryProjectsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[7] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9553,7 +10767,7 @@ func (*QueryProjectsResponse) ProtoMessage() {} // Deprecated: Use QueryProjectsResponse.ProtoReflect.Descriptor instead. func (*QueryProjectsResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{7} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{9} } func (x *QueryProjectsResponse) GetProjects() []*ProjectInfo { @@ -9583,7 +10797,7 @@ type QueryProjectInfoRequest struct { func (x *QueryProjectInfoRequest) Reset() { *x = QueryProjectInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[8] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9597,7 +10811,7 @@ func (*QueryProjectInfoRequest) ProtoMessage() {} // Deprecated: Use QueryProjectInfoRequest.ProtoReflect.Descriptor instead. func (*QueryProjectInfoRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{8} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{10} } func (x *QueryProjectInfoRequest) GetProjectId() string { @@ -9620,7 +10834,7 @@ type QueryProjectInfoResponse struct { func (x *QueryProjectInfoResponse) Reset() { *x = QueryProjectInfoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[9] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9634,7 +10848,7 @@ func (*QueryProjectInfoResponse) ProtoMessage() {} // Deprecated: Use QueryProjectInfoResponse.ProtoReflect.Descriptor instead. func (*QueryProjectInfoResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{9} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{11} } func (x *QueryProjectInfoResponse) GetInfo() *ProjectInfo { @@ -9659,7 +10873,7 @@ type QueryBatchesRequest struct { func (x *QueryBatchesRequest) Reset() { *x = QueryBatchesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[10] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9673,7 +10887,7 @@ func (*QueryBatchesRequest) ProtoMessage() {} // Deprecated: Use QueryBatchesRequest.ProtoReflect.Descriptor instead. func (*QueryBatchesRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{10} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{12} } func (x *QueryBatchesRequest) GetProjectId() string { @@ -9705,7 +10919,7 @@ type QueryBatchesResponse struct { func (x *QueryBatchesResponse) Reset() { *x = QueryBatchesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[11] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9719,7 +10933,7 @@ func (*QueryBatchesResponse) ProtoMessage() {} // Deprecated: Use QueryBatchesResponse.ProtoReflect.Descriptor instead. func (*QueryBatchesResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{11} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{13} } func (x *QueryBatchesResponse) GetBatches() []*BatchInfo { @@ -9749,7 +10963,7 @@ type QueryBatchInfoRequest struct { func (x *QueryBatchInfoRequest) Reset() { *x = QueryBatchInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[12] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9763,7 +10977,7 @@ func (*QueryBatchInfoRequest) ProtoMessage() {} // Deprecated: Use QueryBatchInfoRequest.ProtoReflect.Descriptor instead. func (*QueryBatchInfoRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{12} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{14} } func (x *QueryBatchInfoRequest) GetBatchDenom() string { @@ -9786,7 +11000,7 @@ type QueryBatchInfoResponse struct { func (x *QueryBatchInfoResponse) Reset() { *x = QueryBatchInfoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[13] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9800,7 +11014,7 @@ func (*QueryBatchInfoResponse) ProtoMessage() {} // Deprecated: Use QueryBatchInfoResponse.ProtoReflect.Descriptor instead. func (*QueryBatchInfoResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{13} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{15} } func (x *QueryBatchInfoResponse) GetInfo() *BatchInfo { @@ -9825,7 +11039,7 @@ type QueryBalanceRequest struct { func (x *QueryBalanceRequest) Reset() { *x = QueryBalanceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[14] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9839,7 +11053,7 @@ func (*QueryBalanceRequest) ProtoMessage() {} // Deprecated: Use QueryBalanceRequest.ProtoReflect.Descriptor instead. func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{14} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{16} } func (x *QueryBalanceRequest) GetAccount() string { @@ -9871,7 +11085,7 @@ type QueryBalanceResponse struct { func (x *QueryBalanceResponse) Reset() { *x = QueryBalanceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[15] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9885,7 +11099,7 @@ func (*QueryBalanceResponse) ProtoMessage() {} // Deprecated: Use QueryBalanceResponse.ProtoReflect.Descriptor instead. func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{15} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{17} } func (x *QueryBalanceResponse) GetTradableAmount() string { @@ -9915,7 +11129,7 @@ type QuerySupplyRequest struct { func (x *QuerySupplyRequest) Reset() { *x = QuerySupplyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[16] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9929,7 +11143,7 @@ func (*QuerySupplyRequest) ProtoMessage() {} // Deprecated: Use QuerySupplyRequest.ProtoReflect.Descriptor instead. func (*QuerySupplyRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{16} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{18} } func (x *QuerySupplyRequest) GetBatchDenom() string { @@ -9951,12 +11165,15 @@ type QuerySupplyResponse struct { // retired_supply is the decimal number of retired credits in the batch // supply. RetiredSupply string `protobuf:"bytes,2,opt,name=retired_supply,json=retiredSupply,proto3" json:"retired_supply,omitempty"` + // cancelled_amount is the decimal number of cancelled credits in the batch + // supply. + CancelledAmount string `protobuf:"bytes,3,opt,name=cancelled_amount,json=cancelledAmount,proto3" json:"cancelled_amount,omitempty"` } func (x *QuerySupplyResponse) Reset() { *x = QuerySupplyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[17] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9970,7 +11187,7 @@ func (*QuerySupplyResponse) ProtoMessage() {} // Deprecated: Use QuerySupplyResponse.ProtoReflect.Descriptor instead. func (*QuerySupplyResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{17} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{19} } func (x *QuerySupplyResponse) GetTradableSupply() string { @@ -9987,6 +11204,13 @@ func (x *QuerySupplyResponse) GetRetiredSupply() string { return "" } +func (x *QuerySupplyResponse) GetCancelledAmount() string { + if x != nil { + return x.CancelledAmount + } + return "" +} + // QueryCreditTypesRequest is the Query/Credit_Types request type type QueryCreditTypesRequest struct { state protoimpl.MessageState @@ -9997,7 +11221,7 @@ type QueryCreditTypesRequest struct { func (x *QueryCreditTypesRequest) Reset() { *x = QueryCreditTypesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[18] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10011,7 +11235,7 @@ func (*QueryCreditTypesRequest) ProtoMessage() {} // Deprecated: Use QueryCreditTypesRequest.ProtoReflect.Descriptor instead. func (*QueryCreditTypesRequest) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{18} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{20} } // QueryCreditTypesRequest is the Query/Credit_Types response type @@ -10027,7 +11251,7 @@ type QueryCreditTypesResponse struct { func (x *QueryCreditTypesResponse) Reset() { *x = QueryCreditTypesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[19] + mi := &file_regen_ecocredit_v1beta1_query_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10041,7 +11265,7 @@ func (*QueryCreditTypesResponse) ProtoMessage() {} // Deprecated: Use QueryCreditTypesResponse.ProtoReflect.Descriptor instead. func (*QueryCreditTypesResponse) Descriptor() ([]byte, []int) { - return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{19} + return file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP(), []int{21} } func (x *QueryCreditTypesResponse) GetCreditTypes() []*CreditType { @@ -10097,210 +11321,240 @@ var file_regen_ecocredit_v1beta1_query_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x79, 0x0a, - 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x64, - 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa2, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x61, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7d, 0x0a, + 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, - 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7c, 0x0a, - 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, - 0x74, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x7e, 0x0a, 0x19, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, 0x0a, 0x14, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, - 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x14, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x64, 0x12, + 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa2, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x40, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x17, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, + 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7c, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x15, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x50, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x36, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x66, 0x0a, 0x14, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, - 0x74, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x22, 0x35, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x65, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, + 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x01, 0x0a, 0x14, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x15, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x50, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, + 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, + 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x50, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x66, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x64, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x74, + 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x35, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x64, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x22, - 0x19, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, + 0x52, 0x0d, 0x72, 0x65, 0x74, 0x69, 0x72, 0x65, 0x64, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, + 0x29, 0x0a, 0x10, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x6c, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x19, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, - 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x32, 0xf0, - 0x0c, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x90, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x61, - 0x73, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, + 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x32, 0xa6, 0x0e, 0x0a, 0x05, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x90, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, + 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2e, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x09, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2e, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x7d, 0x12, - 0xa7, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x72, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2f, + 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xb3, 0x01, 0x0a, 0x0c, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x12, 0x31, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x32, 0x2f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, + 0x12, 0xa7, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x2d, 0x2e, + 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x7d, - 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0xaa, 0x01, 0x0a, 0x0b, 0x50, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x2e, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa6, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, + 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, + 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0xaa, 0x01, 0x0a, 0x0b, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x2e, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, - 0xa4, 0x01, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2e, 0x2e, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, - 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x7b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xb0, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x12, 0x40, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x7b, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x2f, - 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x06, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa6, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, + 0x79, 0x42, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, + 0x12, 0xa4, 0x01, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2e, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x7b, 0x62, 0x61, 0x74, 0x63, 0x68, - 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0xa1, - 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x30, - 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x72, - 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x72, 0x65, - 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2d, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x2e, - 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, - 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, - 0x12, 0x1f, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0xfb, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, - 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, 0x65, - 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2d, - 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0xb0, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x48, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x12, 0x40, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x7b, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x06, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, + 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x12, 0x35, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x17, 0x52, 0x65, 0x67, 0x65, - 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, - 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x23, - 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, 0x6f, - 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x31, 0x2f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x2f, 0x7b, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, + 0xa1, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, + 0x30, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x31, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x72, + 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2d, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, + 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x72, 0x65, + 0x67, 0x65, 0x6e, 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x21, 0x12, 0x1f, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, + 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0xfb, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2e, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x65, 0x67, + 0x65, 0x6e, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x72, 0x65, 0x67, 0x65, 0x6e, + 0x2d, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x67, 0x65, + 0x6e, 0x2f, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x65, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x52, 0x45, 0x58, 0xaa, 0x02, 0x17, 0x52, 0x65, 0x67, + 0x65, 0x6e, 0x2e, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x2e, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x17, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, + 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, + 0x23, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x5c, 0x45, 0x63, 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x3a, 0x3a, 0x45, 0x63, + 0x6f, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -10315,76 +11569,82 @@ func file_regen_ecocredit_v1beta1_query_proto_rawDescGZIP() []byte { return file_regen_ecocredit_v1beta1_query_proto_rawDescData } -var file_regen_ecocredit_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_regen_ecocredit_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_regen_ecocredit_v1beta1_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: regen.ecocredit.v1beta1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: regen.ecocredit.v1beta1.QueryParamsResponse - (*QueryClassesRequest)(nil), // 2: regen.ecocredit.v1beta1.QueryClassesRequest - (*QueryClassesResponse)(nil), // 3: regen.ecocredit.v1beta1.QueryClassesResponse - (*QueryClassInfoRequest)(nil), // 4: regen.ecocredit.v1beta1.QueryClassInfoRequest - (*QueryClassInfoResponse)(nil), // 5: regen.ecocredit.v1beta1.QueryClassInfoResponse - (*QueryProjectsRequest)(nil), // 6: regen.ecocredit.v1beta1.QueryProjectsRequest - (*QueryProjectsResponse)(nil), // 7: regen.ecocredit.v1beta1.QueryProjectsResponse - (*QueryProjectInfoRequest)(nil), // 8: regen.ecocredit.v1beta1.QueryProjectInfoRequest - (*QueryProjectInfoResponse)(nil), // 9: regen.ecocredit.v1beta1.QueryProjectInfoResponse - (*QueryBatchesRequest)(nil), // 10: regen.ecocredit.v1beta1.QueryBatchesRequest - (*QueryBatchesResponse)(nil), // 11: regen.ecocredit.v1beta1.QueryBatchesResponse - (*QueryBatchInfoRequest)(nil), // 12: regen.ecocredit.v1beta1.QueryBatchInfoRequest - (*QueryBatchInfoResponse)(nil), // 13: regen.ecocredit.v1beta1.QueryBatchInfoResponse - (*QueryBalanceRequest)(nil), // 14: regen.ecocredit.v1beta1.QueryBalanceRequest - (*QueryBalanceResponse)(nil), // 15: regen.ecocredit.v1beta1.QueryBalanceResponse - (*QuerySupplyRequest)(nil), // 16: regen.ecocredit.v1beta1.QuerySupplyRequest - (*QuerySupplyResponse)(nil), // 17: regen.ecocredit.v1beta1.QuerySupplyResponse - (*QueryCreditTypesRequest)(nil), // 18: regen.ecocredit.v1beta1.QueryCreditTypesRequest - (*QueryCreditTypesResponse)(nil), // 19: regen.ecocredit.v1beta1.QueryCreditTypesResponse - (*Params)(nil), // 20: regen.ecocredit.v1beta1.Params - (*v1beta1.PageRequest)(nil), // 21: cosmos.base.query.v1beta1.PageRequest - (*ClassInfo)(nil), // 22: regen.ecocredit.v1beta1.ClassInfo - (*v1beta1.PageResponse)(nil), // 23: cosmos.base.query.v1beta1.PageResponse - (*ProjectInfo)(nil), // 24: regen.ecocredit.v1beta1.ProjectInfo - (*BatchInfo)(nil), // 25: regen.ecocredit.v1beta1.BatchInfo - (*CreditType)(nil), // 26: regen.ecocredit.v1beta1.CreditType + (*QueryParamsRequest)(nil), // 0: regen.ecocredit.v1beta1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: regen.ecocredit.v1beta1.QueryParamsResponse + (*QueryClassesRequest)(nil), // 2: regen.ecocredit.v1beta1.QueryClassesRequest + (*QueryClassesResponse)(nil), // 3: regen.ecocredit.v1beta1.QueryClassesResponse + (*QueryClassInfoRequest)(nil), // 4: regen.ecocredit.v1beta1.QueryClassInfoRequest + (*QueryClassInfoResponse)(nil), // 5: regen.ecocredit.v1beta1.QueryClassInfoResponse + (*QueryClassIssuersRequest)(nil), // 6: regen.ecocredit.v1beta1.QueryClassIssuersRequest + (*QueryClassIssuersResponse)(nil), // 7: regen.ecocredit.v1beta1.QueryClassIssuersResponse + (*QueryProjectsRequest)(nil), // 8: regen.ecocredit.v1beta1.QueryProjectsRequest + (*QueryProjectsResponse)(nil), // 9: regen.ecocredit.v1beta1.QueryProjectsResponse + (*QueryProjectInfoRequest)(nil), // 10: regen.ecocredit.v1beta1.QueryProjectInfoRequest + (*QueryProjectInfoResponse)(nil), // 11: regen.ecocredit.v1beta1.QueryProjectInfoResponse + (*QueryBatchesRequest)(nil), // 12: regen.ecocredit.v1beta1.QueryBatchesRequest + (*QueryBatchesResponse)(nil), // 13: regen.ecocredit.v1beta1.QueryBatchesResponse + (*QueryBatchInfoRequest)(nil), // 14: regen.ecocredit.v1beta1.QueryBatchInfoRequest + (*QueryBatchInfoResponse)(nil), // 15: regen.ecocredit.v1beta1.QueryBatchInfoResponse + (*QueryBalanceRequest)(nil), // 16: regen.ecocredit.v1beta1.QueryBalanceRequest + (*QueryBalanceResponse)(nil), // 17: regen.ecocredit.v1beta1.QueryBalanceResponse + (*QuerySupplyRequest)(nil), // 18: regen.ecocredit.v1beta1.QuerySupplyRequest + (*QuerySupplyResponse)(nil), // 19: regen.ecocredit.v1beta1.QuerySupplyResponse + (*QueryCreditTypesRequest)(nil), // 20: regen.ecocredit.v1beta1.QueryCreditTypesRequest + (*QueryCreditTypesResponse)(nil), // 21: regen.ecocredit.v1beta1.QueryCreditTypesResponse + (*Params)(nil), // 22: regen.ecocredit.v1beta1.Params + (*v1beta1.PageRequest)(nil), // 23: cosmos.base.query.v1beta1.PageRequest + (*ClassInfo)(nil), // 24: regen.ecocredit.v1beta1.ClassInfo + (*v1beta1.PageResponse)(nil), // 25: cosmos.base.query.v1beta1.PageResponse + (*ProjectInfo)(nil), // 26: regen.ecocredit.v1beta1.ProjectInfo + (*BatchInfo)(nil), // 27: regen.ecocredit.v1beta1.BatchInfo + (*CreditType)(nil), // 28: regen.ecocredit.v1beta1.CreditType } var file_regen_ecocredit_v1beta1_query_proto_depIdxs = []int32{ - 20, // 0: regen.ecocredit.v1beta1.QueryParamsResponse.params:type_name -> regen.ecocredit.v1beta1.Params - 21, // 1: regen.ecocredit.v1beta1.QueryClassesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 22, // 2: regen.ecocredit.v1beta1.QueryClassesResponse.classes:type_name -> regen.ecocredit.v1beta1.ClassInfo - 23, // 3: regen.ecocredit.v1beta1.QueryClassesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 22, // 4: regen.ecocredit.v1beta1.QueryClassInfoResponse.info:type_name -> regen.ecocredit.v1beta1.ClassInfo - 21, // 5: regen.ecocredit.v1beta1.QueryProjectsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 24, // 6: regen.ecocredit.v1beta1.QueryProjectsResponse.projects:type_name -> regen.ecocredit.v1beta1.ProjectInfo - 23, // 7: regen.ecocredit.v1beta1.QueryProjectsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 24, // 8: regen.ecocredit.v1beta1.QueryProjectInfoResponse.info:type_name -> regen.ecocredit.v1beta1.ProjectInfo - 21, // 9: regen.ecocredit.v1beta1.QueryBatchesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 25, // 10: regen.ecocredit.v1beta1.QueryBatchesResponse.batches:type_name -> regen.ecocredit.v1beta1.BatchInfo - 23, // 11: regen.ecocredit.v1beta1.QueryBatchesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 25, // 12: regen.ecocredit.v1beta1.QueryBatchInfoResponse.info:type_name -> regen.ecocredit.v1beta1.BatchInfo - 26, // 13: regen.ecocredit.v1beta1.QueryCreditTypesResponse.credit_types:type_name -> regen.ecocredit.v1beta1.CreditType - 2, // 14: regen.ecocredit.v1beta1.Query.Classes:input_type -> regen.ecocredit.v1beta1.QueryClassesRequest - 4, // 15: regen.ecocredit.v1beta1.Query.ClassInfo:input_type -> regen.ecocredit.v1beta1.QueryClassInfoRequest - 6, // 16: regen.ecocredit.v1beta1.Query.Projects:input_type -> regen.ecocredit.v1beta1.QueryProjectsRequest - 8, // 17: regen.ecocredit.v1beta1.Query.ProjectInfo:input_type -> regen.ecocredit.v1beta1.QueryProjectInfoRequest - 10, // 18: regen.ecocredit.v1beta1.Query.Batches:input_type -> regen.ecocredit.v1beta1.QueryBatchesRequest - 12, // 19: regen.ecocredit.v1beta1.Query.BatchInfo:input_type -> regen.ecocredit.v1beta1.QueryBatchInfoRequest - 14, // 20: regen.ecocredit.v1beta1.Query.Balance:input_type -> regen.ecocredit.v1beta1.QueryBalanceRequest - 16, // 21: regen.ecocredit.v1beta1.Query.Supply:input_type -> regen.ecocredit.v1beta1.QuerySupplyRequest - 18, // 22: regen.ecocredit.v1beta1.Query.CreditTypes:input_type -> regen.ecocredit.v1beta1.QueryCreditTypesRequest - 0, // 23: regen.ecocredit.v1beta1.Query.Params:input_type -> regen.ecocredit.v1beta1.QueryParamsRequest - 3, // 24: regen.ecocredit.v1beta1.Query.Classes:output_type -> regen.ecocredit.v1beta1.QueryClassesResponse - 5, // 25: regen.ecocredit.v1beta1.Query.ClassInfo:output_type -> regen.ecocredit.v1beta1.QueryClassInfoResponse - 7, // 26: regen.ecocredit.v1beta1.Query.Projects:output_type -> regen.ecocredit.v1beta1.QueryProjectsResponse - 9, // 27: regen.ecocredit.v1beta1.Query.ProjectInfo:output_type -> regen.ecocredit.v1beta1.QueryProjectInfoResponse - 11, // 28: regen.ecocredit.v1beta1.Query.Batches:output_type -> regen.ecocredit.v1beta1.QueryBatchesResponse - 13, // 29: regen.ecocredit.v1beta1.Query.BatchInfo:output_type -> regen.ecocredit.v1beta1.QueryBatchInfoResponse - 15, // 30: regen.ecocredit.v1beta1.Query.Balance:output_type -> regen.ecocredit.v1beta1.QueryBalanceResponse - 17, // 31: regen.ecocredit.v1beta1.Query.Supply:output_type -> regen.ecocredit.v1beta1.QuerySupplyResponse - 19, // 32: regen.ecocredit.v1beta1.Query.CreditTypes:output_type -> regen.ecocredit.v1beta1.QueryCreditTypesResponse - 1, // 33: regen.ecocredit.v1beta1.Query.Params:output_type -> regen.ecocredit.v1beta1.QueryParamsResponse - 24, // [24:34] is the sub-list for method output_type - 14, // [14:24] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 22, // 0: regen.ecocredit.v1beta1.QueryParamsResponse.params:type_name -> regen.ecocredit.v1beta1.Params + 23, // 1: regen.ecocredit.v1beta1.QueryClassesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 24, // 2: regen.ecocredit.v1beta1.QueryClassesResponse.classes:type_name -> regen.ecocredit.v1beta1.ClassInfo + 25, // 3: regen.ecocredit.v1beta1.QueryClassesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 24, // 4: regen.ecocredit.v1beta1.QueryClassInfoResponse.info:type_name -> regen.ecocredit.v1beta1.ClassInfo + 23, // 5: regen.ecocredit.v1beta1.QueryClassIssuersRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 25, // 6: regen.ecocredit.v1beta1.QueryClassIssuersResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 23, // 7: regen.ecocredit.v1beta1.QueryProjectsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 26, // 8: regen.ecocredit.v1beta1.QueryProjectsResponse.projects:type_name -> regen.ecocredit.v1beta1.ProjectInfo + 25, // 9: regen.ecocredit.v1beta1.QueryProjectsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 26, // 10: regen.ecocredit.v1beta1.QueryProjectInfoResponse.info:type_name -> regen.ecocredit.v1beta1.ProjectInfo + 23, // 11: regen.ecocredit.v1beta1.QueryBatchesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 27, // 12: regen.ecocredit.v1beta1.QueryBatchesResponse.batches:type_name -> regen.ecocredit.v1beta1.BatchInfo + 25, // 13: regen.ecocredit.v1beta1.QueryBatchesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 27, // 14: regen.ecocredit.v1beta1.QueryBatchInfoResponse.info:type_name -> regen.ecocredit.v1beta1.BatchInfo + 28, // 15: regen.ecocredit.v1beta1.QueryCreditTypesResponse.credit_types:type_name -> regen.ecocredit.v1beta1.CreditType + 2, // 16: regen.ecocredit.v1beta1.Query.Classes:input_type -> regen.ecocredit.v1beta1.QueryClassesRequest + 4, // 17: regen.ecocredit.v1beta1.Query.ClassInfo:input_type -> regen.ecocredit.v1beta1.QueryClassInfoRequest + 6, // 18: regen.ecocredit.v1beta1.Query.ClassIssuers:input_type -> regen.ecocredit.v1beta1.QueryClassIssuersRequest + 8, // 19: regen.ecocredit.v1beta1.Query.Projects:input_type -> regen.ecocredit.v1beta1.QueryProjectsRequest + 10, // 20: regen.ecocredit.v1beta1.Query.ProjectInfo:input_type -> regen.ecocredit.v1beta1.QueryProjectInfoRequest + 12, // 21: regen.ecocredit.v1beta1.Query.Batches:input_type -> regen.ecocredit.v1beta1.QueryBatchesRequest + 14, // 22: regen.ecocredit.v1beta1.Query.BatchInfo:input_type -> regen.ecocredit.v1beta1.QueryBatchInfoRequest + 16, // 23: regen.ecocredit.v1beta1.Query.Balance:input_type -> regen.ecocredit.v1beta1.QueryBalanceRequest + 18, // 24: regen.ecocredit.v1beta1.Query.Supply:input_type -> regen.ecocredit.v1beta1.QuerySupplyRequest + 20, // 25: regen.ecocredit.v1beta1.Query.CreditTypes:input_type -> regen.ecocredit.v1beta1.QueryCreditTypesRequest + 0, // 26: regen.ecocredit.v1beta1.Query.Params:input_type -> regen.ecocredit.v1beta1.QueryParamsRequest + 3, // 27: regen.ecocredit.v1beta1.Query.Classes:output_type -> regen.ecocredit.v1beta1.QueryClassesResponse + 5, // 28: regen.ecocredit.v1beta1.Query.ClassInfo:output_type -> regen.ecocredit.v1beta1.QueryClassInfoResponse + 7, // 29: regen.ecocredit.v1beta1.Query.ClassIssuers:output_type -> regen.ecocredit.v1beta1.QueryClassIssuersResponse + 9, // 30: regen.ecocredit.v1beta1.Query.Projects:output_type -> regen.ecocredit.v1beta1.QueryProjectsResponse + 11, // 31: regen.ecocredit.v1beta1.Query.ProjectInfo:output_type -> regen.ecocredit.v1beta1.QueryProjectInfoResponse + 13, // 32: regen.ecocredit.v1beta1.Query.Batches:output_type -> regen.ecocredit.v1beta1.QueryBatchesResponse + 15, // 33: regen.ecocredit.v1beta1.Query.BatchInfo:output_type -> regen.ecocredit.v1beta1.QueryBatchInfoResponse + 17, // 34: regen.ecocredit.v1beta1.Query.Balance:output_type -> regen.ecocredit.v1beta1.QueryBalanceResponse + 19, // 35: regen.ecocredit.v1beta1.Query.Supply:output_type -> regen.ecocredit.v1beta1.QuerySupplyResponse + 21, // 36: regen.ecocredit.v1beta1.Query.CreditTypes:output_type -> regen.ecocredit.v1beta1.QueryCreditTypesResponse + 1, // 37: regen.ecocredit.v1beta1.Query.Params:output_type -> regen.ecocredit.v1beta1.QueryParamsResponse + 27, // [27:38] is the sub-list for method output_type + 16, // [16:27] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_regen_ecocredit_v1beta1_query_proto_init() } @@ -10468,7 +11728,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryProjectsRequest); i { + switch v := v.(*QueryClassIssuersRequest); i { case 0: return &v.state case 1: @@ -10480,7 +11740,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryProjectsResponse); i { + switch v := v.(*QueryClassIssuersResponse); i { case 0: return &v.state case 1: @@ -10492,7 +11752,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryProjectInfoRequest); i { + switch v := v.(*QueryProjectsRequest); i { case 0: return &v.state case 1: @@ -10504,7 +11764,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryProjectInfoResponse); i { + switch v := v.(*QueryProjectsResponse); i { case 0: return &v.state case 1: @@ -10516,7 +11776,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBatchesRequest); i { + switch v := v.(*QueryProjectInfoRequest); i { case 0: return &v.state case 1: @@ -10528,7 +11788,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBatchesResponse); i { + switch v := v.(*QueryProjectInfoResponse); i { case 0: return &v.state case 1: @@ -10540,7 +11800,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBatchInfoRequest); i { + switch v := v.(*QueryBatchesRequest); i { case 0: return &v.state case 1: @@ -10552,7 +11812,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBatchInfoResponse); i { + switch v := v.(*QueryBatchesResponse); i { case 0: return &v.state case 1: @@ -10564,7 +11824,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBalanceRequest); i { + switch v := v.(*QueryBatchInfoRequest); i { case 0: return &v.state case 1: @@ -10576,7 +11836,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryBalanceResponse); i { + switch v := v.(*QueryBatchInfoResponse); i { case 0: return &v.state case 1: @@ -10588,7 +11848,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuerySupplyRequest); i { + switch v := v.(*QueryBalanceRequest); i { case 0: return &v.state case 1: @@ -10600,7 +11860,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuerySupplyResponse); i { + switch v := v.(*QueryBalanceResponse); i { case 0: return &v.state case 1: @@ -10612,7 +11872,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryCreditTypesRequest); i { + switch v := v.(*QuerySupplyRequest); i { case 0: return &v.state case 1: @@ -10624,6 +11884,30 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { } } file_regen_ecocredit_v1beta1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySupplyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_v1beta1_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCreditTypesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_regen_ecocredit_v1beta1_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryCreditTypesResponse); i { case 0: return &v.state @@ -10642,7 +11926,7 @@ func file_regen_ecocredit_v1beta1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_regen_ecocredit_v1beta1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 20, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/api/regen/ecocredit/v1beta1/query_grpc.pb.go b/api/regen/ecocredit/v1beta1/query_grpc.pb.go index 256c985e69..03de0a9b1c 100644 --- a/api/regen/ecocredit/v1beta1/query_grpc.pb.go +++ b/api/regen/ecocredit/v1beta1/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1beta1/query.proto package ecocreditv1beta1 @@ -26,6 +26,8 @@ type QueryClient interface { Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) // ClassInfo queries for information on a credit class. ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error) + // ClassIssuers queries for the addresses of the issuers for a credit class. + ClassIssuers(ctx context.Context, in *QueryClassIssuersRequest, opts ...grpc.CallOption) (*QueryClassIssuersResponse, error) // Projects queries for all projects within a class with pagination. Projects(ctx context.Context, in *QueryProjectsRequest, opts ...grpc.CallOption) (*QueryProjectsResponse, error) // ClassInfo queries for information on a project. @@ -72,6 +74,15 @@ func (c *queryClient) ClassInfo(ctx context.Context, in *QueryClassInfoRequest, return out, nil } +func (c *queryClient) ClassIssuers(ctx context.Context, in *QueryClassIssuersRequest, opts ...grpc.CallOption) (*QueryClassIssuersResponse, error) { + out := new(QueryClassIssuersResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1beta1.Query/ClassIssuers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Projects(ctx context.Context, in *QueryProjectsRequest, opts ...grpc.CallOption) (*QueryProjectsResponse, error) { out := new(QueryProjectsResponse) err := c.cc.Invoke(ctx, "/regen.ecocredit.v1beta1.Query/Projects", in, out, opts...) @@ -152,6 +163,8 @@ type QueryServer interface { Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) // ClassInfo queries for information on a credit class. ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error) + // ClassIssuers queries for the addresses of the issuers for a credit class. + ClassIssuers(context.Context, *QueryClassIssuersRequest) (*QueryClassIssuersResponse, error) // Projects queries for all projects within a class with pagination. Projects(context.Context, *QueryProjectsRequest) (*QueryProjectsResponse, error) // ClassInfo queries for information on a project. @@ -183,6 +196,9 @@ func (UnimplementedQueryServer) Classes(context.Context, *QueryClassesRequest) ( func (UnimplementedQueryServer) ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClassInfo not implemented") } +func (UnimplementedQueryServer) ClassIssuers(context.Context, *QueryClassIssuersRequest) (*QueryClassIssuersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassIssuers not implemented") +} func (UnimplementedQueryServer) Projects(context.Context, *QueryProjectsRequest) (*QueryProjectsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Projects not implemented") } @@ -256,6 +272,24 @@ func _Query_ClassInfo_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_ClassIssuers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassIssuersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassIssuers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1beta1.Query/ClassIssuers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassIssuers(ctx, req.(*QueryClassIssuersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Projects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryProjectsRequest) if err := dec(in); err != nil { @@ -415,6 +449,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "ClassInfo", Handler: _Query_ClassInfo_Handler, }, + { + MethodName: "ClassIssuers", + Handler: _Query_ClassIssuers_Handler, + }, { MethodName: "Projects", Handler: _Query_Projects_Handler, diff --git a/api/regen/ecocredit/v1beta1/state.pulsar.go b/api/regen/ecocredit/v1beta1/state.pulsar.go index 5b4af8da3e..b07815e055 100644 --- a/api/regen/ecocredit/v1beta1/state.pulsar.go +++ b/api/regen/ecocredit/v1beta1/state.pulsar.go @@ -5727,7 +5727,7 @@ func (x *fastReflection_BatchSupply) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1beta1/state.proto const ( diff --git a/api/regen/ecocredit/v1beta1/tx.pulsar.go b/api/regen/ecocredit/v1beta1/tx.pulsar.go index 1590df16a7..771d4fae1a 100644 --- a/api/regen/ecocredit/v1beta1/tx.pulsar.go +++ b/api/regen/ecocredit/v1beta1/tx.pulsar.go @@ -11311,7 +11311,7 @@ func (x *fastReflection_MsgUpdateClassMetadataResponse) ProtoMethods() *protoifa // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1beta1/tx.proto const ( diff --git a/api/regen/ecocredit/v1beta1/tx_grpc.pb.go b/api/regen/ecocredit/v1beta1/tx_grpc.pb.go index ea642beb25..c5ce88b1f7 100644 --- a/api/regen/ecocredit/v1beta1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1beta1/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/ecocredit/v1beta1/tx.proto package ecocreditv1beta1 diff --git a/api/regen/ecocredit/v1beta1/types.pulsar.go b/api/regen/ecocredit/v1beta1/types.pulsar.go index c4797cdab9..1a1dea00ee 100644 --- a/api/regen/ecocredit/v1beta1/types.pulsar.go +++ b/api/regen/ecocredit/v1beta1/types.pulsar.go @@ -827,7 +827,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/ecocredit/v1beta1/types.proto const ( diff --git a/api/regen/group/v1alpha1/events.pulsar.go b/api/regen/group/v1alpha1/events.pulsar.go index 88a1f65b38..a6a5f24e95 100644 --- a/api/regen/group/v1alpha1/events.pulsar.go +++ b/api/regen/group/v1alpha1/events.pulsar.go @@ -2875,7 +2875,7 @@ func (x *fastReflection_EventExec) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/group/v1alpha1/events.proto const ( diff --git a/api/regen/group/v1alpha1/genesis.pulsar.go b/api/regen/group/v1alpha1/genesis.pulsar.go index 83282bfdcb..38fdc07572 100644 --- a/api/regen/group/v1alpha1/genesis.pulsar.go +++ b/api/regen/group/v1alpha1/genesis.pulsar.go @@ -1205,7 +1205,7 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/group/v1alpha1/genesis.proto const ( diff --git a/api/regen/group/v1alpha1/query.pulsar.go b/api/regen/group/v1alpha1/query.pulsar.go index 5384a5a650..f646904362 100644 --- a/api/regen/group/v1alpha1/query.pulsar.go +++ b/api/regen/group/v1alpha1/query.pulsar.go @@ -10909,7 +10909,7 @@ func (x *fastReflection_QueryVotesByVoterResponse) ProtoMethods() *protoiface.Me // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/group/v1alpha1/query.proto const ( diff --git a/api/regen/group/v1alpha1/query_grpc.pb.go b/api/regen/group/v1alpha1/query_grpc.pb.go index 802b5810f5..fe4ba1f7b9 100644 --- a/api/regen/group/v1alpha1/query_grpc.pb.go +++ b/api/regen/group/v1alpha1/query_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/group/v1alpha1/query.proto package groupv1alpha1 diff --git a/api/regen/group/v1alpha1/tx.pulsar.go b/api/regen/group/v1alpha1/tx.pulsar.go index 1d22208c7f..c22a1b4915 100644 --- a/api/regen/group/v1alpha1/tx.pulsar.go +++ b/api/regen/group/v1alpha1/tx.pulsar.go @@ -10558,7 +10558,7 @@ func (x *fastReflection_MsgExecResponse) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/group/v1alpha1/tx.proto const ( diff --git a/api/regen/group/v1alpha1/tx_grpc.pb.go b/api/regen/group/v1alpha1/tx_grpc.pb.go index eac2a30959..84172ca02e 100644 --- a/api/regen/group/v1alpha1/tx_grpc.pb.go +++ b/api/regen/group/v1alpha1/tx_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) +// - protoc v3.19.1 // source: regen/group/v1alpha1/tx.proto package groupv1alpha1 diff --git a/api/regen/group/v1alpha1/types.pulsar.go b/api/regen/group/v1alpha1/types.pulsar.go index d290272399..5f05ad2f7e 100644 --- a/api/regen/group/v1alpha1/types.pulsar.go +++ b/api/regen/group/v1alpha1/types.pulsar.go @@ -6029,7 +6029,7 @@ func (x *fastReflection_Vote) ProtoMethods() *protoiface.Methods { // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 -// protoc (unknown) +// protoc v3.19.1 // source: regen/group/v1alpha1/types.proto const ( diff --git a/go.sum b/go.sum index bdba051200..5f68029119 100644 --- a/go.sum +++ b/go.sum @@ -240,7 +240,6 @@ github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNs github.com/cosmos/cosmos-sdk/api v0.1.0-alpha3/go.mod h1:Ht15guGn9F8b0lv8NkjXE9/asAvVUOt2n4gvQ4q5MyU= github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4/go.mod h1:gZu6sOu2vl4Fd7I+BjDSx2bxndwPgFLGfOegek3SQQo= github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.2/go.mod h1:Gi7pzVRnvZ1N16JAXpLADzng0ePoE7YeEHaULSFB2Ts= -github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.6/go.mod h1:pH7cqdUlm/zbtGUxlg9Lf/KL8poW4N9HkSN1AKAwRKk= github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.7/go.mod h1:woV5EBAWmTaXKs7YXioQsYheXSZkmZIgLPq+Koi/GB8= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= diff --git a/proto/regen/ecocredit/basket/v1beta1/events.proto b/proto/regen/ecocredit/basket/v1beta1/events.proto index 6013b46504..96a3706e4e 100644 --- a/proto/regen/ecocredit/basket/v1beta1/events.proto +++ b/proto/regen/ecocredit/basket/v1beta1/events.proto @@ -2,4 +2,4 @@ syntax = "proto3"; package regen.ecocredit.basket.v1beta1; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket/v1beta1"; diff --git a/proto/regen/ecocredit/basket/v1beta1/query.proto b/proto/regen/ecocredit/basket/v1beta1/query.proto index 8d97f03e1d..d6d0ede01f 100644 --- a/proto/regen/ecocredit/basket/v1beta1/query.proto +++ b/proto/regen/ecocredit/basket/v1beta1/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "regen/ecocredit/basket/v1beta1/types.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket/v1beta1"; // Msg is the regen.ecocredit.basket.v1beta1 Query service. service Query { diff --git a/proto/regen/ecocredit/basket/v1beta1/state.proto b/proto/regen/ecocredit/basket/v1beta1/state.proto index 9eaab6e419..3fc822962c 100644 --- a/proto/regen/ecocredit/basket/v1beta1/state.proto +++ b/proto/regen/ecocredit/basket/v1beta1/state.proto @@ -4,7 +4,7 @@ package regen.ecocredit.basket.v1beta1; import "cosmos/orm/v1alpha1/orm.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket/v1beta1"; // BasketBalance stores the amount of credits from a batch in a basket message BasketBalance { diff --git a/proto/regen/ecocredit/basket/v1beta1/tx.proto b/proto/regen/ecocredit/basket/v1beta1/tx.proto index 54ceeaac31..b9be223df3 100644 --- a/proto/regen/ecocredit/basket/v1beta1/tx.proto +++ b/proto/regen/ecocredit/basket/v1beta1/tx.proto @@ -4,7 +4,7 @@ package regen.ecocredit.basket.v1beta1; import "regen/ecocredit/basket/v1beta1/types.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket/v1beta1"; // Msg is the regen.ecocredit.basket.v1beta1 Msg service. service Msg { diff --git a/proto/regen/ecocredit/basket/v1beta1/types.proto b/proto/regen/ecocredit/basket/v1beta1/types.proto index 9d57fab868..5e3dff9e17 100644 --- a/proto/regen/ecocredit/basket/v1beta1/types.proto +++ b/proto/regen/ecocredit/basket/v1beta1/types.proto @@ -5,7 +5,7 @@ package regen.ecocredit.basket.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/basket/v1beta1"; // BasketCredit represents the information for a credit batch inside a basket. message BasketCredit { diff --git a/proto/regen/ecocredit/marketplace/v1beta1/events.proto b/proto/regen/ecocredit/marketplace/v1beta1/events.proto index ae9001f3b2..d296278cd2 100644 --- a/proto/regen/ecocredit/marketplace/v1beta1/events.proto +++ b/proto/regen/ecocredit/marketplace/v1beta1/events.proto @@ -6,7 +6,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/v1beta1"; // EventSell is an event emitted when a sell order is created. message EventSell { diff --git a/proto/regen/ecocredit/marketplace/v1beta1/query.proto b/proto/regen/ecocredit/marketplace/v1beta1/query.proto index 295ca9d8cc..b09eb45c5e 100644 --- a/proto/regen/ecocredit/marketplace/v1beta1/query.proto +++ b/proto/regen/ecocredit/marketplace/v1beta1/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "regen/ecocredit/marketplace/v1beta1/state.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/v1beta1"; // Msg is the regen.ecocredit.marketplace.v1beta1 Query service. service Query { diff --git a/proto/regen/ecocredit/marketplace/v1beta1/state.proto b/proto/regen/ecocredit/marketplace/v1beta1/state.proto index 9336b3ba82..1f48fe0c7c 100644 --- a/proto/regen/ecocredit/marketplace/v1beta1/state.proto +++ b/proto/regen/ecocredit/marketplace/v1beta1/state.proto @@ -6,7 +6,7 @@ import "google/protobuf/timestamp.proto"; import "cosmos/orm/v1alpha1/orm.proto"; import "regen/ecocredit/marketplace/v1beta1/types.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/v1beta1"; // SellOrder represents the information for a sell order. message SellOrder { diff --git a/proto/regen/ecocredit/marketplace/v1beta1/tx.proto b/proto/regen/ecocredit/marketplace/v1beta1/tx.proto index 037b3ff5e9..7c6a7943c4 100644 --- a/proto/regen/ecocredit/marketplace/v1beta1/tx.proto +++ b/proto/regen/ecocredit/marketplace/v1beta1/tx.proto @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/timestamp.proto"; import "regen/ecocredit/marketplace/v1beta1/types.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/v1beta1"; // Msg is the regen.ecocredit.marketplace.v1beta1 Msg service. service Msg { diff --git a/proto/regen/ecocredit/marketplace/v1beta1/types.proto b/proto/regen/ecocredit/marketplace/v1beta1/types.proto index 65c8f3f0ca..ab3637bf96 100644 --- a/proto/regen/ecocredit/marketplace/v1beta1/types.proto +++ b/proto/regen/ecocredit/marketplace/v1beta1/types.proto @@ -4,7 +4,7 @@ package regen.ecocredit.marketplace.v1beta1; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1"; +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace/v1beta1"; // Filter is used to create filtered buy orders which match credit batch // sell orders based on selection criteria rather than matching individual diff --git a/proto/regen/ecocredit/v1beta1/query.proto b/proto/regen/ecocredit/v1beta1/query.proto index 8d5f8fbf01..e1fa7c140a 100644 --- a/proto/regen/ecocredit/v1beta1/query.proto +++ b/proto/regen/ecocredit/v1beta1/query.proto @@ -24,7 +24,14 @@ service Query { "/regen/ecocredit/v1beta1/classes/{class_id}"; } - // Projects queries for all projects within a class with pagination. + // ClassIssuers queries for the addresses of the issuers for a credit class. + rpc ClassIssuers(QueryClassIssuersRequest) returns (QueryClassIssuersResponse) { + option (google.api.http).get = + "/regen/ecocredit/v1alpha2/classes/{class_id}/issuers"; + } + + + // Projects queries for all projects within a class with pagination. rpc Projects(QueryProjectsRequest) returns (QueryProjectsResponse) { option (google.api.http).get = "/regen/ecocredit/v1beta1/classes/{class_id}/projects"; @@ -113,6 +120,24 @@ message QueryClassInfoResponse { ClassInfo info = 1; } +// QueryClassIssuersRequest is the Query/ClassIssuers request type. +message QueryClassIssuersRequest { + // class_id is the unique ID of credit class to query. + string class_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryClassIssuersRequest is the Query/ClassIssuers response type. +message QueryClassIssuersResponse { + // issuers is a list of issuers for the credit class + repeated string issuers = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // QueryProjectsRequest is the Query/Projects request type. message QueryProjectsRequest { @@ -218,6 +243,10 @@ message QuerySupplyResponse { // retired_supply is the decimal number of retired credits in the batch // supply. string retired_supply = 2; + + // cancelled_amount is the decimal number of cancelled credits in the batch + // supply. + string cancelled_amount = 3; } // QueryCreditTypesRequest is the Query/Credit_Types request type diff --git a/types/math/dec.go b/types/math/dec.go index f61db05f03..887040d050 100644 --- a/types/math/dec.go +++ b/types/math/dec.go @@ -2,7 +2,6 @@ package math import ( "fmt" - "github.com/cockroachdb/apd/v2" "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -33,6 +32,9 @@ var dec128Context = apd.Context{ } func NewDecFromString(s string) (Dec, error) { + if s == "" { + s = "0" + } d, _, err := apd.NewFromString(s) if err != nil { return Dec{}, ErrInvalidDecString.Wrap(err.Error()) diff --git a/x/data/query.pb.gw.go b/x/data/query.pb.gw.go index ce1a719a83..487d029e7f 100644 --- a/x/data/query.pb.gw.go +++ b/x/data/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_ByIRI_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryByIRIRequest @@ -232,12 +234,14 @@ func local_request_Query_Signers_0(ctx context.Context, marshaler runtime.Marsha // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_ByIRI_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 { @@ -245,6 +249,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ByIRI_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) @@ -258,6 +263,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BySigner_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 { @@ -265,6 +272,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BySigner_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) @@ -278,6 +286,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Signers_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 { @@ -285,6 +295,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Signers_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) diff --git a/x/ecocredit/basket/v1beta1/events.pb.go b/x/ecocredit/basket/v1beta1/events.pb.go new file mode 100644 index 0000000000..be45c46047 --- /dev/null +++ b/x/ecocredit/basket/v1beta1/events.pb.go @@ -0,0 +1,39 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/events.proto + +package v1beta1 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("regen/ecocredit/basket/v1beta1/events.proto", fileDescriptor_0b65fabc48182a26) +} + +var fileDescriptor_0b65fabc48182a26 = []byte{ + // 150 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0x4a, 0x4d, 0x4f, + 0xcd, 0xd3, 0x4f, 0x4d, 0xce, 0x4f, 0x2e, 0x4a, 0x4d, 0xc9, 0x2c, 0xd1, 0x4f, 0x4a, 0x2c, 0xce, + 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, + 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x03, 0x2b, 0xd6, 0x83, 0x2b, 0xd6, 0x83, + 0x28, 0xd6, 0x83, 0x2a, 0x76, 0x8a, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, + 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, + 0x28, 0x87, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, 0x21, 0xba, + 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0x50, 0x5e, 0x4e, 0x6a, 0x4a, 0x7a, 0x6a, 0x91, 0x7e, + 0x05, 0x4e, 0x87, 0x24, 0xb1, 0x81, 0x9d, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x42, + 0x91, 0x3f, 0xb1, 0x00, 0x00, 0x00, +} diff --git a/x/ecocredit/basket/v1beta1/query.pb.go b/x/ecocredit/basket/v1beta1/query.pb.go new file mode 100644 index 0000000000..43136b4dee --- /dev/null +++ b/x/ecocredit/basket/v1beta1/query.pb.go @@ -0,0 +1,2029 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/query.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 + +// Basket defines a credit basket. +type Basket struct { + // curator is the address of the basket curator who is able to change certain + // basket settings. + Curator string `protobuf:"bytes,1,opt,name=curator,proto3" json:"curator,omitempty"` + // name will be used to create a bank denom for this basket token of the form + // ecocredit:{curator}:{name}. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // display_name will be used to create a bank Metadata display name for this + // basket token of the form ecocredit:{curator}:{display_name}. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // exponent is the exponent that will be used for denom metadata. An exponent + // of 6 will mean that 10^6 units of a basket token should be displayed + // as one unit in user interfaces. + Exponent uint32 `protobuf:"varint,4,opt,name=exponent,proto3" json:"exponent,omitempty"` + // basket_criteria is the criteria by which credits can be added to the + // basket. Basket criteria will be applied in order and the first criteria + // which applies to a credit will determine its multiplier in the basket. + BasketCriteria []*BasketCriteria `protobuf:"bytes,5,rep,name=basket_criteria,json=basketCriteria,proto3" json:"basket_criteria,omitempty"` + // disable_auto_retire allows auto-retirement to be disabled. + // The credits will be auto-retired if disable_auto_retire is + // false unless the credits were previously put into the basket by the + // address picking them from the basket, in which case they will remain + // tradable. + DisableAutoRetire bool `protobuf:"varint,6,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // allow_picking specifies whether an address which didn't deposit the credits + // in the basket can pick those credits or not. + AllowPicking bool `protobuf:"varint,7,opt,name=allow_picking,json=allowPicking,proto3" json:"allow_picking,omitempty"` +} + +func (m *Basket) Reset() { *m = Basket{} } +func (m *Basket) String() string { return proto.CompactTextString(m) } +func (*Basket) ProtoMessage() {} +func (*Basket) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{0} +} +func (m *Basket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Basket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Basket.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 *Basket) XXX_Merge(src proto.Message) { + xxx_messageInfo_Basket.Merge(m, src) +} +func (m *Basket) XXX_Size() int { + return m.Size() +} +func (m *Basket) XXX_DiscardUnknown() { + xxx_messageInfo_Basket.DiscardUnknown(m) +} + +var xxx_messageInfo_Basket proto.InternalMessageInfo + +func (m *Basket) GetCurator() string { + if m != nil { + return m.Curator + } + return "" +} + +func (m *Basket) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Basket) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *Basket) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +func (m *Basket) GetBasketCriteria() []*BasketCriteria { + if m != nil { + return m.BasketCriteria + } + return nil +} + +func (m *Basket) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *Basket) GetAllowPicking() bool { + if m != nil { + return m.AllowPicking + } + return false +} + +// QueryBasketRequest is the Query/Basket request type. +type QueryBasketRequest struct { + // basket_denom represents the denom of the basket to query. + BasketDenom string `protobuf:"bytes,1,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` +} + +func (m *QueryBasketRequest) Reset() { *m = QueryBasketRequest{} } +func (m *QueryBasketRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBasketRequest) ProtoMessage() {} +func (*QueryBasketRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{1} +} +func (m *QueryBasketRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketRequest.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 *QueryBasketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketRequest.Merge(m, src) +} +func (m *QueryBasketRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketRequest proto.InternalMessageInfo + +func (m *QueryBasketRequest) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +// QueryBasketResponse is the Query/Basket response type. +type QueryBasketResponse struct { + // basket is the queried basket. + Basket *Basket `protobuf:"bytes,1,opt,name=basket,proto3" json:"basket,omitempty"` +} + +func (m *QueryBasketResponse) Reset() { *m = QueryBasketResponse{} } +func (m *QueryBasketResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBasketResponse) ProtoMessage() {} +func (*QueryBasketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{2} +} +func (m *QueryBasketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketResponse.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 *QueryBasketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketResponse.Merge(m, src) +} +func (m *QueryBasketResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketResponse proto.InternalMessageInfo + +func (m *QueryBasketResponse) GetBasket() *Basket { + if m != nil { + return m.Basket + } + return nil +} + +// QueryBasketsRequest is the Query/Baskets request type. +type QueryBasketsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBasketsRequest) Reset() { *m = QueryBasketsRequest{} } +func (m *QueryBasketsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBasketsRequest) ProtoMessage() {} +func (*QueryBasketsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{3} +} +func (m *QueryBasketsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketsRequest.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 *QueryBasketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketsRequest.Merge(m, src) +} +func (m *QueryBasketsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketsRequest proto.InternalMessageInfo + +func (m *QueryBasketsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBasketsResponse is the Query/Baskets response type. +type QueryBasketsResponse struct { + // baskets are the fetched baskets. + Baskets []*Basket `protobuf:"bytes,1,rep,name=baskets,proto3" json:"baskets,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBasketsResponse) Reset() { *m = QueryBasketsResponse{} } +func (m *QueryBasketsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBasketsResponse) ProtoMessage() {} +func (*QueryBasketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{4} +} +func (m *QueryBasketsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketsResponse.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 *QueryBasketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketsResponse.Merge(m, src) +} +func (m *QueryBasketsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketsResponse proto.InternalMessageInfo + +func (m *QueryBasketsResponse) GetBaskets() []*Basket { + if m != nil { + return m.Baskets + } + return nil +} + +func (m *QueryBasketsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBasketCreditsRequest is the Query/BasketCredits request type. +type QueryBasketCreditsRequest struct { + // basket_denom is the basket denom to query credits for. + BasketDenom string `protobuf:"bytes,1,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` +} + +func (m *QueryBasketCreditsRequest) Reset() { *m = QueryBasketCreditsRequest{} } +func (m *QueryBasketCreditsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBasketCreditsRequest) ProtoMessage() {} +func (*QueryBasketCreditsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{5} +} +func (m *QueryBasketCreditsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketCreditsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketCreditsRequest.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 *QueryBasketCreditsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketCreditsRequest.Merge(m, src) +} +func (m *QueryBasketCreditsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketCreditsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketCreditsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketCreditsRequest proto.InternalMessageInfo + +func (m *QueryBasketCreditsRequest) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +// QueryBasketCreditsResponse is the Query/BasketCredits response type. +type QueryBasketCreditsResponse struct { + // credits are the credits inside the basket. + Credits []*BasketCredit `protobuf:"bytes,1,rep,name=credits,proto3" json:"credits,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBasketCreditsResponse) Reset() { *m = QueryBasketCreditsResponse{} } +func (m *QueryBasketCreditsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBasketCreditsResponse) ProtoMessage() {} +func (*QueryBasketCreditsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e03f8820496919c5, []int{6} +} +func (m *QueryBasketCreditsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBasketCreditsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBasketCreditsResponse.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 *QueryBasketCreditsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBasketCreditsResponse.Merge(m, src) +} +func (m *QueryBasketCreditsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBasketCreditsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBasketCreditsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBasketCreditsResponse proto.InternalMessageInfo + +func (m *QueryBasketCreditsResponse) GetCredits() []*BasketCredit { + if m != nil { + return m.Credits + } + return nil +} + +func (m *QueryBasketCreditsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*Basket)(nil), "regen.ecocredit.basket.v1beta1.Basket") + proto.RegisterType((*QueryBasketRequest)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketRequest") + proto.RegisterType((*QueryBasketResponse)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketResponse") + proto.RegisterType((*QueryBasketsRequest)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketsRequest") + proto.RegisterType((*QueryBasketsResponse)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketsResponse") + proto.RegisterType((*QueryBasketCreditsRequest)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketCreditsRequest") + proto.RegisterType((*QueryBasketCreditsResponse)(nil), "regen.ecocredit.basket.v1beta1.QueryBasketCreditsResponse") +} + +func init() { + proto.RegisterFile("regen/ecocredit/basket/v1beta1/query.proto", fileDescriptor_e03f8820496919c5) +} + +var fileDescriptor_e03f8820496919c5 = []byte{ + // 657 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xdf, 0x6a, 0x13, 0x4f, + 0x14, 0xee, 0xa4, 0x6d, 0xd2, 0xdf, 0xa4, 0xfd, 0x89, 0x53, 0x2f, 0xd6, 0x45, 0x96, 0x34, 0x05, + 0x8d, 0xa2, 0xbb, 0x26, 0x15, 0xac, 0xbd, 0x28, 0xb5, 0x95, 0x7a, 0x27, 0x75, 0x41, 0x84, 0x82, + 0x84, 0xc9, 0xe6, 0xb0, 0x5d, 0xba, 0xd9, 0xd9, 0xce, 0x4c, 0xfa, 0x07, 0xf1, 0xc6, 0x27, 0x10, + 0x7c, 0x00, 0x51, 0x2f, 0xc5, 0xf7, 0xe8, 0x65, 0xc1, 0x1b, 0x2f, 0xa5, 0xf5, 0x41, 0x64, 0x67, + 0x66, 0x63, 0xd7, 0x7f, 0x49, 0xc4, 0xbb, 0xcc, 0x39, 0xdf, 0xf7, 0x9d, 0xef, 0x9c, 0x39, 0xd9, + 0xc1, 0x37, 0x38, 0x84, 0x90, 0x78, 0x10, 0xb0, 0x80, 0x43, 0x37, 0x92, 0x5e, 0x87, 0x8a, 0x5d, + 0x90, 0xde, 0x7e, 0xb3, 0x03, 0x92, 0x36, 0xbd, 0xbd, 0x3e, 0xf0, 0x23, 0x37, 0xe5, 0x4c, 0x32, + 0xe2, 0x28, 0xac, 0x3b, 0xc0, 0xba, 0x1a, 0xeb, 0x1a, 0xac, 0x7d, 0x25, 0x64, 0x2c, 0x8c, 0xc1, + 0xa3, 0x69, 0xe4, 0xd1, 0x24, 0x61, 0x92, 0xca, 0x88, 0x25, 0x42, 0xb3, 0xed, 0x61, 0x95, 0xe4, + 0x51, 0x0a, 0x03, 0x6c, 0xc0, 0x44, 0x8f, 0x89, 0x0c, 0x02, 0xda, 0xc2, 0x00, 0x96, 0xd2, 0x30, + 0x4a, 0x94, 0xb0, 0xc6, 0xd6, 0xdf, 0x97, 0x70, 0x79, 0x5d, 0x49, 0x11, 0x0b, 0x57, 0x82, 0x3e, + 0xa7, 0x92, 0x71, 0x0b, 0xd5, 0x50, 0xe3, 0x3f, 0x3f, 0x3f, 0x12, 0x82, 0xa7, 0x12, 0xda, 0x03, + 0xab, 0xa4, 0xc2, 0xea, 0x37, 0x59, 0xc0, 0xb3, 0xdd, 0x48, 0xa4, 0x31, 0x3d, 0x6a, 0xab, 0xdc, + 0xa4, 0xca, 0x55, 0x4d, 0xec, 0x51, 0x06, 0xb1, 0xf1, 0x0c, 0x1c, 0xa6, 0x2c, 0x81, 0x44, 0x5a, + 0x53, 0x35, 0xd4, 0x98, 0xf3, 0x07, 0x67, 0xf2, 0x14, 0x5f, 0xd0, 0x1d, 0xb4, 0x03, 0x1e, 0x49, + 0xe0, 0x11, 0xb5, 0xa6, 0x6b, 0x93, 0x8d, 0x6a, 0xcb, 0x75, 0xff, 0x3c, 0x27, 0x57, 0xbb, 0xdd, + 0x30, 0x2c, 0xff, 0xff, 0x4e, 0xe1, 0x4c, 0x5c, 0x3c, 0xdf, 0x8d, 0x04, 0xed, 0xc4, 0xd0, 0xa6, + 0x7d, 0xc9, 0xda, 0x1c, 0x64, 0xc4, 0xc1, 0x2a, 0xd7, 0x50, 0x63, 0xc6, 0xbf, 0x68, 0x52, 0xf7, + 0xfb, 0x92, 0xf9, 0x2a, 0x41, 0x16, 0xf1, 0x1c, 0x8d, 0x63, 0x76, 0xd0, 0x4e, 0xa3, 0x60, 0x37, + 0x4a, 0x42, 0xab, 0xa2, 0x90, 0xb3, 0x2a, 0xb8, 0xa5, 0x63, 0xf5, 0xbb, 0x98, 0x3c, 0xce, 0xe6, + 0xa8, 0x6b, 0xfb, 0xb0, 0xd7, 0x07, 0x21, 0xb3, 0x11, 0x98, 0x1e, 0xba, 0x90, 0xb0, 0x9e, 0x99, + 0x5a, 0x55, 0xc7, 0x1e, 0x64, 0xa1, 0xfa, 0x13, 0x3c, 0x5f, 0x20, 0x8a, 0x94, 0x25, 0x02, 0xc8, + 0x2a, 0x2e, 0x6b, 0x94, 0xe2, 0x54, 0x5b, 0x57, 0x47, 0x6b, 0xda, 0x37, 0xac, 0xfa, 0xb3, 0x82, + 0xac, 0xc8, 0x0d, 0x6d, 0x62, 0xfc, 0xfd, 0x82, 0x07, 0xd2, 0x7a, 0x1b, 0x32, 0x45, 0x70, 0xf5, + 0x42, 0xe6, 0xaa, 0x5b, 0x34, 0x04, 0xc3, 0xf5, 0xcf, 0x31, 0xeb, 0x6f, 0x11, 0xbe, 0x54, 0xd4, + 0x37, 0xbe, 0xd7, 0x70, 0x45, 0x3b, 0x10, 0x16, 0x52, 0xb7, 0x35, 0xaa, 0xf1, 0x9c, 0x46, 0x1e, + 0x16, 0x2c, 0x96, 0x94, 0xc5, 0x6b, 0x43, 0x2d, 0xea, 0xf2, 0x05, 0x8f, 0xab, 0xf8, 0xf2, 0x39, + 0x8b, 0x1b, 0xaa, 0xb8, 0x18, 0xe3, 0x66, 0x3e, 0x22, 0x6c, 0xff, 0x4a, 0xc0, 0x74, 0xba, 0x89, + 0x2b, 0xba, 0xa1, 0xbc, 0xd3, 0x9b, 0xa3, 0xee, 0x65, 0x96, 0xf3, 0x73, 0xf2, 0x3f, 0xeb, 0xb7, + 0xf5, 0x6e, 0x0a, 0x4f, 0x2b, 0xbf, 0xe4, 0x03, 0x1a, 0xfc, 0x65, 0x5b, 0xc3, 0x4c, 0xfd, 0xbc, + 0xb5, 0xf6, 0xd2, 0x58, 0x1c, 0xed, 0xa4, 0xbe, 0xfc, 0xf2, 0xd3, 0xd7, 0xd7, 0xa5, 0x16, 0xb9, + 0xed, 0xfd, 0xf8, 0x1d, 0xda, 0x6f, 0xd2, 0x38, 0xdd, 0xa1, 0x4d, 0xf3, 0x41, 0x12, 0xde, 0xf3, + 0xf3, 0x93, 0x7f, 0x41, 0xde, 0x20, 0x5c, 0x31, 0x6b, 0x44, 0xc6, 0x29, 0x9d, 0xdf, 0xa5, 0x7d, + 0x67, 0x3c, 0x92, 0x31, 0x7c, 0x5d, 0x19, 0x5e, 0x24, 0x0b, 0x43, 0x0d, 0x93, 0x63, 0x84, 0xe7, + 0x0a, 0x4b, 0x40, 0xee, 0x8d, 0x51, 0xb2, 0xb8, 0x79, 0xf6, 0xca, 0xdf, 0x50, 0x8d, 0xe7, 0x35, + 0xe5, 0x79, 0x85, 0x2c, 0x8f, 0x3b, 0x64, 0xcf, 0x6c, 0xdb, 0xfa, 0xf6, 0xf1, 0xa9, 0x83, 0x4e, + 0x4e, 0x1d, 0xf4, 0xe5, 0xd4, 0x41, 0xaf, 0xce, 0x9c, 0x89, 0x93, 0x33, 0x67, 0xe2, 0xf3, 0x99, + 0x33, 0xb1, 0xbd, 0x16, 0x46, 0x72, 0xa7, 0xdf, 0x71, 0x03, 0xd6, 0xd3, 0xea, 0xb7, 0x12, 0x90, + 0x07, 0x8c, 0xef, 0x9a, 0x53, 0x0c, 0xdd, 0x10, 0xb8, 0x77, 0xf8, 0xdb, 0x17, 0xa6, 0x53, 0x56, + 0x0f, 0xc6, 0xd2, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0x7e, 0xaa, 0xea, 0xf4, 0x06, 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 { + // Basket queries one basket by denom. + Basket(ctx context.Context, in *QueryBasketRequest, opts ...grpc.CallOption) (*QueryBasketResponse, error) + // Baskets lists all baskets in the ecocredit module. + Baskets(ctx context.Context, in *QueryBasketsRequest, opts ...grpc.CallOption) (*QueryBasketsResponse, error) + // BasketCredits lists all ecocredits inside a given basket. + BasketCredits(ctx context.Context, in *QueryBasketCreditsRequest, opts ...grpc.CallOption) (*QueryBasketCreditsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Basket(ctx context.Context, in *QueryBasketRequest, opts ...grpc.CallOption) (*QueryBasketResponse, error) { + out := new(QueryBasketResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Query/Basket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Baskets(ctx context.Context, in *QueryBasketsRequest, opts ...grpc.CallOption) (*QueryBasketsResponse, error) { + out := new(QueryBasketsResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Query/Baskets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BasketCredits(ctx context.Context, in *QueryBasketCreditsRequest, opts ...grpc.CallOption) (*QueryBasketCreditsResponse, error) { + out := new(QueryBasketCreditsResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Query/BasketCredits", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Basket queries one basket by denom. + Basket(context.Context, *QueryBasketRequest) (*QueryBasketResponse, error) + // Baskets lists all baskets in the ecocredit module. + Baskets(context.Context, *QueryBasketsRequest) (*QueryBasketsResponse, error) + // BasketCredits lists all ecocredits inside a given basket. + BasketCredits(context.Context, *QueryBasketCreditsRequest) (*QueryBasketCreditsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Basket(ctx context.Context, req *QueryBasketRequest) (*QueryBasketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Basket not implemented") +} +func (*UnimplementedQueryServer) Baskets(ctx context.Context, req *QueryBasketsRequest) (*QueryBasketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Baskets not implemented") +} +func (*UnimplementedQueryServer) BasketCredits(ctx context.Context, req *QueryBasketCreditsRequest) (*QueryBasketCreditsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BasketCredits not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Basket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBasketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Basket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Query/Basket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Basket(ctx, req.(*QueryBasketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Baskets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBasketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Baskets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Query/Baskets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Baskets(ctx, req.(*QueryBasketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BasketCredits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBasketCreditsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BasketCredits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Query/BasketCredits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BasketCredits(ctx, req.(*QueryBasketCreditsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.basket.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Basket", + Handler: _Query_Basket_Handler, + }, + { + MethodName: "Baskets", + Handler: _Query_Baskets_Handler, + }, + { + MethodName: "BasketCredits", + Handler: _Query_BasketCredits_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/basket/v1beta1/query.proto", +} + +func (m *Basket) 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 *Basket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Basket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowPicking { + i-- + if m.AllowPicking { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.BasketCriteria) > 0 { + for iNdEx := len(m.BasketCriteria) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BasketCriteria[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Exponent != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x20 + } + if len(m.DisplayName) > 0 { + i -= len(m.DisplayName) + copy(dAtA[i:], m.DisplayName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DisplayName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Curator) > 0 { + i -= len(m.Curator) + copy(dAtA[i:], m.Curator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Curator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketRequest) 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 *QueryBasketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketResponse) 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 *QueryBasketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Basket != nil { + { + size, err := m.Basket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketsRequest) 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 *QueryBasketsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketsResponse) 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 *QueryBasketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Baskets) > 0 { + for iNdEx := len(m.Baskets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Baskets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketCreditsRequest) 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 *QueryBasketCreditsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketCreditsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBasketCreditsResponse) 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 *QueryBasketCreditsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBasketCreditsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Credits) > 0 { + for iNdEx := len(m.Credits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credits[iNdEx].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 *Basket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Curator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.DisplayName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovQuery(uint64(m.Exponent)) + } + if len(m.BasketCriteria) > 0 { + for _, e := range m.BasketCriteria { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.DisableAutoRetire { + n += 2 + } + if m.AllowPicking { + n += 2 + } + return n +} + +func (m *QueryBasketRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBasketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Basket != nil { + l = m.Basket.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBasketsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBasketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Baskets) > 0 { + for _, e := range m.Baskets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBasketCreditsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBasketCreditsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Credits) > 0 { + for _, e := range m.Credits { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Basket) 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: Basket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Basket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Curator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Curator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketCriteria", 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 + } + m.BasketCriteria = append(m.BasketCriteria, &BasketCriteria{}) + if err := m.BasketCriteria[len(m.BasketCriteria)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowPicking", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowPicking = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketRequest) 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: QueryBasketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketResponse) 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: QueryBasketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Basket == nil { + m.Basket = &Basket{} + } + if err := m.Basket.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 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketsRequest) 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: QueryBasketsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketsResponse) 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: QueryBasketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Baskets", 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 + } + m.Baskets = append(m.Baskets, &Basket{}) + if err := m.Baskets[len(m.Baskets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketCreditsRequest) 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: QueryBasketCreditsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketCreditsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBasketCreditsResponse) 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: QueryBasketCreditsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBasketCreditsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credits", 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 + } + m.Credits = append(m.Credits, &BasketCredit{}) + if err := m.Credits[len(m.Credits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (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/ecocredit/basket/v1beta1/query.pb.gw.go b/x/ecocredit/basket/v1beta1/query.pb.gw.go new file mode 100644 index 0000000000..1189ffd9df --- /dev/null +++ b/x/ecocredit/basket/v1beta1/query.pb.gw.go @@ -0,0 +1,373 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/query.proto + +/* +Package v1beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1beta1 + +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_Basket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["basket_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "basket_denom") + } + + protoReq.BasketDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "basket_denom", err) + } + + msg, err := client.Basket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Basket_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["basket_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "basket_denom") + } + + protoReq.BasketDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "basket_denom", err) + } + + msg, err := server.Basket(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Baskets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Baskets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Baskets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Baskets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Baskets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Baskets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Baskets(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_BasketCredits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketCreditsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["basket_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "basket_denom") + } + + protoReq.BasketDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "basket_denom", err) + } + + msg, err := client.BasketCredits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BasketCredits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBasketCreditsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["basket_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "basket_denom") + } + + protoReq.BasketDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "basket_denom", err) + } + + msg, err := server.BasketCredits(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_Basket_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_Basket_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_Basket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Baskets_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_Baskets_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_Baskets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BasketCredits_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_BasketCredits_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_BasketCredits_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_Basket_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_Basket_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_Basket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Baskets_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_Baskets_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_Baskets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BasketCredits_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_BasketCredits_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_BasketCredits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Basket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"regen", "ecocredit", "v1alpha1", "baskets", "basket_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Baskets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"regen", "ecocredit", "v1alpha1", "baskets"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BasketCredits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"regen", "ecocredit", "v1alpha1", "baskets", "basket_denom", "credits"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Basket_0 = runtime.ForwardResponseMessage + + forward_Query_Baskets_0 = runtime.ForwardResponseMessage + + forward_Query_BasketCredits_0 = runtime.ForwardResponseMessage +) diff --git a/x/ecocredit/basket/v1beta1/state.pb.go b/x/ecocredit/basket/v1beta1/state.pb.go new file mode 100644 index 0000000000..a33ceb76aa --- /dev/null +++ b/x/ecocredit/basket/v1beta1/state.pb.go @@ -0,0 +1,417 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/state.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/orm/v1alpha1" + proto "github.com/gogo/protobuf/proto" + 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 + +// BasketBalance stores the amount of credits from a batch in a basket +type BasketBalance struct { + // basket_denom is the denom of the basket + BasketDenom string `protobuf:"bytes,1,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` + // batch_id is the id of the credit batch + BatchId uint64 `protobuf:"varint,2,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"` + // balance is the amount of ecocredits held in the basket + Balance string `protobuf:"bytes,3,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (m *BasketBalance) Reset() { *m = BasketBalance{} } +func (m *BasketBalance) String() string { return proto.CompactTextString(m) } +func (*BasketBalance) ProtoMessage() {} +func (*BasketBalance) Descriptor() ([]byte, []int) { + return fileDescriptor_87a9a9e13a9680aa, []int{0} +} +func (m *BasketBalance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasketBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasketBalance.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 *BasketBalance) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasketBalance.Merge(m, src) +} +func (m *BasketBalance) XXX_Size() int { + return m.Size() +} +func (m *BasketBalance) XXX_DiscardUnknown() { + xxx_messageInfo_BasketBalance.DiscardUnknown(m) +} + +var xxx_messageInfo_BasketBalance proto.InternalMessageInfo + +func (m *BasketBalance) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +func (m *BasketBalance) GetBatchId() uint64 { + if m != nil { + return m.BatchId + } + return 0 +} + +func (m *BasketBalance) GetBalance() string { + if m != nil { + return m.Balance + } + return "" +} + +func init() { + proto.RegisterType((*BasketBalance)(nil), "regen.ecocredit.basket.v1beta1.BasketBalance") +} + +func init() { + proto.RegisterFile("regen/ecocredit/basket/v1beta1/state.proto", fileDescriptor_87a9a9e13a9680aa) +} + +var fileDescriptor_87a9a9e13a9680aa = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2a, 0x4a, 0x4d, 0x4f, + 0xcd, 0xd3, 0x4f, 0x4d, 0xce, 0x4f, 0x2e, 0x4a, 0x4d, 0xc9, 0x2c, 0xd1, 0x4f, 0x4a, 0x2c, 0xce, + 0x4e, 0x2d, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, + 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x03, 0xab, 0xd5, 0x83, 0xab, 0xd5, 0x83, 0xa8, + 0xd5, 0x83, 0xaa, 0x95, 0x92, 0x4d, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2f, 0xca, 0xd5, + 0x2f, 0x33, 0x4c, 0xcc, 0x29, 0xc8, 0x48, 0x34, 0x04, 0x71, 0x20, 0xda, 0x95, 0xba, 0x18, 0xb9, + 0x78, 0x9d, 0xc0, 0x3a, 0x9c, 0x12, 0x73, 0x12, 0xf3, 0x92, 0x53, 0x85, 0x14, 0xb9, 0x78, 0x20, + 0x46, 0xc4, 0xa7, 0xa4, 0xe6, 0xe5, 0xe7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x71, 0x43, + 0xc4, 0x5c, 0x40, 0x42, 0x42, 0x92, 0x5c, 0x1c, 0x49, 0x89, 0x25, 0xc9, 0x19, 0xf1, 0x99, 0x29, + 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0xec, 0x60, 0xbe, 0x67, 0x8a, 0x90, 0x04, 0x17, 0x7b, + 0x12, 0xc4, 0x20, 0x09, 0x66, 0xb0, 0x46, 0x18, 0xd7, 0x4a, 0xf1, 0xd3, 0xbc, 0xcb, 0x7d, 0xcc, + 0xd2, 0x5c, 0xe2, 0x5c, 0xa2, 0xc8, 0xe6, 0xeb, 0xc0, 0x4d, 0x62, 0x74, 0x8a, 0x3a, 0xf1, 0x48, + 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, + 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x87, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, + 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, 0x87, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xa1, 0xbc, + 0x9c, 0xd4, 0x94, 0xf4, 0xd4, 0x22, 0xfd, 0x0a, 0x9c, 0x61, 0x96, 0xc4, 0x06, 0xf6, 0xaf, 0x31, + 0x20, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x92, 0xd5, 0xce, 0x5c, 0x01, 0x00, 0x00, +} + +func (m *BasketBalance) 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 *BasketBalance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasketBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balance) > 0 { + i -= len(m.Balance) + copy(dAtA[i:], m.Balance) + i = encodeVarintState(dAtA, i, uint64(len(m.Balance))) + i-- + dAtA[i] = 0x1a + } + if m.BatchId != 0 { + i = encodeVarintState(dAtA, i, uint64(m.BatchId)) + i-- + dAtA[i] = 0x10 + } + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintState(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintState(dAtA []byte, offset int, v uint64) int { + offset -= sovState(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BasketBalance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.BatchId != 0 { + n += 1 + sovState(uint64(m.BatchId)) + } + l = len(m.Balance) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + return n +} + +func sovState(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BasketBalance) 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 ErrIntOverflowState + } + 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: BasketBalance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasketBalance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchId", wireType) + } + m.BatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BatchId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balance = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipState(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, ErrIntOverflowState + } + 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, ErrIntOverflowState + } + 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, ErrIntOverflowState + } + 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, ErrInvalidLengthState + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupState + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthState + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowState = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/basket/v1beta1/tx.pb.go b/x/ecocredit/basket/v1beta1/tx.pb.go new file mode 100644 index 0000000000..ad40f374fa --- /dev/null +++ b/x/ecocredit/basket/v1beta1/tx.pb.go @@ -0,0 +1,2513 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/tx.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 + +// MsgCreateBasket is the Msg/CreateBasket request type. +type MsgCreateBasket struct { + // curator is the address of the basket curator who is able to change certain + // basket settings. + Curator string `protobuf:"bytes,1,opt,name=curator,proto3" json:"curator,omitempty"` + // name will be used to create a bank denom for this basket token of the form + // ecocredit:{curator}:{name}. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // display_name will be used to create a bank Metadata display name for this + // basket token of the form ecocredit:{curator}:{display_name}. + DisplayName string `protobuf:"bytes,3,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // exponent is the exponent that will be used for denom metadata. An exponent + // of 6 will mean that 10^6 units of a basket token should be displayed + // as one unit in user interfaces. + Exponent uint32 `protobuf:"varint,4,opt,name=exponent,proto3" json:"exponent,omitempty"` + // basket_criteria is the criteria by which credits can be added to the + // basket. Basket criteria will be applied in order and the first criteria + // which applies to a credit will determine its multiplier in the basket. + BasketCriteria []*BasketCriteria `protobuf:"bytes,5,rep,name=basket_criteria,json=basketCriteria,proto3" json:"basket_criteria,omitempty"` + // disable_auto_retire allows auto-retirement to be disabled. + // The credits will be auto-retired if disable_auto_retire is + // false unless the credits were previously put into the basket by the + // address picking them from the basket, in which case they will remain + // tradable. + DisableAutoRetire bool `protobuf:"varint,6,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // allow_picking specifies whether an address which didn't deposit the credits + // in the basket can pick those credits or not. + AllowPicking bool `protobuf:"varint,7,opt,name=allow_picking,json=allowPicking,proto3" json:"allow_picking,omitempty"` +} + +func (m *MsgCreateBasket) Reset() { *m = MsgCreateBasket{} } +func (m *MsgCreateBasket) String() string { return proto.CompactTextString(m) } +func (*MsgCreateBasket) ProtoMessage() {} +func (*MsgCreateBasket) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{0} +} +func (m *MsgCreateBasket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateBasket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateBasket.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 *MsgCreateBasket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateBasket.Merge(m, src) +} +func (m *MsgCreateBasket) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateBasket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateBasket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateBasket proto.InternalMessageInfo + +func (m *MsgCreateBasket) GetCurator() string { + if m != nil { + return m.Curator + } + return "" +} + +func (m *MsgCreateBasket) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgCreateBasket) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *MsgCreateBasket) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +func (m *MsgCreateBasket) GetBasketCriteria() []*BasketCriteria { + if m != nil { + return m.BasketCriteria + } + return nil +} + +func (m *MsgCreateBasket) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *MsgCreateBasket) GetAllowPicking() bool { + if m != nil { + return m.AllowPicking + } + return false +} + +// MsgCreateBasketResponse is the Msg/CreateBasket response type. +type MsgCreateBasketResponse struct { + // basket_denom is the unique denomination ID of the newly created basket. + BasketDenom string `protobuf:"bytes,1,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` +} + +func (m *MsgCreateBasketResponse) Reset() { *m = MsgCreateBasketResponse{} } +func (m *MsgCreateBasketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateBasketResponse) ProtoMessage() {} +func (*MsgCreateBasketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{1} +} +func (m *MsgCreateBasketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateBasketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateBasketResponse.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 *MsgCreateBasketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateBasketResponse.Merge(m, src) +} +func (m *MsgCreateBasketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateBasketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateBasketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateBasketResponse proto.InternalMessageInfo + +func (m *MsgCreateBasketResponse) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +// MsgAddToBasket is the Msg/AddToBasket request type. +type MsgAddToBasket struct { + // owner is the owner of credits being added to the basket. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // basket_denom is the basket denom to add credits to. + BasketDenom string `protobuf:"bytes,2,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` + // credits are credits to add to the basket. If they do not match the basket's + // admission criteria the operation will fail. + Credits []*BasketCredit `protobuf:"bytes,3,rep,name=credits,proto3" json:"credits,omitempty"` +} + +func (m *MsgAddToBasket) Reset() { *m = MsgAddToBasket{} } +func (m *MsgAddToBasket) String() string { return proto.CompactTextString(m) } +func (*MsgAddToBasket) ProtoMessage() {} +func (*MsgAddToBasket) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{2} +} +func (m *MsgAddToBasket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddToBasket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddToBasket.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 *MsgAddToBasket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddToBasket.Merge(m, src) +} +func (m *MsgAddToBasket) XXX_Size() int { + return m.Size() +} +func (m *MsgAddToBasket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddToBasket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddToBasket proto.InternalMessageInfo + +func (m *MsgAddToBasket) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgAddToBasket) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +func (m *MsgAddToBasket) GetCredits() []*BasketCredit { + if m != nil { + return m.Credits + } + return nil +} + +// MsgAddToBasketResponse is the Msg/AddToBasket response type. +type MsgAddToBasketResponse struct { + // amount_received is the amount of basket tokens received. + AmountReceived string `protobuf:"bytes,1,opt,name=amount_received,json=amountReceived,proto3" json:"amount_received,omitempty"` +} + +func (m *MsgAddToBasketResponse) Reset() { *m = MsgAddToBasketResponse{} } +func (m *MsgAddToBasketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddToBasketResponse) ProtoMessage() {} +func (*MsgAddToBasketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{3} +} +func (m *MsgAddToBasketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddToBasketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddToBasketResponse.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 *MsgAddToBasketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddToBasketResponse.Merge(m, src) +} +func (m *MsgAddToBasketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddToBasketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddToBasketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddToBasketResponse proto.InternalMessageInfo + +func (m *MsgAddToBasketResponse) GetAmountReceived() string { + if m != nil { + return m.AmountReceived + } + return "" +} + +// MsgTakeFromBasket is the Msg/TakeFromBasket request type. +type MsgTakeFromBasket struct { + // owner is the owner of the basket tokens. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // basket_denom is the basket denom to take credits from. + BasketDenom string `protobuf:"bytes,2,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` + // amount is the number of credits to take from the basket. + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` + // retirement_location is the optional retirement location for the credits + // which will be used only if retire_on_take is true for this basket. + RetirementLocation string `protobuf:"bytes,4,opt,name=retirement_location,json=retirementLocation,proto3" json:"retirement_location,omitempty"` +} + +func (m *MsgTakeFromBasket) Reset() { *m = MsgTakeFromBasket{} } +func (m *MsgTakeFromBasket) String() string { return proto.CompactTextString(m) } +func (*MsgTakeFromBasket) ProtoMessage() {} +func (*MsgTakeFromBasket) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{4} +} +func (m *MsgTakeFromBasket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTakeFromBasket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTakeFromBasket.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 *MsgTakeFromBasket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTakeFromBasket.Merge(m, src) +} +func (m *MsgTakeFromBasket) XXX_Size() int { + return m.Size() +} +func (m *MsgTakeFromBasket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTakeFromBasket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTakeFromBasket proto.InternalMessageInfo + +func (m *MsgTakeFromBasket) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgTakeFromBasket) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +func (m *MsgTakeFromBasket) GetAmount() string { + if m != nil { + return m.Amount + } + return "" +} + +func (m *MsgTakeFromBasket) GetRetirementLocation() string { + if m != nil { + return m.RetirementLocation + } + return "" +} + +// MsgTakeFromBasketResponse is the Msg/TakeFromBasket response type. +type MsgTakeFromBasketResponse struct { + // credits are the credits taken out of the basket. + Credits []*BasketCredit `protobuf:"bytes,1,rep,name=credits,proto3" json:"credits,omitempty"` +} + +func (m *MsgTakeFromBasketResponse) Reset() { *m = MsgTakeFromBasketResponse{} } +func (m *MsgTakeFromBasketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTakeFromBasketResponse) ProtoMessage() {} +func (*MsgTakeFromBasketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{5} +} +func (m *MsgTakeFromBasketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTakeFromBasketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTakeFromBasketResponse.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 *MsgTakeFromBasketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTakeFromBasketResponse.Merge(m, src) +} +func (m *MsgTakeFromBasketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTakeFromBasketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTakeFromBasketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTakeFromBasketResponse proto.InternalMessageInfo + +func (m *MsgTakeFromBasketResponse) GetCredits() []*BasketCredit { + if m != nil { + return m.Credits + } + return nil +} + +// MsgPickFromBasket is the Msg/PickFromBasket request type. +type MsgPickFromBasket struct { + // owner is the owner of the basket tokens. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // basket_denom is the basket denom to pick credits from. + BasketDenom string `protobuf:"bytes,2,opt,name=basket_denom,json=basketDenom,proto3" json:"basket_denom,omitempty"` + // credits are the units of credits being picked from the basket + Credits []*BasketCredit `protobuf:"bytes,3,rep,name=credits,proto3" json:"credits,omitempty"` + // retirement_location is the optional retirement location for the credits + // which will be used only if retire_on_take is true for this basket. + RetirementLocation string `protobuf:"bytes,4,opt,name=retirement_location,json=retirementLocation,proto3" json:"retirement_location,omitempty"` +} + +func (m *MsgPickFromBasket) Reset() { *m = MsgPickFromBasket{} } +func (m *MsgPickFromBasket) String() string { return proto.CompactTextString(m) } +func (*MsgPickFromBasket) ProtoMessage() {} +func (*MsgPickFromBasket) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{6} +} +func (m *MsgPickFromBasket) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPickFromBasket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPickFromBasket.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 *MsgPickFromBasket) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPickFromBasket.Merge(m, src) +} +func (m *MsgPickFromBasket) XXX_Size() int { + return m.Size() +} +func (m *MsgPickFromBasket) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPickFromBasket.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPickFromBasket proto.InternalMessageInfo + +func (m *MsgPickFromBasket) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgPickFromBasket) GetBasketDenom() string { + if m != nil { + return m.BasketDenom + } + return "" +} + +func (m *MsgPickFromBasket) GetCredits() []*BasketCredit { + if m != nil { + return m.Credits + } + return nil +} + +func (m *MsgPickFromBasket) GetRetirementLocation() string { + if m != nil { + return m.RetirementLocation + } + return "" +} + +// MsgPickFromBasketResponse is the Msg/PickFromBasket response type. +type MsgPickFromBasketResponse struct { +} + +func (m *MsgPickFromBasketResponse) Reset() { *m = MsgPickFromBasketResponse{} } +func (m *MsgPickFromBasketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPickFromBasketResponse) ProtoMessage() {} +func (*MsgPickFromBasketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9e55200bd8b36dca, []int{7} +} +func (m *MsgPickFromBasketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPickFromBasketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPickFromBasketResponse.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 *MsgPickFromBasketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPickFromBasketResponse.Merge(m, src) +} +func (m *MsgPickFromBasketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPickFromBasketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPickFromBasketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPickFromBasketResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateBasket)(nil), "regen.ecocredit.basket.v1beta1.MsgCreateBasket") + proto.RegisterType((*MsgCreateBasketResponse)(nil), "regen.ecocredit.basket.v1beta1.MsgCreateBasketResponse") + proto.RegisterType((*MsgAddToBasket)(nil), "regen.ecocredit.basket.v1beta1.MsgAddToBasket") + proto.RegisterType((*MsgAddToBasketResponse)(nil), "regen.ecocredit.basket.v1beta1.MsgAddToBasketResponse") + proto.RegisterType((*MsgTakeFromBasket)(nil), "regen.ecocredit.basket.v1beta1.MsgTakeFromBasket") + proto.RegisterType((*MsgTakeFromBasketResponse)(nil), "regen.ecocredit.basket.v1beta1.MsgTakeFromBasketResponse") + proto.RegisterType((*MsgPickFromBasket)(nil), "regen.ecocredit.basket.v1beta1.MsgPickFromBasket") + proto.RegisterType((*MsgPickFromBasketResponse)(nil), "regen.ecocredit.basket.v1beta1.MsgPickFromBasketResponse") +} + +func init() { + proto.RegisterFile("regen/ecocredit/basket/v1beta1/tx.proto", fileDescriptor_9e55200bd8b36dca) +} + +var fileDescriptor_9e55200bd8b36dca = []byte{ + // 610 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xae, 0x9b, 0xfe, 0x6e, 0xda, 0x54, 0xdd, 0xa2, 0x62, 0x82, 0x64, 0x85, 0x70, 0x68, 0x84, + 0xc0, 0x56, 0x8b, 0x04, 0x42, 0xe2, 0x40, 0x5b, 0xd4, 0x13, 0x41, 0xc8, 0xaa, 0x84, 0xd4, 0x8b, + 0xb5, 0xb6, 0x47, 0xc6, 0x8a, 0xbd, 0x6b, 0xad, 0xd7, 0x6d, 0x7a, 0xe1, 0x19, 0xe0, 0xc0, 0x5b, + 0xf0, 0x1a, 0x48, 0x1c, 0x7b, 0xe4, 0x88, 0xda, 0x77, 0xe0, 0x8c, 0xb2, 0xbb, 0x31, 0x71, 0x02, + 0x34, 0x51, 0x7b, 0xcb, 0xcc, 0x7c, 0xf3, 0xf3, 0x7d, 0x33, 0xce, 0xa2, 0x1d, 0x0e, 0x11, 0x50, + 0x07, 0x02, 0x16, 0x70, 0x08, 0x63, 0xe1, 0xf8, 0x24, 0xef, 0x81, 0x70, 0x4e, 0x77, 0x7d, 0x10, + 0x64, 0xd7, 0x11, 0x7d, 0x3b, 0xe3, 0x4c, 0x30, 0x6c, 0x49, 0xa0, 0x5d, 0x02, 0x6d, 0x05, 0xb4, + 0x35, 0xb0, 0xf9, 0xe8, 0xba, 0x42, 0xe7, 0x19, 0xe4, 0xaa, 0x56, 0xfb, 0xeb, 0x3c, 0xda, 0xe8, + 0xe6, 0xd1, 0x21, 0x07, 0x22, 0xe0, 0x40, 0xe2, 0xb0, 0x89, 0x96, 0x83, 0x82, 0x13, 0xc1, 0xb8, + 0x69, 0xb4, 0x8c, 0xce, 0xaa, 0x3b, 0x34, 0x31, 0x46, 0x0b, 0x94, 0xa4, 0x60, 0xce, 0x4b, 0xb7, + 0xfc, 0x8d, 0x1f, 0xa0, 0xb5, 0x30, 0xce, 0xb3, 0x84, 0x9c, 0x7b, 0x32, 0x56, 0x93, 0xb1, 0xba, + 0xf6, 0xbd, 0x1d, 0x40, 0x9a, 0x68, 0x05, 0xfa, 0x19, 0xa3, 0x40, 0x85, 0xb9, 0xd0, 0x32, 0x3a, + 0xeb, 0x6e, 0x69, 0xe3, 0xf7, 0x68, 0x43, 0x8d, 0xe7, 0x05, 0x3c, 0x16, 0xc0, 0x63, 0x62, 0x2e, + 0xb6, 0x6a, 0x9d, 0xfa, 0x9e, 0x6d, 0xff, 0x9f, 0xa6, 0xad, 0xa6, 0x3d, 0xd4, 0x59, 0x6e, 0xc3, + 0xaf, 0xd8, 0xd8, 0x46, 0x5b, 0x61, 0x9c, 0x13, 0x3f, 0x01, 0x8f, 0x14, 0x82, 0x79, 0x1c, 0x44, + 0xcc, 0xc1, 0x5c, 0x6a, 0x19, 0x9d, 0x15, 0x77, 0x53, 0x87, 0xf6, 0x0b, 0xc1, 0x5c, 0x19, 0xc0, + 0x0f, 0xd1, 0x3a, 0x49, 0x12, 0x76, 0xe6, 0x65, 0x71, 0xd0, 0x8b, 0x69, 0x64, 0x2e, 0x4b, 0xe4, + 0x9a, 0x74, 0xbe, 0x53, 0xbe, 0xf6, 0x4b, 0x74, 0x77, 0x4c, 0x2d, 0x17, 0xf2, 0x8c, 0xd1, 0x5c, + 0xea, 0xa0, 0x89, 0x84, 0x40, 0x59, 0xaa, 0xa5, 0xab, 0x2b, 0xdf, 0xeb, 0x81, 0xab, 0xfd, 0xd9, + 0x40, 0x8d, 0x6e, 0x1e, 0xed, 0x87, 0xe1, 0x31, 0xd3, 0x5a, 0xdf, 0x41, 0x8b, 0xec, 0x8c, 0xc2, + 0x50, 0x69, 0x65, 0x4c, 0xd4, 0x9a, 0x9f, 0xa8, 0x85, 0x8f, 0xd0, 0xb2, 0x92, 0x25, 0x37, 0x6b, + 0x52, 0xaf, 0xc7, 0xd3, 0xea, 0x35, 0x88, 0xb9, 0xc3, 0xe4, 0xf6, 0x3e, 0xda, 0xae, 0x8e, 0x54, + 0x12, 0xda, 0x41, 0x1b, 0x24, 0x65, 0x05, 0x15, 0x1e, 0x87, 0x00, 0xe2, 0x53, 0x08, 0xf5, 0x90, + 0x0d, 0xe5, 0x76, 0xb5, 0xb7, 0xfd, 0xc5, 0x40, 0x9b, 0xdd, 0x3c, 0x3a, 0x26, 0x3d, 0x38, 0xe2, + 0x2c, 0xbd, 0x29, 0xb3, 0x6d, 0xb4, 0xa4, 0x1a, 0xe8, 0x53, 0xd2, 0x16, 0x76, 0xd0, 0x96, 0xda, + 0x61, 0x0a, 0x54, 0x78, 0x09, 0x0b, 0x88, 0x88, 0x19, 0x95, 0x07, 0xb5, 0xea, 0xe2, 0x3f, 0xa1, + 0x37, 0x3a, 0xd2, 0x0e, 0xd0, 0xbd, 0x89, 0xb1, 0x4a, 0x76, 0x23, 0xfa, 0x19, 0x37, 0xd1, 0xef, + 0x9b, 0x22, 0x3f, 0x38, 0x90, 0xdb, 0x20, 0x7f, 0x4b, 0x6b, 0x9d, 0x5d, 0xac, 0xfb, 0x52, 0xac, + 0x2a, 0x8d, 0xa1, 0x58, 0x7b, 0xbf, 0x6a, 0xa8, 0xd6, 0xcd, 0x23, 0xdc, 0x47, 0x6b, 0x95, 0x7f, + 0x0a, 0xe7, 0xba, 0xe1, 0xc6, 0x3e, 0x96, 0xe6, 0xf3, 0x19, 0x13, 0xca, 0x75, 0x15, 0xa8, 0x3e, + 0xfa, 0xd9, 0xd8, 0x53, 0xd4, 0x19, 0xc1, 0x37, 0x9f, 0xcd, 0x86, 0x2f, 0xdb, 0x7e, 0x44, 0x8d, + 0xb1, 0xb3, 0xde, 0x9d, 0xa2, 0x52, 0x35, 0xa5, 0xf9, 0x62, 0xe6, 0x94, 0xd1, 0xfe, 0x63, 0x97, + 0x35, 0x4d, 0xff, 0x6a, 0xca, 0x54, 0xfd, 0xff, 0xbe, 0xf8, 0x83, 0x93, 0xef, 0x97, 0x96, 0x71, + 0x71, 0x69, 0x19, 0x3f, 0x2f, 0x2d, 0xe3, 0xd3, 0x95, 0x35, 0x77, 0x71, 0x65, 0xcd, 0xfd, 0xb8, + 0xb2, 0xe6, 0x4e, 0x5e, 0x45, 0xb1, 0xf8, 0x50, 0xf8, 0x76, 0xc0, 0x52, 0x47, 0x96, 0x7f, 0x42, + 0x41, 0x9c, 0x31, 0xde, 0xd3, 0x56, 0x02, 0x61, 0x04, 0xdc, 0xe9, 0xff, 0xf3, 0x19, 0xf2, 0x97, + 0xe4, 0x0b, 0xf4, 0xf4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xb5, 0x84, 0x37, 0xf8, 0x06, + 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 { + // CreateBasket creates a bank denom which wraps credits. + CreateBasket(ctx context.Context, in *MsgCreateBasket, opts ...grpc.CallOption) (*MsgCreateBasketResponse, error) + // AddToBasket adds credits to a basket in return for basket tokens. + AddToBasket(ctx context.Context, in *MsgAddToBasket, opts ...grpc.CallOption) (*MsgAddToBasketResponse, error) + // TakeFromBasket takes credits from a basket without regard for which + // credits they are. The credits will be auto-retired if disable_auto_retire + // is false. Credits will be chosen randomly using the previous block hash + // as a consensus source of randomness. + // More concretely, the implementation is as follows: + // - take the previous block hash and convert it into an uint64, + // - given the total number of different credits within the basket `n`, the + // first credits that will get picked correspond to: hash modulo n (in + // terms of order), + // - then if we need to take more credits, we get some from the next one and + // so on. + TakeFromBasket(ctx context.Context, in *MsgTakeFromBasket, opts ...grpc.CallOption) (*MsgTakeFromBasketResponse, error) + // PickFromBasket picks specific credits from a basket. If allow_picking is + // set to false, then only an address which deposited credits in the basket + // can pick those credits. All other addresses will be blocked from picking + // those credits. The credits will be auto-retired if disable_auto_retire is + // false unless the credits were previously put into the basket by the + // address picking them from the basket, in which case they will remain + // tradable. This functionality allows the owner of a credit to have more + // control over the credits they are putting in baskets then ordinary users + // to deal with the scenario where basket tokens end up being worth + // significantly less than the credits on their own. + PickFromBasket(ctx context.Context, in *MsgPickFromBasket, opts ...grpc.CallOption) (*MsgPickFromBasketResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateBasket(ctx context.Context, in *MsgCreateBasket, opts ...grpc.CallOption) (*MsgCreateBasketResponse, error) { + out := new(MsgCreateBasketResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Msg/CreateBasket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AddToBasket(ctx context.Context, in *MsgAddToBasket, opts ...grpc.CallOption) (*MsgAddToBasketResponse, error) { + out := new(MsgAddToBasketResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Msg/AddToBasket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TakeFromBasket(ctx context.Context, in *MsgTakeFromBasket, opts ...grpc.CallOption) (*MsgTakeFromBasketResponse, error) { + out := new(MsgTakeFromBasketResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Msg/TakeFromBasket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) PickFromBasket(ctx context.Context, in *MsgPickFromBasket, opts ...grpc.CallOption) (*MsgPickFromBasketResponse, error) { + out := new(MsgPickFromBasketResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.basket.v1beta1.Msg/PickFromBasket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateBasket creates a bank denom which wraps credits. + CreateBasket(context.Context, *MsgCreateBasket) (*MsgCreateBasketResponse, error) + // AddToBasket adds credits to a basket in return for basket tokens. + AddToBasket(context.Context, *MsgAddToBasket) (*MsgAddToBasketResponse, error) + // TakeFromBasket takes credits from a basket without regard for which + // credits they are. The credits will be auto-retired if disable_auto_retire + // is false. Credits will be chosen randomly using the previous block hash + // as a consensus source of randomness. + // More concretely, the implementation is as follows: + // - take the previous block hash and convert it into an uint64, + // - given the total number of different credits within the basket `n`, the + // first credits that will get picked correspond to: hash modulo n (in + // terms of order), + // - then if we need to take more credits, we get some from the next one and + // so on. + TakeFromBasket(context.Context, *MsgTakeFromBasket) (*MsgTakeFromBasketResponse, error) + // PickFromBasket picks specific credits from a basket. If allow_picking is + // set to false, then only an address which deposited credits in the basket + // can pick those credits. All other addresses will be blocked from picking + // those credits. The credits will be auto-retired if disable_auto_retire is + // false unless the credits were previously put into the basket by the + // address picking them from the basket, in which case they will remain + // tradable. This functionality allows the owner of a credit to have more + // control over the credits they are putting in baskets then ordinary users + // to deal with the scenario where basket tokens end up being worth + // significantly less than the credits on their own. + PickFromBasket(context.Context, *MsgPickFromBasket) (*MsgPickFromBasketResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateBasket(ctx context.Context, req *MsgCreateBasket) (*MsgCreateBasketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBasket not implemented") +} +func (*UnimplementedMsgServer) AddToBasket(ctx context.Context, req *MsgAddToBasket) (*MsgAddToBasketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddToBasket not implemented") +} +func (*UnimplementedMsgServer) TakeFromBasket(ctx context.Context, req *MsgTakeFromBasket) (*MsgTakeFromBasketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TakeFromBasket not implemented") +} +func (*UnimplementedMsgServer) PickFromBasket(ctx context.Context, req *MsgPickFromBasket) (*MsgPickFromBasketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PickFromBasket not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateBasket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateBasket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateBasket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Msg/CreateBasket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateBasket(ctx, req.(*MsgCreateBasket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AddToBasket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddToBasket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddToBasket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Msg/AddToBasket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddToBasket(ctx, req.(*MsgAddToBasket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TakeFromBasket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTakeFromBasket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TakeFromBasket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Msg/TakeFromBasket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TakeFromBasket(ctx, req.(*MsgTakeFromBasket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_PickFromBasket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPickFromBasket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PickFromBasket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.basket.v1beta1.Msg/PickFromBasket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PickFromBasket(ctx, req.(*MsgPickFromBasket)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.basket.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateBasket", + Handler: _Msg_CreateBasket_Handler, + }, + { + MethodName: "AddToBasket", + Handler: _Msg_AddToBasket_Handler, + }, + { + MethodName: "TakeFromBasket", + Handler: _Msg_TakeFromBasket_Handler, + }, + { + MethodName: "PickFromBasket", + Handler: _Msg_PickFromBasket_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/basket/v1beta1/tx.proto", +} + +func (m *MsgCreateBasket) 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 *MsgCreateBasket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateBasket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AllowPicking { + i-- + if m.AllowPicking { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.BasketCriteria) > 0 { + for iNdEx := len(m.BasketCriteria) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BasketCriteria[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Exponent != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x20 + } + if len(m.DisplayName) > 0 { + i -= len(m.DisplayName) + copy(dAtA[i:], m.DisplayName) + i = encodeVarintTx(dAtA, i, uint64(len(m.DisplayName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Curator) > 0 { + i -= len(m.Curator) + copy(dAtA[i:], m.Curator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Curator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateBasketResponse) 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 *MsgCreateBasketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateBasketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddToBasket) 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 *MsgAddToBasket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddToBasket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Credits) > 0 { + for iNdEx := len(m.Credits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddToBasketResponse) 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 *MsgAddToBasketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddToBasketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AmountReceived) > 0 { + i -= len(m.AmountReceived) + copy(dAtA[i:], m.AmountReceived) + i = encodeVarintTx(dAtA, i, uint64(len(m.AmountReceived))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTakeFromBasket) 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 *MsgTakeFromBasket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTakeFromBasket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetirementLocation) > 0 { + i -= len(m.RetirementLocation) + copy(dAtA[i:], m.RetirementLocation) + i = encodeVarintTx(dAtA, i, uint64(len(m.RetirementLocation))) + i-- + dAtA[i] = 0x22 + } + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintTx(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x1a + } + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTakeFromBasketResponse) 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 *MsgTakeFromBasketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTakeFromBasketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Credits) > 0 { + for iNdEx := len(m.Credits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgPickFromBasket) 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 *MsgPickFromBasket) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPickFromBasket) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetirementLocation) > 0 { + i -= len(m.RetirementLocation) + copy(dAtA[i:], m.RetirementLocation) + i = encodeVarintTx(dAtA, i, uint64(len(m.RetirementLocation))) + i-- + dAtA[i] = 0x22 + } + if len(m.Credits) > 0 { + for iNdEx := len(m.Credits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Credits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.BasketDenom) > 0 { + i -= len(m.BasketDenom) + copy(dAtA[i:], m.BasketDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BasketDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPickFromBasketResponse) 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 *MsgPickFromBasketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPickFromBasketResponse) 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 *MsgCreateBasket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Curator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DisplayName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovTx(uint64(m.Exponent)) + } + if len(m.BasketCriteria) > 0 { + for _, e := range m.BasketCriteria { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.DisableAutoRetire { + n += 2 + } + if m.AllowPicking { + n += 2 + } + return n +} + +func (m *MsgCreateBasketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAddToBasket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Credits) > 0 { + for _, e := range m.Credits { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAddToBasketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AmountReceived) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTakeFromBasket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RetirementLocation) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTakeFromBasketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Credits) > 0 { + for _, e := range m.Credits { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgPickFromBasket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BasketDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Credits) > 0 { + for _, e := range m.Credits { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.RetirementLocation) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPickFromBasketResponse) 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 *MsgCreateBasket) 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: MsgCreateBasket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateBasket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Curator", 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.Curator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayName", 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.DisplayName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketCriteria", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BasketCriteria = append(m.BasketCriteria, &BasketCriteria{}) + if err := m.BasketCriteria[len(m.BasketCriteria)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowPicking", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowPicking = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateBasketResponse) 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: MsgCreateBasketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateBasketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", 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.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddToBasket) 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: MsgAddToBasket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddToBasket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", 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.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credits = append(m.Credits, &BasketCredit{}) + if err := m.Credits[len(m.Credits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddToBasketResponse) 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: MsgAddToBasketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddToBasketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AmountReceived", 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.AmountReceived = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTakeFromBasket) 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: MsgTakeFromBasket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTakeFromBasket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", 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.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetirementLocation", 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.RetirementLocation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTakeFromBasketResponse) 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: MsgTakeFromBasketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTakeFromBasketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credits = append(m.Credits, &BasketCredit{}) + if err := m.Credits[len(m.Credits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPickFromBasket) 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: MsgPickFromBasket: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPickFromBasket: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BasketDenom", 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.BasketDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Credits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Credits = append(m.Credits, &BasketCredit{}) + if err := m.Credits[len(m.Credits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetirementLocation", 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.RetirementLocation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPickFromBasketResponse) 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: MsgPickFromBasketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPickFromBasketResponse: 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 { + return ErrInvalidLengthTx + } + if (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/ecocredit/basket/v1beta1/types.pb.go b/x/ecocredit/basket/v1beta1/types.pb.go new file mode 100644 index 0000000000..d67ed18868 --- /dev/null +++ b/x/ecocredit/basket/v1beta1/types.pb.go @@ -0,0 +1,2291 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/basket/v1beta1/types.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// BasketCredit represents the information for a credit batch inside a basket. +type BasketCredit struct { + // batch_denom is the unique ID of the credit batch. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // tradable_amount is the number of credits in this transfer that can be + // traded by the recipient. Decimal values are acceptable within the + // precision returned by Query/Precision. + TradableAmount string `protobuf:"bytes,2,opt,name=tradable_amount,json=tradableAmount,proto3" json:"tradable_amount,omitempty"` +} + +func (m *BasketCredit) Reset() { *m = BasketCredit{} } +func (m *BasketCredit) String() string { return proto.CompactTextString(m) } +func (*BasketCredit) ProtoMessage() {} +func (*BasketCredit) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{0} +} +func (m *BasketCredit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasketCredit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasketCredit.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 *BasketCredit) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasketCredit.Merge(m, src) +} +func (m *BasketCredit) XXX_Size() int { + return m.Size() +} +func (m *BasketCredit) XXX_DiscardUnknown() { + xxx_messageInfo_BasketCredit.DiscardUnknown(m) +} + +var xxx_messageInfo_BasketCredit proto.InternalMessageInfo + +func (m *BasketCredit) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *BasketCredit) GetTradableAmount() string { + if m != nil { + return m.TradableAmount + } + return "" +} + +// BasketCriteria defines a criteria by which credits can be added to a basket. +type BasketCriteria struct { + // filter defines condition(s) that credits should satisfy in order to be + // added to the basket. + Filter *Filter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` + // multiplier is an integer number which is applied to credit units when + // converting to basket units. For example if the multiplier is 2000, then + // 1.1 credits will result in 2200 basket tokens. If there are any fractional + // amounts left over in this calculation when adding credits to a basket, + // those fractional amounts will not get added to the basket. + Multiplier string `protobuf:"bytes,2,opt,name=multiplier,proto3" json:"multiplier,omitempty"` +} + +func (m *BasketCriteria) Reset() { *m = BasketCriteria{} } +func (m *BasketCriteria) String() string { return proto.CompactTextString(m) } +func (*BasketCriteria) ProtoMessage() {} +func (*BasketCriteria) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{1} +} +func (m *BasketCriteria) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasketCriteria) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasketCriteria.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 *BasketCriteria) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasketCriteria.Merge(m, src) +} +func (m *BasketCriteria) XXX_Size() int { + return m.Size() +} +func (m *BasketCriteria) XXX_DiscardUnknown() { + xxx_messageInfo_BasketCriteria.DiscardUnknown(m) +} + +var xxx_messageInfo_BasketCriteria proto.InternalMessageInfo + +func (m *BasketCriteria) GetFilter() *Filter { + if m != nil { + return m.Filter + } + return nil +} + +func (m *BasketCriteria) GetMultiplier() string { + if m != nil { + return m.Multiplier + } + return "" +} + +// Filter defines condition(s) that credits should satisfy in order to be added +// to the basket. It can handled nested conditions linked with and/or operators. +type Filter struct { + // sum is the oneof that specifies the type of filter. + // + // Types that are valid to be assigned to Sum: + // *Filter_And_ + // *Filter_Or_ + // *Filter_CreditTypeName + // *Filter_ClassId + // *Filter_ProjectId + // *Filter_BatchDenom + // *Filter_ClassAdmin + // *Filter_Issuer + // *Filter_Owner + // *Filter_ProjectLocation + // *Filter_DateRange_ + // *Filter_Tag + Sum isFilter_Sum `protobuf_oneof:"sum"` +} + +func (m *Filter) Reset() { *m = Filter{} } +func (m *Filter) String() string { return proto.CompactTextString(m) } +func (*Filter) ProtoMessage() {} +func (*Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{2} +} +func (m *Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter.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 *Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter.Merge(m, src) +} +func (m *Filter) XXX_Size() int { + return m.Size() +} +func (m *Filter) XXX_DiscardUnknown() { + xxx_messageInfo_Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter proto.InternalMessageInfo + +type isFilter_Sum interface { + isFilter_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type Filter_And_ struct { + And *Filter_And `protobuf:"bytes,1,opt,name=and,proto3,oneof" json:"and,omitempty"` +} +type Filter_Or_ struct { + Or *Filter_Or `protobuf:"bytes,2,opt,name=or,proto3,oneof" json:"or,omitempty"` +} +type Filter_CreditTypeName struct { + CreditTypeName string `protobuf:"bytes,3,opt,name=credit_type_name,json=creditTypeName,proto3,oneof" json:"credit_type_name,omitempty"` +} +type Filter_ClassId struct { + ClassId string `protobuf:"bytes,4,opt,name=class_id,json=classId,proto3,oneof" json:"class_id,omitempty"` +} +type Filter_ProjectId struct { + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3,oneof" json:"project_id,omitempty"` +} +type Filter_BatchDenom struct { + BatchDenom string `protobuf:"bytes,6,opt,name=batch_denom,json=batchDenom,proto3,oneof" json:"batch_denom,omitempty"` +} +type Filter_ClassAdmin struct { + ClassAdmin string `protobuf:"bytes,7,opt,name=class_admin,json=classAdmin,proto3,oneof" json:"class_admin,omitempty"` +} +type Filter_Issuer struct { + Issuer string `protobuf:"bytes,8,opt,name=issuer,proto3,oneof" json:"issuer,omitempty"` +} +type Filter_Owner struct { + Owner string `protobuf:"bytes,9,opt,name=owner,proto3,oneof" json:"owner,omitempty"` +} +type Filter_ProjectLocation struct { + ProjectLocation string `protobuf:"bytes,10,opt,name=project_location,json=projectLocation,proto3,oneof" json:"project_location,omitempty"` +} +type Filter_DateRange_ struct { + DateRange *Filter_DateRange `protobuf:"bytes,11,opt,name=date_range,json=dateRange,proto3,oneof" json:"date_range,omitempty"` +} +type Filter_Tag struct { + Tag string `protobuf:"bytes,12,opt,name=tag,proto3,oneof" json:"tag,omitempty"` +} + +func (*Filter_And_) isFilter_Sum() {} +func (*Filter_Or_) isFilter_Sum() {} +func (*Filter_CreditTypeName) isFilter_Sum() {} +func (*Filter_ClassId) isFilter_Sum() {} +func (*Filter_ProjectId) isFilter_Sum() {} +func (*Filter_BatchDenom) isFilter_Sum() {} +func (*Filter_ClassAdmin) isFilter_Sum() {} +func (*Filter_Issuer) isFilter_Sum() {} +func (*Filter_Owner) isFilter_Sum() {} +func (*Filter_ProjectLocation) isFilter_Sum() {} +func (*Filter_DateRange_) isFilter_Sum() {} +func (*Filter_Tag) isFilter_Sum() {} + +func (m *Filter) GetSum() isFilter_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Filter) GetAnd() *Filter_And { + if x, ok := m.GetSum().(*Filter_And_); ok { + return x.And + } + return nil +} + +func (m *Filter) GetOr() *Filter_Or { + if x, ok := m.GetSum().(*Filter_Or_); ok { + return x.Or + } + return nil +} + +func (m *Filter) GetCreditTypeName() string { + if x, ok := m.GetSum().(*Filter_CreditTypeName); ok { + return x.CreditTypeName + } + return "" +} + +func (m *Filter) GetClassId() string { + if x, ok := m.GetSum().(*Filter_ClassId); ok { + return x.ClassId + } + return "" +} + +func (m *Filter) GetProjectId() string { + if x, ok := m.GetSum().(*Filter_ProjectId); ok { + return x.ProjectId + } + return "" +} + +func (m *Filter) GetBatchDenom() string { + if x, ok := m.GetSum().(*Filter_BatchDenom); ok { + return x.BatchDenom + } + return "" +} + +func (m *Filter) GetClassAdmin() string { + if x, ok := m.GetSum().(*Filter_ClassAdmin); ok { + return x.ClassAdmin + } + return "" +} + +func (m *Filter) GetIssuer() string { + if x, ok := m.GetSum().(*Filter_Issuer); ok { + return x.Issuer + } + return "" +} + +func (m *Filter) GetOwner() string { + if x, ok := m.GetSum().(*Filter_Owner); ok { + return x.Owner + } + return "" +} + +func (m *Filter) GetProjectLocation() string { + if x, ok := m.GetSum().(*Filter_ProjectLocation); ok { + return x.ProjectLocation + } + return "" +} + +func (m *Filter) GetDateRange() *Filter_DateRange { + if x, ok := m.GetSum().(*Filter_DateRange_); ok { + return x.DateRange + } + return nil +} + +func (m *Filter) GetTag() string { + if x, ok := m.GetSum().(*Filter_Tag); ok { + return x.Tag + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Filter) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Filter_And_)(nil), + (*Filter_Or_)(nil), + (*Filter_CreditTypeName)(nil), + (*Filter_ClassId)(nil), + (*Filter_ProjectId)(nil), + (*Filter_BatchDenom)(nil), + (*Filter_ClassAdmin)(nil), + (*Filter_Issuer)(nil), + (*Filter_Owner)(nil), + (*Filter_ProjectLocation)(nil), + (*Filter_DateRange_)(nil), + (*Filter_Tag)(nil), + } +} + +// And specifies an "and" condition between the list of filters. +type Filter_And struct { + // filters is a list of filters where all conditions should be satisfied. + Filters []*Filter `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (m *Filter_And) Reset() { *m = Filter_And{} } +func (m *Filter_And) String() string { return proto.CompactTextString(m) } +func (*Filter_And) ProtoMessage() {} +func (*Filter_And) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{2, 0} +} +func (m *Filter_And) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter_And) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter_And.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 *Filter_And) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter_And.Merge(m, src) +} +func (m *Filter_And) XXX_Size() int { + return m.Size() +} +func (m *Filter_And) XXX_DiscardUnknown() { + xxx_messageInfo_Filter_And.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter_And proto.InternalMessageInfo + +func (m *Filter_And) GetFilters() []*Filter { + if m != nil { + return m.Filters + } + return nil +} + +// And specifies an "or" condition between the list of filters. +type Filter_Or struct { + // filters is a list of filters where at least one of the conditions should be satisfied. + Filters []*Filter `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"` +} + +func (m *Filter_Or) Reset() { *m = Filter_Or{} } +func (m *Filter_Or) String() string { return proto.CompactTextString(m) } +func (*Filter_Or) ProtoMessage() {} +func (*Filter_Or) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{2, 1} +} +func (m *Filter_Or) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter_Or) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter_Or.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 *Filter_Or) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter_Or.Merge(m, src) +} +func (m *Filter_Or) XXX_Size() int { + return m.Size() +} +func (m *Filter_Or) XXX_DiscardUnknown() { + xxx_messageInfo_Filter_Or.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter_Or proto.InternalMessageInfo + +func (m *Filter_Or) GetFilters() []*Filter { + if m != nil { + return m.Filters + } + return nil +} + +// DateRange defines a period for credit batches in a basket. +type Filter_DateRange struct { + // start_date is the beginning of the period during which this credit batch + // was quantified and verified. If it is empty then there is no start date + // limit. + StartDate *time.Time `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3,stdtime" json:"start_date,omitempty"` + // end_date is the end of the period during which this credit batch was + // quantified and verified. If it is empty then there is no end date + // limit. + EndDate *time.Time `protobuf:"bytes,8,opt,name=end_date,json=endDate,proto3,stdtime" json:"end_date,omitempty"` +} + +func (m *Filter_DateRange) Reset() { *m = Filter_DateRange{} } +func (m *Filter_DateRange) String() string { return proto.CompactTextString(m) } +func (*Filter_DateRange) ProtoMessage() {} +func (*Filter_DateRange) Descriptor() ([]byte, []int) { + return fileDescriptor_685ac2fc3638ac99, []int{2, 2} +} +func (m *Filter_DateRange) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter_DateRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter_DateRange.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 *Filter_DateRange) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter_DateRange.Merge(m, src) +} +func (m *Filter_DateRange) XXX_Size() int { + return m.Size() +} +func (m *Filter_DateRange) XXX_DiscardUnknown() { + xxx_messageInfo_Filter_DateRange.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter_DateRange proto.InternalMessageInfo + +func (m *Filter_DateRange) GetStartDate() *time.Time { + if m != nil { + return m.StartDate + } + return nil +} + +func (m *Filter_DateRange) GetEndDate() *time.Time { + if m != nil { + return m.EndDate + } + return nil +} + +func init() { + proto.RegisterType((*BasketCredit)(nil), "regen.ecocredit.basket.v1beta1.BasketCredit") + proto.RegisterType((*BasketCriteria)(nil), "regen.ecocredit.basket.v1beta1.BasketCriteria") + proto.RegisterType((*Filter)(nil), "regen.ecocredit.basket.v1beta1.Filter") + proto.RegisterType((*Filter_And)(nil), "regen.ecocredit.basket.v1beta1.Filter.And") + proto.RegisterType((*Filter_Or)(nil), "regen.ecocredit.basket.v1beta1.Filter.Or") + proto.RegisterType((*Filter_DateRange)(nil), "regen.ecocredit.basket.v1beta1.Filter.DateRange") +} + +func init() { + proto.RegisterFile("regen/ecocredit/basket/v1beta1/types.proto", fileDescriptor_685ac2fc3638ac99) +} + +var fileDescriptor_685ac2fc3638ac99 = []byte{ + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x4e, 0xdc, 0x3a, + 0x14, 0x9e, 0xcc, 0xc0, 0xfc, 0x9c, 0x41, 0x80, 0xac, 0xab, 0xab, 0x68, 0xae, 0x94, 0x01, 0x16, + 0xf7, 0xde, 0x52, 0x35, 0x29, 0x74, 0x89, 0x44, 0x99, 0x29, 0xa2, 0x20, 0x55, 0x45, 0x8d, 0x58, + 0x54, 0x6c, 0x22, 0x27, 0x3e, 0x84, 0x94, 0xc4, 0x8e, 0x1c, 0x4f, 0x29, 0x8f, 0xd0, 0x1d, 0x6f, + 0xd0, 0xd7, 0xe9, 0x92, 0x65, 0x77, 0xad, 0xe0, 0x45, 0x2a, 0x3b, 0x0e, 0xa2, 0x8b, 0x56, 0x53, + 0xa9, 0xbb, 0x9c, 0xef, 0xe7, 0xfc, 0xf8, 0xd8, 0x81, 0x4d, 0x89, 0x29, 0xf2, 0x00, 0x13, 0x91, + 0x48, 0x64, 0x99, 0x0a, 0x62, 0x5a, 0x5d, 0xa0, 0x0a, 0xde, 0x6f, 0xc5, 0xa8, 0xe8, 0x56, 0xa0, + 0xae, 0x4a, 0xac, 0xfc, 0x52, 0x0a, 0x25, 0x88, 0x67, 0xb4, 0xfe, 0xbd, 0xd6, 0xaf, 0xb5, 0xbe, + 0xd5, 0x8e, 0xfe, 0x4a, 0x45, 0x2a, 0x8c, 0x34, 0xd0, 0x5f, 0xb5, 0x6b, 0x34, 0x4e, 0x85, 0x48, + 0x73, 0x0c, 0x4c, 0x14, 0xcf, 0xce, 0x02, 0x95, 0x15, 0x58, 0x29, 0x5a, 0x94, 0xb5, 0x60, 0xe3, + 0x2d, 0x2c, 0x4d, 0x4d, 0xa2, 0x17, 0x26, 0x2b, 0x19, 0xc3, 0x30, 0xa6, 0x2a, 0x39, 0x8f, 0x18, + 0x72, 0x51, 0xb8, 0xce, 0x9a, 0xf3, 0xff, 0x20, 0x04, 0x03, 0xed, 0x6b, 0x84, 0xfc, 0x07, 0x2b, + 0x4a, 0x52, 0x46, 0xe3, 0x1c, 0x23, 0x5a, 0x88, 0x19, 0x57, 0x6e, 0xdb, 0x88, 0x96, 0x1b, 0x78, + 0x62, 0xd0, 0x8d, 0x12, 0x96, 0x9b, 0xcc, 0x99, 0x42, 0x99, 0x51, 0xb2, 0x0b, 0xdd, 0xb3, 0x2c, + 0x57, 0x28, 0x4d, 0xda, 0xe1, 0xf6, 0xbf, 0xfe, 0xaf, 0x67, 0xf2, 0x0f, 0x8c, 0x3a, 0xb4, 0x2e, + 0xe2, 0x01, 0x14, 0xb3, 0x5c, 0x65, 0x65, 0x9e, 0xa1, 0xb4, 0x55, 0x1f, 0x20, 0x1b, 0x9f, 0xba, + 0xd0, 0xad, 0x2d, 0x64, 0x17, 0x3a, 0x94, 0x33, 0x5b, 0x67, 0x73, 0xbe, 0x3a, 0xfe, 0x84, 0xb3, + 0xc3, 0x56, 0xa8, 0x8d, 0x64, 0x07, 0xda, 0xa2, 0x2e, 0x31, 0xdc, 0x7e, 0x34, 0xa7, 0xfd, 0x58, + 0x1e, 0xb6, 0xc2, 0xb6, 0x90, 0x64, 0x13, 0x56, 0x6b, 0x61, 0xa4, 0x17, 0x18, 0x71, 0x5a, 0xa0, + 0xdb, 0xd1, 0xdd, 0x1e, 0xb6, 0xc2, 0xe5, 0x9a, 0x39, 0xb9, 0x2a, 0xf1, 0x35, 0x2d, 0x90, 0xfc, + 0x03, 0xfd, 0x24, 0xa7, 0x55, 0x15, 0x65, 0xcc, 0x5d, 0xb0, 0x9a, 0x9e, 0x41, 0x8e, 0x18, 0x19, + 0x03, 0x94, 0x52, 0xbc, 0xc3, 0x44, 0x69, 0x7a, 0xd1, 0xd2, 0x03, 0x8b, 0x1d, 0x31, 0xb2, 0xfe, + 0xe3, 0xb6, 0xba, 0x56, 0xf1, 0x70, 0x5f, 0xeb, 0x30, 0xac, 0x0b, 0x50, 0x56, 0x64, 0xdc, 0xed, + 0x35, 0x12, 0x03, 0x4e, 0x34, 0x46, 0x5c, 0xe8, 0x66, 0x55, 0x35, 0x43, 0xe9, 0xf6, 0x2d, 0x6b, + 0x63, 0xf2, 0x37, 0x2c, 0x8a, 0x4b, 0x8e, 0xd2, 0x1d, 0x58, 0xa2, 0x0e, 0xc9, 0x63, 0x58, 0x6d, + 0x1a, 0xcb, 0x45, 0x42, 0x55, 0x26, 0xb8, 0x0b, 0x56, 0xb2, 0x62, 0x99, 0x57, 0x96, 0x20, 0x6f, + 0x00, 0x18, 0x55, 0x18, 0x49, 0xca, 0x53, 0x74, 0x87, 0xe6, 0x4c, 0x9f, 0xce, 0x79, 0xa6, 0xfb, + 0x54, 0x61, 0xa8, 0x7d, 0x7a, 0x6e, 0xd6, 0x04, 0x84, 0x40, 0x47, 0xd1, 0xd4, 0x5d, 0xb2, 0x25, + 0x75, 0x30, 0x7a, 0x09, 0x9d, 0x09, 0x67, 0x64, 0x0f, 0x7a, 0xf5, 0x75, 0xa9, 0x5c, 0x67, 0xad, + 0xf3, 0x1b, 0xb7, 0xac, 0xb1, 0x8d, 0x0e, 0xa0, 0x7d, 0x2c, 0xff, 0x40, 0x9e, 0x8f, 0x0e, 0x0c, + 0xee, 0xfb, 0x27, 0xcf, 0x01, 0x2a, 0x45, 0xa5, 0x8a, 0xf4, 0x14, 0x66, 0x0d, 0xc3, 0xed, 0x91, + 0x5f, 0x3f, 0x4f, 0xbf, 0x79, 0x9e, 0xfe, 0x49, 0xf3, 0x3c, 0xa7, 0x0b, 0xd7, 0x5f, 0xc7, 0x4e, + 0x38, 0x30, 0x1e, 0x9d, 0x85, 0xec, 0x40, 0x1f, 0x39, 0xab, 0xed, 0xfd, 0x39, 0xed, 0x3d, 0xe4, + 0x4c, 0x9b, 0xa7, 0x8b, 0xd0, 0xa9, 0x66, 0xc5, 0xf4, 0xf4, 0xf3, 0xad, 0xe7, 0xdc, 0xdc, 0x7a, + 0xce, 0xb7, 0x5b, 0xcf, 0xb9, 0xbe, 0xf3, 0x5a, 0x37, 0x77, 0x5e, 0xeb, 0xcb, 0x9d, 0xd7, 0x3a, + 0xdd, 0x4b, 0x33, 0x75, 0x3e, 0x8b, 0xfd, 0x44, 0x14, 0x81, 0x99, 0xf3, 0x09, 0x47, 0x75, 0x29, + 0xe4, 0x85, 0x8d, 0x72, 0x64, 0x29, 0xca, 0xe0, 0xc3, 0x4f, 0x7f, 0x56, 0x71, 0xd7, 0x74, 0xf1, + 0xec, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x40, 0x92, 0x11, 0xd5, 0x04, 0x00, 0x00, +} + +func (m *BasketCredit) 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 *BasketCredit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasketCredit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TradableAmount) > 0 { + i -= len(m.TradableAmount) + copy(dAtA[i:], m.TradableAmount) + i = encodeVarintTypes(dAtA, i, uint64(len(m.TradableAmount))) + i-- + dAtA[i] = 0x12 + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintTypes(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BasketCriteria) 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 *BasketCriteria) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasketCriteria) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Multiplier) > 0 { + i -= len(m.Multiplier) + copy(dAtA[i:], m.Multiplier) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Multiplier))) + i-- + dAtA[i] = 0x12 + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Filter) 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 *Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Filter_And_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_And_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.And != nil { + { + size, err := m.And.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Filter_Or_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Or_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Or != nil { + { + size, err := m.Or.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Filter_CreditTypeName) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_CreditTypeName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.CreditTypeName) + copy(dAtA[i:], m.CreditTypeName) + i = encodeVarintTypes(dAtA, i, uint64(len(m.CreditTypeName))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *Filter_ClassId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_ClassId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil +} +func (m *Filter_ProjectId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_ProjectId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ProjectId) + copy(dAtA[i:], m.ProjectId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProjectId))) + i-- + dAtA[i] = 0x2a + return len(dAtA) - i, nil +} +func (m *Filter_BatchDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_BatchDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintTypes(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0x32 + return len(dAtA) - i, nil +} +func (m *Filter_ClassAdmin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_ClassAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ClassAdmin) + copy(dAtA[i:], m.ClassAdmin) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClassAdmin))) + i-- + dAtA[i] = 0x3a + return len(dAtA) - i, nil +} +func (m *Filter_Issuer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Issuer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil +} +func (m *Filter_Owner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Owner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x4a + return len(dAtA) - i, nil +} +func (m *Filter_ProjectLocation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_ProjectLocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ProjectLocation) + copy(dAtA[i:], m.ProjectLocation) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProjectLocation))) + i-- + dAtA[i] = 0x52 + return len(dAtA) - i, nil +} +func (m *Filter_DateRange_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_DateRange_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DateRange != nil { + { + size, err := m.DateRange.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + return len(dAtA) - i, nil +} +func (m *Filter_Tag) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Tag) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Tag) + copy(dAtA[i:], m.Tag) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Tag))) + i-- + dAtA[i] = 0x62 + return len(dAtA) - i, nil +} +func (m *Filter_And) 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 *Filter_And) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_And) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Filters) > 0 { + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Filter_Or) 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 *Filter_Or) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Or) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Filters) > 0 { + for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Filters[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Filter_DateRange) 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 *Filter_DateRange) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_DateRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EndDate != nil { + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTypes(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + } + if m.StartDate != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTypes(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BasketCredit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.TradableAmount) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BasketCriteria) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Multiplier) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Filter_And_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.And != nil { + l = m.And.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Filter_Or_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Or != nil { + l = m.Or.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Filter_CreditTypeName) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CreditTypeName) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_ClassId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_ProjectId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectId) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_BatchDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BatchDenom) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_ClassAdmin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassAdmin) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_Issuer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Issuer) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_Owner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_ProjectLocation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProjectLocation) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_DateRange_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DateRange != nil { + l = m.DateRange.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Filter_Tag) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tag) + n += 1 + l + sovTypes(uint64(l)) + return n +} +func (m *Filter_And) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Filters) > 0 { + for _, e := range m.Filters { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *Filter_Or) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Filters) > 0 { + for _, e := range m.Filters { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *Filter_DateRange) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate) + n += 1 + l + sovTypes(uint64(l)) + } + if m.EndDate != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate) + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BasketCredit) 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 ErrIntOverflowTypes + } + 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: BasketCredit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasketCredit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradableAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TradableAmount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BasketCriteria) 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 ErrIntOverflowTypes + } + 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: BasketCriteria: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasketCriteria: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &Filter{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Multiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Multiplier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter) 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 ErrIntOverflowTypes + } + 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: Filter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Filter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field And", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Filter_And{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Filter_And_{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Or", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Filter_Or{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Filter_Or_{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditTypeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_CreditTypeName{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_ClassId{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_ProjectId{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_BatchDenom{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassAdmin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_ClassAdmin{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_Issuer{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_Owner{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectLocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_ProjectLocation{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DateRange", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Filter_DateRange{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Filter_DateRange_{v} + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tag", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sum = &Filter_Tag{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter_And) 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 ErrIntOverflowTypes + } + 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: And: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: And: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filters = append(m.Filters, &Filter{}) + if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter_Or) 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 ErrIntOverflowTypes + } + 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: Or: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Or: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Filters = append(m.Filters, &Filter{}) + if err := m.Filters[len(m.Filters)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter_DateRange) 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 ErrIntOverflowTypes + } + 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: DateRange: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DateRange: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.StartDate == nil { + m.StartDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EndDate == nil { + m.EndDate = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.EndDate, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/denom.go b/x/ecocredit/denom.go index 0622115bae..2f64e93952 100644 --- a/x/ecocredit/denom.go +++ b/x/ecocredit/denom.go @@ -3,10 +3,11 @@ package ecocredit import ( "fmt" "regexp" + "strings" "time" ) -// Calculate the ID to use for a new credit class, based on the credit type and +// FormatClassID formats the ID to use for a new credit class, based on the credit type and // sequence number. This format may evolve over time, but will maintain // backwards compatibility. // @@ -16,7 +17,7 @@ func FormatClassID(creditType CreditType, classSeqNo uint64) string { return fmt.Sprintf("%s%02d", creditType.Abbreviation, classSeqNo) } -// Calculate the denomination to use for a batch, based on the batch +// FormatDenom formats the denomination to use for a batch, based on the batch // information. This format may evolve over time, but will maintain backwards // compatibility. // @@ -57,7 +58,7 @@ var ( reFullBatchDenom = regexp.MustCompile(fmt.Sprintf(`^%s$`, ReBatchDenom)) ) -// Validate a class ID conforms to the format described in FormatClassID. The +// ValidateClassID validates a class ID conforms to the format described in FormatClassID. The // return is nil if the ID is valid. func ValidateClassID(classId string) error { matches := reFullClassID.FindStringSubmatch(classId) @@ -67,7 +68,7 @@ func ValidateClassID(classId string) error { return nil } -// Validate a batch denomination conforms to the format described in +// ValidateDenom validates a batch denomination conforms to the format described in // FormatDenom. The return is nil if the denom is valid. func ValidateDenom(denom string) error { matches := reFullBatchDenom.FindStringSubmatch(denom) @@ -76,3 +77,16 @@ func ValidateDenom(denom string) error { } return nil } + +// GetClassIdFromBatchDenom returns the classID in a batch denom +func GetClassIdFromBatchDenom(denom string) string { + var s strings.Builder + for _, r := range denom { + if r != '-' { + s.WriteRune(r) + continue + } + break + } + return s.String() +} diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index 94dc17436e..eeaccee40e 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -4,6 +4,7 @@ go 1.17 require ( github.com/cosmos/cosmos-sdk v0.44.2 + github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4 github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.7 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 @@ -19,6 +20,7 @@ require ( github.com/tendermint/tm-db v0.6.6 google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb google.golang.org/grpc v1.44.0 + google.golang.org/protobuf v1.27.1 pgregory.net/rapid v0.4.7 sigs.k8s.io/yaml v1.1.0 ) @@ -39,7 +41,6 @@ require ( github.com/coinbase/rosetta-sdk-go v0.6.10 // indirect github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect - github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4 // indirect github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/iavl v0.17.1 // indirect @@ -118,7 +119,6 @@ require ( golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.6 // indirect - google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index 72243c98e4..48f1b00ae9 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -220,17 +220,12 @@ github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-proto v1.0.0-alpha6/go.mod h1:msdDWOvfStHLG+Z2y2SJ0dcqimZ2vc8M1MPnZ4jOF7U= github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= -github.com/cosmos/cosmos-sdk/api v0.1.0-alpha3 h1:tqpedvX/1UgQyX3W2hlW6Xg801FyojYT/NOHbW0oG+s= -github.com/cosmos/cosmos-sdk/api v0.1.0-alpha3/go.mod h1:Ht15guGn9F8b0lv8NkjXE9/asAvVUOt2n4gvQ4q5MyU= github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4 h1:z2si9sQNUTj2jw+24SujuUxcoNS3TVga/fdYsS4rJII= github.com/cosmos/cosmos-sdk/api v0.1.0-alpha4/go.mod h1:gZu6sOu2vl4Fd7I+BjDSx2bxndwPgFLGfOegek3SQQo= github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.2 h1:bBglNlra8ZHb4dmbEE8V85ihLA+DkriSm7tcx6x/JWo= github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.2/go.mod h1:Gi7pzVRnvZ1N16JAXpLADzng0ePoE7YeEHaULSFB2Ts= -github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.6 h1:ZfS4+Vf+zdX3ABGmThHSJt9KTOOIxCxGg8mbob7JbUw= -github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.6/go.mod h1:pH7cqdUlm/zbtGUxlg9Lf/KL8poW4N9HkSN1AKAwRKk= github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.7 h1:pDxU4OFliJjQ22Tqf9kCfPZFtJla/yfGnV6EojVw+d8= github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.7/go.mod h1:woV5EBAWmTaXKs7YXioQsYheXSZkmZIgLPq+Koi/GB8= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -1594,8 +1589,7 @@ google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1610,7 +1604,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/x/ecocredit/marketplace/v1beta1/events.pb.go b/x/ecocredit/marketplace/v1beta1/events.pb.go new file mode 100644 index 0000000000..46137921e2 --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/events.pb.go @@ -0,0 +1,2233 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/events.proto + +package v1beta1 + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// EventSell is an event emitted when a sell order is created. +type EventSell struct { + // order_id is the unique ID of sell order. + OrderId uint64 `protobuf:"varint,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` + // batch_denom is the credit batch being sold. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // quantity is the quantity of credits being sold. + Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + // ask_price is the price the seller is asking for each unit of the + // batch_denom. Each credit unit of the batch will be sold for at least the + // ask_price or more. + AskPrice *types.Coin `protobuf:"bytes,4,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"` + // disable_auto_retire disables auto-retirement of credits which allows a + // buyer to disable auto-retirement in their buy order enabling them to + // resell the credits to another buyer. + DisableAutoRetire bool `protobuf:"varint,5,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is an optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *time.Time `protobuf:"bytes,6,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *EventSell) Reset() { *m = EventSell{} } +func (m *EventSell) String() string { return proto.CompactTextString(m) } +func (*EventSell) ProtoMessage() {} +func (*EventSell) Descriptor() ([]byte, []int) { + return fileDescriptor_c64cc204b7516f6a, []int{0} +} +func (m *EventSell) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSell) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventSell.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 *EventSell) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSell.Merge(m, src) +} +func (m *EventSell) XXX_Size() int { + return m.Size() +} +func (m *EventSell) XXX_DiscardUnknown() { + xxx_messageInfo_EventSell.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSell proto.InternalMessageInfo + +func (m *EventSell) GetOrderId() uint64 { + if m != nil { + return m.OrderId + } + return 0 +} + +func (m *EventSell) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventSell) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *EventSell) GetAskPrice() *types.Coin { + if m != nil { + return m.AskPrice + } + return nil +} + +func (m *EventSell) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *EventSell) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +// EventUpdateSellOrder is an event emitted when a sell order is updated. +type EventUpdateSellOrder struct { + // owner is the owner of the sell orders. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // sell_order_id is the ID of an existing sell order. + SellOrderId uint64 `protobuf:"varint,2,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // batch_denom is the credit batch being sold. + BatchDenom string `protobuf:"bytes,3,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // new_quantity is the updated quantity of credits available to sell, if it + // is set to zero then the order is cancelled. + NewQuantity string `protobuf:"bytes,4,opt,name=new_quantity,json=newQuantity,proto3" json:"new_quantity,omitempty"` + // new_ask_price is the new ask price for this sell order + NewAskPrice *types.Coin `protobuf:"bytes,5,opt,name=new_ask_price,json=newAskPrice,proto3" json:"new_ask_price,omitempty"` + // disable_auto_retire updates the disable_auto_retire field in the sell order. + DisableAutoRetire bool `protobuf:"varint,6,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // new_expiration is an optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + NewExpiration *time.Time `protobuf:"bytes,7,opt,name=new_expiration,json=newExpiration,proto3,stdtime" json:"new_expiration,omitempty"` +} + +func (m *EventUpdateSellOrder) Reset() { *m = EventUpdateSellOrder{} } +func (m *EventUpdateSellOrder) String() string { return proto.CompactTextString(m) } +func (*EventUpdateSellOrder) ProtoMessage() {} +func (*EventUpdateSellOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_c64cc204b7516f6a, []int{1} +} +func (m *EventUpdateSellOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateSellOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateSellOrder.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 *EventUpdateSellOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateSellOrder.Merge(m, src) +} +func (m *EventUpdateSellOrder) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateSellOrder) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateSellOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateSellOrder proto.InternalMessageInfo + +func (m *EventUpdateSellOrder) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *EventUpdateSellOrder) GetSellOrderId() uint64 { + if m != nil { + return m.SellOrderId + } + return 0 +} + +func (m *EventUpdateSellOrder) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventUpdateSellOrder) GetNewQuantity() string { + if m != nil { + return m.NewQuantity + } + return "" +} + +func (m *EventUpdateSellOrder) GetNewAskPrice() *types.Coin { + if m != nil { + return m.NewAskPrice + } + return nil +} + +func (m *EventUpdateSellOrder) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *EventUpdateSellOrder) GetNewExpiration() *time.Time { + if m != nil { + return m.NewExpiration + } + return nil +} + +// EventBuyOrderCreated is an event emitted when a buy order is created. +type EventBuyOrderCreated struct { + // buy_order_id is the unique ID of buy order. + BuyOrderId uint64 `protobuf:"varint,1,opt,name=buy_order_id,json=buyOrderId,proto3" json:"buy_order_id,omitempty"` + // sell_order_id is the sell order ID against which the buyer is trying to buy. + SellOrderId uint64 `protobuf:"varint,2,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // quantity is the quantity of credits to buy. If the quantity of credits + // available is less than this amount the order will be partially filled + // unless disable_partial_fill is true. + Quantity string `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + // bid price is the bid price for this buy order. A credit unit will be + // settled at a purchase price that is no more than the bid price. The + // buy order will fail if the buyer does not have enough funds available + // to complete the purchase. + BidPrice *types.Coin `protobuf:"bytes,4,opt,name=bid_price,json=bidPrice,proto3" json:"bid_price,omitempty"` + // disable_auto_retire allows auto-retirement to be disabled. If it is set to true + // the credits will not auto-retire and can be resold assuming that the + // corresponding sell order has auto-retirement disabled. If the sell order + // hasn't disabled auto-retirement and the buy order tries to disable it, + // that buy order will fail. + DisableAutoRetire bool `protobuf:"varint,5,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // disable_partial_fill disables the default behavior of partially filling + // buy orders if the requested quantity is not available. + DisablePartialFill bool `protobuf:"varint,6,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // retirement_location is the optional retirement location for the credits + // which will be used only if disable_auto_retire is false. + RetirementLocation string `protobuf:"bytes,7,opt,name=retirement_location,json=retirementLocation,proto3" json:"retirement_location,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *time.Time `protobuf:"bytes,8,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *EventBuyOrderCreated) Reset() { *m = EventBuyOrderCreated{} } +func (m *EventBuyOrderCreated) String() string { return proto.CompactTextString(m) } +func (*EventBuyOrderCreated) ProtoMessage() {} +func (*EventBuyOrderCreated) Descriptor() ([]byte, []int) { + return fileDescriptor_c64cc204b7516f6a, []int{2} +} +func (m *EventBuyOrderCreated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBuyOrderCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventBuyOrderCreated.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 *EventBuyOrderCreated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBuyOrderCreated.Merge(m, src) +} +func (m *EventBuyOrderCreated) XXX_Size() int { + return m.Size() +} +func (m *EventBuyOrderCreated) XXX_DiscardUnknown() { + xxx_messageInfo_EventBuyOrderCreated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBuyOrderCreated proto.InternalMessageInfo + +func (m *EventBuyOrderCreated) GetBuyOrderId() uint64 { + if m != nil { + return m.BuyOrderId + } + return 0 +} + +func (m *EventBuyOrderCreated) GetSellOrderId() uint64 { + if m != nil { + return m.SellOrderId + } + return 0 +} + +func (m *EventBuyOrderCreated) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *EventBuyOrderCreated) GetBidPrice() *types.Coin { + if m != nil { + return m.BidPrice + } + return nil +} + +func (m *EventBuyOrderCreated) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *EventBuyOrderCreated) GetDisablePartialFill() bool { + if m != nil { + return m.DisablePartialFill + } + return false +} + +func (m *EventBuyOrderCreated) GetRetirementLocation() string { + if m != nil { + return m.RetirementLocation + } + return "" +} + +func (m *EventBuyOrderCreated) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +// EventBuyOrderFilled is an event emitted when a buy order is filled. +type EventBuyOrderFilled struct { + // buy_order_id is the unique ID of the buy order. + BuyOrderId uint64 `protobuf:"varint,1,opt,name=buy_order_id,json=buyOrderId,proto3" json:"buy_order_id,omitempty"` + // sell_order_id is the unique ID of the sell order. + SellOrderId uint64 `protobuf:"varint,2,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // batch_denom is the credit batch ID of the purchased credits. + BatchDenom string `protobuf:"bytes,3,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // quantity is the quantity of the purchased credits. + Quantity string `protobuf:"bytes,4,opt,name=quantity,proto3" json:"quantity,omitempty"` + // total_price is the total price for the purchased credits. + TotalPrice *types.Coin `protobuf:"bytes,5,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"` +} + +func (m *EventBuyOrderFilled) Reset() { *m = EventBuyOrderFilled{} } +func (m *EventBuyOrderFilled) String() string { return proto.CompactTextString(m) } +func (*EventBuyOrderFilled) ProtoMessage() {} +func (*EventBuyOrderFilled) Descriptor() ([]byte, []int) { + return fileDescriptor_c64cc204b7516f6a, []int{3} +} +func (m *EventBuyOrderFilled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventBuyOrderFilled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventBuyOrderFilled.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 *EventBuyOrderFilled) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventBuyOrderFilled.Merge(m, src) +} +func (m *EventBuyOrderFilled) XXX_Size() int { + return m.Size() +} +func (m *EventBuyOrderFilled) XXX_DiscardUnknown() { + xxx_messageInfo_EventBuyOrderFilled.DiscardUnknown(m) +} + +var xxx_messageInfo_EventBuyOrderFilled proto.InternalMessageInfo + +func (m *EventBuyOrderFilled) GetBuyOrderId() uint64 { + if m != nil { + return m.BuyOrderId + } + return 0 +} + +func (m *EventBuyOrderFilled) GetSellOrderId() uint64 { + if m != nil { + return m.SellOrderId + } + return 0 +} + +func (m *EventBuyOrderFilled) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventBuyOrderFilled) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *EventBuyOrderFilled) GetTotalPrice() *types.Coin { + if m != nil { + return m.TotalPrice + } + return nil +} + +// EventAllowAskDenom is an event emitted when an ask denom is added. +type EventAllowAskDenom struct { + // denom is the denom to allow (ex. ibc/GLKHDSG423SGS) + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // display_denom is the denom to display to the user and is informational + DisplayDenom string `protobuf:"bytes,2,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"` + // exponent is the exponent that relates the denom to the display_denom and is + // informational + Exponent uint32 `protobuf:"varint,3,opt,name=exponent,proto3" json:"exponent,omitempty"` +} + +func (m *EventAllowAskDenom) Reset() { *m = EventAllowAskDenom{} } +func (m *EventAllowAskDenom) String() string { return proto.CompactTextString(m) } +func (*EventAllowAskDenom) ProtoMessage() {} +func (*EventAllowAskDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_c64cc204b7516f6a, []int{4} +} +func (m *EventAllowAskDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventAllowAskDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventAllowAskDenom.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 *EventAllowAskDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventAllowAskDenom.Merge(m, src) +} +func (m *EventAllowAskDenom) XXX_Size() int { + return m.Size() +} +func (m *EventAllowAskDenom) XXX_DiscardUnknown() { + xxx_messageInfo_EventAllowAskDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_EventAllowAskDenom proto.InternalMessageInfo + +func (m *EventAllowAskDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *EventAllowAskDenom) GetDisplayDenom() string { + if m != nil { + return m.DisplayDenom + } + return "" +} + +func (m *EventAllowAskDenom) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +func init() { + proto.RegisterType((*EventSell)(nil), "regen.ecocredit.marketplace.v1beta1.EventSell") + proto.RegisterType((*EventUpdateSellOrder)(nil), "regen.ecocredit.marketplace.v1beta1.EventUpdateSellOrder") + proto.RegisterType((*EventBuyOrderCreated)(nil), "regen.ecocredit.marketplace.v1beta1.EventBuyOrderCreated") + proto.RegisterType((*EventBuyOrderFilled)(nil), "regen.ecocredit.marketplace.v1beta1.EventBuyOrderFilled") + proto.RegisterType((*EventAllowAskDenom)(nil), "regen.ecocredit.marketplace.v1beta1.EventAllowAskDenom") +} + +func init() { + proto.RegisterFile("regen/ecocredit/marketplace/v1beta1/events.proto", fileDescriptor_c64cc204b7516f6a) +} + +var fileDescriptor_c64cc204b7516f6a = []byte{ + // 675 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xbf, 0x6e, 0xdb, 0x3a, + 0x14, 0xc6, 0x23, 0xc7, 0x4e, 0x6c, 0x3a, 0xbe, 0xc0, 0x65, 0x3c, 0x38, 0x1e, 0x14, 0x5f, 0x67, + 0xf1, 0x72, 0xa5, 0xe4, 0x5e, 0xa0, 0x43, 0x81, 0x02, 0x4d, 0xd2, 0xb4, 0x08, 0x50, 0xa0, 0xa9, + 0xda, 0x2e, 0x5d, 0x04, 0x4a, 0x3a, 0x51, 0x08, 0x53, 0xa4, 0x4a, 0x51, 0x71, 0xfc, 0x00, 0x1d, + 0x0b, 0xe4, 0xb1, 0x3a, 0x74, 0xc8, 0xd0, 0xa1, 0x5b, 0x8b, 0xe4, 0x45, 0x0a, 0x52, 0xf2, 0x9f, + 0x24, 0x68, 0x6d, 0x04, 0xdd, 0x7c, 0x78, 0xce, 0x47, 0x1e, 0xfe, 0xce, 0x67, 0x0a, 0xed, 0x4a, + 0x88, 0x81, 0xbb, 0x10, 0x8a, 0x50, 0x42, 0x44, 0x95, 0x9b, 0x10, 0x39, 0x04, 0x95, 0x32, 0x12, + 0x82, 0x7b, 0xbe, 0x17, 0x80, 0x22, 0x7b, 0x2e, 0x9c, 0x03, 0x57, 0x99, 0x93, 0x4a, 0xa1, 0x04, + 0xde, 0x31, 0x0a, 0x67, 0xaa, 0x70, 0xe6, 0x14, 0x4e, 0xa9, 0xe8, 0xb6, 0x63, 0x11, 0x0b, 0x53, + 0xef, 0xea, 0x5f, 0x85, 0xb4, 0x6b, 0x87, 0x22, 0x4b, 0x44, 0xe6, 0x06, 0x24, 0x9b, 0x6d, 0x1e, + 0x0a, 0xca, 0xcb, 0xfc, 0x76, 0x2c, 0x44, 0xcc, 0xc0, 0x35, 0x51, 0x90, 0x9f, 0xba, 0x8a, 0x26, + 0x90, 0x29, 0x92, 0xa4, 0x45, 0x41, 0xff, 0x53, 0x05, 0x35, 0x8e, 0x74, 0x33, 0x6f, 0x80, 0x31, + 0xbc, 0x85, 0xea, 0x42, 0x46, 0x20, 0x7d, 0x1a, 0x75, 0xac, 0x9e, 0x35, 0xa8, 0x7a, 0xeb, 0x26, + 0x3e, 0x8e, 0xf0, 0x36, 0x6a, 0x06, 0x44, 0x85, 0x67, 0x7e, 0x04, 0x5c, 0x24, 0x9d, 0x4a, 0xcf, + 0x1a, 0x34, 0x3c, 0x64, 0x96, 0x9e, 0xe9, 0x15, 0xdc, 0x45, 0xf5, 0x0f, 0x39, 0xe1, 0x8a, 0xaa, + 0x71, 0x67, 0xd5, 0x64, 0xa7, 0x31, 0x7e, 0x84, 0x1a, 0x24, 0x1b, 0xfa, 0xa9, 0xa4, 0x21, 0x74, + 0xaa, 0x3d, 0x6b, 0xd0, 0xfc, 0x6f, 0xcb, 0x29, 0x5a, 0x77, 0x74, 0xeb, 0x93, 0x5b, 0x3a, 0x87, + 0x82, 0x72, 0xaf, 0x4e, 0xb2, 0xe1, 0x89, 0x2e, 0xc5, 0x0e, 0xda, 0x8c, 0x68, 0x46, 0x02, 0x06, + 0x3e, 0xc9, 0x95, 0xf0, 0x25, 0x28, 0x2a, 0xa1, 0x53, 0xeb, 0x59, 0x83, 0xba, 0xf7, 0x77, 0x99, + 0xda, 0xcf, 0x95, 0xf0, 0x4c, 0x02, 0x3f, 0x45, 0x08, 0x2e, 0x52, 0x2a, 0x89, 0xa2, 0x82, 0x77, + 0xd6, 0xcc, 0x41, 0x5d, 0xa7, 0x60, 0xe0, 0x4c, 0x18, 0x38, 0x6f, 0x27, 0x0c, 0x0e, 0xaa, 0x97, + 0xdf, 0xb7, 0x2d, 0x6f, 0x4e, 0xd3, 0xff, 0x52, 0x41, 0x6d, 0xc3, 0xe3, 0x5d, 0x1a, 0x11, 0x05, + 0x9a, 0xca, 0x2b, 0x4d, 0x00, 0xb7, 0x51, 0x4d, 0x8c, 0x38, 0x48, 0xc3, 0xa5, 0xe1, 0x15, 0x01, + 0xee, 0xa3, 0x56, 0x06, 0x8c, 0xf9, 0x53, 0x6a, 0x15, 0x43, 0xad, 0x99, 0x4d, 0x74, 0xf7, 0xc9, + 0xad, 0xde, 0x23, 0xf7, 0x0f, 0xda, 0xe0, 0x30, 0xf2, 0xa7, 0xf4, 0xaa, 0xa6, 0xa2, 0xc9, 0x61, + 0xf4, 0x7a, 0x02, 0xf0, 0x09, 0x6a, 0xe9, 0x92, 0x19, 0xc4, 0xda, 0x22, 0x88, 0x5a, 0xbe, 0xbf, + 0x80, 0xe3, 0xda, 0xaf, 0x38, 0xbe, 0x40, 0x7f, 0xe9, 0xe3, 0xe6, 0x58, 0xae, 0x2f, 0xc9, 0x52, + 0xb7, 0x79, 0x34, 0xc3, 0xf9, 0x71, 0xb5, 0xc4, 0x79, 0x90, 0x8f, 0x0d, 0x8f, 0x43, 0x09, 0x44, + 0x41, 0x84, 0x7b, 0x68, 0x23, 0xc8, 0xc7, 0xfe, 0x1d, 0xb7, 0xa1, 0xa0, 0x2c, 0x3b, 0x8e, 0x96, + 0x42, 0xbb, 0xc0, 0x73, 0x01, 0x8d, 0x96, 0xf6, 0x5c, 0x40, 0xa3, 0x87, 0x79, 0x6e, 0x17, 0xb5, + 0x27, 0xf5, 0x29, 0x91, 0x8a, 0x12, 0xe6, 0x9f, 0x52, 0xc6, 0x4a, 0xb8, 0xb8, 0xcc, 0x9d, 0x14, + 0xa9, 0xe7, 0x94, 0x31, 0xec, 0xa2, 0xcd, 0x62, 0xd3, 0x04, 0xb8, 0xf2, 0x99, 0x08, 0x67, 0x88, + 0x1b, 0x1e, 0x9e, 0xa5, 0x5e, 0x96, 0x99, 0x3b, 0xb6, 0xae, 0x3f, 0xc0, 0xd6, 0x5f, 0x2d, 0xb4, + 0x79, 0x6b, 0x0e, 0xba, 0x91, 0x3f, 0x36, 0x86, 0x85, 0x0e, 0x9f, 0x9f, 0x53, 0xf5, 0xce, 0x9c, + 0x1e, 0xa3, 0xa6, 0x12, 0x8a, 0xb0, 0x65, 0x8d, 0x8d, 0x4c, 0xb5, 0x99, 0x55, 0x7f, 0x88, 0xb0, + 0xb9, 0xd5, 0x3e, 0x63, 0x42, 0xbb, 0xbd, 0x38, 0xad, 0x8d, 0x6a, 0x45, 0x23, 0xe5, 0x5f, 0xd5, + 0x04, 0x78, 0x07, 0xb5, 0x22, 0x9a, 0xa5, 0x8c, 0x8c, 0x6f, 0x3d, 0x61, 0x1b, 0xe5, 0xe2, 0xb4, + 0x51, 0xb8, 0x48, 0x05, 0x07, 0xae, 0xcc, 0x35, 0x5a, 0xde, 0x34, 0x3e, 0xf0, 0x3f, 0x5f, 0xdb, + 0xd6, 0xd5, 0xb5, 0x6d, 0xfd, 0xb8, 0xb6, 0xad, 0xcb, 0x1b, 0x7b, 0xe5, 0xea, 0xc6, 0x5e, 0xf9, + 0x76, 0x63, 0xaf, 0xbc, 0x3f, 0x8a, 0xa9, 0x3a, 0xcb, 0x03, 0x27, 0x14, 0x89, 0x6b, 0xde, 0xf2, + 0x7f, 0x39, 0xa8, 0x91, 0x90, 0xc3, 0x32, 0x62, 0x10, 0xc5, 0x20, 0xdd, 0x8b, 0xdf, 0x7f, 0x14, + 0x82, 0x35, 0x33, 0xca, 0xff, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x66, 0xf1, 0x27, 0x8e, 0x42, + 0x06, 0x00, 0x00, +} + +func (m *EventSell) 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 *EventSell) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSell) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintEvents(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.AskPrice != nil { + { + size, err := m.AskPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x1a + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0x12 + } + if m.OrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.OrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateSellOrder) 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 *EventUpdateSellOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateSellOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewExpiration != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NewExpiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintEvents(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x3a + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.NewAskPrice != nil { + { + size, err := m.NewAskPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.NewQuantity) > 0 { + i -= len(m.NewQuantity) + copy(dAtA[i:], m.NewQuantity) + i = encodeVarintEvents(dAtA, i, uint64(len(m.NewQuantity))) + i-- + dAtA[i] = 0x22 + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0x1a + } + if m.SellOrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventBuyOrderCreated) 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 *EventBuyOrderCreated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBuyOrderCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintEvents(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x42 + } + if len(m.RetirementLocation) > 0 { + i -= len(m.RetirementLocation) + copy(dAtA[i:], m.RetirementLocation) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RetirementLocation))) + i-- + dAtA[i] = 0x3a + } + if m.DisablePartialFill { + i-- + if m.DisablePartialFill { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.BidPrice != nil { + { + size, err := m.BidPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x1a + } + if m.SellOrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x10 + } + if m.BuyOrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.BuyOrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventBuyOrderFilled) 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 *EventBuyOrderFilled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventBuyOrderFilled) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalPrice != nil { + { + size, err := m.TotalPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x22 + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0x1a + } + if m.SellOrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x10 + } + if m.BuyOrderId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.BuyOrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventAllowAskDenom) 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 *EventAllowAskDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventAllowAskDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exponent != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x18 + } + if len(m.DisplayDenom) > 0 { + i -= len(m.DisplayDenom) + copy(dAtA[i:], m.DisplayDenom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DisplayDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventSell) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OrderId != 0 { + n += 1 + sovEvents(uint64(m.OrderId)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.AskPrice != nil { + l = m.AskPrice.Size() + n += 1 + l + sovEvents(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventUpdateSellOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.SellOrderId != 0 { + n += 1 + sovEvents(uint64(m.SellOrderId)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.NewQuantity) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.NewAskPrice != nil { + l = m.NewAskPrice.Size() + n += 1 + l + sovEvents(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.NewExpiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration) + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventBuyOrderCreated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BuyOrderId != 0 { + n += 1 + sovEvents(uint64(m.BuyOrderId)) + } + if m.SellOrderId != 0 { + n += 1 + sovEvents(uint64(m.SellOrderId)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.BidPrice != nil { + l = m.BidPrice.Size() + n += 1 + l + sovEvents(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.DisablePartialFill { + n += 2 + } + l = len(m.RetirementLocation) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventBuyOrderFilled) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BuyOrderId != 0 { + n += 1 + sovEvents(uint64(m.BuyOrderId)) + } + if m.SellOrderId != 0 { + n += 1 + sovEvents(uint64(m.SellOrderId)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.TotalPrice != nil { + l = m.TotalPrice.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventAllowAskDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.DisplayDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovEvents(uint64(m.Exponent)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventSell) 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 ErrIntOverflowEvents + } + 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: EventSell: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSell: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderId", wireType) + } + m.OrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AskPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AskPrice == nil { + m.AskPrice = &types.Coin{} + } + if err := m.AskPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateSellOrder) 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 ErrIntOverflowEvents + } + 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: EventUpdateSellOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateSellOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + m.SellOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SellOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewQuantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewQuantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewAskPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewAskPrice == nil { + m.NewAskPrice = &types.Coin{} + } + if err := m.NewAskPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewExpiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewExpiration == nil { + m.NewExpiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.NewExpiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBuyOrderCreated) 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 ErrIntOverflowEvents + } + 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: EventBuyOrderCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBuyOrderCreated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrderId", wireType) + } + m.BuyOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BuyOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + m.SellOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SellOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BidPrice == nil { + m.BidPrice = &types.Coin{} + } + if err := m.BidPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisablePartialFill", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisablePartialFill = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetirementLocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RetirementLocation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventBuyOrderFilled) 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 ErrIntOverflowEvents + } + 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: EventBuyOrderFilled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventBuyOrderFilled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrderId", wireType) + } + m.BuyOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BuyOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + m.SellOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SellOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TotalPrice == nil { + m.TotalPrice = &types.Coin{} + } + if err := m.TotalPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventAllowAskDenom) 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 ErrIntOverflowEvents + } + 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: EventAllowAskDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventAllowAskDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/marketplace/v1beta1/query.pb.go b/x/ecocredit/marketplace/v1beta1/query.pb.go new file mode 100644 index 0000000000..62b7a5f641 --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/query.pb.go @@ -0,0 +1,3975 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/query.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 + +// QuerySellOrderRequest is the Query/SellOrder request type. +type QuerySellOrderRequest struct { + // sell_order_id is the id of the requested sell order. + SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` +} + +func (m *QuerySellOrderRequest) Reset() { *m = QuerySellOrderRequest{} } +func (m *QuerySellOrderRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrderRequest) ProtoMessage() {} +func (*QuerySellOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{0} +} +func (m *QuerySellOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrderRequest.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 *QuerySellOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrderRequest.Merge(m, src) +} +func (m *QuerySellOrderRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrderRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrderRequest proto.InternalMessageInfo + +func (m *QuerySellOrderRequest) GetSellOrderId() uint64 { + if m != nil { + return m.SellOrderId + } + return 0 +} + +// QuerySellOrderResponse is the Query/SellOrder response type. +type QuerySellOrderResponse struct { + // sell_order contains all information related to a sell order. + SellOrder *SellOrder `protobuf:"bytes,1,opt,name=sell_order,json=sellOrder,proto3" json:"sell_order,omitempty"` +} + +func (m *QuerySellOrderResponse) Reset() { *m = QuerySellOrderResponse{} } +func (m *QuerySellOrderResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrderResponse) ProtoMessage() {} +func (*QuerySellOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{1} +} +func (m *QuerySellOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrderResponse.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 *QuerySellOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrderResponse.Merge(m, src) +} +func (m *QuerySellOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrderResponse proto.InternalMessageInfo + +func (m *QuerySellOrderResponse) GetSellOrder() *SellOrder { + if m != nil { + return m.SellOrder + } + return nil +} + +// QuerySellOrdersRequest is the Query/SellOrders request type. +type QuerySellOrdersRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersRequest) Reset() { *m = QuerySellOrdersRequest{} } +func (m *QuerySellOrdersRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersRequest) ProtoMessage() {} +func (*QuerySellOrdersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{2} +} +func (m *QuerySellOrdersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersRequest.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 *QuerySellOrdersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersRequest.Merge(m, src) +} +func (m *QuerySellOrdersRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersRequest proto.InternalMessageInfo + +func (m *QuerySellOrdersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySellOrdersResponse is the Query/SellOrders response type. +type QuerySellOrdersResponse struct { + // sell_orders is a list of sell orders. + SellOrders []*SellOrder `protobuf:"bytes,1,rep,name=sell_orders,json=sellOrders,proto3" json:"sell_orders,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersResponse) Reset() { *m = QuerySellOrdersResponse{} } +func (m *QuerySellOrdersResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersResponse) ProtoMessage() {} +func (*QuerySellOrdersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{3} +} +func (m *QuerySellOrdersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersResponse.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 *QuerySellOrdersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersResponse.Merge(m, src) +} +func (m *QuerySellOrdersResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersResponse proto.InternalMessageInfo + +func (m *QuerySellOrdersResponse) GetSellOrders() []*SellOrder { + if m != nil { + return m.SellOrders + } + return nil +} + +func (m *QuerySellOrdersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySellOrdersByDenomRequest is the Query/SellOrdersByDenom request type. +type QuerySellOrdersByBatchDenomRequest struct { + // batch_denom is an ecocredit denom + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersByBatchDenomRequest) Reset() { *m = QuerySellOrdersByBatchDenomRequest{} } +func (m *QuerySellOrdersByBatchDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersByBatchDenomRequest) ProtoMessage() {} +func (*QuerySellOrdersByBatchDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{4} +} +func (m *QuerySellOrdersByBatchDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersByBatchDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersByBatchDenomRequest.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 *QuerySellOrdersByBatchDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersByBatchDenomRequest.Merge(m, src) +} +func (m *QuerySellOrdersByBatchDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersByBatchDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersByBatchDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersByBatchDenomRequest proto.InternalMessageInfo + +func (m *QuerySellOrdersByBatchDenomRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *QuerySellOrdersByBatchDenomRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySellOrdersByDenomResponse is the Query/SellOrdersByDenom response type. +type QuerySellOrdersByBatchDenomResponse struct { + // sell_orders is a list of sell orders. + SellOrders []*SellOrder `protobuf:"bytes,1,rep,name=sell_orders,json=sellOrders,proto3" json:"sell_orders,omitempty"` + // pagination defines an optional pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersByBatchDenomResponse) Reset() { *m = QuerySellOrdersByBatchDenomResponse{} } +func (m *QuerySellOrdersByBatchDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersByBatchDenomResponse) ProtoMessage() {} +func (*QuerySellOrdersByBatchDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{5} +} +func (m *QuerySellOrdersByBatchDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersByBatchDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersByBatchDenomResponse.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 *QuerySellOrdersByBatchDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersByBatchDenomResponse.Merge(m, src) +} +func (m *QuerySellOrdersByBatchDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersByBatchDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersByBatchDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersByBatchDenomResponse proto.InternalMessageInfo + +func (m *QuerySellOrdersByBatchDenomResponse) GetSellOrders() []*SellOrder { + if m != nil { + return m.SellOrders + } + return nil +} + +func (m *QuerySellOrdersByBatchDenomResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySellOrdersByAddressRequest is the Query/SellOrdersByAddress request type. +type QuerySellOrdersByAddressRequest struct { + // address is the creator of the sell order + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersByAddressRequest) Reset() { *m = QuerySellOrdersByAddressRequest{} } +func (m *QuerySellOrdersByAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersByAddressRequest) ProtoMessage() {} +func (*QuerySellOrdersByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{6} +} +func (m *QuerySellOrdersByAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersByAddressRequest.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 *QuerySellOrdersByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersByAddressRequest.Merge(m, src) +} +func (m *QuerySellOrdersByAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersByAddressRequest proto.InternalMessageInfo + +func (m *QuerySellOrdersByAddressRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QuerySellOrdersByAddressRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySellOrdersByAddressResponse is the Query/SellOrdersByAddressResponse response type. +type QuerySellOrdersByAddressResponse struct { + // sell_orders is a list of sell orders. + SellOrders []*SellOrder `protobuf:"bytes,1,rep,name=sell_orders,json=sellOrders,proto3" json:"sell_orders,omitempty"` + // pagination defines an optional pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySellOrdersByAddressResponse) Reset() { *m = QuerySellOrdersByAddressResponse{} } +func (m *QuerySellOrdersByAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySellOrdersByAddressResponse) ProtoMessage() {} +func (*QuerySellOrdersByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{7} +} +func (m *QuerySellOrdersByAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySellOrdersByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySellOrdersByAddressResponse.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 *QuerySellOrdersByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySellOrdersByAddressResponse.Merge(m, src) +} +func (m *QuerySellOrdersByAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySellOrdersByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySellOrdersByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySellOrdersByAddressResponse proto.InternalMessageInfo + +func (m *QuerySellOrdersByAddressResponse) GetSellOrders() []*SellOrder { + if m != nil { + return m.SellOrders + } + return nil +} + +func (m *QuerySellOrdersByAddressResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBuyOrderRequest is the Query/BuyOrder request type. +type QueryBuyOrderRequest struct { + // buy_order_id is the id of the buy order. + BuyOrderId uint64 `protobuf:"varint,1,opt,name=buy_order_id,json=buyOrderId,proto3" json:"buy_order_id,omitempty"` +} + +func (m *QueryBuyOrderRequest) Reset() { *m = QueryBuyOrderRequest{} } +func (m *QueryBuyOrderRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrderRequest) ProtoMessage() {} +func (*QueryBuyOrderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{8} +} +func (m *QueryBuyOrderRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrderRequest.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 *QueryBuyOrderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrderRequest.Merge(m, src) +} +func (m *QueryBuyOrderRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrderRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrderRequest proto.InternalMessageInfo + +func (m *QueryBuyOrderRequest) GetBuyOrderId() uint64 { + if m != nil { + return m.BuyOrderId + } + return 0 +} + +// QueryBuyOrderResponse is the Query/BuyOrder response type. +type QueryBuyOrderResponse struct { + // buy_order contains all information related to a buy order. + BuyOrder *BuyOrder `protobuf:"bytes,1,opt,name=buy_order,json=buyOrder,proto3" json:"buy_order,omitempty"` +} + +func (m *QueryBuyOrderResponse) Reset() { *m = QueryBuyOrderResponse{} } +func (m *QueryBuyOrderResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrderResponse) ProtoMessage() {} +func (*QueryBuyOrderResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{9} +} +func (m *QueryBuyOrderResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrderResponse.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 *QueryBuyOrderResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrderResponse.Merge(m, src) +} +func (m *QueryBuyOrderResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrderResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrderResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrderResponse proto.InternalMessageInfo + +func (m *QueryBuyOrderResponse) GetBuyOrder() *BuyOrder { + if m != nil { + return m.BuyOrder + } + return nil +} + +// QueryBuyOrdersRequest is the Query/BuyOrders request type. +type QueryBuyOrdersRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBuyOrdersRequest) Reset() { *m = QueryBuyOrdersRequest{} } +func (m *QueryBuyOrdersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrdersRequest) ProtoMessage() {} +func (*QueryBuyOrdersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{10} +} +func (m *QueryBuyOrdersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrdersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrdersRequest.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 *QueryBuyOrdersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrdersRequest.Merge(m, src) +} +func (m *QueryBuyOrdersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrdersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrdersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrdersRequest proto.InternalMessageInfo + +func (m *QueryBuyOrdersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBuyOrdersResponse is the Query/BuyOrders response type. +type QueryBuyOrdersResponse struct { + // buy_orders is a list of buy orders. + BuyOrders []*BuyOrder `protobuf:"bytes,1,rep,name=buy_orders,json=buyOrders,proto3" json:"buy_orders,omitempty"` + // pagination defines an optional pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBuyOrdersResponse) Reset() { *m = QueryBuyOrdersResponse{} } +func (m *QueryBuyOrdersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrdersResponse) ProtoMessage() {} +func (*QueryBuyOrdersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{11} +} +func (m *QueryBuyOrdersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrdersResponse.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 *QueryBuyOrdersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrdersResponse.Merge(m, src) +} +func (m *QueryBuyOrdersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrdersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrdersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrdersResponse proto.InternalMessageInfo + +func (m *QueryBuyOrdersResponse) GetBuyOrders() []*BuyOrder { + if m != nil { + return m.BuyOrders + } + return nil +} + +func (m *QueryBuyOrdersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBuyOrdersByAddressRequest is the Query/BuyOrdersByAddress request type +type QueryBuyOrdersByAddressRequest struct { + // address of the buy order creator + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBuyOrdersByAddressRequest) Reset() { *m = QueryBuyOrdersByAddressRequest{} } +func (m *QueryBuyOrdersByAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrdersByAddressRequest) ProtoMessage() {} +func (*QueryBuyOrdersByAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{12} +} +func (m *QueryBuyOrdersByAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrdersByAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrdersByAddressRequest.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 *QueryBuyOrdersByAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrdersByAddressRequest.Merge(m, src) +} +func (m *QueryBuyOrdersByAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrdersByAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrdersByAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrdersByAddressRequest proto.InternalMessageInfo + +func (m *QueryBuyOrdersByAddressRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryBuyOrdersByAddressRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryBuyOrdersByAddressResponse is the Query/BuyOrdersByAddress response type. +type QueryBuyOrdersByAddressResponse struct { + // buy_orders is a list of buy orders. + BuyOrders []*BuyOrder `protobuf:"bytes,1,rep,name=buy_orders,json=buyOrders,proto3" json:"buy_orders,omitempty"` + // pagination defines an optional pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryBuyOrdersByAddressResponse) Reset() { *m = QueryBuyOrdersByAddressResponse{} } +func (m *QueryBuyOrdersByAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBuyOrdersByAddressResponse) ProtoMessage() {} +func (*QueryBuyOrdersByAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{13} +} +func (m *QueryBuyOrdersByAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBuyOrdersByAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBuyOrdersByAddressResponse.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 *QueryBuyOrdersByAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBuyOrdersByAddressResponse.Merge(m, src) +} +func (m *QueryBuyOrdersByAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBuyOrdersByAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBuyOrdersByAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBuyOrdersByAddressResponse proto.InternalMessageInfo + +func (m *QueryBuyOrdersByAddressResponse) GetBuyOrders() []*BuyOrder { + if m != nil { + return m.BuyOrders + } + return nil +} + +func (m *QueryBuyOrdersByAddressResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowedDenomsRequest is the Query/AllowedDenoms request type. +type QueryAllowedDenomsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowedDenomsRequest) Reset() { *m = QueryAllowedDenomsRequest{} } +func (m *QueryAllowedDenomsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllowedDenomsRequest) ProtoMessage() {} +func (*QueryAllowedDenomsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{14} +} +func (m *QueryAllowedDenomsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowedDenomsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowedDenomsRequest.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 *QueryAllowedDenomsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowedDenomsRequest.Merge(m, src) +} +func (m *QueryAllowedDenomsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowedDenomsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowedDenomsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowedDenomsRequest proto.InternalMessageInfo + +func (m *QueryAllowedDenomsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowedDenomsResponse is the Query/AllowedDenoms response type. +type QueryAllowedDenomsResponse struct { + // allowed_denoms is a list of coin denoms allowed to use in the ask price of sell orders. + AllowedDenoms []*AllowedDenom `protobuf:"bytes,1,rep,name=allowed_denoms,json=allowedDenoms,proto3" json:"allowed_denoms,omitempty"` + // pagination defines an optional pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowedDenomsResponse) Reset() { *m = QueryAllowedDenomsResponse{} } +func (m *QueryAllowedDenomsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllowedDenomsResponse) ProtoMessage() {} +func (*QueryAllowedDenomsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d68580ac6d625703, []int{15} +} +func (m *QueryAllowedDenomsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowedDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowedDenomsResponse.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 *QueryAllowedDenomsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowedDenomsResponse.Merge(m, src) +} +func (m *QueryAllowedDenomsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowedDenomsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowedDenomsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowedDenomsResponse proto.InternalMessageInfo + +func (m *QueryAllowedDenomsResponse) GetAllowedDenoms() []*AllowedDenom { + if m != nil { + return m.AllowedDenoms + } + return nil +} + +func (m *QueryAllowedDenomsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QuerySellOrderRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrderRequest") + proto.RegisterType((*QuerySellOrderResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrderResponse") + proto.RegisterType((*QuerySellOrdersRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersRequest") + proto.RegisterType((*QuerySellOrdersResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersResponse") + proto.RegisterType((*QuerySellOrdersByBatchDenomRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersByBatchDenomRequest") + proto.RegisterType((*QuerySellOrdersByBatchDenomResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersByBatchDenomResponse") + proto.RegisterType((*QuerySellOrdersByAddressRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersByAddressRequest") + proto.RegisterType((*QuerySellOrdersByAddressResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QuerySellOrdersByAddressResponse") + proto.RegisterType((*QueryBuyOrderRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrderRequest") + proto.RegisterType((*QueryBuyOrderResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrderResponse") + proto.RegisterType((*QueryBuyOrdersRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrdersRequest") + proto.RegisterType((*QueryBuyOrdersResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrdersResponse") + proto.RegisterType((*QueryBuyOrdersByAddressRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrdersByAddressRequest") + proto.RegisterType((*QueryBuyOrdersByAddressResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QueryBuyOrdersByAddressResponse") + proto.RegisterType((*QueryAllowedDenomsRequest)(nil), "regen.ecocredit.marketplace.v1beta1.QueryAllowedDenomsRequest") + proto.RegisterType((*QueryAllowedDenomsResponse)(nil), "regen.ecocredit.marketplace.v1beta1.QueryAllowedDenomsResponse") +} + +func init() { + proto.RegisterFile("regen/ecocredit/marketplace/v1beta1/query.proto", fileDescriptor_d68580ac6d625703) +} + +var fileDescriptor_d68580ac6d625703 = []byte{ + // 886 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0x13, 0x47, + 0x14, 0xce, 0xa4, 0xbf, 0xe2, 0xe7, 0xba, 0x87, 0x69, 0x9b, 0xa6, 0xab, 0xca, 0xb1, 0x36, 0x6d, + 0x52, 0x55, 0xf5, 0xae, 0x9c, 0x4a, 0x6d, 0x7e, 0x54, 0x49, 0xe3, 0x26, 0x84, 0x20, 0x50, 0xc0, + 0x5c, 0x10, 0x17, 0x33, 0xbb, 0x3b, 0xda, 0x58, 0x59, 0xef, 0x3a, 0x3b, 0xeb, 0x04, 0x2b, 0xf2, + 0x25, 0x9c, 0x91, 0x90, 0xf8, 0x43, 0x90, 0x40, 0x42, 0x1c, 0x10, 0x11, 0x17, 0xc4, 0x31, 0x12, + 0x17, 0x6e, 0xa0, 0x98, 0x3f, 0x81, 0x3f, 0x00, 0x79, 0x76, 0x76, 0xbd, 0xfe, 0x91, 0xb0, 0x6c, + 0x2c, 0x91, 0x5b, 0x3c, 0x99, 0xef, 0xbd, 0xef, 0xfb, 0x66, 0xe6, 0xbd, 0xb7, 0xa0, 0xba, 0xd4, + 0xa4, 0xb6, 0x4a, 0x75, 0x47, 0x77, 0xa9, 0x51, 0xf1, 0xd4, 0x2a, 0x71, 0xb7, 0xa9, 0x57, 0xb3, + 0x88, 0x4e, 0xd5, 0xdd, 0x82, 0x46, 0x3d, 0x52, 0x50, 0x77, 0xea, 0xd4, 0x6d, 0x28, 0x35, 0xd7, + 0xf1, 0x1c, 0x3c, 0xc5, 0x01, 0x4a, 0x08, 0x50, 0x22, 0x00, 0x45, 0x00, 0xa4, 0x5f, 0x4c, 0xc7, + 0x31, 0x2d, 0xaa, 0x92, 0x5a, 0x45, 0x25, 0xb6, 0xed, 0x78, 0xc4, 0xab, 0x38, 0x36, 0xf3, 0x43, + 0x48, 0xb1, 0x72, 0x32, 0x8f, 0x78, 0x54, 0x00, 0xfe, 0xd0, 0x1d, 0x56, 0x75, 0x98, 0xaa, 0x11, + 0x46, 0x7d, 0x32, 0xe1, 0xb6, 0x1a, 0x31, 0x2b, 0x36, 0x8f, 0xee, 0xef, 0x95, 0x17, 0xe1, 0xc7, + 0x6b, 0xed, 0x1d, 0xd7, 0xa9, 0x65, 0x6d, 0xba, 0x06, 0x75, 0x4b, 0x74, 0xa7, 0x4e, 0x99, 0x87, + 0x65, 0xc8, 0x30, 0x6a, 0x59, 0x65, 0xa7, 0xbd, 0x58, 0xae, 0x18, 0x13, 0x28, 0x87, 0x7e, 0xff, + 0xb2, 0x94, 0x66, 0xc1, 0xc6, 0x0d, 0x43, 0x36, 0x61, 0xbc, 0x17, 0xcc, 0x6a, 0x8e, 0xcd, 0x28, + 0xbe, 0x02, 0xd0, 0x41, 0x73, 0x68, 0x7a, 0x56, 0x51, 0x62, 0x78, 0xa1, 0x74, 0x62, 0xa5, 0xc2, + 0x54, 0xf2, 0xad, 0xde, 0x44, 0x2c, 0xa0, 0x79, 0x01, 0xa0, 0xa3, 0x49, 0x24, 0x9a, 0x56, 0x7c, + 0x03, 0x94, 0xb6, 0x01, 0x8a, 0x7f, 0x1a, 0x41, 0xf8, 0xab, 0xc4, 0xa4, 0x02, 0x5b, 0x8a, 0x20, + 0xe5, 0x47, 0x08, 0x7e, 0xea, 0x4b, 0x21, 0xc4, 0x6c, 0x42, 0xba, 0x23, 0x86, 0x4d, 0xa0, 0xdc, + 0x17, 0x09, 0xd4, 0x40, 0xa8, 0x86, 0xe1, 0xf5, 0x2e, 0xd2, 0xa3, 0x9c, 0xf4, 0xcc, 0x47, 0x49, + 0xfb, 0x6c, 0xba, 0x58, 0xdf, 0x45, 0x20, 0xf7, 0xb0, 0x2e, 0x36, 0x8a, 0xc4, 0xd3, 0xb7, 0x56, + 0xa9, 0xed, 0x54, 0x03, 0x93, 0x26, 0x21, 0xad, 0xb5, 0x17, 0xcb, 0x46, 0x7b, 0x95, 0xbb, 0x94, + 0x2a, 0x81, 0x16, 0xee, 0xeb, 0x71, 0x71, 0x34, 0xb1, 0x8b, 0x87, 0x08, 0xa6, 0x4e, 0xe5, 0x73, + 0xee, 0x1d, 0xbd, 0x83, 0x60, 0xb2, 0x4f, 0xc1, 0x8a, 0x61, 0xb8, 0x94, 0x85, 0x77, 0x6e, 0x02, + 0xbe, 0x21, 0xfe, 0x8a, 0xb0, 0x32, 0xf8, 0x39, 0x34, 0x1f, 0x9f, 0x22, 0xc8, 0x9d, 0xcc, 0xe2, + 0xdc, 0x9b, 0x38, 0x07, 0x3f, 0x70, 0xf6, 0xc5, 0x7a, 0xa3, 0xab, 0xa6, 0xe4, 0xe0, 0x5b, 0xad, + 0xde, 0xe8, 0x2d, 0x29, 0xa0, 0x89, 0x6d, 0x1b, 0x86, 0xac, 0x8b, 0x72, 0xd4, 0x41, 0x0a, 0xb1, + 0x97, 0x20, 0x15, 0x42, 0xc5, 0x33, 0xcf, 0xc7, 0x92, 0x1a, 0x46, 0x1a, 0x0b, 0xd2, 0xc8, 0xe5, + 0x9e, 0x24, 0x43, 0x2f, 0x26, 0x0f, 0x90, 0xa8, 0x57, 0x91, 0x0c, 0x42, 0xc7, 0x65, 0x80, 0x50, + 0x47, 0x70, 0x66, 0x9f, 0x28, 0x24, 0x15, 0x08, 0x19, 0xe2, 0x89, 0x1d, 0x20, 0xc8, 0x76, 0x33, + 0xfe, 0x0c, 0xb7, 0xfe, 0x49, 0xf0, 0xf6, 0x06, 0x91, 0x38, 0xdf, 0xfe, 0xe9, 0xf0, 0x33, 0x67, + 0xbe, 0x62, 0x59, 0xce, 0x1e, 0x35, 0x78, 0xb5, 0x1b, 0xfa, 0xb5, 0x3a, 0x44, 0x20, 0x0d, 0xca, + 0x22, 0xac, 0xb9, 0x01, 0xdf, 0x11, 0xff, 0x1f, 0x7e, 0x9d, 0x0f, 0xec, 0x29, 0xc4, 0xb2, 0x27, + 0x1a, 0xb3, 0x94, 0x21, 0xd1, 0x0c, 0x43, 0xb3, 0x69, 0xf6, 0x20, 0x03, 0x5f, 0x71, 0x05, 0xf8, + 0x05, 0x82, 0x54, 0x58, 0x85, 0xf0, 0x42, 0x2c, 0x8a, 0x03, 0x07, 0x15, 0x69, 0x31, 0x11, 0xd6, + 0x27, 0x27, 0xff, 0x77, 0xf0, 0xea, 0xdd, 0xfd, 0xd1, 0x05, 0x3c, 0xd7, 0x37, 0x64, 0xed, 0x16, + 0x88, 0x55, 0xdb, 0x6a, 0x4f, 0x56, 0xd4, 0xb2, 0xf2, 0xfe, 0x7d, 0x53, 0x2b, 0x86, 0xba, 0xdf, + 0x35, 0x15, 0x35, 0xf1, 0x63, 0x04, 0xd0, 0xa9, 0xd2, 0x38, 0x09, 0x9b, 0xe0, 0xa2, 0x48, 0xff, + 0x26, 0x03, 0x0b, 0x2d, 0x79, 0xae, 0x65, 0x06, 0xff, 0x16, 0x4b, 0x0b, 0x7e, 0x8f, 0x60, 0x7c, + 0x70, 0x9b, 0xc6, 0xeb, 0x49, 0x78, 0x0c, 0x18, 0x3c, 0xa4, 0x8b, 0x67, 0x0f, 0x24, 0xc4, 0xad, + 0x73, 0x71, 0x2b, 0x78, 0x39, 0xde, 0x41, 0xf1, 0xd9, 0x26, 0xcf, 0x9f, 0x81, 0xba, 0x1f, 0x99, + 0x7d, 0x9a, 0xb8, 0x85, 0xe0, 0xfb, 0x01, 0x5d, 0x15, 0xaf, 0x26, 0xa3, 0xda, 0x5d, 0x24, 0xa5, + 0xb5, 0x33, 0x46, 0x11, 0x6a, 0x97, 0xb9, 0xda, 0x79, 0xfc, 0x4f, 0x3c, 0xb5, 0xa2, 0x10, 0xab, + 0xfb, 0xe2, 0x8f, 0x26, 0x7e, 0x8e, 0x60, 0x2c, 0x28, 0x78, 0x78, 0x3e, 0x3e, 0xa9, 0x9e, 0x8e, + 0x2d, 0x2d, 0x24, 0x81, 0x0a, 0x11, 0x4b, 0x5c, 0xc4, 0x1c, 0xfe, 0xfb, 0x64, 0x11, 0x5a, 0xbd, + 0x11, 0x7d, 0x5a, 0xd1, 0xe1, 0xa0, 0x89, 0x1f, 0x22, 0x48, 0x85, 0x9d, 0x00, 0x27, 0x60, 0xc2, + 0x12, 0x94, 0x88, 0xbe, 0x8e, 0x2d, 0xff, 0xc9, 0x65, 0x4c, 0xe3, 0x5f, 0xe3, 0xc8, 0xc0, 0x6f, + 0x10, 0xe0, 0xfe, 0xf6, 0x85, 0xff, 0x4f, 0xc0, 0xa0, 0xef, 0x72, 0xad, 0x9e, 0x2d, 0x48, 0xa2, + 0x63, 0xe9, 0xbf, 0x5a, 0xcf, 0x10, 0x64, 0xba, 0x1a, 0x10, 0x5e, 0x8a, 0xcf, 0x6b, 0x50, 0x7f, + 0x94, 0x96, 0x13, 0xe3, 0xe3, 0x1f, 0x11, 0x61, 0xdb, 0x7e, 0x39, 0x60, 0xc5, 0xf2, 0xcb, 0xe3, + 0x2c, 0x3a, 0x3a, 0xce, 0xa2, 0xb7, 0xc7, 0x59, 0x74, 0xaf, 0x95, 0x1d, 0x39, 0x6a, 0x65, 0x47, + 0x5e, 0xb7, 0xb2, 0x23, 0x37, 0xd7, 0xcc, 0x8a, 0xb7, 0x55, 0xd7, 0x14, 0xdd, 0xa9, 0xfa, 0x91, + 0xf2, 0x36, 0xf5, 0xf6, 0x1c, 0x77, 0x5b, 0xfc, 0xb2, 0xa8, 0x61, 0x52, 0x57, 0xbd, 0x7d, 0xfa, + 0xb7, 0xb8, 0xf6, 0x35, 0xff, 0xb4, 0xfe, 0xeb, 0x43, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0xd8, + 0x19, 0x4f, 0x2d, 0x10, 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 { + // SellOrder queries a sell order by its ID + SellOrder(ctx context.Context, in *QuerySellOrderRequest, opts ...grpc.CallOption) (*QuerySellOrderResponse, error) + // SellOrders queries a paginated list of all sell orders + SellOrders(ctx context.Context, in *QuerySellOrdersRequest, opts ...grpc.CallOption) (*QuerySellOrdersResponse, error) + // SellOrdersByDenom queries a paginated list of all sell orders of a specific ecocredit denom + SellOrdersByBatchDenom(ctx context.Context, in *QuerySellOrdersByBatchDenomRequest, opts ...grpc.CallOption) (*QuerySellOrdersByBatchDenomResponse, error) + // SellOrdersByAddress queries a paginated list of all sell orders from a specific address + SellOrdersByAddress(ctx context.Context, in *QuerySellOrdersByAddressRequest, opts ...grpc.CallOption) (*QuerySellOrdersByAddressResponse, error) + // BuyOrder queries a buy order by its id + BuyOrder(ctx context.Context, in *QueryBuyOrderRequest, opts ...grpc.CallOption) (*QueryBuyOrderResponse, error) + // BuyOrders queries a paginated list of all buy orders + BuyOrders(ctx context.Context, in *QueryBuyOrdersRequest, opts ...grpc.CallOption) (*QueryBuyOrdersResponse, error) + // BuyOrdersByAddress queries a paginated list of buy orders by creator address + BuyOrdersByAddress(ctx context.Context, in *QueryBuyOrdersByAddressRequest, opts ...grpc.CallOption) (*QueryBuyOrdersByAddressResponse, error) + // AllowedDenoms queries all denoms allowed to be set in the AskPrice of a sell order + AllowedDenoms(ctx context.Context, in *QueryAllowedDenomsRequest, opts ...grpc.CallOption) (*QueryAllowedDenomsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) SellOrder(ctx context.Context, in *QuerySellOrderRequest, opts ...grpc.CallOption) (*QuerySellOrderResponse, error) { + out := new(QuerySellOrderResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/SellOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SellOrders(ctx context.Context, in *QuerySellOrdersRequest, opts ...grpc.CallOption) (*QuerySellOrdersResponse, error) { + out := new(QuerySellOrdersResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/SellOrders", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SellOrdersByBatchDenom(ctx context.Context, in *QuerySellOrdersByBatchDenomRequest, opts ...grpc.CallOption) (*QuerySellOrdersByBatchDenomResponse, error) { + out := new(QuerySellOrdersByBatchDenomResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/SellOrdersByBatchDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SellOrdersByAddress(ctx context.Context, in *QuerySellOrdersByAddressRequest, opts ...grpc.CallOption) (*QuerySellOrdersByAddressResponse, error) { + out := new(QuerySellOrdersByAddressResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/SellOrdersByAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BuyOrder(ctx context.Context, in *QueryBuyOrderRequest, opts ...grpc.CallOption) (*QueryBuyOrderResponse, error) { + out := new(QueryBuyOrderResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrder", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BuyOrders(ctx context.Context, in *QueryBuyOrdersRequest, opts ...grpc.CallOption) (*QueryBuyOrdersResponse, error) { + out := new(QueryBuyOrdersResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrders", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BuyOrdersByAddress(ctx context.Context, in *QueryBuyOrdersByAddressRequest, opts ...grpc.CallOption) (*QueryBuyOrdersByAddressResponse, error) { + out := new(QueryBuyOrdersByAddressResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrdersByAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllowedDenoms(ctx context.Context, in *QueryAllowedDenomsRequest, opts ...grpc.CallOption) (*QueryAllowedDenomsResponse, error) { + out := new(QueryAllowedDenomsResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Query/AllowedDenoms", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // SellOrder queries a sell order by its ID + SellOrder(context.Context, *QuerySellOrderRequest) (*QuerySellOrderResponse, error) + // SellOrders queries a paginated list of all sell orders + SellOrders(context.Context, *QuerySellOrdersRequest) (*QuerySellOrdersResponse, error) + // SellOrdersByDenom queries a paginated list of all sell orders of a specific ecocredit denom + SellOrdersByBatchDenom(context.Context, *QuerySellOrdersByBatchDenomRequest) (*QuerySellOrdersByBatchDenomResponse, error) + // SellOrdersByAddress queries a paginated list of all sell orders from a specific address + SellOrdersByAddress(context.Context, *QuerySellOrdersByAddressRequest) (*QuerySellOrdersByAddressResponse, error) + // BuyOrder queries a buy order by its id + BuyOrder(context.Context, *QueryBuyOrderRequest) (*QueryBuyOrderResponse, error) + // BuyOrders queries a paginated list of all buy orders + BuyOrders(context.Context, *QueryBuyOrdersRequest) (*QueryBuyOrdersResponse, error) + // BuyOrdersByAddress queries a paginated list of buy orders by creator address + BuyOrdersByAddress(context.Context, *QueryBuyOrdersByAddressRequest) (*QueryBuyOrdersByAddressResponse, error) + // AllowedDenoms queries all denoms allowed to be set in the AskPrice of a sell order + AllowedDenoms(context.Context, *QueryAllowedDenomsRequest) (*QueryAllowedDenomsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) SellOrder(ctx context.Context, req *QuerySellOrderRequest) (*QuerySellOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SellOrder not implemented") +} +func (*UnimplementedQueryServer) SellOrders(ctx context.Context, req *QuerySellOrdersRequest) (*QuerySellOrdersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SellOrders not implemented") +} +func (*UnimplementedQueryServer) SellOrdersByBatchDenom(ctx context.Context, req *QuerySellOrdersByBatchDenomRequest) (*QuerySellOrdersByBatchDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SellOrdersByBatchDenom not implemented") +} +func (*UnimplementedQueryServer) SellOrdersByAddress(ctx context.Context, req *QuerySellOrdersByAddressRequest) (*QuerySellOrdersByAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SellOrdersByAddress not implemented") +} +func (*UnimplementedQueryServer) BuyOrder(ctx context.Context, req *QueryBuyOrderRequest) (*QueryBuyOrderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyOrder not implemented") +} +func (*UnimplementedQueryServer) BuyOrders(ctx context.Context, req *QueryBuyOrdersRequest) (*QueryBuyOrdersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyOrders not implemented") +} +func (*UnimplementedQueryServer) BuyOrdersByAddress(ctx context.Context, req *QueryBuyOrdersByAddressRequest) (*QueryBuyOrdersByAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BuyOrdersByAddress not implemented") +} +func (*UnimplementedQueryServer) AllowedDenoms(ctx context.Context, req *QueryAllowedDenomsRequest) (*QueryAllowedDenomsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowedDenoms not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_SellOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySellOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SellOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/SellOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SellOrder(ctx, req.(*QuerySellOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SellOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySellOrdersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SellOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/SellOrders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SellOrders(ctx, req.(*QuerySellOrdersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SellOrdersByBatchDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySellOrdersByBatchDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SellOrdersByBatchDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/SellOrdersByBatchDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SellOrdersByBatchDenom(ctx, req.(*QuerySellOrdersByBatchDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SellOrdersByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySellOrdersByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SellOrdersByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/SellOrdersByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SellOrdersByAddress(ctx, req.(*QuerySellOrdersByAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BuyOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBuyOrderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuyOrder(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrder", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuyOrder(ctx, req.(*QueryBuyOrderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BuyOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBuyOrdersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuyOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuyOrders(ctx, req.(*QueryBuyOrdersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BuyOrdersByAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBuyOrdersByAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BuyOrdersByAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/BuyOrdersByAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BuyOrdersByAddress(ctx, req.(*QueryBuyOrdersByAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllowedDenoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllowedDenomsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllowedDenoms(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Query/AllowedDenoms", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllowedDenoms(ctx, req.(*QueryAllowedDenomsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.marketplace.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SellOrder", + Handler: _Query_SellOrder_Handler, + }, + { + MethodName: "SellOrders", + Handler: _Query_SellOrders_Handler, + }, + { + MethodName: "SellOrdersByBatchDenom", + Handler: _Query_SellOrdersByBatchDenom_Handler, + }, + { + MethodName: "SellOrdersByAddress", + Handler: _Query_SellOrdersByAddress_Handler, + }, + { + MethodName: "BuyOrder", + Handler: _Query_BuyOrder_Handler, + }, + { + MethodName: "BuyOrders", + Handler: _Query_BuyOrders_Handler, + }, + { + MethodName: "BuyOrdersByAddress", + Handler: _Query_BuyOrdersByAddress_Handler, + }, + { + MethodName: "AllowedDenoms", + Handler: _Query_AllowedDenoms_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/marketplace/v1beta1/query.proto", +} + +func (m *QuerySellOrderRequest) 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 *QuerySellOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SellOrderId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrderResponse) 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 *QuerySellOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SellOrder != nil { + { + size, err := m.SellOrder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersRequest) 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 *QuerySellOrdersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersResponse) 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 *QuerySellOrdersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SellOrders) > 0 { + for iNdEx := len(m.SellOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SellOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersByBatchDenomRequest) 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 *QuerySellOrdersByBatchDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersByBatchDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersByBatchDenomResponse) 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 *QuerySellOrdersByBatchDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersByBatchDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SellOrders) > 0 { + for iNdEx := len(m.SellOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SellOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersByAddressRequest) 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 *QuerySellOrdersByAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySellOrdersByAddressResponse) 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 *QuerySellOrdersByAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySellOrdersByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SellOrders) > 0 { + for iNdEx := len(m.SellOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SellOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrderRequest) 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 *QueryBuyOrderRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrderRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BuyOrderId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BuyOrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrderResponse) 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 *QueryBuyOrderResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BuyOrder != nil { + { + size, err := m.BuyOrder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrdersRequest) 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 *QueryBuyOrdersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrdersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrdersResponse) 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 *QueryBuyOrdersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.BuyOrders) > 0 { + for iNdEx := len(m.BuyOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BuyOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrdersByAddressRequest) 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 *QueryBuyOrdersByAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrdersByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBuyOrdersByAddressResponse) 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 *QueryBuyOrdersByAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBuyOrdersByAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.BuyOrders) > 0 { + for iNdEx := len(m.BuyOrders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BuyOrders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAllowedDenomsRequest) 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 *QueryAllowedDenomsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowedDenomsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllowedDenomsResponse) 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 *QueryAllowedDenomsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowedDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.AllowedDenoms) > 0 { + for iNdEx := len(m.AllowedDenoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedDenoms[iNdEx].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 *QuerySellOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SellOrderId != 0 { + n += 1 + sovQuery(uint64(m.SellOrderId)) + } + return n +} + +func (m *QuerySellOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SellOrder != nil { + l = m.SellOrder.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SellOrders) > 0 { + for _, e := range m.SellOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersByBatchDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersByBatchDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SellOrders) > 0 { + for _, e := range m.SellOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySellOrdersByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SellOrders) > 0 { + for _, e := range m.SellOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuyOrderRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BuyOrderId != 0 { + n += 1 + sovQuery(uint64(m.BuyOrderId)) + } + return n +} + +func (m *QueryBuyOrderResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BuyOrder != nil { + l = m.BuyOrder.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuyOrdersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuyOrdersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BuyOrders) > 0 { + for _, e := range m.BuyOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuyOrdersByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBuyOrdersByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BuyOrders) > 0 { + for _, e := range m.BuyOrders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowedDenomsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowedDenomsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedDenoms) > 0 { + for _, e := range m.AllowedDenoms { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QuerySellOrderRequest) 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: QuerySellOrderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + m.SellOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SellOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrderResponse) 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: QuerySellOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrder", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SellOrder == nil { + m.SellOrder = &SellOrder{} + } + if err := m.SellOrder.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 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersRequest) 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: QuerySellOrdersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersResponse) 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: QuerySellOrdersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrders", 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 + } + m.SellOrders = append(m.SellOrders, &SellOrder{}) + if err := m.SellOrders[len(m.SellOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersByBatchDenomRequest) 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: QuerySellOrdersByBatchDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersByBatchDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersByBatchDenomResponse) 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: QuerySellOrdersByBatchDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersByBatchDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrders", 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 + } + m.SellOrders = append(m.SellOrders, &SellOrder{}) + if err := m.SellOrders[len(m.SellOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersByAddressRequest) 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: QuerySellOrdersByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySellOrdersByAddressResponse) 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: QuerySellOrdersByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySellOrdersByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrders", 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 + } + m.SellOrders = append(m.SellOrders, &SellOrder{}) + if err := m.SellOrders[len(m.SellOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrderRequest) 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: QueryBuyOrderRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrderRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrderId", wireType) + } + m.BuyOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BuyOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrderResponse) 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: QueryBuyOrderResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrderResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrder", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BuyOrder == nil { + m.BuyOrder = &BuyOrder{} + } + if err := m.BuyOrder.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 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrdersRequest) 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: QueryBuyOrdersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrdersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrdersResponse) 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: QueryBuyOrdersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrdersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrders", 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 + } + m.BuyOrders = append(m.BuyOrders, &BuyOrder{}) + if err := m.BuyOrders[len(m.BuyOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrdersByAddressRequest) 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: QueryBuyOrdersByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrdersByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBuyOrdersByAddressResponse) 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: QueryBuyOrdersByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBuyOrdersByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrders", 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 + } + m.BuyOrders = append(m.BuyOrders, &BuyOrder{}) + if err := m.BuyOrders[len(m.BuyOrders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowedDenomsRequest) 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: QueryAllowedDenomsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowedDenomsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowedDenomsResponse) 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: QueryAllowedDenomsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowedDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedDenoms", 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 + } + m.AllowedDenoms = append(m.AllowedDenoms, &AllowedDenom{}) + if err := m.AllowedDenoms[len(m.AllowedDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (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/ecocredit/marketplace/v1beta1/query.pb.gw.go b/x/ecocredit/marketplace/v1beta1/query.pb.gw.go new file mode 100644 index 0000000000..09f8d09dd1 --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/query.pb.gw.go @@ -0,0 +1,896 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/query.proto + +/* +Package v1beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1beta1 + +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_SellOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["sell_order_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sell_order_id") + } + + protoReq.SellOrderId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sell_order_id", err) + } + + msg, err := client.SellOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SellOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["sell_order_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sell_order_id") + } + + protoReq.SellOrderId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sell_order_id", err) + } + + msg, err := server.SellOrder(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SellOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SellOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SellOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SellOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SellOrders(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SellOrdersByBatchDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{"batch_denom": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_SellOrdersByBatchDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersByBatchDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["batch_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_denom") + } + + protoReq.BatchDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrdersByBatchDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SellOrdersByBatchDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SellOrdersByBatchDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersByBatchDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["batch_denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "batch_denom") + } + + protoReq.BatchDenom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "batch_denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrdersByBatchDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SellOrdersByBatchDenom(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SellOrdersByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_SellOrdersByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrdersByAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SellOrdersByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SellOrdersByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySellOrdersByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SellOrdersByAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SellOrdersByAddress(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_BuyOrder_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["buy_order_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "buy_order_id") + } + + protoReq.BuyOrderId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "buy_order_id", err) + } + + msg, err := client.BuyOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BuyOrder_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["buy_order_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "buy_order_id") + } + + protoReq.BuyOrderId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "buy_order_id", err) + } + + msg, err := server.BuyOrder(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_BuyOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_BuyOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuyOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BuyOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BuyOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrdersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuyOrders_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BuyOrders(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_BuyOrdersByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_BuyOrdersByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrdersByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuyOrdersByAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BuyOrdersByAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BuyOrdersByAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBuyOrdersByAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_BuyOrdersByAddress_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BuyOrdersByAddress(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllowedDenoms_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllowedDenoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowedDenomsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowedDenoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllowedDenoms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllowedDenoms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowedDenomsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowedDenoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllowedDenoms(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_SellOrder_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_SellOrder_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_SellOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrders_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_SellOrders_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_SellOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrdersByBatchDenom_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_SellOrdersByBatchDenom_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_SellOrdersByBatchDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrdersByAddress_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_SellOrdersByAddress_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_SellOrdersByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrder_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_BuyOrder_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_BuyOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrders_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_BuyOrders_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_BuyOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrdersByAddress_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_BuyOrdersByAddress_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_BuyOrdersByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllowedDenoms_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_AllowedDenoms_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_AllowedDenoms_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_SellOrder_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_SellOrder_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_SellOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrders_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_SellOrders_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_SellOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrdersByBatchDenom_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_SellOrdersByBatchDenom_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_SellOrdersByBatchDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SellOrdersByAddress_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_SellOrdersByAddress_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_SellOrdersByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrder_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_BuyOrder_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_BuyOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrders_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_BuyOrders_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_BuyOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_BuyOrdersByAddress_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_BuyOrdersByAddress_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_BuyOrdersByAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllowedDenoms_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_AllowedDenoms_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_AllowedDenoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_SellOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"regen", "ecocredit", "v1alpha1", "sell-orders", "id", "sell_order_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SellOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"regen", "ecocredit", "v1alpha1", "sell-orders"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SellOrdersByBatchDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"regen", "ecocredit", "v1alpha1", "sell-orders", "batch-denom", "batch_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SellOrdersByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"regen", "ecocredit", "v1alpha1", "sell-orders", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BuyOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"regen", "ecocredit", "v1alpha1", "buy-orders", "id", "buy_order_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BuyOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"regen", "ecocredit", "v1alpha1", "buy-orders"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BuyOrdersByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"regen", "ecocredit", "v1alpha1", "buy-orders", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllowedDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"regen", "ecocredit", "v1alpha1", "ask-denoms"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_SellOrder_0 = runtime.ForwardResponseMessage + + forward_Query_SellOrders_0 = runtime.ForwardResponseMessage + + forward_Query_SellOrdersByBatchDenom_0 = runtime.ForwardResponseMessage + + forward_Query_SellOrdersByAddress_0 = runtime.ForwardResponseMessage + + forward_Query_BuyOrder_0 = runtime.ForwardResponseMessage + + forward_Query_BuyOrders_0 = runtime.ForwardResponseMessage + + forward_Query_BuyOrdersByAddress_0 = runtime.ForwardResponseMessage + + forward_Query_AllowedDenoms_0 = runtime.ForwardResponseMessage +) diff --git a/x/ecocredit/marketplace/v1beta1/state.pb.go b/x/ecocredit/marketplace/v1beta1/state.pb.go new file mode 100644 index 0000000000..789d5474e5 --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/state.pb.go @@ -0,0 +1,2232 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/state.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/api/cosmos/orm/v1alpha1" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + 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 + +// SellOrder represents the information for a sell order. +type SellOrder struct { + // id is the unique ID of sell order. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // seller is the bytes address of the owner of the credits being sold. + Seller []byte `protobuf:"bytes,2,opt,name=seller,proto3" json:"seller,omitempty"` + // batch_id is ID of the credit batch being sold. + BatchId uint64 `protobuf:"varint,3,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"` + // quantity is the decimal quantity of credits being sold. + Quantity string `protobuf:"bytes,4,opt,name=quantity,proto3" json:"quantity,omitempty"` + // market_id is the market in which this sell order exists and specifies + // the bank_denom that ask_price corresponds to. + MarketId uint64 `protobuf:"varint,5,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // ask_price is the integer price (encoded as a string) the seller is asking + // for each unit of the batch_denom. Each credit unit of the batch will be + // sold for at least the ask_price or more. + AskPrice string `protobuf:"bytes,6,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"` + // disable_auto_retire disables auto-retirement of credits which allows a + // buyer to disable auto-retirement in their buy order enabling them to + // resell the credits to another buyer. + DisableAutoRetire bool `protobuf:"varint,7,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is an optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *types.Timestamp `protobuf:"bytes,9,opt,name=expiration,proto3" json:"expiration,omitempty"` + // maker indicates that this is a maker order, meaning that when it hit + // the order book, there were no matching buy orders. + Maker bool `protobuf:"varint,10,opt,name=maker,proto3" json:"maker,omitempty"` +} + +func (m *SellOrder) Reset() { *m = SellOrder{} } +func (m *SellOrder) String() string { return proto.CompactTextString(m) } +func (*SellOrder) ProtoMessage() {} +func (*SellOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_eb96826ffd3cfdd5, []int{0} +} +func (m *SellOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SellOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SellOrder.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 *SellOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_SellOrder.Merge(m, src) +} +func (m *SellOrder) XXX_Size() int { + return m.Size() +} +func (m *SellOrder) XXX_DiscardUnknown() { + xxx_messageInfo_SellOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_SellOrder proto.InternalMessageInfo + +func (m *SellOrder) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *SellOrder) GetSeller() []byte { + if m != nil { + return m.Seller + } + return nil +} + +func (m *SellOrder) GetBatchId() uint64 { + if m != nil { + return m.BatchId + } + return 0 +} + +func (m *SellOrder) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *SellOrder) GetMarketId() uint64 { + if m != nil { + return m.MarketId + } + return 0 +} + +func (m *SellOrder) GetAskPrice() string { + if m != nil { + return m.AskPrice + } + return "" +} + +func (m *SellOrder) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *SellOrder) GetExpiration() *types.Timestamp { + if m != nil { + return m.Expiration + } + return nil +} + +func (m *SellOrder) GetMaker() bool { + if m != nil { + return m.Maker + } + return false +} + +// BuyOrder represents the information for a buy order. +type BuyOrder struct { + // id is the unique ID of buy order. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // buyer is the bytes address of the account that created the buy order + Buyer []byte `protobuf:"bytes,2,opt,name=buyer,proto3" json:"buyer,omitempty"` + // selection is the buy order selection. + Selection *BuyOrder_Selection `protobuf:"bytes,3,opt,name=selection,proto3" json:"selection,omitempty"` + // quantity is the decimal quantity of credits to buy. If the quantity of credits + // available is less than this amount the order will be partially filled + // unless disable_partial_fill is true. + Quantity string `protobuf:"bytes,4,opt,name=quantity,proto3" json:"quantity,omitempty"` + // market_id is the market in which this sell order exists and specifies + // the bank_denom that ask_price corresponds to. + MarketId uint64 `protobuf:"varint,5,opt,name=market_id,json=marketId,proto3" json:"market_id,omitempty"` + // bid price is the integer bid price for this buy order. A credit unit will be + // settled at a purchase price that is no more than the bid price. The + // buy order will fail if the buyer does not have enough funds available + // to complete the purchase. + BidPrice string `protobuf:"bytes,6,opt,name=bid_price,json=bidPrice,proto3" json:"bid_price,omitempty"` + // disable_auto_retire allows auto-retirement to be disabled. If it is set to true + // the credits will not auto-retire and can be resold assuming that the + // corresponding sell order has auto-retirement disabled. If the sell order + // hasn't disabled auto-retirement and the buy order tries to disable it, + // that buy order will fail. + DisableAutoRetire bool `protobuf:"varint,7,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // disable_partial_fill disables the default behavior of partially filling + // buy orders if the requested quantity is not available. + DisablePartialFill bool `protobuf:"varint,8,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *types.Timestamp `protobuf:"bytes,9,opt,name=expiration,proto3" json:"expiration,omitempty"` + // maker indicates that this is a maker order, meaning that when it hit + // the order book, there were no matching sell orders. + Maker bool `protobuf:"varint,10,opt,name=maker,proto3" json:"maker,omitempty"` +} + +func (m *BuyOrder) Reset() { *m = BuyOrder{} } +func (m *BuyOrder) String() string { return proto.CompactTextString(m) } +func (*BuyOrder) ProtoMessage() {} +func (*BuyOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_eb96826ffd3cfdd5, []int{1} +} +func (m *BuyOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BuyOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BuyOrder.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 *BuyOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuyOrder.Merge(m, src) +} +func (m *BuyOrder) XXX_Size() int { + return m.Size() +} +func (m *BuyOrder) XXX_DiscardUnknown() { + xxx_messageInfo_BuyOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_BuyOrder proto.InternalMessageInfo + +func (m *BuyOrder) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *BuyOrder) GetBuyer() []byte { + if m != nil { + return m.Buyer + } + return nil +} + +func (m *BuyOrder) GetSelection() *BuyOrder_Selection { + if m != nil { + return m.Selection + } + return nil +} + +func (m *BuyOrder) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *BuyOrder) GetMarketId() uint64 { + if m != nil { + return m.MarketId + } + return 0 +} + +func (m *BuyOrder) GetBidPrice() string { + if m != nil { + return m.BidPrice + } + return "" +} + +func (m *BuyOrder) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *BuyOrder) GetDisablePartialFill() bool { + if m != nil { + return m.DisablePartialFill + } + return false +} + +func (m *BuyOrder) GetExpiration() *types.Timestamp { + if m != nil { + return m.Expiration + } + return nil +} + +func (m *BuyOrder) GetMaker() bool { + if m != nil { + return m.Maker + } + return false +} + +// Selection defines a buy order selection. +type BuyOrder_Selection struct { + // sum defines the type of selection. + // + // Types that are valid to be assigned to Sum: + // *BuyOrder_Selection_SellOrderId + // *BuyOrder_Selection_Filter + Sum isBuyOrder_Selection_Sum `protobuf_oneof:"sum"` +} + +func (m *BuyOrder_Selection) Reset() { *m = BuyOrder_Selection{} } +func (m *BuyOrder_Selection) String() string { return proto.CompactTextString(m) } +func (*BuyOrder_Selection) ProtoMessage() {} +func (*BuyOrder_Selection) Descriptor() ([]byte, []int) { + return fileDescriptor_eb96826ffd3cfdd5, []int{1, 0} +} +func (m *BuyOrder_Selection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BuyOrder_Selection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BuyOrder_Selection.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 *BuyOrder_Selection) XXX_Merge(src proto.Message) { + xxx_messageInfo_BuyOrder_Selection.Merge(m, src) +} +func (m *BuyOrder_Selection) XXX_Size() int { + return m.Size() +} +func (m *BuyOrder_Selection) XXX_DiscardUnknown() { + xxx_messageInfo_BuyOrder_Selection.DiscardUnknown(m) +} + +var xxx_messageInfo_BuyOrder_Selection proto.InternalMessageInfo + +type isBuyOrder_Selection_Sum interface { + isBuyOrder_Selection_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type BuyOrder_Selection_SellOrderId struct { + SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3,oneof" json:"sell_order_id,omitempty"` +} +type BuyOrder_Selection_Filter struct { + Filter *Filter `protobuf:"bytes,2,opt,name=filter,proto3,oneof" json:"filter,omitempty"` +} + +func (*BuyOrder_Selection_SellOrderId) isBuyOrder_Selection_Sum() {} +func (*BuyOrder_Selection_Filter) isBuyOrder_Selection_Sum() {} + +func (m *BuyOrder_Selection) GetSum() isBuyOrder_Selection_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *BuyOrder_Selection) GetSellOrderId() uint64 { + if x, ok := m.GetSum().(*BuyOrder_Selection_SellOrderId); ok { + return x.SellOrderId + } + return 0 +} + +func (m *BuyOrder_Selection) GetFilter() *Filter { + if x, ok := m.GetSum().(*BuyOrder_Selection_Filter); ok { + return x.Filter + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*BuyOrder_Selection) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*BuyOrder_Selection_SellOrderId)(nil), + (*BuyOrder_Selection_Filter)(nil), + } +} + +// AllowedDenom represents the information for an allowed ask/bid denom. +type AllowedDenom struct { + // denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS) + BankDenom string `protobuf:"bytes,1,opt,name=bank_denom,json=bankDenom,proto3" json:"bank_denom,omitempty"` + // display_denom is the denom to display to the user and is informational. + // Because the denom is likely an IBC denom, this should be chosen by + // governance to represent the consensus trusted name of the denom. + DisplayDenom string `protobuf:"bytes,2,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"` + // exponent is the exponent that relates the denom to the display_denom and is + // informational + Exponent uint32 `protobuf:"varint,3,opt,name=exponent,proto3" json:"exponent,omitempty"` +} + +func (m *AllowedDenom) Reset() { *m = AllowedDenom{} } +func (m *AllowedDenom) String() string { return proto.CompactTextString(m) } +func (*AllowedDenom) ProtoMessage() {} +func (*AllowedDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_eb96826ffd3cfdd5, []int{2} +} +func (m *AllowedDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllowedDenom.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 *AllowedDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedDenom.Merge(m, src) +} +func (m *AllowedDenom) XXX_Size() int { + return m.Size() +} +func (m *AllowedDenom) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedDenom proto.InternalMessageInfo + +func (m *AllowedDenom) GetBankDenom() string { + if m != nil { + return m.BankDenom + } + return "" +} + +func (m *AllowedDenom) GetDisplayDenom() string { + if m != nil { + return m.DisplayDenom + } + return "" +} + +func (m *AllowedDenom) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +// Market describes a distinctly processed market between a credit type and +// allowed bank denom. Each market has its own precision in the order book +// and is processed independently of other markets. Governance must enable +// markets one by one. Every additional enabled market potentially adds more +// processing overhead to the blockchain and potentially weakens liquidity in +// competing markets. For instance, enabling side by side USD/Carbon and +// EUR/Carbon markets may have the end result that each market individually has +// less liquidity and longer settlement times. Such decisions should be taken +// with care. +type Market struct { + // id is the unique ID of the market. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // credit_type is the abbreviation of the credit type. + CreditType string `protobuf:"bytes,2,opt,name=credit_type,json=creditType,proto3" json:"credit_type,omitempty"` + // bank_denom is an allowed bank denom. + BankDenom string `protobuf:"bytes,3,opt,name=bank_denom,json=bankDenom,proto3" json:"bank_denom,omitempty"` + // precision_modifier is an optional modifier used to convert arbitrary + // precision integer bank amounts to uint32 values used for sorting in the + // order book. Given an arbitrary precision integer x, its uint32 conversion + // will be x / 10^precision_modifier using round half away from zero + // rounding. + // + // uint32 values range from 0 to 4,294,967,295. + // This allows for a full 9 digits of precision. In most real world markets + // this amount of precision is sufficient and most common downside - + // that some orders with very miniscule price differences may be ordered + // equivalently (because of rounding) - is acceptable. + // Note that this rounding will not affect settlement price which will + // always be done exactly. + // + // Given a USD stable coin with 6 decimal digits, a precision_modifier + // of 0 is probably acceptable as long as credits are always less than + // $4,294/unit. With precision down to $0.001 (a precision_modifier of 3 + // in this case), prices can rise up to $4,294,000/unit. Either scenario + // is probably quite acceptable given that carbon prices are unlikely to + // rise above $1000/ton any time in the near future. + // + // If credit prices, exceed the maximum range of uint32 with this + // precision_modifier, orders with high prices will fail and governance + // will need to adjust precision_modifier to allow for higher prices in + // exchange for less precision at the lower end. + PrecisionModifier uint32 `protobuf:"varint,4,opt,name=precision_modifier,json=precisionModifier,proto3" json:"precision_modifier,omitempty"` +} + +func (m *Market) Reset() { *m = Market{} } +func (m *Market) String() string { return proto.CompactTextString(m) } +func (*Market) ProtoMessage() {} +func (*Market) Descriptor() ([]byte, []int) { + return fileDescriptor_eb96826ffd3cfdd5, []int{3} +} +func (m *Market) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Market) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Market.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 *Market) XXX_Merge(src proto.Message) { + xxx_messageInfo_Market.Merge(m, src) +} +func (m *Market) XXX_Size() int { + return m.Size() +} +func (m *Market) XXX_DiscardUnknown() { + xxx_messageInfo_Market.DiscardUnknown(m) +} + +var xxx_messageInfo_Market proto.InternalMessageInfo + +func (m *Market) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Market) GetCreditType() string { + if m != nil { + return m.CreditType + } + return "" +} + +func (m *Market) GetBankDenom() string { + if m != nil { + return m.BankDenom + } + return "" +} + +func (m *Market) GetPrecisionModifier() uint32 { + if m != nil { + return m.PrecisionModifier + } + return 0 +} + +func init() { + proto.RegisterType((*SellOrder)(nil), "regen.ecocredit.marketplace.v1beta1.SellOrder") + proto.RegisterType((*BuyOrder)(nil), "regen.ecocredit.marketplace.v1beta1.BuyOrder") + proto.RegisterType((*BuyOrder_Selection)(nil), "regen.ecocredit.marketplace.v1beta1.BuyOrder.Selection") + proto.RegisterType((*AllowedDenom)(nil), "regen.ecocredit.marketplace.v1beta1.AllowedDenom") + proto.RegisterType((*Market)(nil), "regen.ecocredit.marketplace.v1beta1.Market") +} + +func init() { + proto.RegisterFile("regen/ecocredit/marketplace/v1beta1/state.proto", fileDescriptor_eb96826ffd3cfdd5) +} + +var fileDescriptor_eb96826ffd3cfdd5 = []byte{ + // 751 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0xaf, 0xdb, 0x44, + 0x14, 0xcd, 0x38, 0x1f, 0x8d, 0x27, 0x49, 0x95, 0x4e, 0x9f, 0x2a, 0x13, 0x68, 0x1a, 0xa5, 0x20, + 0x45, 0x2a, 0xb5, 0x49, 0x41, 0x42, 0xca, 0xae, 0x4f, 0xb4, 0xea, 0x5b, 0x54, 0x54, 0x6e, 0xd9, + 0xb0, 0xb1, 0xc6, 0x9e, 0x9b, 0xbc, 0x51, 0xc6, 0x1e, 0x33, 0x1e, 0xb7, 0x2f, 0x2b, 0xfe, 0x01, + 0x62, 0x8f, 0xc4, 0xdf, 0x60, 0xc9, 0x96, 0x65, 0x25, 0x36, 0x2c, 0x51, 0xde, 0x3f, 0xe0, 0x17, + 0x20, 0x8f, 0x3f, 0x5e, 0x08, 0x08, 0x3d, 0x41, 0x97, 0x67, 0xee, 0x3d, 0x73, 0x8f, 0xcf, 0x3d, + 0x1e, 0xec, 0x29, 0xd8, 0x40, 0xe2, 0x41, 0x24, 0x23, 0x05, 0x8c, 0x6b, 0x2f, 0xa6, 0x6a, 0x0b, + 0x3a, 0x15, 0x34, 0x02, 0xef, 0xf5, 0x32, 0x04, 0x4d, 0x97, 0x5e, 0xa6, 0xa9, 0x06, 0x37, 0x55, + 0x52, 0x4b, 0x72, 0xdf, 0x10, 0xdc, 0x86, 0xe0, 0x1e, 0x10, 0xdc, 0x8a, 0x30, 0xb9, 0xb7, 0x91, + 0x72, 0x23, 0xc0, 0x33, 0x94, 0x30, 0x5f, 0x7b, 0x9a, 0xc7, 0x90, 0x69, 0x1a, 0xa7, 0xe5, 0x2d, + 0x93, 0xbb, 0x91, 0xcc, 0x62, 0x99, 0x79, 0x52, 0xc5, 0xde, 0xeb, 0x25, 0x15, 0xe9, 0x39, 0x5d, + 0x16, 0xa0, 0x2a, 0x5f, 0x4b, 0x95, 0xde, 0xa5, 0x90, 0x95, 0x84, 0xf9, 0xde, 0xc2, 0xf6, 0x4b, + 0x10, 0xe2, 0x4b, 0xc5, 0x40, 0x91, 0x9b, 0xd8, 0xe2, 0xcc, 0x41, 0x33, 0xb4, 0xe8, 0xf8, 0x16, + 0x67, 0xe4, 0x0e, 0xee, 0x65, 0x20, 0x04, 0x28, 0xc7, 0x9a, 0xa1, 0xc5, 0xd0, 0xaf, 0x10, 0x79, + 0x0f, 0xf7, 0x43, 0xaa, 0xa3, 0xf3, 0x80, 0x33, 0xa7, 0x6d, 0xba, 0x6f, 0x18, 0x7c, 0xc6, 0xc8, + 0x04, 0xf7, 0xbf, 0xc9, 0x69, 0xa2, 0xb9, 0xde, 0x39, 0x9d, 0x19, 0x5a, 0xd8, 0x7e, 0x83, 0xc9, + 0xfb, 0xd8, 0x2e, 0xf5, 0x14, 0xbc, 0xae, 0xe1, 0xf5, 0xcb, 0x83, 0x33, 0x56, 0x14, 0x69, 0xb6, + 0x0d, 0x52, 0xc5, 0x23, 0x70, 0x7a, 0x25, 0x93, 0x66, 0xdb, 0x17, 0x05, 0x26, 0x2e, 0xbe, 0xcd, + 0x78, 0x46, 0x43, 0x01, 0x01, 0xcd, 0xb5, 0x0c, 0x14, 0x68, 0xae, 0xc0, 0xb9, 0x31, 0x43, 0x8b, + 0xbe, 0x7f, 0xab, 0x2a, 0x3d, 0xce, 0xb5, 0xf4, 0x4d, 0x81, 0xac, 0x30, 0x86, 0x8b, 0x94, 0x2b, + 0xaa, 0xb9, 0x4c, 0x1c, 0x7b, 0x86, 0x16, 0x83, 0x47, 0x13, 0xb7, 0x34, 0xd7, 0xad, 0xcd, 0x75, + 0x5f, 0xd5, 0xe6, 0xfa, 0x07, 0xdd, 0xe4, 0x04, 0x77, 0x63, 0xba, 0x05, 0xe5, 0x60, 0x73, 0x7b, + 0x09, 0x56, 0xab, 0x3f, 0x7e, 0xfc, 0xf5, 0xbb, 0xf6, 0x67, 0xb8, 0x57, 0x58, 0x34, 0x46, 0x64, + 0x78, 0x65, 0xc1, 0x18, 0x11, 0x5c, 0x1b, 0x35, 0xb6, 0xc8, 0xcd, 0xc3, 0xd9, 0xe3, 0xb6, 0x83, + 0xe6, 0x3f, 0x77, 0x70, 0xff, 0x34, 0xdf, 0xfd, 0xb3, 0xc7, 0x27, 0xb8, 0x1b, 0xe6, 0xbb, 0xc6, + 0xe2, 0x12, 0x90, 0xaf, 0xb0, 0x9d, 0x81, 0x80, 0xc8, 0xe8, 0x6f, 0x1b, 0xfd, 0x9f, 0xbb, 0xd7, + 0x48, 0x90, 0x5b, 0xcf, 0x71, 0x5f, 0xd6, 0x74, 0xff, 0xea, 0xa6, 0xff, 0xb5, 0x9d, 0x90, 0xb3, + 0xbf, 0x6e, 0x27, 0xe4, 0xec, 0xbf, 0x6d, 0xe7, 0x13, 0x7c, 0x52, 0xf7, 0xa7, 0x54, 0x69, 0x4e, + 0x45, 0xb0, 0xe6, 0x42, 0x38, 0x7d, 0x43, 0x20, 0x55, 0xed, 0x45, 0x59, 0x7a, 0xca, 0x85, 0x78, + 0xf7, 0xfb, 0x9c, 0x7c, 0x6b, 0x72, 0x5f, 0xd9, 0xf2, 0x21, 0x1e, 0x15, 0xeb, 0x0b, 0x64, 0xe1, + 0x5c, 0x50, 0xaf, 0xe7, 0x59, 0xcb, 0x1f, 0x64, 0xf5, 0xbf, 0x71, 0xc6, 0xc8, 0x13, 0xdc, 0x5b, + 0x73, 0xa1, 0xab, 0x55, 0x0d, 0x1e, 0x3d, 0xb8, 0xd6, 0x42, 0x9e, 0x1a, 0xca, 0xb3, 0x96, 0x5f, + 0x91, 0x4f, 0xbb, 0xb8, 0x9d, 0xe5, 0xf1, 0xea, 0x81, 0x09, 0xd4, 0x47, 0x4d, 0xa0, 0xec, 0x2a, + 0x07, 0x63, 0x74, 0x94, 0x20, 0xcb, 0xb1, 0xe6, 0x3f, 0x20, 0x3c, 0x7c, 0x2c, 0x84, 0x7c, 0x03, + 0xec, 0x0b, 0x48, 0x64, 0x4c, 0xee, 0x62, 0x1c, 0xd2, 0x64, 0x1b, 0xb0, 0x02, 0x19, 0xb9, 0xb6, + 0x6f, 0x17, 0x27, 0x65, 0xf9, 0x3e, 0x1e, 0x31, 0x9e, 0xa5, 0x82, 0xee, 0xaa, 0x0e, 0xcb, 0x74, + 0x0c, 0xab, 0xc3, 0xb2, 0x69, 0x82, 0xfb, 0x70, 0x91, 0xca, 0x04, 0x12, 0x6d, 0x22, 0x36, 0xf2, + 0x1b, 0xdc, 0xa8, 0x1b, 0x1e, 0xce, 0x21, 0xb7, 0x8f, 0xae, 0x1d, 0x23, 0x07, 0x39, 0xed, 0xf9, + 0x4f, 0x08, 0xf7, 0x9e, 0x9b, 0x4f, 0xff, 0x5b, 0xba, 0xef, 0xe1, 0x41, 0xe9, 0x4d, 0x50, 0xbc, + 0x3a, 0x95, 0x0c, 0x5c, 0x1e, 0xbd, 0xda, 0xa5, 0x70, 0xf4, 0x21, 0xed, 0xe3, 0x0f, 0x79, 0x88, + 0x49, 0xaa, 0x20, 0xe2, 0x19, 0x97, 0x49, 0x10, 0x4b, 0xc6, 0xd7, 0x1c, 0x94, 0x89, 0xee, 0xc8, + 0xbf, 0xd5, 0x54, 0x9e, 0x57, 0x85, 0x95, 0x6b, 0x64, 0x2f, 0x1a, 0x53, 0x3f, 0xc0, 0x77, 0x0e, + 0xc6, 0x7f, 0x7c, 0x35, 0xc9, 0x28, 0xef, 0x9c, 0x06, 0xbf, 0xec, 0xa7, 0xe8, 0xed, 0x7e, 0x8a, + 0x7e, 0xdf, 0x4f, 0xd1, 0xf7, 0x97, 0xd3, 0xd6, 0xdb, 0xcb, 0x69, 0xeb, 0xb7, 0xcb, 0x69, 0xeb, + 0xeb, 0x27, 0x1b, 0xae, 0xcf, 0xf3, 0xd0, 0x8d, 0x64, 0x5c, 0x3e, 0xaa, 0x0f, 0x13, 0xd0, 0x6f, + 0xa4, 0xda, 0x56, 0x48, 0x00, 0xdb, 0x80, 0xf2, 0x2e, 0xfe, 0xfd, 0xad, 0x0d, 0x7b, 0x26, 0x9c, + 0x9f, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x62, 0x62, 0x31, 0x4c, 0x2f, 0x06, 0x00, 0x00, +} + +func (m *SellOrder) 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 *SellOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SellOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Maker { + i-- + if m.Maker { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.Expiration != nil { + { + size, err := m.Expiration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.AskPrice) > 0 { + i -= len(m.AskPrice) + copy(dAtA[i:], m.AskPrice) + i = encodeVarintState(dAtA, i, uint64(len(m.AskPrice))) + i-- + dAtA[i] = 0x32 + } + if m.MarketId != 0 { + i = encodeVarintState(dAtA, i, uint64(m.MarketId)) + i-- + dAtA[i] = 0x28 + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintState(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x22 + } + if m.BatchId != 0 { + i = encodeVarintState(dAtA, i, uint64(m.BatchId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Seller) > 0 { + i -= len(m.Seller) + copy(dAtA[i:], m.Seller) + i = encodeVarintState(dAtA, i, uint64(len(m.Seller))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BuyOrder) 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 *BuyOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuyOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Maker { + i-- + if m.Maker { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.Expiration != nil { + { + size, err := m.Expiration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.DisablePartialFill { + i-- + if m.DisablePartialFill { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.BidPrice) > 0 { + i -= len(m.BidPrice) + copy(dAtA[i:], m.BidPrice) + i = encodeVarintState(dAtA, i, uint64(len(m.BidPrice))) + i-- + dAtA[i] = 0x32 + } + if m.MarketId != 0 { + i = encodeVarintState(dAtA, i, uint64(m.MarketId)) + i-- + dAtA[i] = 0x28 + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintState(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x22 + } + if m.Selection != nil { + { + size, err := m.Selection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Buyer) > 0 { + i -= len(m.Buyer) + copy(dAtA[i:], m.Buyer) + i = encodeVarintState(dAtA, i, uint64(len(m.Buyer))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BuyOrder_Selection) 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 *BuyOrder_Selection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuyOrder_Selection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *BuyOrder_Selection_SellOrderId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuyOrder_Selection_SellOrderId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintState(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *BuyOrder_Selection_Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BuyOrder_Selection_Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *AllowedDenom) 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 *AllowedDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exponent != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x18 + } + if len(m.DisplayDenom) > 0 { + i -= len(m.DisplayDenom) + copy(dAtA[i:], m.DisplayDenom) + i = encodeVarintState(dAtA, i, uint64(len(m.DisplayDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.BankDenom) > 0 { + i -= len(m.BankDenom) + copy(dAtA[i:], m.BankDenom) + i = encodeVarintState(dAtA, i, uint64(len(m.BankDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Market) 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 *Market) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Market) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PrecisionModifier != 0 { + i = encodeVarintState(dAtA, i, uint64(m.PrecisionModifier)) + i-- + dAtA[i] = 0x20 + } + if len(m.BankDenom) > 0 { + i -= len(m.BankDenom) + copy(dAtA[i:], m.BankDenom) + i = encodeVarintState(dAtA, i, uint64(len(m.BankDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.CreditType) > 0 { + i -= len(m.CreditType) + copy(dAtA[i:], m.CreditType) + i = encodeVarintState(dAtA, i, uint64(len(m.CreditType))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintState(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintState(dAtA []byte, offset int, v uint64) int { + offset -= sovState(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SellOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovState(uint64(m.Id)) + } + l = len(m.Seller) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.BatchId != 0 { + n += 1 + sovState(uint64(m.BatchId)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.MarketId != 0 { + n += 1 + sovState(uint64(m.MarketId)) + } + l = len(m.AskPrice) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.Expiration != nil { + l = m.Expiration.Size() + n += 1 + l + sovState(uint64(l)) + } + if m.Maker { + n += 2 + } + return n +} + +func (m *BuyOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovState(uint64(m.Id)) + } + l = len(m.Buyer) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.Selection != nil { + l = m.Selection.Size() + n += 1 + l + sovState(uint64(l)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.MarketId != 0 { + n += 1 + sovState(uint64(m.MarketId)) + } + l = len(m.BidPrice) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.DisablePartialFill { + n += 2 + } + if m.Expiration != nil { + l = m.Expiration.Size() + n += 1 + l + sovState(uint64(l)) + } + if m.Maker { + n += 2 + } + return n +} + +func (m *BuyOrder_Selection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *BuyOrder_Selection_SellOrderId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovState(uint64(m.SellOrderId)) + return n +} +func (m *BuyOrder_Selection_Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovState(uint64(l)) + } + return n +} +func (m *AllowedDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BankDenom) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.DisplayDenom) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovState(uint64(m.Exponent)) + } + return n +} + +func (m *Market) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovState(uint64(m.Id)) + } + l = len(m.CreditType) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + l = len(m.BankDenom) + if l > 0 { + n += 1 + l + sovState(uint64(l)) + } + if m.PrecisionModifier != 0 { + n += 1 + sovState(uint64(m.PrecisionModifier)) + } + return n +} + +func sovState(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozState(x uint64) (n int) { + return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SellOrder) 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 ErrIntOverflowState + } + 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: SellOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SellOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seller", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seller = append(m.Seller[:0], dAtA[iNdEx:postIndex]...) + if m.Seller == nil { + m.Seller = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchId", wireType) + } + m.BatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BatchId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + } + m.MarketId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MarketId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AskPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AskPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = &types.Timestamp{} + } + if err := m.Expiration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Maker", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Maker = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BuyOrder) 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 ErrIntOverflowState + } + 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: BuyOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BuyOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buyer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Buyer = append(m.Buyer[:0], dAtA[iNdEx:postIndex]...) + if m.Buyer == nil { + m.Buyer = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selection == nil { + m.Selection = &BuyOrder_Selection{} + } + if err := m.Selection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketId", wireType) + } + m.MarketId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MarketId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BidPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisablePartialFill", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisablePartialFill = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = &types.Timestamp{} + } + if err := m.Expiration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Maker", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Maker = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BuyOrder_Selection) 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 ErrIntOverflowState + } + 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: Selection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Selection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &BuyOrder_Selection_SellOrderId{v} + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Filter{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &BuyOrder_Selection_Filter{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedDenom) 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 ErrIntOverflowState + } + 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: AllowedDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BankDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BankDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Market) 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 ErrIntOverflowState + } + 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: Market: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Market: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreditType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreditType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BankDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + 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 ErrInvalidLengthState + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BankDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrecisionModifier", wireType) + } + m.PrecisionModifier = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrecisionModifier |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipState(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthState + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipState(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, ErrIntOverflowState + } + 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, ErrIntOverflowState + } + 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, ErrIntOverflowState + } + 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, ErrInvalidLengthState + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupState + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthState + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowState = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/marketplace/v1beta1/tx.pb.go b/x/ecocredit/marketplace/v1beta1/tx.pb.go new file mode 100644 index 0000000000..6f7ef9666f --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/tx.pb.go @@ -0,0 +1,3716 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/tx.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// MsgSell is the Msg/Sell request type. +type MsgSell struct { + // owner is the address of the owner of the credits being sold. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // orders are the sell orders being created. + Orders []*MsgSell_Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders,omitempty"` +} + +func (m *MsgSell) Reset() { *m = MsgSell{} } +func (m *MsgSell) String() string { return proto.CompactTextString(m) } +func (*MsgSell) ProtoMessage() {} +func (*MsgSell) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{0} +} +func (m *MsgSell) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSell) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSell.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 *MsgSell) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSell.Merge(m, src) +} +func (m *MsgSell) XXX_Size() int { + return m.Size() +} +func (m *MsgSell) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSell.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSell proto.InternalMessageInfo + +func (m *MsgSell) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgSell) GetOrders() []*MsgSell_Order { + if m != nil { + return m.Orders + } + return nil +} + +// Order is the content of a new sell order. +type MsgSell_Order struct { + // batch_denom is the credit batch being sold. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // quantity is the quantity of credits being sold from this batch. If it is + // less then the balance of credits the owner has available at the time this + // sell order is matched, the quantity will be adjusted downwards to the + // owner's balance. However, if the balance of credits is less than this + // quantity at the time the sell order is created, the operation will fail. + Quantity string `protobuf:"bytes,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + // ask_price is the price the seller is asking for each unit of the + // batch_denom. Each credit unit of the batch will be sold for at least the + // ask_price or more. + AskPrice *types.Coin `protobuf:"bytes,3,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"` + // disable_auto_retire disables auto-retirement of credits which allows a + // buyer to disable auto-retirement in their buy order enabling them to + // resell the credits to another buyer. + DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is an optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *time.Time `protobuf:"bytes,5,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *MsgSell_Order) Reset() { *m = MsgSell_Order{} } +func (m *MsgSell_Order) String() string { return proto.CompactTextString(m) } +func (*MsgSell_Order) ProtoMessage() {} +func (*MsgSell_Order) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{0, 0} +} +func (m *MsgSell_Order) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSell_Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSell_Order.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 *MsgSell_Order) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSell_Order.Merge(m, src) +} +func (m *MsgSell_Order) XXX_Size() int { + return m.Size() +} +func (m *MsgSell_Order) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSell_Order.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSell_Order proto.InternalMessageInfo + +func (m *MsgSell_Order) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *MsgSell_Order) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *MsgSell_Order) GetAskPrice() *types.Coin { + if m != nil { + return m.AskPrice + } + return nil +} + +func (m *MsgSell_Order) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *MsgSell_Order) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +// MsgSellResponse is the Msg/Sell response type. +type MsgSellResponse struct { + // sell_order_ids are the sell order IDs of the newly created sell orders. + SellOrderIds []uint64 `protobuf:"varint,1,rep,packed,name=sell_order_ids,json=sellOrderIds,proto3" json:"sell_order_ids,omitempty"` +} + +func (m *MsgSellResponse) Reset() { *m = MsgSellResponse{} } +func (m *MsgSellResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSellResponse) ProtoMessage() {} +func (*MsgSellResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{1} +} +func (m *MsgSellResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSellResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSellResponse.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 *MsgSellResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSellResponse.Merge(m, src) +} +func (m *MsgSellResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSellResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSellResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSellResponse proto.InternalMessageInfo + +func (m *MsgSellResponse) GetSellOrderIds() []uint64 { + if m != nil { + return m.SellOrderIds + } + return nil +} + +// MsgUpdateSellOrders is the Msg/UpdateSellOrders request type. +type MsgUpdateSellOrders struct { + // owner is the owner of the sell orders. + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // updates are updates to existing sell orders. + Updates []*MsgUpdateSellOrders_Update `protobuf:"bytes,2,rep,name=updates,proto3" json:"updates,omitempty"` +} + +func (m *MsgUpdateSellOrders) Reset() { *m = MsgUpdateSellOrders{} } +func (m *MsgUpdateSellOrders) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSellOrders) ProtoMessage() {} +func (*MsgUpdateSellOrders) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{2} +} +func (m *MsgUpdateSellOrders) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSellOrders) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSellOrders.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 *MsgUpdateSellOrders) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSellOrders.Merge(m, src) +} +func (m *MsgUpdateSellOrders) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSellOrders) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSellOrders.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSellOrders proto.InternalMessageInfo + +func (m *MsgUpdateSellOrders) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgUpdateSellOrders) GetUpdates() []*MsgUpdateSellOrders_Update { + if m != nil { + return m.Updates + } + return nil +} + +// Update is an update to an existing sell order. +type MsgUpdateSellOrders_Update struct { + // sell_order_id is the ID of an existing sell order. + SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3" json:"sell_order_id,omitempty"` + // new_quantity is the updated quantity of credits available to sell, if it + // is set to zero then the order is cancelled. + NewQuantity string `protobuf:"bytes,2,opt,name=new_quantity,json=newQuantity,proto3" json:"new_quantity,omitempty"` + // new_ask_price is the new ask price for this sell order + NewAskPrice *types.Coin `protobuf:"bytes,3,opt,name=new_ask_price,json=newAskPrice,proto3" json:"new_ask_price,omitempty"` + // disable_auto_retire updates the disable_auto_retire field in the sell order. + DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // new_expiration is an optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + NewExpiration *time.Time `protobuf:"bytes,5,opt,name=new_expiration,json=newExpiration,proto3,stdtime" json:"new_expiration,omitempty"` +} + +func (m *MsgUpdateSellOrders_Update) Reset() { *m = MsgUpdateSellOrders_Update{} } +func (m *MsgUpdateSellOrders_Update) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSellOrders_Update) ProtoMessage() {} +func (*MsgUpdateSellOrders_Update) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{2, 0} +} +func (m *MsgUpdateSellOrders_Update) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSellOrders_Update) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSellOrders_Update.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 *MsgUpdateSellOrders_Update) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSellOrders_Update.Merge(m, src) +} +func (m *MsgUpdateSellOrders_Update) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSellOrders_Update) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSellOrders_Update.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSellOrders_Update proto.InternalMessageInfo + +func (m *MsgUpdateSellOrders_Update) GetSellOrderId() uint64 { + if m != nil { + return m.SellOrderId + } + return 0 +} + +func (m *MsgUpdateSellOrders_Update) GetNewQuantity() string { + if m != nil { + return m.NewQuantity + } + return "" +} + +func (m *MsgUpdateSellOrders_Update) GetNewAskPrice() *types.Coin { + if m != nil { + return m.NewAskPrice + } + return nil +} + +func (m *MsgUpdateSellOrders_Update) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *MsgUpdateSellOrders_Update) GetNewExpiration() *time.Time { + if m != nil { + return m.NewExpiration + } + return nil +} + +// MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type. +type MsgUpdateSellOrdersResponse struct { +} + +func (m *MsgUpdateSellOrdersResponse) Reset() { *m = MsgUpdateSellOrdersResponse{} } +func (m *MsgUpdateSellOrdersResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSellOrdersResponse) ProtoMessage() {} +func (*MsgUpdateSellOrdersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{3} +} +func (m *MsgUpdateSellOrdersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSellOrdersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSellOrdersResponse.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 *MsgUpdateSellOrdersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSellOrdersResponse.Merge(m, src) +} +func (m *MsgUpdateSellOrdersResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSellOrdersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSellOrdersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSellOrdersResponse proto.InternalMessageInfo + +// MsgBuy is the Msg/Buy request type. +type MsgBuy struct { + // buyer is the address of the credit buyer. + Buyer string `protobuf:"bytes,1,opt,name=buyer,proto3" json:"buyer,omitempty"` + // orders are the new buy orders. + Orders []*MsgBuy_Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders,omitempty"` +} + +func (m *MsgBuy) Reset() { *m = MsgBuy{} } +func (m *MsgBuy) String() string { return proto.CompactTextString(m) } +func (*MsgBuy) ProtoMessage() {} +func (*MsgBuy) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{4} +} +func (m *MsgBuy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuy.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 *MsgBuy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuy.Merge(m, src) +} +func (m *MsgBuy) XXX_Size() int { + return m.Size() +} +func (m *MsgBuy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuy proto.InternalMessageInfo + +func (m *MsgBuy) GetBuyer() string { + if m != nil { + return m.Buyer + } + return "" +} + +func (m *MsgBuy) GetOrders() []*MsgBuy_Order { + if m != nil { + return m.Orders + } + return nil +} + +// Order is a buy order. +type MsgBuy_Order struct { + // selection is the buy order selection. + Selection *MsgBuy_Order_Selection `protobuf:"bytes,1,opt,name=selection,proto3" json:"selection,omitempty"` + // quantity is the quantity of credits to buy. If the quantity of credits + // available is less than this amount the order will be partially filled + // unless disable_partial_fill is true. + Quantity string `protobuf:"bytes,2,opt,name=quantity,proto3" json:"quantity,omitempty"` + // bid price is the bid price for this buy order. A credit unit will be + // settled at a purchase price that is no more than the bid price. The + // buy order will fail if the buyer does not have enough funds available + // to complete the purchase. + BidPrice *types.Coin `protobuf:"bytes,3,opt,name=bid_price,json=bidPrice,proto3" json:"bid_price,omitempty"` + // disable_auto_retire allows auto-retirement to be disabled. If it is set to true + // the credits will not auto-retire and can be resold assuming that the + // corresponding sell order has auto-retirement disabled. If the sell order + // hasn't disabled auto-retirement and the buy order tries to disable it, + // that buy order will fail. + DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // disable_partial_fill disables the default behavior of partially filling + // buy orders if the requested quantity is not available. + DisablePartialFill bool `protobuf:"varint,5,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // retirement_location is the optional retirement location for the credits + // which will be used only if disable_auto_retire is false. + RetirementLocation string `protobuf:"bytes,6,opt,name=retirement_location,json=retirementLocation,proto3" json:"retirement_location,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *time.Time `protobuf:"bytes,7,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *MsgBuy_Order) Reset() { *m = MsgBuy_Order{} } +func (m *MsgBuy_Order) String() string { return proto.CompactTextString(m) } +func (*MsgBuy_Order) ProtoMessage() {} +func (*MsgBuy_Order) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{4, 0} +} +func (m *MsgBuy_Order) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuy_Order) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuy_Order.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 *MsgBuy_Order) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuy_Order.Merge(m, src) +} +func (m *MsgBuy_Order) XXX_Size() int { + return m.Size() +} +func (m *MsgBuy_Order) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuy_Order.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuy_Order proto.InternalMessageInfo + +func (m *MsgBuy_Order) GetSelection() *MsgBuy_Order_Selection { + if m != nil { + return m.Selection + } + return nil +} + +func (m *MsgBuy_Order) GetQuantity() string { + if m != nil { + return m.Quantity + } + return "" +} + +func (m *MsgBuy_Order) GetBidPrice() *types.Coin { + if m != nil { + return m.BidPrice + } + return nil +} + +func (m *MsgBuy_Order) GetDisableAutoRetire() bool { + if m != nil { + return m.DisableAutoRetire + } + return false +} + +func (m *MsgBuy_Order) GetDisablePartialFill() bool { + if m != nil { + return m.DisablePartialFill + } + return false +} + +func (m *MsgBuy_Order) GetRetirementLocation() string { + if m != nil { + return m.RetirementLocation + } + return "" +} + +func (m *MsgBuy_Order) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +// Selection defines a buy order selection. +type MsgBuy_Order_Selection struct { + // sum defines the type of selection. + // + // Types that are valid to be assigned to Sum: + // *MsgBuy_Order_Selection_SellOrderId + // *MsgBuy_Order_Selection_Filter + Sum isMsgBuy_Order_Selection_Sum `protobuf_oneof:"sum"` +} + +func (m *MsgBuy_Order_Selection) Reset() { *m = MsgBuy_Order_Selection{} } +func (m *MsgBuy_Order_Selection) String() string { return proto.CompactTextString(m) } +func (*MsgBuy_Order_Selection) ProtoMessage() {} +func (*MsgBuy_Order_Selection) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{4, 0, 0} +} +func (m *MsgBuy_Order_Selection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuy_Order_Selection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuy_Order_Selection.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 *MsgBuy_Order_Selection) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuy_Order_Selection.Merge(m, src) +} +func (m *MsgBuy_Order_Selection) XXX_Size() int { + return m.Size() +} +func (m *MsgBuy_Order_Selection) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuy_Order_Selection.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuy_Order_Selection proto.InternalMessageInfo + +type isMsgBuy_Order_Selection_Sum interface { + isMsgBuy_Order_Selection_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgBuy_Order_Selection_SellOrderId struct { + SellOrderId uint64 `protobuf:"varint,1,opt,name=sell_order_id,json=sellOrderId,proto3,oneof" json:"sell_order_id,omitempty"` +} +type MsgBuy_Order_Selection_Filter struct { + Filter *Filter `protobuf:"bytes,2,opt,name=filter,proto3,oneof" json:"filter,omitempty"` +} + +func (*MsgBuy_Order_Selection_SellOrderId) isMsgBuy_Order_Selection_Sum() {} +func (*MsgBuy_Order_Selection_Filter) isMsgBuy_Order_Selection_Sum() {} + +func (m *MsgBuy_Order_Selection) GetSum() isMsgBuy_Order_Selection_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *MsgBuy_Order_Selection) GetSellOrderId() uint64 { + if x, ok := m.GetSum().(*MsgBuy_Order_Selection_SellOrderId); ok { + return x.SellOrderId + } + return 0 +} + +func (m *MsgBuy_Order_Selection) GetFilter() *Filter { + if x, ok := m.GetSum().(*MsgBuy_Order_Selection_Filter); ok { + return x.Filter + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgBuy_Order_Selection) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgBuy_Order_Selection_SellOrderId)(nil), + (*MsgBuy_Order_Selection_Filter)(nil), + } +} + +// MsgBuyResponse is the Msg/Buy response type. +type MsgBuyResponse struct { + // buy_order_ids are the buy order IDs of the newly created buy orders. Buy + // orders may not settle instantaneously, but rather in batches at specified + // batch epoch times. + BuyOrderIds []uint64 `protobuf:"varint,1,rep,packed,name=buy_order_ids,json=buyOrderIds,proto3" json:"buy_order_ids,omitempty"` +} + +func (m *MsgBuyResponse) Reset() { *m = MsgBuyResponse{} } +func (m *MsgBuyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBuyResponse) ProtoMessage() {} +func (*MsgBuyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{5} +} +func (m *MsgBuyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBuyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBuyResponse.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 *MsgBuyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBuyResponse.Merge(m, src) +} +func (m *MsgBuyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBuyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBuyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBuyResponse proto.InternalMessageInfo + +func (m *MsgBuyResponse) GetBuyOrderIds() []uint64 { + if m != nil { + return m.BuyOrderIds + } + return nil +} + +// MsgAllowAskDenom is the Msg/AllowAskDenom request type. +type MsgAllowAskDenom struct { + // root_address is the address of the governance account which can authorize ask denoms + RootAddress string `protobuf:"bytes,1,opt,name=root_address,json=rootAddress,proto3" json:"root_address,omitempty"` + // denom is the denom to allow (ex. ibc/GLKHDSG423SGS) + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` + // display_denom is the denom to display to the user and is informational + DisplayDenom string `protobuf:"bytes,3,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"` + // exponent is the exponent that relates the denom to the display_denom and is + // informational + Exponent uint32 `protobuf:"varint,4,opt,name=exponent,proto3" json:"exponent,omitempty"` +} + +func (m *MsgAllowAskDenom) Reset() { *m = MsgAllowAskDenom{} } +func (m *MsgAllowAskDenom) String() string { return proto.CompactTextString(m) } +func (*MsgAllowAskDenom) ProtoMessage() {} +func (*MsgAllowAskDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{6} +} +func (m *MsgAllowAskDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowAskDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowAskDenom.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 *MsgAllowAskDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowAskDenom.Merge(m, src) +} +func (m *MsgAllowAskDenom) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowAskDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowAskDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowAskDenom proto.InternalMessageInfo + +func (m *MsgAllowAskDenom) GetRootAddress() string { + if m != nil { + return m.RootAddress + } + return "" +} + +func (m *MsgAllowAskDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *MsgAllowAskDenom) GetDisplayDenom() string { + if m != nil { + return m.DisplayDenom + } + return "" +} + +func (m *MsgAllowAskDenom) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +// MsgAllowAskDenomResponse is the Msg/AllowAskDenom response type. +type MsgAllowAskDenomResponse struct { +} + +func (m *MsgAllowAskDenomResponse) Reset() { *m = MsgAllowAskDenomResponse{} } +func (m *MsgAllowAskDenomResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllowAskDenomResponse) ProtoMessage() {} +func (*MsgAllowAskDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_35ceac134323d237, []int{7} +} +func (m *MsgAllowAskDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowAskDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowAskDenomResponse.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 *MsgAllowAskDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowAskDenomResponse.Merge(m, src) +} +func (m *MsgAllowAskDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowAskDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowAskDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowAskDenomResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSell)(nil), "regen.ecocredit.marketplace.v1beta1.MsgSell") + proto.RegisterType((*MsgSell_Order)(nil), "regen.ecocredit.marketplace.v1beta1.MsgSell.Order") + proto.RegisterType((*MsgSellResponse)(nil), "regen.ecocredit.marketplace.v1beta1.MsgSellResponse") + proto.RegisterType((*MsgUpdateSellOrders)(nil), "regen.ecocredit.marketplace.v1beta1.MsgUpdateSellOrders") + proto.RegisterType((*MsgUpdateSellOrders_Update)(nil), "regen.ecocredit.marketplace.v1beta1.MsgUpdateSellOrders.Update") + proto.RegisterType((*MsgUpdateSellOrdersResponse)(nil), "regen.ecocredit.marketplace.v1beta1.MsgUpdateSellOrdersResponse") + proto.RegisterType((*MsgBuy)(nil), "regen.ecocredit.marketplace.v1beta1.MsgBuy") + proto.RegisterType((*MsgBuy_Order)(nil), "regen.ecocredit.marketplace.v1beta1.MsgBuy.Order") + proto.RegisterType((*MsgBuy_Order_Selection)(nil), "regen.ecocredit.marketplace.v1beta1.MsgBuy.Order.Selection") + proto.RegisterType((*MsgBuyResponse)(nil), "regen.ecocredit.marketplace.v1beta1.MsgBuyResponse") + proto.RegisterType((*MsgAllowAskDenom)(nil), "regen.ecocredit.marketplace.v1beta1.MsgAllowAskDenom") + proto.RegisterType((*MsgAllowAskDenomResponse)(nil), "regen.ecocredit.marketplace.v1beta1.MsgAllowAskDenomResponse") +} + +func init() { + proto.RegisterFile("regen/ecocredit/marketplace/v1beta1/tx.proto", fileDescriptor_35ceac134323d237) +} + +var fileDescriptor_35ceac134323d237 = []byte{ + // 912 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x66, 0x1d, 0x27, 0x79, 0x8e, 0x43, 0x99, 0xe4, 0x60, 0x16, 0xe1, 0xb8, 0x6e, 0x0f, + 0x96, 0x5a, 0x76, 0x89, 0x5b, 0x3e, 0x24, 0x54, 0xd1, 0x18, 0x52, 0x5a, 0x84, 0x45, 0xd9, 0xc0, + 0xa1, 0x5c, 0x56, 0xfb, 0xf1, 0xb2, 0x1d, 0x32, 0xde, 0x59, 0x76, 0x66, 0x49, 0x7c, 0xe2, 0x84, + 0xb8, 0x54, 0x28, 0x7f, 0x16, 0xc7, 0x1e, 0x39, 0x20, 0x81, 0x92, 0x3b, 0x17, 0x2e, 0x1c, 0xd1, + 0xce, 0x7e, 0x38, 0x71, 0x03, 0xd8, 0xbe, 0xf9, 0xbd, 0xf7, 0x7b, 0x6f, 0xde, 0xbc, 0xdf, 0xfc, + 0x9e, 0x17, 0xee, 0x26, 0x18, 0x62, 0x64, 0xa1, 0xcf, 0xfd, 0x04, 0x03, 0x2a, 0xad, 0xb1, 0x9b, + 0x1c, 0xa3, 0x8c, 0x99, 0xeb, 0xa3, 0xf5, 0xfd, 0x9e, 0x87, 0xd2, 0xdd, 0xb3, 0xe4, 0xa9, 0x19, + 0x27, 0x5c, 0x72, 0x72, 0x4b, 0xa1, 0xcd, 0x0a, 0x6d, 0x5e, 0x42, 0x9b, 0x05, 0xda, 0xd8, 0x09, + 0x79, 0xc8, 0x15, 0xde, 0xca, 0x7e, 0xe5, 0xa9, 0x46, 0xc7, 0xe7, 0x62, 0xcc, 0x85, 0xe5, 0xb9, + 0x62, 0x5a, 0xd8, 0xe7, 0x34, 0x2a, 0xe2, 0xbb, 0x21, 0xe7, 0x21, 0x43, 0x4b, 0x59, 0x5e, 0x7a, + 0x64, 0x49, 0x3a, 0x46, 0x21, 0xdd, 0x71, 0x5c, 0x00, 0xac, 0xb9, 0x3a, 0x9d, 0xc4, 0x28, 0xf2, + 0x84, 0xde, 0x6f, 0x2b, 0xb0, 0x36, 0x12, 0xe1, 0x21, 0x32, 0x46, 0x76, 0x60, 0x95, 0x9f, 0x44, + 0x98, 0xb4, 0xb5, 0xae, 0xd6, 0xdf, 0xb0, 0x73, 0x83, 0x7c, 0x06, 0x0d, 0x9e, 0x04, 0x98, 0x88, + 0xf6, 0x4a, 0x57, 0xef, 0x37, 0x07, 0x03, 0x73, 0x8e, 0xfb, 0x99, 0x45, 0x4d, 0xf3, 0x8b, 0x2c, + 0xd5, 0x2e, 0x2a, 0x18, 0x7f, 0x6a, 0xb0, 0xaa, 0x3c, 0x64, 0x17, 0x9a, 0x9e, 0x2b, 0xfd, 0xe7, + 0x4e, 0x80, 0x11, 0x1f, 0x17, 0x27, 0x82, 0x72, 0x7d, 0x92, 0x79, 0x88, 0x01, 0xeb, 0xdf, 0xa5, + 0x6e, 0x24, 0xa9, 0x9c, 0xb4, 0x57, 0x54, 0xb4, 0xb2, 0xc9, 0x7b, 0xb0, 0xe1, 0x8a, 0x63, 0x27, + 0x4e, 0xa8, 0x8f, 0x6d, 0xbd, 0xab, 0xf5, 0x9b, 0x83, 0x37, 0xcc, 0x7c, 0x74, 0x66, 0x36, 0xba, + 0xaa, 0x8b, 0x8f, 0x39, 0x8d, 0xec, 0x75, 0x57, 0x1c, 0x3f, 0xcd, 0xa0, 0xc4, 0x84, 0xed, 0x80, + 0x0a, 0xd7, 0x63, 0xe8, 0xb8, 0xa9, 0xe4, 0x4e, 0x82, 0x92, 0x26, 0xd8, 0xae, 0x77, 0xb5, 0xfe, + 0xba, 0xfd, 0x7a, 0x11, 0xda, 0x4f, 0x25, 0xb7, 0x55, 0x80, 0x3c, 0x04, 0xc0, 0xd3, 0x98, 0x26, + 0xae, 0xa4, 0x3c, 0x6a, 0xaf, 0xaa, 0x83, 0x0c, 0x33, 0xe7, 0xc0, 0x2c, 0x39, 0x30, 0xbf, 0x2a, + 0x39, 0x18, 0xd6, 0xcf, 0x7e, 0xdf, 0xd5, 0xec, 0x4b, 0x39, 0xbd, 0xf7, 0xe1, 0xb5, 0x62, 0x12, + 0x36, 0x8a, 0x98, 0x47, 0x02, 0xc9, 0x6d, 0xd8, 0x12, 0xc8, 0x98, 0xa3, 0x46, 0xe2, 0xd0, 0x40, + 0xb4, 0xb5, 0xae, 0xde, 0xaf, 0xdb, 0x9b, 0x99, 0x57, 0x0d, 0xe7, 0x49, 0x20, 0x7a, 0x67, 0x3a, + 0x6c, 0x8f, 0x44, 0xf8, 0x75, 0x1c, 0xb8, 0x12, 0x0f, 0xcb, 0x88, 0xf8, 0x17, 0x8e, 0x9e, 0xc1, + 0x5a, 0xaa, 0x90, 0x25, 0x49, 0x1f, 0xcd, 0x4b, 0xd2, 0xec, 0x01, 0x66, 0xee, 0xb0, 0xcb, 0x7a, + 0xc6, 0x4f, 0x2b, 0xd0, 0xc8, 0x7d, 0xa4, 0x07, 0xad, 0x2b, 0x9d, 0xab, 0x1e, 0xea, 0x76, 0xf3, + 0x52, 0xe3, 0xe4, 0x26, 0x6c, 0x46, 0x78, 0xe2, 0xcc, 0x50, 0xd7, 0x8c, 0xf0, 0xe4, 0xcb, 0x92, + 0xbd, 0x07, 0xd0, 0xca, 0x20, 0x0b, 0x30, 0x98, 0xa5, 0xef, 0x2f, 0x4b, 0xe2, 0xa7, 0xb0, 0x95, + 0x1d, 0xb7, 0x04, 0x91, 0x59, 0x9b, 0x07, 0x53, 0x2e, 0xdf, 0x82, 0x37, 0xaf, 0x19, 0x58, 0xc9, + 0x6b, 0xef, 0xef, 0x3a, 0x34, 0x46, 0x22, 0x1c, 0xa6, 0x93, 0x8c, 0x24, 0x2f, 0x9d, 0x4c, 0x49, + 0x52, 0x06, 0x79, 0x32, 0x23, 0xa4, 0xbd, 0x79, 0x39, 0x1a, 0xa6, 0x93, 0x19, 0x1d, 0xbd, 0xa8, + 0x97, 0x3a, 0x7a, 0x06, 0x1b, 0x02, 0x19, 0xfa, 0xea, 0x62, 0x9a, 0xba, 0xd8, 0x87, 0x0b, 0xd7, + 0x35, 0x0f, 0xcb, 0x12, 0xf6, 0xb4, 0xda, 0xff, 0x29, 0xd0, 0xa3, 0xc1, 0xdc, 0x0a, 0xf4, 0x68, + 0xb0, 0x1c, 0x79, 0xef, 0xc0, 0x4e, 0x89, 0x8f, 0xdd, 0x44, 0x52, 0x97, 0x39, 0x47, 0x94, 0x31, + 0x45, 0xe1, 0xba, 0x4d, 0x8a, 0xd8, 0xd3, 0x3c, 0xf4, 0x88, 0x32, 0x46, 0x2c, 0xd8, 0xce, 0x8b, + 0x8e, 0x31, 0x92, 0x0e, 0xe3, 0x7e, 0xce, 0x79, 0x43, 0x5d, 0x80, 0x4c, 0x43, 0x9f, 0x17, 0x91, + 0x19, 0x91, 0xaf, 0x2d, 0x2e, 0x72, 0xe3, 0x07, 0xd8, 0xa8, 0x06, 0x48, 0x6e, 0x5f, 0x2b, 0x92, + 0xc7, 0xb5, 0xab, 0x32, 0x39, 0x80, 0xc6, 0x11, 0x65, 0x12, 0x13, 0x35, 0xd9, 0xe6, 0xe0, 0xce, + 0x5c, 0x9c, 0x3d, 0x52, 0x29, 0x8f, 0x6b, 0x76, 0x91, 0x3c, 0x5c, 0x05, 0x5d, 0xa4, 0xe3, 0xde, + 0x7d, 0xd8, 0xca, 0xe9, 0xac, 0x96, 0x4c, 0x0f, 0x5a, 0x5e, 0x3a, 0x79, 0x65, 0xc7, 0x34, 0xbd, + 0x74, 0x52, 0xad, 0x98, 0x17, 0x1a, 0xdc, 0x18, 0x89, 0x70, 0x9f, 0x31, 0x9e, 0xa9, 0x2b, 0x5f, + 0xbb, 0x37, 0x61, 0x33, 0xe1, 0x5c, 0x3a, 0x6e, 0x10, 0x24, 0x28, 0x44, 0xf1, 0x82, 0x9b, 0x99, + 0x6f, 0x3f, 0x77, 0x65, 0xaf, 0x3b, 0x5f, 0xda, 0xf9, 0xa3, 0xc8, 0x0d, 0x72, 0x0b, 0x5a, 0x01, + 0x15, 0x31, 0x73, 0x27, 0xc5, 0x4a, 0xd7, 0x55, 0x74, 0xb3, 0x70, 0x56, 0x4b, 0x1d, 0x4f, 0x63, + 0x1e, 0x61, 0x24, 0x15, 0xe7, 0x2d, 0xbb, 0xb2, 0x7b, 0x06, 0xb4, 0x67, 0xbb, 0x29, 0xaf, 0x33, + 0xf8, 0x4b, 0x07, 0x7d, 0x24, 0x42, 0xf2, 0x2d, 0xd4, 0xd5, 0x3f, 0xd5, 0xdd, 0x45, 0xfe, 0x83, + 0x8c, 0xfb, 0x8b, 0xa0, 0xab, 0x11, 0xfe, 0xac, 0xc1, 0x8d, 0x57, 0xd6, 0xef, 0x07, 0xcb, 0xee, + 0x55, 0xe3, 0xe1, 0xb2, 0x99, 0x55, 0x43, 0x21, 0xe8, 0xd9, 0x72, 0xb9, 0xb3, 0x80, 0xbc, 0x8d, + 0x7b, 0x0b, 0x80, 0xab, 0x83, 0x7e, 0xd4, 0xa0, 0x75, 0xf5, 0x55, 0xbc, 0x3b, 0x6f, 0x99, 0x2b, + 0x69, 0xc6, 0x83, 0xa5, 0xd2, 0xca, 0x3e, 0x86, 0xce, 0x2f, 0xe7, 0x1d, 0xed, 0xe5, 0x79, 0x47, + 0xfb, 0xe3, 0xbc, 0xa3, 0x9d, 0x5d, 0x74, 0x6a, 0x2f, 0x2f, 0x3a, 0xb5, 0x5f, 0x2f, 0x3a, 0xb5, + 0x6f, 0x0e, 0x42, 0x2a, 0x9f, 0xa7, 0x9e, 0xe9, 0xf3, 0x71, 0xfe, 0xc5, 0xf3, 0x76, 0x84, 0xf2, + 0x84, 0x27, 0xc7, 0x85, 0xc5, 0x30, 0x08, 0x31, 0xb1, 0x4e, 0xff, 0xfb, 0x43, 0xc8, 0x6b, 0x28, + 0x79, 0xdf, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, 0x2b, 0xb9, 0x50, 0xe3, 0xe0, 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 + +// 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 { + // Sell creates new sell orders. + Sell(ctx context.Context, in *MsgSell, opts ...grpc.CallOption) (*MsgSellResponse, error) + // UpdateSellOrders updates existing sell orders. + UpdateSellOrders(ctx context.Context, in *MsgUpdateSellOrders, opts ...grpc.CallOption) (*MsgUpdateSellOrdersResponse, error) + // Buy creates credit buy orders. + Buy(ctx context.Context, in *MsgBuy, opts ...grpc.CallOption) (*MsgBuyResponse, error) + // AllowAskDenom is a governance operation which authorizes a new ask denom to be used in sell orders + AllowAskDenom(ctx context.Context, in *MsgAllowAskDenom, opts ...grpc.CallOption) (*MsgAllowAskDenomResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Sell(ctx context.Context, in *MsgSell, opts ...grpc.CallOption) (*MsgSellResponse, error) { + out := new(MsgSellResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Msg/Sell", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateSellOrders(ctx context.Context, in *MsgUpdateSellOrders, opts ...grpc.CallOption) (*MsgUpdateSellOrdersResponse, error) { + out := new(MsgUpdateSellOrdersResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Msg/UpdateSellOrders", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Buy(ctx context.Context, in *MsgBuy, opts ...grpc.CallOption) (*MsgBuyResponse, error) { + out := new(MsgBuyResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Msg/Buy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AllowAskDenom(ctx context.Context, in *MsgAllowAskDenom, opts ...grpc.CallOption) (*MsgAllowAskDenomResponse, error) { + out := new(MsgAllowAskDenomResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.marketplace.v1beta1.Msg/AllowAskDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Sell creates new sell orders. + Sell(context.Context, *MsgSell) (*MsgSellResponse, error) + // UpdateSellOrders updates existing sell orders. + UpdateSellOrders(context.Context, *MsgUpdateSellOrders) (*MsgUpdateSellOrdersResponse, error) + // Buy creates credit buy orders. + Buy(context.Context, *MsgBuy) (*MsgBuyResponse, error) + // AllowAskDenom is a governance operation which authorizes a new ask denom to be used in sell orders + AllowAskDenom(context.Context, *MsgAllowAskDenom) (*MsgAllowAskDenomResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Sell(ctx context.Context, req *MsgSell) (*MsgSellResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sell not implemented") +} +func (*UnimplementedMsgServer) UpdateSellOrders(ctx context.Context, req *MsgUpdateSellOrders) (*MsgUpdateSellOrdersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateSellOrders not implemented") +} +func (*UnimplementedMsgServer) Buy(ctx context.Context, req *MsgBuy) (*MsgBuyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Buy not implemented") +} +func (*UnimplementedMsgServer) AllowAskDenom(ctx context.Context, req *MsgAllowAskDenom) (*MsgAllowAskDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowAskDenom not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Sell_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSell) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Sell(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Msg/Sell", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Sell(ctx, req.(*MsgSell)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateSellOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateSellOrders) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateSellOrders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Msg/UpdateSellOrders", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateSellOrders(ctx, req.(*MsgUpdateSellOrders)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Buy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBuy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Buy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Msg/Buy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Buy(ctx, req.(*MsgBuy)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AllowAskDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllowAskDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AllowAskDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.marketplace.v1beta1.Msg/AllowAskDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllowAskDenom(ctx, req.(*MsgAllowAskDenom)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.marketplace.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Sell", + Handler: _Msg_Sell_Handler, + }, + { + MethodName: "UpdateSellOrders", + Handler: _Msg_UpdateSellOrders_Handler, + }, + { + MethodName: "Buy", + Handler: _Msg_Buy_Handler, + }, + { + MethodName: "AllowAskDenom", + Handler: _Msg_AllowAskDenom_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/marketplace/v1beta1/tx.proto", +} + +func (m *MsgSell) 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 *MsgSell) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSell) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Orders) > 0 { + for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSell_Order) 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 *MsgSell_Order) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSell_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTx(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.AskPrice != nil { + { + size, err := m.AskPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintTx(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x12 + } + if len(m.BatchDenom) > 0 { + i -= len(m.BatchDenom) + copy(dAtA[i:], m.BatchDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.BatchDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSellResponse) 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 *MsgSellResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSellResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SellOrderIds) > 0 { + dAtA4 := make([]byte, len(m.SellOrderIds)*10) + var j3 int + for _, num := range m.SellOrderIds { + for num >= 1<<7 { + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA4[j3] = uint8(num) + j3++ + } + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintTx(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSellOrders) 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 *MsgUpdateSellOrders) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSellOrders) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Updates) > 0 { + for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSellOrders_Update) 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 *MsgUpdateSellOrders_Update) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSellOrders_Update) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewExpiration != nil { + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NewExpiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x2a + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.NewAskPrice != nil { + { + size, err := m.NewAskPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.NewQuantity) > 0 { + i -= len(m.NewQuantity) + copy(dAtA[i:], m.NewQuantity) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewQuantity))) + i-- + dAtA[i] = 0x12 + } + if m.SellOrderId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSellOrdersResponse) 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 *MsgUpdateSellOrdersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSellOrdersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBuy) 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 *MsgBuy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Orders) > 0 { + for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Buyer) > 0 { + i -= len(m.Buyer) + copy(dAtA[i:], m.Buyer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Buyer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBuy_Order) 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 *MsgBuy_Order) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuy_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x3a + } + if len(m.RetirementLocation) > 0 { + i -= len(m.RetirementLocation) + copy(dAtA[i:], m.RetirementLocation) + i = encodeVarintTx(dAtA, i, uint64(len(m.RetirementLocation))) + i-- + dAtA[i] = 0x32 + } + if m.DisablePartialFill { + i-- + if m.DisablePartialFill { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.DisableAutoRetire { + i-- + if m.DisableAutoRetire { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.BidPrice != nil { + { + size, err := m.BidPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Quantity) > 0 { + i -= len(m.Quantity) + copy(dAtA[i:], m.Quantity) + i = encodeVarintTx(dAtA, i, uint64(len(m.Quantity))) + i-- + dAtA[i] = 0x12 + } + if m.Selection != nil { + { + size, err := m.Selection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBuy_Order_Selection) 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 *MsgBuy_Order_Selection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuy_Order_Selection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *MsgBuy_Order_Selection_SellOrderId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuy_Order_Selection_SellOrderId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.SellOrderId)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *MsgBuy_Order_Selection_Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuy_Order_Selection_Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MsgBuyResponse) 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 *MsgBuyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBuyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BuyOrderIds) > 0 { + dAtA12 := make([]byte, len(m.BuyOrderIds)*10) + var j11 int + for _, num := range m.BuyOrderIds { + for num >= 1<<7 { + dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j11++ + } + dAtA12[j11] = uint8(num) + j11++ + } + i -= j11 + copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintTx(dAtA, i, uint64(j11)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAllowAskDenom) 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 *MsgAllowAskDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowAskDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Exponent != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x20 + } + if len(m.DisplayDenom) > 0 { + i -= len(m.DisplayDenom) + copy(dAtA[i:], m.DisplayDenom) + i = encodeVarintTx(dAtA, i, uint64(len(m.DisplayDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintTx(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.RootAddress) > 0 { + i -= len(m.RootAddress) + copy(dAtA[i:], m.RootAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.RootAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAllowAskDenomResponse) 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 *MsgAllowAskDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowAskDenomResponse) 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 *MsgSell) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Orders) > 0 { + for _, e := range m.Orders { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSell_Order) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.AskPrice != nil { + l = m.AskPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSellResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SellOrderIds) > 0 { + l = 0 + for _, e := range m.SellOrderIds { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } + return n +} + +func (m *MsgUpdateSellOrders) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Updates) > 0 { + for _, e := range m.Updates { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateSellOrders_Update) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SellOrderId != 0 { + n += 1 + sovTx(uint64(m.SellOrderId)) + } + l = len(m.NewQuantity) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.NewAskPrice != nil { + l = m.NewAskPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.NewExpiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration) + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateSellOrdersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBuy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Buyer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Orders) > 0 { + for _, e := range m.Orders { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgBuy_Order) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Selection != nil { + l = m.Selection.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Quantity) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BidPrice != nil { + l = m.BidPrice.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.DisableAutoRetire { + n += 2 + } + if m.DisablePartialFill { + n += 2 + } + l = len(m.RetirementLocation) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBuy_Order_Selection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *MsgBuy_Order_Selection_SellOrderId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.SellOrderId)) + return n +} +func (m *MsgBuy_Order_Selection_Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgBuyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BuyOrderIds) > 0 { + l = 0 + for _, e := range m.BuyOrderIds { + l += sovTx(uint64(e)) + } + n += 1 + sovTx(uint64(l)) + l + } + return n +} + +func (m *MsgAllowAskDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RootAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DisplayDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovTx(uint64(m.Exponent)) + } + return n +} + +func (m *MsgAllowAskDenomResponse) 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 *MsgSell) 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: MsgSell: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSell: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Orders = append(m.Orders, &MsgSell_Order{}) + if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSell_Order) 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: Order: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Order: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchDenom", 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.BatchDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", 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.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AskPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AskPrice == nil { + m.AskPrice = &types.Coin{} + } + if err := m.AskPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSellResponse) 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: MsgSellResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSellResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SellOrderIds = append(m.SellOrderIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.SellOrderIds) == 0 { + m.SellOrderIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SellOrderIds = append(m.SellOrderIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSellOrders) 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: MsgUpdateSellOrders: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSellOrders: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Updates = append(m.Updates, &MsgUpdateSellOrders_Update{}) + if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSellOrders_Update) 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: Update: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Update: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + m.SellOrderId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SellOrderId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewQuantity", 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.NewQuantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewAskPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewAskPrice == nil { + m.NewAskPrice = &types.Coin{} + } + if err := m.NewAskPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewExpiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewExpiration == nil { + m.NewExpiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.NewExpiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSellOrdersResponse) 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: MsgUpdateSellOrdersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSellOrdersResponse: 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 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBuy) 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: MsgBuy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBuy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buyer", 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.Buyer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Orders = append(m.Orders, &MsgBuy_Order{}) + if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBuy_Order) 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: Order: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Order: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selection == nil { + m.Selection = &MsgBuy_Order_Selection{} + } + if err := m.Selection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", 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.Quantity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BidPrice == nil { + m.BidPrice = &types.Coin{} + } + if err := m.BidPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableAutoRetire", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableAutoRetire = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisablePartialFill", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisablePartialFill = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetirementLocation", 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.RetirementLocation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBuy_Order_Selection) 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: Selection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Selection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SellOrderId", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &MsgBuy_Order_Selection_SellOrderId{v} + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Filter{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &MsgBuy_Order_Selection_Filter{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBuyResponse) 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: MsgBuyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBuyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BuyOrderIds = append(m.BuyOrderIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.BuyOrderIds) == 0 { + m.BuyOrderIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BuyOrderIds = append(m.BuyOrderIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BuyOrderIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAllowAskDenom) 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: MsgAllowAskDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowAskDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RootAddress", 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.RootAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayDenom", 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.DisplayDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAllowAskDenomResponse) 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: MsgAllowAskDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowAskDenomResponse: 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 { + return ErrInvalidLengthTx + } + if (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/ecocredit/marketplace/v1beta1/types.pb.go b/x/ecocredit/marketplace/v1beta1/types.pb.go new file mode 100644 index 0000000000..42962088cc --- /dev/null +++ b/x/ecocredit/marketplace/v1beta1/types.pb.go @@ -0,0 +1,1549 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/marketplace/v1beta1/types.proto + +package v1beta1 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + 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 + +// Filter is used to create filtered buy orders which match credit batch +// sell orders based on selection criteria rather than matching individual +// sell orders +type Filter struct { + // or is a list of criteria for matching credit batches. A credit which + // matches this filter must match at least one of these criteria. + Or []*Filter_Criteria `protobuf:"bytes,1,rep,name=or,proto3" json:"or,omitempty"` +} + +func (m *Filter) Reset() { *m = Filter{} } +func (m *Filter) String() string { return proto.CompactTextString(m) } +func (*Filter) ProtoMessage() {} +func (*Filter) Descriptor() ([]byte, []int) { + return fileDescriptor_cb996ab2d5b82893, []int{0} +} +func (m *Filter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter.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 *Filter) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter.Merge(m, src) +} +func (m *Filter) XXX_Size() int { + return m.Size() +} +func (m *Filter) XXX_DiscardUnknown() { + xxx_messageInfo_Filter.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter proto.InternalMessageInfo + +func (m *Filter) GetOr() []*Filter_Criteria { + if m != nil { + return m.Or + } + return nil +} + +// Criteria is a simple filter criteria for matching a credit batch. +type Filter_Criteria struct { + // Valid selector types are all + // attributes which are assigned to credit batches by some authority such + // as the credit issuer or a curator. Requiring some authority-based selector + // ensures that buy orders cannot just match some randomly issued credit + // based on location and dates. + // + // Types that are valid to be assigned to Selector: + // *Filter_Criteria_ClassSelector + // *Filter_Criteria_ProjectSelector + // *Filter_Criteria_BatchSelector + Selector isFilter_Criteria_Selector `protobuf_oneof:"selector"` +} + +func (m *Filter_Criteria) Reset() { *m = Filter_Criteria{} } +func (m *Filter_Criteria) String() string { return proto.CompactTextString(m) } +func (*Filter_Criteria) ProtoMessage() {} +func (*Filter_Criteria) Descriptor() ([]byte, []int) { + return fileDescriptor_cb996ab2d5b82893, []int{0, 0} +} +func (m *Filter_Criteria) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Filter_Criteria) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Filter_Criteria.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 *Filter_Criteria) XXX_Merge(src proto.Message) { + xxx_messageInfo_Filter_Criteria.Merge(m, src) +} +func (m *Filter_Criteria) XXX_Size() int { + return m.Size() +} +func (m *Filter_Criteria) XXX_DiscardUnknown() { + xxx_messageInfo_Filter_Criteria.DiscardUnknown(m) +} + +var xxx_messageInfo_Filter_Criteria proto.InternalMessageInfo + +type isFilter_Criteria_Selector interface { + isFilter_Criteria_Selector() + MarshalTo([]byte) (int, error) + Size() int +} + +type Filter_Criteria_ClassSelector struct { + ClassSelector *ClassSelector `protobuf:"bytes,1,opt,name=class_selector,json=classSelector,proto3,oneof" json:"class_selector,omitempty"` +} +type Filter_Criteria_ProjectSelector struct { + ProjectSelector *ProjectSelector `protobuf:"bytes,2,opt,name=project_selector,json=projectSelector,proto3,oneof" json:"project_selector,omitempty"` +} +type Filter_Criteria_BatchSelector struct { + BatchSelector *BatchSelector `protobuf:"bytes,3,opt,name=batch_selector,json=batchSelector,proto3,oneof" json:"batch_selector,omitempty"` +} + +func (*Filter_Criteria_ClassSelector) isFilter_Criteria_Selector() {} +func (*Filter_Criteria_ProjectSelector) isFilter_Criteria_Selector() {} +func (*Filter_Criteria_BatchSelector) isFilter_Criteria_Selector() {} + +func (m *Filter_Criteria) GetSelector() isFilter_Criteria_Selector { + if m != nil { + return m.Selector + } + return nil +} + +func (m *Filter_Criteria) GetClassSelector() *ClassSelector { + if x, ok := m.GetSelector().(*Filter_Criteria_ClassSelector); ok { + return x.ClassSelector + } + return nil +} + +func (m *Filter_Criteria) GetProjectSelector() *ProjectSelector { + if x, ok := m.GetSelector().(*Filter_Criteria_ProjectSelector); ok { + return x.ProjectSelector + } + return nil +} + +func (m *Filter_Criteria) GetBatchSelector() *BatchSelector { + if x, ok := m.GetSelector().(*Filter_Criteria_BatchSelector); ok { + return x.BatchSelector + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Filter_Criteria) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Filter_Criteria_ClassSelector)(nil), + (*Filter_Criteria_ProjectSelector)(nil), + (*Filter_Criteria_BatchSelector)(nil), + } +} + +// ClassSelector is a selector for a credit class. +type ClassSelector struct { + // class_id is the credit class ID. + ClassId uint64 `protobuf:"varint,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // project_location can be specified in three levels of granularity: + // country, sub-national-code, or postal code. If just country is given, + // for instance "US" then any credits in the "US" will be matched even + // their project location is more specific, ex. "US-NY 12345". If + // a country, sub-national-code and postal code are all provided then + // only projects in that postal code will match. + ProjectLocation string `protobuf:"bytes,2,opt,name=project_location,json=projectLocation,proto3" json:"project_location,omitempty"` + // start_date is the beginning of the period during which a credit batch + // was quantified and verified. If it is empty then there is no start date + // limit. + MinStartDate *types.Timestamp `protobuf:"bytes,3,opt,name=min_start_date,json=minStartDate,proto3" json:"min_start_date,omitempty"` + // max_end_date is the end of the period during which a credit batch was + // quantified and verified. If it is empty then there is no end date + // limit. + MaxEndDate *types.Timestamp `protobuf:"bytes,4,opt,name=max_end_date,json=maxEndDate,proto3" json:"max_end_date,omitempty"` +} + +func (m *ClassSelector) Reset() { *m = ClassSelector{} } +func (m *ClassSelector) String() string { return proto.CompactTextString(m) } +func (*ClassSelector) ProtoMessage() {} +func (*ClassSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_cb996ab2d5b82893, []int{1} +} +func (m *ClassSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClassSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClassSelector.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 *ClassSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClassSelector.Merge(m, src) +} +func (m *ClassSelector) XXX_Size() int { + return m.Size() +} +func (m *ClassSelector) XXX_DiscardUnknown() { + xxx_messageInfo_ClassSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_ClassSelector proto.InternalMessageInfo + +func (m *ClassSelector) GetClassId() uint64 { + if m != nil { + return m.ClassId + } + return 0 +} + +func (m *ClassSelector) GetProjectLocation() string { + if m != nil { + return m.ProjectLocation + } + return "" +} + +func (m *ClassSelector) GetMinStartDate() *types.Timestamp { + if m != nil { + return m.MinStartDate + } + return nil +} + +func (m *ClassSelector) GetMaxEndDate() *types.Timestamp { + if m != nil { + return m.MaxEndDate + } + return nil +} + +// ProjectSelector is a selector for a project. +type ProjectSelector struct { + // project_id is the project ID. + ProjectId uint64 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + // start_date is the beginning of the period during which a credit batch + // was quantified and verified. If it is empty then there is no start date + // limit. + MinStartDate *types.Timestamp `protobuf:"bytes,2,opt,name=min_start_date,json=minStartDate,proto3" json:"min_start_date,omitempty"` + // max_end_date is the end of the period during which a credit batch was + // quantified and verified. If it is empty then there is no end date + // limit. + MaxEndDate *types.Timestamp `protobuf:"bytes,3,opt,name=max_end_date,json=maxEndDate,proto3" json:"max_end_date,omitempty"` +} + +func (m *ProjectSelector) Reset() { *m = ProjectSelector{} } +func (m *ProjectSelector) String() string { return proto.CompactTextString(m) } +func (*ProjectSelector) ProtoMessage() {} +func (*ProjectSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_cb996ab2d5b82893, []int{2} +} +func (m *ProjectSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProjectSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProjectSelector.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 *ProjectSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProjectSelector.Merge(m, src) +} +func (m *ProjectSelector) XXX_Size() int { + return m.Size() +} +func (m *ProjectSelector) XXX_DiscardUnknown() { + xxx_messageInfo_ProjectSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_ProjectSelector proto.InternalMessageInfo + +func (m *ProjectSelector) GetProjectId() uint64 { + if m != nil { + return m.ProjectId + } + return 0 +} + +func (m *ProjectSelector) GetMinStartDate() *types.Timestamp { + if m != nil { + return m.MinStartDate + } + return nil +} + +func (m *ProjectSelector) GetMaxEndDate() *types.Timestamp { + if m != nil { + return m.MaxEndDate + } + return nil +} + +// BatchSelector is a selector for a credit batch. +type BatchSelector struct { + // batch_id is the credit batch ID. + BatchId uint64 `protobuf:"varint,1,opt,name=batch_id,json=batchId,proto3" json:"batch_id,omitempty"` +} + +func (m *BatchSelector) Reset() { *m = BatchSelector{} } +func (m *BatchSelector) String() string { return proto.CompactTextString(m) } +func (*BatchSelector) ProtoMessage() {} +func (*BatchSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_cb996ab2d5b82893, []int{3} +} +func (m *BatchSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BatchSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BatchSelector.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 *BatchSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchSelector.Merge(m, src) +} +func (m *BatchSelector) XXX_Size() int { + return m.Size() +} +func (m *BatchSelector) XXX_DiscardUnknown() { + xxx_messageInfo_BatchSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchSelector proto.InternalMessageInfo + +func (m *BatchSelector) GetBatchId() uint64 { + if m != nil { + return m.BatchId + } + return 0 +} + +func init() { + proto.RegisterType((*Filter)(nil), "regen.ecocredit.marketplace.v1beta1.Filter") + proto.RegisterType((*Filter_Criteria)(nil), "regen.ecocredit.marketplace.v1beta1.Filter.Criteria") + proto.RegisterType((*ClassSelector)(nil), "regen.ecocredit.marketplace.v1beta1.ClassSelector") + proto.RegisterType((*ProjectSelector)(nil), "regen.ecocredit.marketplace.v1beta1.ProjectSelector") + proto.RegisterType((*BatchSelector)(nil), "regen.ecocredit.marketplace.v1beta1.BatchSelector") +} + +func init() { + proto.RegisterFile("regen/ecocredit/marketplace/v1beta1/types.proto", fileDescriptor_cb996ab2d5b82893) +} + +var fileDescriptor_cb996ab2d5b82893 = []byte{ + // 466 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x41, 0x6f, 0xd3, 0x30, + 0x18, 0x86, 0x9b, 0x74, 0x1a, 0x9d, 0xb7, 0x6e, 0xc8, 0x27, 0xa8, 0x44, 0x40, 0xe5, 0x32, 0x90, + 0x70, 0xb4, 0xc2, 0x91, 0x03, 0xea, 0x36, 0x44, 0x25, 0x0e, 0xa8, 0xe3, 0x04, 0x87, 0xc8, 0xb1, + 0x3f, 0x32, 0xb3, 0x24, 0x8e, 0x9c, 0x6f, 0x50, 0xee, 0xfc, 0x00, 0x7e, 0x0a, 0x12, 0x7f, 0x82, + 0xe3, 0x2e, 0x48, 0x1c, 0x51, 0xfb, 0x47, 0x50, 0x9c, 0xa4, 0x49, 0x11, 0x82, 0x56, 0x3b, 0xfa, + 0x95, 0x9e, 0xd7, 0xef, 0xeb, 0xef, 0x33, 0xf1, 0x0d, 0x44, 0x90, 0xfa, 0x20, 0xb4, 0x30, 0x20, + 0x15, 0xfa, 0x09, 0x37, 0x17, 0x80, 0x59, 0xcc, 0x05, 0xf8, 0x1f, 0x8e, 0x42, 0x40, 0x7e, 0xe4, + 0xe3, 0xa7, 0x0c, 0x72, 0x96, 0x19, 0x8d, 0x9a, 0xde, 0xb7, 0x00, 0x5b, 0x02, 0xac, 0x05, 0xb0, + 0x0a, 0x18, 0xdc, 0x8d, 0xb4, 0x8e, 0x62, 0xf0, 0x2d, 0x12, 0x5e, 0xbe, 0xf3, 0x51, 0x25, 0x90, + 0x23, 0x4f, 0xb2, 0xd2, 0x65, 0xf8, 0xb9, 0x4b, 0xb6, 0x9f, 0xab, 0x18, 0xc1, 0xd0, 0x13, 0xe2, + 0x6a, 0x73, 0xcb, 0xb9, 0xd7, 0x3d, 0xdc, 0x1d, 0x3d, 0x61, 0x6b, 0xb8, 0xb3, 0x12, 0x64, 0xc7, + 0x46, 0x21, 0x18, 0xc5, 0xa7, 0xae, 0x36, 0x83, 0x6f, 0x2e, 0xe9, 0xd5, 0x02, 0x7d, 0x4b, 0xf6, + 0x45, 0xcc, 0xf3, 0x3c, 0xc8, 0x21, 0x06, 0x81, 0xd6, 0xde, 0x39, 0xdc, 0x1d, 0x8d, 0xd6, 0xb2, + 0x3f, 0x2e, 0xd0, 0xb3, 0x8a, 0x7c, 0xd1, 0x99, 0xf6, 0x45, 0x5b, 0xa0, 0x9c, 0xdc, 0xcc, 0x8c, + 0x7e, 0x0f, 0x02, 0x1b, 0x7b, 0xd7, 0xda, 0xaf, 0x97, 0xfe, 0x55, 0x09, 0xb7, 0x2e, 0x38, 0xc8, + 0x56, 0xa5, 0x22, 0x7f, 0xc8, 0x51, 0x9c, 0x37, 0x17, 0x74, 0x37, 0xc8, 0x3f, 0x2e, 0xd0, 0x76, + 0xfe, 0xb0, 0x2d, 0x8c, 0x09, 0xe9, 0xd5, 0xb6, 0xc3, 0x1f, 0x0e, 0xe9, 0xaf, 0xd4, 0xa5, 0xb7, + 0x49, 0xaf, 0x7c, 0x3a, 0x25, 0xed, 0xa3, 0x6d, 0x4d, 0x6f, 0xd8, 0xf3, 0x44, 0xd2, 0x07, 0x4d, + 0xf1, 0x58, 0x0b, 0x8e, 0x4a, 0xa7, 0xb6, 0xf8, 0xce, 0xb2, 0xc0, 0xcb, 0x4a, 0xa6, 0xcf, 0xc8, + 0x7e, 0xa2, 0xd2, 0x20, 0x47, 0x6e, 0x30, 0x90, 0x1c, 0xa1, 0x2a, 0x30, 0x60, 0xe5, 0x62, 0xb0, + 0x7a, 0x31, 0xd8, 0xeb, 0x7a, 0x31, 0xa6, 0x7b, 0x89, 0x4a, 0xcf, 0x0a, 0xe0, 0x84, 0x23, 0xd0, + 0xa7, 0x64, 0x2f, 0xe1, 0xb3, 0x00, 0x52, 0x59, 0xf2, 0x5b, 0xff, 0xe5, 0x49, 0xc2, 0x67, 0xa7, + 0xa9, 0x2c, 0xe8, 0xe1, 0x57, 0x87, 0x1c, 0xfc, 0xf1, 0xce, 0xf4, 0x0e, 0x21, 0x75, 0xfc, 0x65, + 0xb7, 0x9d, 0x4a, 0x99, 0xc8, 0xbf, 0x44, 0x76, 0xaf, 0x19, 0xb9, 0xbb, 0x51, 0xe4, 0x87, 0xa4, + 0xbf, 0x32, 0xb8, 0x62, 0x12, 0xe5, 0x12, 0x34, 0x93, 0xb0, 0xe7, 0x89, 0x1c, 0x07, 0xdf, 0xe7, + 0x9e, 0x73, 0x35, 0xf7, 0x9c, 0x5f, 0x73, 0xcf, 0xf9, 0xb2, 0xf0, 0x3a, 0x57, 0x0b, 0xaf, 0xf3, + 0x73, 0xe1, 0x75, 0xde, 0x9c, 0x46, 0x0a, 0xcf, 0x2f, 0x43, 0x26, 0x74, 0x52, 0xfe, 0xec, 0x47, + 0x29, 0xe0, 0x47, 0x6d, 0x2e, 0xaa, 0x53, 0x0c, 0x32, 0x02, 0xe3, 0xcf, 0xfe, 0xfd, 0xe1, 0xc3, + 0x6d, 0x1b, 0xf6, 0xf1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x45, 0xcd, 0x8e, 0xa0, 0x1e, 0x04, + 0x00, 0x00, +} + +func (m *Filter) 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 *Filter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Or) > 0 { + for iNdEx := len(m.Or) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Or[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Filter_Criteria) 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 *Filter_Criteria) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Criteria) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Selector != nil { + { + size := m.Selector.Size() + i -= size + if _, err := m.Selector.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Filter_Criteria_ClassSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Criteria_ClassSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ClassSelector != nil { + { + size, err := m.ClassSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Filter_Criteria_ProjectSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Criteria_ProjectSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ProjectSelector != nil { + { + size, err := m.ProjectSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Filter_Criteria_BatchSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Filter_Criteria_BatchSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.BatchSelector != nil { + { + size, err := m.BatchSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *ClassSelector) 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 *ClassSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClassSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxEndDate != nil { + { + size, err := m.MaxEndDate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.MinStartDate != nil { + { + size, err := m.MinStartDate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.ProjectLocation) > 0 { + i -= len(m.ProjectLocation) + copy(dAtA[i:], m.ProjectLocation) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProjectLocation))) + i-- + dAtA[i] = 0x12 + } + if m.ClassId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ClassId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProjectSelector) 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 *ProjectSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProjectSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxEndDate != nil { + { + size, err := m.MaxEndDate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.MinStartDate != nil { + { + size, err := m.MinStartDate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProjectId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ProjectId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BatchSelector) 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 *BatchSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BatchSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BatchId != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.BatchId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Filter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Or) > 0 { + for _, e := range m.Or { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *Filter_Criteria) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Selector != nil { + n += m.Selector.Size() + } + return n +} + +func (m *Filter_Criteria_ClassSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClassSelector != nil { + l = m.ClassSelector.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Filter_Criteria_ProjectSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProjectSelector != nil { + l = m.ProjectSelector.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *Filter_Criteria_BatchSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BatchSelector != nil { + l = m.BatchSelector.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} +func (m *ClassSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClassId != 0 { + n += 1 + sovTypes(uint64(m.ClassId)) + } + l = len(m.ProjectLocation) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.MinStartDate != nil { + l = m.MinStartDate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.MaxEndDate != nil { + l = m.MaxEndDate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *ProjectSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProjectId != 0 { + n += 1 + sovTypes(uint64(m.ProjectId)) + } + if m.MinStartDate != nil { + l = m.MinStartDate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.MaxEndDate != nil { + l = m.MaxEndDate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BatchSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BatchId != 0 { + n += 1 + sovTypes(uint64(m.BatchId)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Filter) 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 ErrIntOverflowTypes + } + 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: Filter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Filter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Or", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Or = append(m.Or, &Filter_Criteria{}) + if err := m.Or[len(m.Or)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Filter_Criteria) 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 ErrIntOverflowTypes + } + 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: Criteria: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Criteria: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ClassSelector{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Selector = &Filter_Criteria_ClassSelector{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ProjectSelector{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Selector = &Filter_Criteria_ProjectSelector{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &BatchSelector{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Selector = &Filter_Criteria_BatchSelector{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClassSelector) 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 ErrIntOverflowTypes + } + 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: ClassSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClassSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + m.ClassId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClassId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectLocation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProjectLocation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStartDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinStartDate == nil { + m.MinStartDate = &types.Timestamp{} + } + if err := m.MinStartDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxEndDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxEndDate == nil { + m.MaxEndDate = &types.Timestamp{} + } + if err := m.MaxEndDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProjectSelector) 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 ErrIntOverflowTypes + } + 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: ProjectSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProjectSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProjectId", wireType) + } + m.ProjectId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProjectId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinStartDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MinStartDate == nil { + m.MinStartDate = &types.Timestamp{} + } + if err := m.MinStartDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxEndDate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxEndDate == nil { + m.MaxEndDate = &types.Timestamp{} + } + if err := m.MaxEndDate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BatchSelector) 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 ErrIntOverflowTypes + } + 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: BatchSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BatchId", wireType) + } + m.BatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BatchId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/ecocredit/query.pb.gw.go b/x/ecocredit/query.pb.gw.go index b1b7babca6..6bb461ebff 100644 --- a/x/ecocredit/query.pb.gw.go +++ b/x/ecocredit/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join var ( filter_Query_Classes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -1118,12 +1120,14 @@ func local_request_Query_BasketCredits_0(ctx context.Context, marshaler runtime. // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_Classes_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 { @@ -1131,6 +1135,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Classes_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) @@ -1144,6 +1149,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ClassInfo_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 { @@ -1151,6 +1158,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ClassInfo_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) @@ -1164,6 +1172,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Projects_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 { @@ -1171,6 +1181,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Projects_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) @@ -1184,6 +1195,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ProjectInfo_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 { @@ -1191,6 +1204,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ProjectInfo_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) @@ -1204,6 +1218,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Batches_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 { @@ -1211,6 +1227,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Batches_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) @@ -1224,6 +1241,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BatchInfo_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 { @@ -1231,6 +1250,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BatchInfo_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) @@ -1244,6 +1264,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Balance_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 { @@ -1251,6 +1273,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Balance_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) @@ -1264,6 +1287,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Supply_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 { @@ -1271,6 +1296,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Supply_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) @@ -1284,6 +1310,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_CreditTypes_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 { @@ -1291,6 +1319,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_CreditTypes_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) @@ -1304,6 +1333,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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 { @@ -1311,6 +1342,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) @@ -1324,6 +1356,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SellOrder_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 { @@ -1331,6 +1365,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SellOrder_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) @@ -1344,6 +1379,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SellOrders_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 { @@ -1351,6 +1388,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SellOrders_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) @@ -1364,6 +1402,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SellOrdersByBatchDenom_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 { @@ -1371,6 +1411,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SellOrdersByBatchDenom_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) @@ -1384,6 +1425,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SellOrdersByAddress_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 { @@ -1391,6 +1434,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SellOrdersByAddress_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) @@ -1404,6 +1448,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BuyOrder_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 { @@ -1411,6 +1457,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BuyOrder_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) @@ -1424,6 +1471,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BuyOrders_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 { @@ -1431,6 +1480,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BuyOrders_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) @@ -1444,6 +1494,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BuyOrdersByAddress_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 { @@ -1451,6 +1503,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BuyOrdersByAddress_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) @@ -1464,6 +1517,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_AllowedAskDenoms_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 { @@ -1471,6 +1526,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_AllowedAskDenoms_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) @@ -1484,6 +1540,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Basket_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 { @@ -1491,6 +1549,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Basket_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) @@ -1504,6 +1563,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Baskets_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 { @@ -1511,6 +1572,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Baskets_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) @@ -1524,6 +1586,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BasketCredits_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 { @@ -1531,6 +1595,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BasketCredits_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) diff --git a/x/ecocredit/server/core/denom.go b/x/ecocredit/server/core/denom.go new file mode 100644 index 0000000000..2886f4c202 --- /dev/null +++ b/x/ecocredit/server/core/denom.go @@ -0,0 +1,16 @@ +package core + +import ( + "fmt" + "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1" +) + +// FormatClassID formats the ID to use for a new credit class, based on the credit type and +// sequence number. This format may evolve over time, but will maintain +// backwards compatibility. +// +// The initial version has format: +// +func FormatClassID(creditType v1beta1.CreditType, classSeqNo uint64) string { + return fmt.Sprintf("%s%02d", creditType.Abbreviation, classSeqNo) +} diff --git a/x/ecocredit/server/core/genesis.go b/x/ecocredit/server/core/genesis.go new file mode 100644 index 0000000000..0ce3977306 --- /dev/null +++ b/x/ecocredit/server/core/genesis.go @@ -0,0 +1,30 @@ +package core + +import ( + "encoding/json" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/orm/types/ormjson" + regentypes "github.com/regen-network/regen-ledger/types" + abci "github.com/tendermint/tendermint/abci/types" +) + +// InitGenesis performs genesis initialization for the ecocredit module. It +// returns no validator updates. +func (s serverImpl) InitGenesis(ctx regentypes.Context, cdc codec.Codec, data json.RawMessage) ([]abci.ValidatorUpdate, error) { + goCtx := ctx.Context.Context() + target, err := ormjson.NewRawMessageSource(data) + if err != nil { + return nil, err + } + return []abci.ValidatorUpdate{}, s.db.ImportJSON(goCtx, target) +} + +// ExportGenesis will dump the ecocredit module state into a serializable GenesisState. +func (s serverImpl) ExportGenesis(ctx regentypes.Context, cdc codec.Codec) (json.RawMessage, error) { + target := ormjson.NewRawMessageTarget() + err := s.db.ExportJSON(ctx.Context.Context(), target) + if err != nil { + return nil, err + } + return target.JSON() +} diff --git a/x/ecocredit/server/core/invariants.go b/x/ecocredit/server/core/invariants.go new file mode 100644 index 0000000000..f8e0a89c06 --- /dev/null +++ b/x/ecocredit/server/core/invariants.go @@ -0,0 +1,217 @@ +package core + +import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + ecocreditv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1beta1" + "github.com/regen-network/regen-ledger/types/math" + "github.com/regen-network/regen-ledger/x/ecocredit" +) + +// RegisterInvariants registers the ecocredit module invariants. +func (s serverImpl) RegisterInvariants(ir sdk.InvariantRegistry) { + ir.RegisterRoute(ecocredit.ModuleName, "tradable-supply", s.tradableSupplyInvariant()) + ir.RegisterRoute(ecocredit.ModuleName, "retired-supply", s.retiredSupplyInvariant()) +} + +func (s serverImpl) tradableSupplyInvariant() sdk.Invariant { + return func(ctx sdk.Context) (string, bool) { + supplyStore := s.batchSupplyStore + batchStore := s.batchInfoStore + balanceStore := s.batchBalanceStore + return tradableSupplyInvariant(supplyStore, balanceStore, batchStore, ctx) + } +} + +func tradableSupplyInvariant(batchSupplyStore ecocreditv1beta1.BatchSupplyStore, balanceStore ecocreditv1beta1.BatchBalanceStore, batchInfoStore ecocreditv1beta1.BatchInfoStore, ctx sdk.Context) (string, bool) { + var ( + msg string + broken bool + ) + calTradableSupplies := make(map[string]math.Dec) + + err := iterateBalances(balanceStore, batchInfoStore, true, ctx, func(denom, supply string) bool { + balance, err := math.NewNonNegativeDecFromString(supply) + if err != nil { + broken = true + msg += fmt.Sprintf("error while parsing tradable balance %v", err) + } + if supply, ok := calTradableSupplies[denom]; ok { + supply, err := math.SafeAddBalance(supply, balance) + if err != nil { + broken = true + msg += fmt.Sprintf("error adding credit batch tradable supply %v", err) + } + calTradableSupplies[denom] = supply + } else { + calTradableSupplies[denom] = balance + } + + return false + }) + if err != nil { + msg = fmt.Sprintf("error querying credit balances tradable supply %v", err) + } + + if err := iterateSupplies(batchSupplyStore, batchInfoStore, true, ctx, func(denom string, s string) bool { + supply, err := math.NewNonNegativeDecFromString(s) + if err != nil { + broken = true + msg += fmt.Sprintf("error while parsing tradable supply for denom: %s", denom) + } + if s1, ok := calTradableSupplies[denom]; ok { + if supply.Cmp(s1) != 0 { + broken = true + msg += fmt.Sprintf("tradable supply is incorrect for %s credit batch, expected %v, got %v", denom, supply, s1) + } + } else { + broken = true + msg += fmt.Sprintf("tradable supply is not found for %s credit batch", denom) + } + return false + }); err != nil { + msg = fmt.Sprintf("error querying credit tradable supply %v", err) + } + + return msg, broken +} + +func (s serverImpl) retiredSupplyInvariant() sdk.Invariant { + return func(ctx sdk.Context) (string, bool) { + supplyStore := s.batchSupplyStore + balanceStore := s.batchBalanceStore + batchStore := s.batchInfoStore + return retiredSupplyInvariant(supplyStore, balanceStore, batchStore, ctx) + } +} + +func retiredSupplyInvariant(supplyStore ecocreditv1beta1.BatchSupplyStore, balanceStore ecocreditv1beta1.BatchBalanceStore, batchInfoStore ecocreditv1beta1.BatchInfoStore, ctx sdk.Context) (string, bool) { + var ( + msg string + broken bool + ) + calRetiredSupplies := make(map[string]math.Dec) + err := iterateBalances(balanceStore, batchInfoStore, false, ctx, func(denom, supply string) bool { + balance, err := math.NewNonNegativeDecFromString(supply) + if err != nil { + broken = true + msg += fmt.Sprintf("error while parsing retired balance %v", err) + } + if supply, ok := calRetiredSupplies[denom]; ok { + supply, err := math.SafeAddBalance(balance, supply) + if err != nil { + broken = true + msg += fmt.Sprintf("error adding credit batch retired supply %v", err) + } + calRetiredSupplies[denom] = supply + } else { + calRetiredSupplies[denom] = balance + } + return false + }) + if err != nil { + msg = fmt.Sprintf("error querying credit retired balances %v", err) + } + + if err := iterateSupplies(supplyStore, batchInfoStore, false, ctx, func(denom, s string) bool { + supply, err := math.NewNonNegativeDecFromString(s) + if err != nil { + broken = true + msg += fmt.Sprintf("error while parsing reired supply for denom: %s", denom) + } + if s1, ok := calRetiredSupplies[denom]; ok { + if supply.Cmp(s1) != 0 { + broken = true + msg += fmt.Sprintf("retired supply is incorrect for %s credit batch, expected %v, got %v", denom, supply, s1) + } + } else { + broken = true + msg += fmt.Sprintf("retired supply is not found for %s credit batch", denom) + } + + return false + }); err != nil { + msg = fmt.Sprintf("error querying credit retired supply %v", err) + } + + return msg, broken +} + +func iterateBalances(store ecocreditv1beta1.BatchBalanceStore, batchStore ecocreditv1beta1.BatchInfoStore, tradable bool, sdkCtx sdk.Context, cb func(denom, balance string) bool) error { + ctx := sdkCtx.Context() + it, err := store.List(ctx, &ecocreditv1beta1.BatchBalanceBatchIdAddressIndexKey{}) + if err != nil { + return err + } + // we cache denoms here so we don't have to ORM query each time + batchIdToDenom := make(map[uint64]string) + for it.Next() { + val, err := it.Value() + if err != nil { + return err + } + var batchDenom string + if d, ok := batchIdToDenom[val.BatchId]; ok { + batchDenom = d + } else { + batch, err := batchStore.Get(ctx, val.BatchId) + if err != nil { + return err + } + if batch == nil { + panic(fmt.Sprintf("batch was nil with batch id: %d and denom %s", val.BatchId, batchDenom)) + } + batchDenom = batch.BatchDenom + batchIdToDenom[val.BatchId] = batchDenom + } + + var balance string + if tradable { + balance = val.Tradable + } else { + balance = val.Retired + } + + if cb(batchDenom, balance) { + break + } + } + return nil +} + +func iterateSupplies(supplyStore ecocreditv1beta1.BatchSupplyStore, batchStore ecocreditv1beta1.BatchInfoStore, tradable bool, sdkCtx sdk.Context, cb func(denom, supply string) bool) error { + ctx := sdkCtx.Context() + it, err := supplyStore.List(ctx, &ecocreditv1beta1.BatchSupplyBatchIdIndexKey{}) + if err != nil { + return err + } + // we cache denoms here so we don't have to ORM query each time + batchIdToDenom := make(map[uint64]string) + for it.Next() { + val, err := it.Value() + if err != nil { + return err + } + var batchDenom string + if d, ok := batchIdToDenom[val.BatchId]; ok { + batchDenom = d + } else { + batch, err := batchStore.Get(ctx, val.BatchId) + if err != nil { + return err + } + batchDenom = batch.BatchDenom + batchIdToDenom[val.BatchId] = batchDenom + } + var supply string + if tradable { + supply = val.TradableAmount + } else { + supply = val.RetiredAmount + } + if cb(batchDenom, supply) { + break + } + } + return nil +} diff --git a/x/ecocredit/server/core/invariants_test.go b/x/ecocredit/server/core/invariants_test.go new file mode 100644 index 0000000000..561c6b85ed --- /dev/null +++ b/x/ecocredit/server/core/invariants_test.go @@ -0,0 +1,494 @@ +package core + +import ( + "context" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/orm/model/ormdb" + "github.com/cosmos/cosmos-sdk/orm/model/ormtable" + sdk "github.com/cosmos/cosmos-sdk/types" + ecocreditv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1beta1" + "github.com/regen-network/regen-ledger/types/math" + "github.com/regen-network/regen-ledger/x/ecocredit" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/known/timestamppb" + "testing" +) + +func setupStore(t *testing.T) ormdb.ModuleDB { + interfaceRegistry := types.NewInterfaceRegistry() + ecocredit.RegisterTypes(interfaceRegistry) + db := dbm.NewMemDB() + + var moduleSchema = ormdb.ModuleSchema{ + FileDescriptors: map[uint32]protoreflect.FileDescriptor{ + 1: ecocreditv1beta1.File_regen_ecocredit_v1beta1_state_proto, + }, + } + backend := ormtable.NewBackend(ormtable.BackendOptions{ + CommitmentStore: db, + IndexStore: nil, + Hooks: nil, + }) + modDB, err := ormdb.NewModuleDB(moduleSchema, ormdb.ModuleDBOptions{ + TypeResolver: nil, + FileResolver: nil, + JSONValidator: nil, + GetBackend: func(ctx context.Context) (ormtable.Backend, error) { + return backend, nil + }, + GetReadBackend: func(ctx context.Context) (ormtable.ReadBackend, error) { + return backend, nil + }, + }) + require.NoError(t, err) + return modDB +} + +func TestTradableSupplyInvariants(t *testing.T) { + acc1 := sdk.AccAddress([]byte("account1")) + acc2 := sdk.AccAddress([]byte("account2")) + + testCases := []struct { + msg string + balances []*ecocredit.Balance + supply []*ecocredit.Supply + expBroken bool + }{ + { + "valid test case", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + TradableBalance: "100", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + TradableBalance: "210", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + RetiredBalance: "210", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + TradableSupply: "310", + RetiredSupply: "210", + }, + }, + false, + }, + { + "valid test case multiple denom", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + TradableBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + TradableBalance: "210.456", + }, + { + Address: acc2.String(), + BatchDenom: "3/4", + TradableBalance: "210.456", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + TradableSupply: "310.579", + RetiredSupply: "0", + }, + { + BatchDenom: "3/4", + TradableSupply: "210.456", + RetiredSupply: "0", + }, + }, + false, + }, + { + "fail with error tradable balance not found", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + TradableBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + TradableBalance: "210.456", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + TradableSupply: "310.579", + RetiredSupply: "0", + }, + { + BatchDenom: "3/4", + TradableSupply: "1234", + RetiredSupply: "0", + }, + }, + true, + }, + { + "fail with error supply does not match", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + TradableBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + TradableBalance: "210.456", + }, + { + BatchDenom: "3/4", + Address: acc2.String(), + TradableBalance: "1234", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + TradableSupply: "310.57", + RetiredSupply: "0", + }, + { + BatchDenom: "3/4", + TradableSupply: "1234", + RetiredSupply: "0", + }, + }, + true, + }, + } + + db := setupStore(t) + + ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + supplyStore, err := ecocreditv1beta1.NewBatchSupplyStore(db) + require.NoError(t, err) + balanceStore, err := ecocreditv1beta1.NewBatchBalanceStore(db) + require.NoError(t, err) + batchInfoStore, err := ecocreditv1beta1.NewBatchInfoStore(db) + require.NoError(t, err) + + initBatchDenom(t, ctx.Context(), batchInfoStore, testCases) + + for _, tc := range testCases { + tc := tc + + t.Run(tc.msg, func(t *testing.T) { + + initBalances(t, ctx, balanceStore, batchInfoStore, tc.balances) + initSupply(t, ctx, supplyStore, batchInfoStore, tc.supply) + + msg, broken := tradableSupplyInvariant(supplyStore, balanceStore, batchInfoStore, ctx) + if tc.expBroken { + require.True(t, broken, msg) + } else { + require.False(t, broken, msg) + } + }) + } +} + +func initBatchDenom(t *testing.T, ctx context.Context, store ecocreditv1beta1.BatchInfoStore, testCases []struct { + msg string + balances []*ecocredit.Balance + supply []*ecocredit.Supply + expBroken bool +}) { + for _, tc := range testCases { + for _, b := range tc.balances { + has, err := store.HasByBatchDenom(ctx, b.BatchDenom) + require.NoError(t, err) + if !has { + err := store.Insert(ctx, &ecocreditv1beta1.BatchInfo{ + ProjectId: 0, + BatchDenom: b.BatchDenom, + Metadata: nil, + StartDate: timestamppb.Now(), + EndDate: timestamppb.Now(), + }) + require.NoError(t, err) + } + } + for _, s := range tc.supply { + has, err := store.HasByBatchDenom(ctx, s.BatchDenom) + require.NoError(t, err) + if !has { + err := store.Insert(ctx, &ecocreditv1beta1.BatchInfo{ + ProjectId: 0, + BatchDenom: s.BatchDenom, + Metadata: nil, + StartDate: timestamppb.Now(), + EndDate: timestamppb.Now(), + }) + require.NoError(t, err) + } + } + } +} + +func TestRetiredSupplyInvariants(t *testing.T) { + acc1 := sdk.AccAddress([]byte("account1")) + acc2 := sdk.AccAddress([]byte("account2")) + + testCases := []struct { + msg string + balances []*ecocredit.Balance + supply []*ecocredit.Supply + expBroken bool + }{ + { + "valid test case", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + RetiredBalance: "100", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + RetiredBalance: "210", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + TradableBalance: "210", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + RetiredSupply: "310", + TradableSupply: "210", + }, + }, + false, + }, + { + "valid test case multiple denom", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + RetiredBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + RetiredBalance: "210.456", + }, + { + Address: acc2.String(), + BatchDenom: "3/4", + RetiredBalance: "210.456", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + RetiredSupply: "310.579", + TradableSupply: "0", + }, + { + BatchDenom: "3/4", + RetiredSupply: "210.456", + TradableSupply: "0", + }, + }, + false, + }, + { + "fail with error retired balance not found", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + RetiredBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + RetiredBalance: "210.456", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + RetiredSupply: "310.579", + TradableSupply: "0", + }, + { + BatchDenom: "3/4", + RetiredSupply: "1234", + TradableSupply: "0", + }, + }, + true, + }, + { + "fail with error retired supply does not match", + []*ecocredit.Balance{ + { + Address: acc1.String(), + BatchDenom: "1/2", + RetiredBalance: "100.123", + }, + { + Address: acc2.String(), + BatchDenom: "1/2", + RetiredBalance: "210.456", + }, + { + BatchDenom: "3/4", + Address: acc2.String(), + RetiredBalance: "1234", + }, + }, + []*ecocredit.Supply{ + { + BatchDenom: "1/2", + RetiredSupply: "310.57", + TradableSupply: "0", + }, + { + BatchDenom: "3/4", + RetiredSupply: "1234", + TradableSupply: "0", + }, + }, + true, + }, + } + ctx := sdk.NewContext(nil, tmproto.Header{}, false, log.NewNopLogger()) + db := setupStore(t) + supplyStore, err := ecocreditv1beta1.NewBatchSupplyStore(db) + require.NoError(t, err) + balanceStore, err := ecocreditv1beta1.NewBatchBalanceStore(db) + require.NoError(t, err) + batchInfoStore, err := ecocreditv1beta1.NewBatchInfoStore(db) + require.NoError(t, err) + initBatchDenom(t, ctx.Context(), batchInfoStore, testCases) + for _, tc := range testCases { + tc := tc + t.Run(tc.msg, func(t *testing.T) { + initBalances(t, ctx, balanceStore, batchInfoStore, tc.balances) + initSupply(t, ctx, supplyStore, batchInfoStore, tc.supply) + msg, broken := retiredSupplyInvariant(supplyStore, balanceStore, batchInfoStore, ctx) + if tc.expBroken { + require.True(t, broken, msg) + } else { + require.False(t, broken, msg) + } + }) + } +} + +func initBalances(t *testing.T, ctx sdk.Context, store ecocreditv1beta1.BatchBalanceStore, batchInfoStore ecocreditv1beta1.BatchInfoStore, balances []*ecocredit.Balance) { + for _, b := range balances { + addr, err := sdk.AccAddressFromBech32(b.Address) + require.NoError(t, err) + info, err := batchInfoStore.GetByBatchDenom(ctx.Context(), b.BatchDenom) + require.NoError(t, err) + id := info.Id + if b.TradableBalance == "" { + b.TradableBalance = "0" + } + if b.RetiredBalance == "" { + b.RetiredBalance = "0" + } + + trad, err := math.NewNonNegativeDecFromString(b.TradableBalance) + require.NoError(t, err) + ret, err := math.NewNonNegativeDecFromString(b.RetiredBalance) + require.NoError(t, err) + + bal, err := store.Get(ctx.Context(), addr, id) + if err == nil && bal != nil { + balTrad, err := math.NewNonNegativeDecFromString(bal.Tradable) + require.NoError(t, err) + balRet, err := math.NewNonNegativeDecFromString(bal.Retired) + require.NoError(t, err) + trad, err = balTrad.Add(trad) + require.NoError(t, err) + ret, err = balRet.Add(ret) + require.NoError(t, err) + err = store.Update(ctx.Context(), &ecocreditv1beta1.BatchBalance{ + Address: addr, + BatchId: id, + Tradable: trad.String(), + Retired: ret.String(), + }) + require.NoError(t, err) + } else { + err = store.Insert(ctx.Context(), &ecocreditv1beta1.BatchBalance{ + Address: addr, + BatchId: id, + Tradable: trad.String(), + Retired: ret.String(), + }) + require.NoError(t, err) + } + } +} + +func initSupply(t *testing.T, ctx sdk.Context, store ecocreditv1beta1.BatchSupplyStore, batchStore ecocreditv1beta1.BatchInfoStore, supply []*ecocredit.Supply) { + for _, s := range supply { + info, err := batchStore.GetByBatchDenom(ctx.Context(), s.BatchDenom) + require.NoError(t, err) + id := info.Id + trad, err := math.NewNonNegativeDecFromString(s.TradableSupply) + require.NoError(t, err) + ret, err := math.NewNonNegativeDecFromString(s.RetiredSupply) + require.NoError(t, err) + sup, err := store.Get(ctx.Context(), id) + if err == nil && sup != nil { + supplyTradable, err := math.NewNonNegativeDecFromString(sup.TradableAmount) + require.NoError(t, err) + supplyRetired, err := math.NewNonNegativeDecFromString(sup.RetiredAmount) + require.NoError(t, err) + trad, err = supplyTradable.Add(trad) + require.NoError(t, err) + ret, err = supplyRetired.Add(ret) + require.NoError(t, err) + err = store.Update(ctx.Context(), &ecocreditv1beta1.BatchSupply{ + BatchId: sup.BatchId, + TradableAmount: trad.String(), + RetiredAmount: ret.String(), + CancelledAmount: "", + }) + require.NoError(t, err) + } else { + err = store.Insert(ctx.Context(), &ecocreditv1beta1.BatchSupply{ + BatchId: id, + TradableAmount: trad.String(), + RetiredAmount: ret.String(), + CancelledAmount: "", + }) + require.NoError(t, err) + } + } +} diff --git a/x/ecocredit/server/core/msg_server.go b/x/ecocredit/server/core/msg_server.go new file mode 100644 index 0000000000..cc42ba225a --- /dev/null +++ b/x/ecocredit/server/core/msg_server.go @@ -0,0 +1,1199 @@ +package core + +import ( + "context" + "fmt" + "github.com/cosmos/cosmos-sdk/orm/types/ormerrors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + basketv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/basket/v1beta1" + marketplacev1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/marketplace/v1beta1" + ecocreditv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1beta1" + "github.com/regen-network/regen-ledger/types" + "github.com/regen-network/regen-ledger/types/math" + "github.com/regen-network/regen-ledger/x/ecocredit" + "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1" + "google.golang.org/protobuf/types/known/timestamppb" +) + +// TODO: Revisit this once we have proper gas fee framework. +// Tracking issues https://github.com/cosmos/cosmos-sdk/issues/9054, https://github.com/cosmos/cosmos-sdk/discussions/9072 +const gasCostPerIteration = uint64(10) + +// CreateClass creates a new class of ecocredit +// +// The admin is charged a fee for creating the class. This is controlled by +// the global parameter CreditClassFee, which can be updated through the +// governance process. +func (s serverImpl) CreateClass(ctx context.Context, req *v1beta1.MsgCreateClass) (*v1beta1.MsgCreateClassResponse, error) { + regenCtx := types.UnwrapSDKContext(ctx) + sdkCtx := sdk.UnwrapSDKContext(ctx) + // Charge the admin a fee to create the credit class + adminAddress, err := sdk.AccAddressFromBech32(req.Admin) + if err != nil { + return nil, err + } + + var params ecocredit.Params + s.paramSpace.GetParamSet(regenCtx.Context, ¶ms) + if params.AllowlistEnabled && !s.isCreatorAllowListed(regenCtx, params.AllowedClassCreators, adminAddress) { + return nil, sdkerrors.ErrUnauthorized.Wrapf("%s is not allowed to create credit classes", adminAddress.String()) + } + + err = s.chargeCreditClassFee(regenCtx.Context, adminAddress) + if err != nil { + return nil, err + } + + //creditType, err := s.creditTypeStore.GetByName(ctx, req.CreditTypeName) + //if err != nil { + // return nil, err + //} + + creditType, err := s.getCreditType(sdkCtx, req.CreditTypeName) + if err != nil { + return nil, err + } + + classSeq, err := s.getClassSequenceNo(ctx, req.CreditTypeName) + if err != nil { + return nil, fmt.Errorf("error getting class sequence") + } + classID := FormatClassID(creditType, classSeq) + + // TODO(Tyler): waiting for PR that should make this should return the row ID, should include in event and response. + _, err = s.classInfoStore.InsertReturningID(ctx, &ecocreditv1beta1.ClassInfo{ + Name: classID, + Admin: req.Admin, + Metadata: req.Metadata, + CreditType: req.CreditTypeName, + }) + if err != nil { + return nil, err + } + + for _, issuer := range req.Issuers { + if err = s.classIssuerStore.Insert(ctx, &ecocreditv1beta1.ClassIssuer{ + ClassId: classID, + Issuer: issuer, + }); err != nil { + return nil, err + } + } + + err = regenCtx.EventManager().EmitTypedEvent(&v1beta1.EventCreateClass{ + ClassId: classID, + Admin: req.Admin, + }) + if err != nil { + return nil, err + } + + return &v1beta1.MsgCreateClassResponse{ClassId: classID}, nil +} + +// CreateProject creates a new project. +func (s serverImpl) CreateProject(ctx context.Context, req *v1beta1.MsgCreateProject) (*v1beta1.MsgCreateProjectResponse, error) { + sdkCtx := types.UnwrapSDKContext(ctx) + classID := req.ClassId + classInfo, err := s.classInfoStore.GetByName(ctx, classID) + if err != nil { + return nil, err + } + + err = s.assertClassIssuer(ctx, classID, req.Issuer) + if err != nil { + return nil, err + } + + projectID := req.ProjectId + if projectID == "" { + found := false + for !found { + projectID, err = s.genProjectID(ctx, classInfo.Id, classInfo.Name) + if err != nil { + return nil, err + } + found, err = s.projectInfoStore.HasByClassIdName(ctx, classInfo.Id, projectID) + if err != nil { + return nil, err + } + sdkCtx.GasMeter().ConsumeGas(gasCostPerIteration, "project id sequence") + } + } + + // TODO(Tyler): update this to handle the id it returns and put it in event and response. + _, err = s.projectInfoStore.InsertReturningID(ctx, &ecocreditv1beta1.ProjectInfo{ + Name: projectID, + ClassId: classInfo.Id, + ProjectLocation: req.ProjectLocation, + Metadata: req.Metadata, + }) + if err != nil { + return nil, err + } + + if err := sdkCtx.EventManager().EmitTypedEvent(&v1beta1.EventCreateProject{ + ClassId: classID, + ProjectId: projectID, + Issuer: req.Issuer, + ProjectLocation: req.ProjectLocation, + }); err != nil { + return nil, err + } + + return &v1beta1.MsgCreateProjectResponse{ + ProjectId: projectID, + }, nil +} + +// CreateBatch creates a new batch of credits. +// Credits in the batch must not have more decimal places than the credit type's specified precision. +func (s serverImpl) CreateBatch(ctx context.Context, req *v1beta1.MsgCreateBatch) (*v1beta1.MsgCreateBatchResponse, error) { + regenCtx := types.UnwrapSDKContext(ctx) + sdkCtx := sdk.UnwrapSDKContext(ctx) + projectID := req.ProjectId + + projectInfo, err := s.projectInfoStore.GetByName(ctx, projectID) + if err != nil { + return nil, err + } + + classInfo, err := s.classInfoStore.Get(ctx, projectInfo.ClassId) + if err != nil { + return nil, err + } + + err = s.assertClassIssuer(ctx, classInfo.Name, req.Issuer) + if err != nil { + return nil, err + } + + creditType, err := s.getCreditType(sdkCtx, classInfo.CreditType) + if err != nil { + return nil, err + } + + maxDecimalPlaces := creditType.Precision + + batchSeqNo, err := s.getBatchSeqNo(ctx, projectID) + if err != nil { + return nil, err + } + + batchDenom, err := ecocredit.FormatDenom(classInfo.Name, batchSeqNo, req.StartDate, req.EndDate) + if err != nil { + return nil, err + } + + // TODO(Tyler): this should return the ID. we need to use it. wait for update. + id, err := s.batchInfoStore.InsertReturningID(ctx, &ecocreditv1beta1.BatchInfo{ + ProjectId: projectInfo.Id, + BatchDenom: batchDenom, + Metadata: req.Metadata, + StartDate: timestamppb.New(req.StartDate.UTC()), + EndDate: timestamppb.New(req.EndDate.UTC()), + }) + if err != nil { + return nil, err + } + newBatchID := id + + tradableSupply, retiredSupply := math.NewDecFromInt64(0), math.NewDecFromInt64(0) + + for _, issuance := range req.Issuance { + decs, err := getNonNegativeFixedDecs(maxDecimalPlaces, issuance.TradableAmount, issuance.RetiredAmount) + if err != nil { + return nil, err + } + tradable, retired := decs[0], decs[1] + + recipient, _ := sdk.AccAddressFromBech32(issuance.Recipient) + if !tradable.IsZero() { + tradableSupply, err = tradableSupply.Add(tradable) + if err != nil { + return nil, err + } + } + if !retired.IsZero() { + retiredSupply, err = retiredSupply.Add(retired) + if err != nil { + return nil, err + } + if err = regenCtx.EventManager().EmitTypedEvent(&v1beta1.EventRetire{ + Retirer: recipient.String(), + BatchDenom: batchDenom, + Amount: retired.String(), + Location: issuance.RetirementLocation, + }); err != nil { + return nil, err + } + } + if err = s.batchBalanceStore.Insert(ctx, &ecocreditv1beta1.BatchBalance{ + Address: recipient, + BatchId: newBatchID, + Tradable: tradable.String(), + Retired: retired.String(), + }); err != nil { + return nil, err + } + + if err = regenCtx.EventManager().EmitTypedEvent(&v1beta1.EventReceive{ + Recipient: recipient.String(), + BatchDenom: batchDenom, + RetiredAmount: tradable.String(), + TradableAmount: retired.String(), + }); err != nil { + return nil, err + } + + regenCtx.GasMeter().ConsumeGas(gasCostPerIteration, "batch issuance") + } + + if err = s.batchSupplyStore.Insert(ctx, &ecocreditv1beta1.BatchSupply{ + BatchId: newBatchID, + TradableAmount: tradableSupply.String(), + RetiredAmount: retiredSupply.String(), + CancelledAmount: math.NewDecFromInt64(0).String(), + }); err != nil { + return nil, err + } + + // TODO(Tyler): put id here + return &v1beta1.MsgCreateBatchResponse{BatchDenom: batchDenom}, nil +} + +// Send sends credits to a recipient. +// Send also retires credits if the amount to retire is specified in the request. +func (s serverImpl) Send(ctx context.Context, req *v1beta1.MsgSend) (*v1beta1.MsgSendResponse, error) { + sdkCtx := types.UnwrapSDKContext(ctx) + sender, _ := sdk.AccAddressFromBech32(req.Sender) + recipient, _ := sdk.AccAddressFromBech32(req.Recipient) + + for _, credit := range req.Credits { + err := s.sendEcocredits(ctx, credit, recipient, sender) + if err != nil { + return nil, err + } + if err = sdkCtx.EventManager().EmitTypedEvent(&v1beta1.EventReceive{ + Sender: req.Sender, + Recipient: req.Recipient, + BatchDenom: credit.BatchDenom, + TradableAmount: credit.TradableAmount, + RetiredAmount: credit.RetiredAmount, + }); err != nil { + return nil, err + } + sdkCtx.GasMeter().ConsumeGas(gasCostPerIteration, "send ecocredits") + } + return &v1beta1.MsgSendResponse{}, nil +} + +// Retire credits to the specified location. +// WARNING: retiring credits is permanent. Retired credits cannot be un-retired. +func (s serverImpl) Retire(ctx context.Context, req *v1beta1.MsgRetire) (*v1beta1.MsgRetireResponse, error) { + sdkCtx := types.UnwrapSDKContext(ctx) + holder, _ := sdk.AccAddressFromBech32(req.Holder) + + for _, credit := range req.Credits { + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, credit.BatchDenom) + if err != nil { + return nil, err + } + creditType, err := s.getCreditTypeFromBatchDenom(ctx, batch.BatchDenom) + if err != nil { + return nil, err + } + userBalance, err := s.batchBalanceStore.Get(ctx, holder, batch.Id) + if err != nil { + return nil, err + } + + decs, err := getNonNegativeFixedDecs(creditType.Precision, credit.Amount, userBalance.Tradable) + if err != nil { + return nil, err + } + amtToRetire, userTradableBalance := decs[0], decs[1] + + userTradableBalance, err = userTradableBalance.Sub(amtToRetire) + if err != nil { + return nil, err + } + if userTradableBalance.IsNegative() { + return nil, ecocredit.ErrInsufficientFunds.Wrapf("cannot retire %s credits with a balance of %s", credit.Amount, userBalance.Tradable) + } + userRetiredBalance, err := math.NewNonNegativeFixedDecFromString(userBalance.Retired, creditType.Precision) + if err != nil { + return nil, err + } + userRetiredBalance, err = userRetiredBalance.Add(amtToRetire) + if err != nil { + return nil, err + } + batchSupply, err := s.batchSupplyStore.Get(ctx, batch.Id) + if err != nil { + return nil, err + } + decs, err = getNonNegativeFixedDecs(creditType.Precision, batchSupply.RetiredAmount, batchSupply.TradableAmount) + if err != nil { + return nil, err + } + supplyRetired, supplyTradable := decs[0], decs[1] + supplyRetired, err = supplyRetired.Add(amtToRetire) + if err != nil { + return nil, err + } + supplyTradable, err = supplyTradable.Sub(amtToRetire) + if err != nil { + return nil, err + } + + if err = s.batchBalanceStore.Update(ctx, &ecocreditv1beta1.BatchBalance{ + Address: holder, + BatchId: batch.Id, + Tradable: userTradableBalance.String(), + Retired: userRetiredBalance.String(), + }); err != nil { + return nil, err + } + err = s.batchSupplyStore.Update(ctx, &ecocreditv1beta1.BatchSupply{ + BatchId: batch.Id, + TradableAmount: supplyTradable.String(), + RetiredAmount: supplyRetired.String(), + CancelledAmount: batchSupply.CancelledAmount, + }) + if err = sdkCtx.EventManager().EmitTypedEvent(&v1beta1.EventRetire{ + Retirer: req.Holder, + BatchDenom: credit.BatchDenom, + Amount: credit.Amount, + Location: req.Location, + }); err != nil { + return nil, err + } + sdkCtx.GasMeter().ConsumeGas(gasCostPerIteration, "retire ecocredits") + } + return &v1beta1.MsgRetireResponse{}, nil +} + +// Cancel credits, removing them from the supply and balance of the holder +func (s serverImpl) Cancel(ctx context.Context, req *v1beta1.MsgCancel) (*v1beta1.MsgCancelResponse, error) { + sdkCtx := types.UnwrapSDKContext(ctx) + holder, _ := sdk.AccAddressFromBech32(req.Holder) + + for _, credit := range req.Credits { + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, credit.BatchDenom) + if err != nil { + return nil, err + + } + creditType, err := s.getCreditTypeFromBatchDenom(ctx, batch.BatchDenom) + if err != nil { + return nil, err + } + precision := creditType.Precision + + userBalance, err := s.batchBalanceStore.Get(ctx, holder, batch.Id) + if err != nil { + return nil, err + } + batchSupply, err := s.batchSupplyStore.Get(ctx, batch.Id) + if err != nil { + return nil, err + } + decs, err := getNonNegativeFixedDecs(precision, credit.Amount, batchSupply.TradableAmount, userBalance.Tradable, batchSupply.CancelledAmount) + if err != nil { + return nil, err + } + amtToCancelDec, supplyTradable, userBalTradable, cancelledDec := decs[0], decs[1], decs[2], decs[3] + userBalTradable, err = math.SafeSubBalance(userBalTradable, amtToCancelDec) + if err != nil { + return nil, err + } + supplyTradable, err = math.SafeSubBalance(supplyTradable, amtToCancelDec) + if err != nil { + return nil, err + } + cancelledDec, err = cancelledDec.Add(amtToCancelDec) + if err != nil { + return nil, err + } + if err = s.batchBalanceStore.Update(ctx, &ecocreditv1beta1.BatchBalance{ + Address: holder, + BatchId: batch.Id, + Tradable: userBalTradable.String(), + Retired: userBalance.Retired, + }); err != nil { + return nil, err + } + if err = s.batchSupplyStore.Update(ctx, &ecocreditv1beta1.BatchSupply{ + BatchId: batch.Id, + TradableAmount: supplyTradable.String(), + RetiredAmount: batchSupply.RetiredAmount, + CancelledAmount: cancelledDec.String(), + }); err != nil { + return nil, err + } + if err = sdkCtx.EventManager().EmitTypedEvent(&v1beta1.EventCancel{ + Canceller: holder.String(), + BatchDenom: credit.BatchDenom, + Amount: credit.Amount, + }); err != nil { + return nil, err + } + sdkCtx.GasMeter().ConsumeGas(gasCostPerIteration, "cancel ecocredits") + } + return &v1beta1.MsgCancelResponse{}, nil +} + +func (s serverImpl) UpdateClassAdmin(ctx context.Context, req *v1beta1.MsgUpdateClassAdmin) (*v1beta1.MsgUpdateClassAdminResponse, error) { + classInfo, err := s.classInfoStore.GetByName(ctx, req.ClassId) + if err != nil { + return nil, err + } + if classInfo.Admin != req.Admin { + return nil, sdkerrors.ErrUnauthorized.Wrapf("expected admin %s, got %s", classInfo.Admin, req.Admin) + } + classInfo.Admin = req.NewAdmin + if err = s.classInfoStore.Update(ctx, classInfo); err != nil { + return nil, err + } + return &v1beta1.MsgUpdateClassAdminResponse{}, err +} + +func (s serverImpl) UpdateClassIssuers(ctx context.Context, req *v1beta1.MsgUpdateClassIssuers) (*v1beta1.MsgUpdateClassIssuersResponse, error) { + class, err := s.classInfoStore.GetByName(ctx, req.ClassId) + if err != nil { + return nil, err + } + if class.Admin != req.Admin { + return nil, sdkerrors.ErrUnauthorized.Wrapf("expected admin %s, got %s", class.Admin, req.Admin) + } + + // delete the old issuers + if err = s.classIssuerStore.DeleteBy(ctx, ecocreditv1beta1.ClassIssuerClassIdIssuerIndexKey{}.WithClassId(class.Name)); err != nil { + return nil, err + } + + // add the new issuers + for _, issuer := range req.Issuers { + if err = s.classIssuerStore.Insert(ctx, &ecocreditv1beta1.ClassIssuer{ + ClassId: req.ClassId, + Issuer: issuer, + }); err != nil { + return nil, err + } + } + return &v1beta1.MsgUpdateClassIssuersResponse{}, nil +} + +func (s serverImpl) UpdateClassMetadata(ctx context.Context, req *v1beta1.MsgUpdateClassMetadata) (*v1beta1.MsgUpdateClassMetadataResponse, error) { + classInfo, err := s.classInfoStore.GetByName(ctx, req.ClassId) + if err != nil { + return nil, err + } + if classInfo.Admin != req.Admin { + return nil, sdkerrors.ErrUnauthorized.Wrapf("expected admin %s, got %s", classInfo.Admin, req.Admin) + } + classInfo.Metadata = req.Metadata + if err = s.classInfoStore.Update(ctx, classInfo); err != nil { + return nil, err + } + return &v1beta1.MsgUpdateClassMetadataResponse{}, err +} + +// Sell creates new sell orders for credits +// TODO: update this function with ORM +func (s serverImpl) Sell(ctx context.Context, sell *marketplacev1beta1.MsgSell) (*marketplacev1beta1.MsgSellResponse, error) { + panic("implement me") + //ctx := types.UnwrapSDKContext(goCtx) + //owner := req.Owner + //store := ctx.KVStore(s.storeKey) + // + //ownerAddr, err := sdk.AccAddressFromBech32(owner) + //if err != nil { + // return nil, err + //} + // + //sellOrderIds := make([]uint64, len(req.Orders)) + // + //for i, order := range req.Orders { + // + // // verify expiration is in the future + // if order.Expiration != nil && order.Expiration.Before(ctx.BlockTime()) { + // return nil, sdkerrors.ErrInvalidRequest.Wrapf("expiration must be in the future: %s", order.Expiration) + // } + // + // err = verifyCreditBalance(store, ownerAddr, order.BatchDenom, order.Quantity) + // if err != nil { + // return nil, err + // } + // + // // TODO: Verify that AskPrice.Denom is in AllowAskDenom #624 + // + // orderID, err := s.createSellOrder(ctx, owner, order) + // if err != nil { + // return nil, err + // } + // + // sellOrderIds[i] = orderID + // err = ctx.EventManager().EmitTypedEvent(&ecocredit.EventSell{ + // OrderId: orderID, + // BatchDenom: order.BatchDenom, + // Quantity: order.Quantity, + // AskPrice: order.AskPrice, + // DisableAutoRetire: order.DisableAutoRetire, + // Expiration: order.Expiration, + // }) + // if err != nil { + // return nil, err + // } + // + // ctx.GasMeter().ConsumeGas(gasCostPerIteration, "create sell order") + //} + // + //return &ecocredit.MsgSellResponse{SellOrderIds: sellOrderIds}, nil +} + +// TODO: implement this with ORM +func (s serverImpl) createSellOrder(ctx types.Context, owner string, o *marketplacev1beta1.MsgSell_Order) (uint64, error) { + panic("impl me!") + //orderID := s.sellOrderTable.Sequence().PeekNextVal(ctx) + //_, err := s.sellOrderTable.Create(ctx, &ecocredit.SellOrder{ + // Owner: owner, + // OrderId: orderID, + // BatchDenom: o.BatchDenom, + // Quantity: o.Quantity, + // AskPrice: o.AskPrice, + // DisableAutoRetire: o.DisableAutoRetire, + // Expiration: o.Expiration, + //}) + //return orderID, err +} + +// UpdateSellOrders updates existing sell orders for credits +// TODO: impl with ORM +func (s serverImpl) UpdateSellOrders(ctx context.Context, orders *marketplacev1beta1.MsgUpdateSellOrders) (*marketplacev1beta1.MsgUpdateSellOrdersResponse, error) { + panic("implement me") + //ctx := types.UnwrapSDKContext(goCtx) + //owner := req.Owner + //store := ctx.KVStore(s.storeKey) + // + //ownerAddr, err := sdk.AccAddressFromBech32(owner) + //if err != nil { + // return nil, err + //} + // + //for _, update := range req.Updates { + // + // // verify expiration is in the future + // if update.NewExpiration != nil && update.NewExpiration.Before(ctx.BlockTime()) { + // return nil, sdkerrors.ErrInvalidRequest.Wrapf("expiration must be in the future: %s", update.NewExpiration) + // } + // + // sellOrder, err := s.getSellOrder(ctx, update.SellOrderId) + // if err != nil { + // return nil, ecocredit.ErrInvalidSellOrder.Wrapf("sell order id %d not found", update.SellOrderId) + // } + // + // if req.Owner != sellOrder.Owner { + // return nil, sdkerrors.ErrUnauthorized.Wrapf("signer is not the owner of sell order id %d", update.SellOrderId) + // } + // + // // TODO: Verify that NewAskPrice.Denom is in AllowAskDenom #624 + // + // err = verifyCreditBalance(store, ownerAddr, sellOrder.BatchDenom, update.NewQuantity) + // if err != nil { + // return nil, err + // } + // + // sellOrder.Quantity = update.NewQuantity + // sellOrder.AskPrice = update.NewAskPrice + // sellOrder.DisableAutoRetire = update.DisableAutoRetire + // sellOrder.Expiration = update.NewExpiration + // + // err = s.sellOrderTable.Update(ctx, sellOrder.OrderId, sellOrder) + // if err != nil { + // return nil, err + // } + // + // err = ctx.EventManager().EmitTypedEvent(&ecocredit.EventUpdateSellOrder{ + // Owner: owner, + // SellOrderId: sellOrder.OrderId, + // BatchDenom: sellOrder.BatchDenom, + // NewQuantity: sellOrder.Quantity, + // NewAskPrice: sellOrder.AskPrice, + // DisableAutoRetire: sellOrder.DisableAutoRetire, + // NewExpiration: sellOrder.Expiration, + // }) + // if err != nil { + // return nil, err + // } + // + // ctx.GasMeter().ConsumeGas(gasCostPerIteration, "update sell order") + //} + // + //return &ecocredit.MsgUpdateSellOrdersResponse{}, nil +} + +// Buy creates new buy orders for credits +func (s serverImpl) Buy(ctx context.Context, buy *marketplacev1beta1.MsgBuy) (*marketplacev1beta1.MsgBuyResponse, error) { + panic("implement me") + //ctx := types.UnwrapSDKContext(goCtx) + //sdkCtx := sdk.UnwrapSDKContext(goCtx) + //store := ctx.KVStore(s.storeKey) + //buyer := req.Buyer + // + //buyerAddr, err := sdk.AccAddressFromBech32(buyer) + //if err != nil { + // return nil, err + //} + // + //buyOrderIds := make([]uint64, len(req.Orders)) + // + //for i, order := range req.Orders { + // + // // verify expiration is in the future + // if order.Expiration != nil && order.Expiration.Before(ctx.BlockTime()) { + // return nil, sdkerrors.ErrInvalidRequest.Wrapf("expiration must be in the future: %s", order.Expiration) + // } + // + // balances := s.bankKeeper.SpendableCoins(sdkCtx, buyerAddr) + // bidPrice := order.BidPrice + // balanceAmount := balances.AmountOf(bidPrice.Denom) + // + // // TODO: Verify that bidPrice.Denom is in AllowAskDenom #624 + // + // // get decimal amount of credits desired for purchase + // creditsDesired, err := math.NewPositiveDecFromString(order.Quantity) + // if err != nil { + // return nil, err + // } + // + // // calculate the amount of coin to send for purchase + // coinToSend, err := getCoinNeeded(creditsDesired, bidPrice) + // if err != nil { + // return nil, err + // } + // + // // verify buyer has sufficient balance in coin + // if balanceAmount.LT(coinToSend.Amount) { + // return nil, sdkerrors.ErrInsufficientFunds.Wrapf("insufficient balance: got %s, needed at least: %s", balanceAmount.String(), coinToSend.Amount.String()) + // } + // + // switch order.Selection.Sum.(type) { + // case *ecocredit.MsgBuy_Order_Selection_SellOrderId: + // + // sellOrderId := order.Selection.GetSellOrderId() + // sellOrder, err := s.getSellOrder(ctx, sellOrderId) + // if err != nil { + // return nil, err + // } + // + // sellerAddr, err := sdk.AccAddressFromBech32(sellOrder.Owner) + // if err != nil { + // return nil, err + // } + // + // // verify bid price and ask price denoms match + // if bidPrice.Denom != sellOrder.AskPrice.Denom { + // return nil, sdkerrors.ErrInvalidRequest.Wrapf("bid price denom does not match ask price denom: got %s, expected: %s", bidPrice.Denom, sellOrder.AskPrice.Denom) + // } + // + // // verify bid price is greater than or equal to ask price + // if bidPrice.Amount.LT(sellOrder.AskPrice.Amount) { + // return nil, sdkerrors.ErrInvalidRequest.Wrapf("bid price too low: got %s, needed at least: %s", bidPrice.String(), sellOrder.AskPrice.String()) + // } + // + // // verify seller has sufficient balance in credits + // err = verifyCreditBalance(store, sellerAddr, sellOrder.BatchDenom, sellOrder.Quantity) + // if err != nil { + // return nil, ecocredit.ErrInvalidSellOrder.Wrap(err.Error()) + // } + // + // // get decimal amount of credits available for purchase + // creditsAvailable, err := math.NewDecFromString(sellOrder.Quantity) + // if err != nil { + // return nil, ecocredit.ErrInvalidSellOrder.Wrap(err.Error()) + // } + // + // creditsToReceive := creditsDesired + // + // // check if credits desired is more than credits available + // if creditsDesired.Cmp(creditsAvailable) == 1 { + // + // // error if partial fill disabled + // if order.DisablePartialFill { + // return nil, ecocredit.ErrInsufficientFunds.Wrap("sell order does not have sufficient credits to fill the buy order") + // } + // + // creditsToReceive = creditsAvailable + // + // // recalculate coinToSend if creditsToReceive is not creditsDesired + // coinToSend, err = getCoinNeeded(creditsToReceive, bidPrice) + // if err != nil { + // return nil, err + // } + // } + // + // // send coin to the seller account + // err = s.bankKeeper.SendCoins(sdkCtx, buyerAddr, sellerAddr, sdk.Coins{coinToSend}) + // if err != nil { + // return nil, err + // } + // + // // error if auto-retire is required for given sell order + // if !sellOrder.DisableAutoRetire && order.DisableAutoRetire { + // return nil, ecocredit.ErrInvalidBuyOrder.Wrapf("auto-retire is required for sell order %d", sellOrder.OrderId) + // } + // + // // error if auto-retire is required and missing location + // if !sellOrder.DisableAutoRetire && order.RetirementLocation == "" { + // return nil, ecocredit.ErrInvalidBuyOrder.Wrapf("retirement location is required for sell order %d", sellOrder.OrderId) + // } + // + // // declare credit for send message + // credit := &ecocredit.MsgSend_SendCredits{ + // BatchDenom: sellOrder.BatchDenom, + // } + // + // // set tradable or retired amount depending on auto-retire + // if sellOrder.DisableAutoRetire && order.DisableAutoRetire { + // credit.RetiredAmount = "0" + // credit.TradableAmount = creditsToReceive.String() + // } else { + // credit.RetiredAmount = creditsToReceive.String() + // credit.RetirementLocation = order.RetirementLocation + // credit.TradableAmount = "0" + // } + // + // // send credits to the buyer account + // err = s.sendEcocredits(ctx, credit, store, sellerAddr, buyerAddr) + // if err != nil { + // return nil, err + // } + // + // // get remaining credits in sell order + // creditsRemaining, err := creditsAvailable.Sub(creditsToReceive) + // if err != nil { + // return nil, err + // } + // + // if creditsRemaining.IsZero() { + // + // // delete sell order if no remaining credits + // if err := s.sellOrderTable.Delete(ctx, sellOrder.OrderId); err != nil { + // return nil, err + // } + // + // } else { + // sellOrder.Quantity = creditsRemaining.String() + // + // // update sell order quantity with remaining credits + // err = s.sellOrderTable.Update(ctx, sellOrder.OrderId, sellOrder) + // if err != nil { + // return nil, err + // } + // } + // + // // TODO: do we want to store a direct buy order? #623 + // buyOrderID := s.buyOrderTable.Sequence().NextVal(ctx) + // buyOrderIds[i] = buyOrderID + // + // err = ctx.EventManager().EmitTypedEvent(&ecocredit.EventBuyOrderCreated{ + // BuyOrderId: buyOrderID, + // SellOrderId: sellOrderId, + // Quantity: order.Quantity, + // BidPrice: order.BidPrice, + // DisableAutoRetire: order.DisableAutoRetire, + // DisablePartialFill: order.DisablePartialFill, + // RetirementLocation: order.RetirementLocation, + // Expiration: order.Expiration, + // }) + // if err != nil { + // return nil, err + // } + // + // err = ctx.EventManager().EmitTypedEvent(&ecocredit.EventBuyOrderFilled{ + // BuyOrderId: buyOrderID, + // SellOrderId: sellOrderId, + // BatchDenom: sellOrder.BatchDenom, + // Quantity: creditsToReceive.String(), + // TotalPrice: &coinToSend, + // }) + // if err != nil { + // return nil, err + // } + // + // // TODO: implement processing for filter option #623 + // //case *ecocredit.MsgBuy_Order_Selection_Filter: + // + // default: + // return nil, sdkerrors.ErrInvalidRequest + // } + // + // ctx.GasMeter().ConsumeGas(gasCostPerIteration, "create buy order") + //} + // + //return &ecocredit.MsgBuyResponse{BuyOrderIds: buyOrderIds}, nil +} + +// TODO: impl with ORM +func (s serverImpl) createBuyOrder(ctx types.Context, buyer string, o *marketplacev1beta1.MsgBuy_Order) (uint64, error) { + panic("impl me!") + //orderID := s.buyOrderTable.Sequence().PeekNextVal(ctx) + //selection := ecocredit.BuyOrder_Selection{ + // Sum: &ecocredit.BuyOrder_Selection_SellOrderId{ + // SellOrderId: o.Selection.GetSellOrderId(), + // }, + //} + //_, err := s.buyOrderTable.Create(ctx, &ecocredit.BuyOrder{ + // Buyer: buyer, + // BuyOrderId: orderID, + // Selection: &selection, + // Quantity: o.Quantity, + // BidPrice: o.BidPrice, + // DisableAutoRetire: o.DisableAutoRetire, + // DisablePartialFill: o.DisablePartialFill, + // Expiration: o.Expiration, + //}) + //return orderID, err +} + +// AllowAskDenom adds a new ask denom +// TODO: impl with ORM +func (s serverImpl) AllowAskDenom(ctx context.Context, denom *marketplacev1beta1.MsgAllowAskDenom) (*marketplacev1beta1.MsgAllowAskDenomResponse, error) { + panic("implement me") + // ctx := types.UnwrapSDKContext(goCtx) + // + //rootAddress := s.accountKeeper.GetModuleAddress(govtypes.ModuleName).String() + // + //if req.RootAddress != rootAddress { + // return nil, sdkerrors.ErrUnauthorized.Wrapf("root address must be governance module address, got: %s, expected: %s", req.RootAddress, rootAddress) + //} + // + //err := s.askDenomTable.Create(ctx, &ecocredit.AskDenom{ + // Denom: req.Denom, + // DisplayDenom: req.DisplayDenom, + // Exponent: req.Exponent, + //}) + //if err != nil { + // return nil, err + //} + // + //err = ctx.EventManager().EmitTypedEvent(&ecocredit.EventAllowAskDenom{ + // Denom: req.Denom, + // DisplayDenom: req.DisplayDenom, + // Exponent: req.Exponent, + //}) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.MsgAllowAskDenomResponse{}, nil +} + +func (s serverImpl) CreateBasket(ctx context.Context, basket *basketv1beta1.MsgCreateBasket) (*basketv1beta1.MsgCreateBasketResponse, error) { + panic("implement me") +} + +func (s serverImpl) AddToBasket(ctx context.Context, basket *basketv1beta1.MsgAddToBasket) (*basketv1beta1.MsgAddToBasketResponse, error) { + panic("implement me") +} + +func (s serverImpl) TakeFromBasket(ctx context.Context, basket *basketv1beta1.MsgTakeFromBasket) (*basketv1beta1.MsgTakeFromBasketResponse, error) { + panic("implement me") +} + +func (s serverImpl) PickFromBasket(ctx context.Context, basket *basketv1beta1.MsgPickFromBasket) (*basketv1beta1.MsgPickFromBasketResponse, error) { + panic("implement me") +} + +// ------- UTILITIES ------ + +// Checks if the given address is in the allowlist of credit class creators +func (s serverImpl) isCreatorAllowListed(ctx types.Context, allowlist []string, designer sdk.Address) bool { + for _, addr := range allowlist { + ctx.GasMeter().ConsumeGas(gasCostPerIteration, "credit class creators allowlist") + allowListedAddr, _ := sdk.AccAddressFromBech32(addr) + if designer.Equals(allowListedAddr) { + return true + } + } + return false +} + +// AssertClassIssuer makes sure that the issuer is part of issuers of given classID. +// Returns ErrUnauthorized otherwise. +func (s serverImpl) assertClassIssuer(goCtx context.Context, classID, issuer string) error { + it, err := s.classIssuerStore.List(goCtx, ecocreditv1beta1.ClassIssuerClassIdIssuerIndexKey{}.WithClassId(classID)) + if err != nil { + return err + } + + defer it.Close() + for it.Next() { + v, err := it.Value() + if err != nil { + return err + } + if v.Issuer == issuer { + return nil + } + } + return sdkerrors.ErrUnauthorized.Wrapf("%s is not an issuer for class %s", issuer, classID) +} + +func (s serverImpl) genProjectID(ctx context.Context, classRowID uint64, classID string) (string, error) { + var nextID uint64 + projectSeqNo, err := s.projectSeqStore.Get(ctx, classRowID) + switch err { + case ormerrors.NotFound: + nextID = 1 + case nil: + nextID = projectSeqNo.NextProjectId + default: + return "", err + } + + if err = s.projectSeqStore.Save(ctx, &ecocreditv1beta1.ProjectSequence{ + ClassId: classRowID, + NextProjectId: nextID + 1, + }); err != nil { + return "", err + } + + return ecocredit.FormatProjectID(classID, nextID), nil +} + +func (s serverImpl) getBatchSeqNo(ctx context.Context, projectID string) (uint64, error) { + var seq uint64 + batchSeq, err := s.batchSeqStore.Get(ctx, projectID) + + switch err { + case ormerrors.NotFound: + seq = 1 + case nil: + seq = batchSeq.NextBatchId + default: + return 0, err + } + if err = s.batchSeqStore.Save(ctx, &ecocreditv1beta1.BatchSequence{ + ProjectId: projectID, + NextBatchId: seq + 1, + }); err != nil { + return 0, err + } + + return seq, err +} + +func (s serverImpl) sendEcocredits(ctx context.Context, credit *v1beta1.MsgSend_SendCredits, to, from sdk.AccAddress) error { + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, credit.BatchDenom) + if err != nil { + return err + } + creditType, err := s.getCreditTypeFromBatchDenom(ctx, batch.BatchDenom) + if err != nil { + return err + } + precision := creditType.Precision + + batchSupply, err := s.batchSupplyStore.Get(ctx, batch.Id) + if err != nil { + return err + } + fromBalance, err := s.batchBalanceStore.Get(ctx, from, batch.Id) + if err != nil { + if err == ormerrors.NotFound { + return ecocredit.ErrInsufficientFunds.Wrapf("you do not have any credits from batch %s", batch.BatchDenom) + } + return err + } + + toBalance, err := s.batchBalanceStore.Get(ctx, to, batch.Id) + if err != nil { + if err == ormerrors.NotFound { + toBalance = &ecocreditv1beta1.BatchBalance{ + Address: to, + BatchId: batch.Id, + Tradable: "0", + Retired: "0", + } + } else { + return err + } + } + decs, err := getNonNegativeFixedDecs(precision, toBalance.Tradable, toBalance.Retired, fromBalance.Tradable, fromBalance.Retired, credit.TradableAmount, credit.RetiredAmount, batchSupply.TradableAmount, batchSupply.RetiredAmount) + if err != nil { + return err + } + toTradableBalance, toRetiredBalance, + fromTradableBalance, fromRetiredBalance, + sendAmtTradable, sendAmtRetired, + batchSupplyTradable, batchSupplyRetired := decs[0], decs[1], decs[2], decs[3], decs[4], decs[5], decs[6], decs[7] + + if !sendAmtTradable.IsZero() { + fromTradableBalance, err = math.SafeSubBalance(fromTradableBalance, sendAmtTradable) + if err != nil { + return err + } + toTradableBalance, err = toTradableBalance.Add(sendAmtTradable) + if err != nil { + return err + } + } + + didRetire := false + if !sendAmtRetired.IsZero() { + didRetire = true + fromTradableBalance, err = math.SafeSubBalance(fromTradableBalance, sendAmtRetired) + if err != nil { + return err + } + toRetiredBalance, err = toRetiredBalance.Add(sendAmtRetired) + if err != nil { + return err + } + batchSupplyRetired, err = batchSupplyRetired.Add(sendAmtRetired) + if err != nil { + return err + } + batchSupplyTradable, err = batchSupplyTradable.Sub(sendAmtRetired) + if err != nil { + return err + } + } + // update the "to" balance + if err := s.batchBalanceStore.Save(ctx, &ecocreditv1beta1.BatchBalance{ + Address: to, + BatchId: batch.Id, + Tradable: toTradableBalance.String(), + Retired: toRetiredBalance.String(), + }); err != nil { + return err + } + + // update the "from" balance + if err := s.batchBalanceStore.Update(ctx, &ecocreditv1beta1.BatchBalance{ + Address: from, + BatchId: batch.Id, + Tradable: fromTradableBalance.String(), + Retired: fromRetiredBalance.String(), + }); err != nil { + return err + } + // update the "retired" balance only if credits were retired + if didRetire { + if err := s.batchSupplyStore.Update(ctx, &ecocreditv1beta1.BatchSupply{ + BatchId: batch.Id, + TradableAmount: batchSupplyTradable.String(), + RetiredAmount: batchSupplyRetired.String(), + CancelledAmount: batchSupply.CancelledAmount, + }); err != nil { + return err + } + if err = sdk.UnwrapSDKContext(ctx).EventManager().EmitTypedEvent(&ecocredit.EventRetire{ + Retirer: to.String(), + BatchDenom: credit.BatchDenom, + Amount: sendAmtRetired.String(), + Location: credit.RetirementLocation, + }); err != nil { + return err + } + } + return nil +} + +func getNonNegativeFixedDecs(precision uint32, decimals ...string) ([]math.Dec, error) { + decs := make([]math.Dec, len(decimals)) + for i, decimal := range decimals { + dec, err := math.NewNonNegativeFixedDecFromString(decimal, precision) + if err != nil { + return nil, err + } + decs[i] = dec + } + return decs, nil +} + +func (s serverImpl) getCreditTypeFromBatchDenom(ctx context.Context, denom string) (v1beta1.CreditType, error) { + classId := ecocredit.GetClassIdFromBatchDenom(denom) + classInfo, err := s.classInfoStore.GetByName(ctx, classId) + if err != nil { + return v1beta1.CreditType{}, err + } + return s.getCreditType(sdk.UnwrapSDKContext(ctx), classInfo.CreditType) +} + +func (s serverImpl) getClassSequenceNo(ctx context.Context, ctype string) (uint64, error) { + var seq uint64 + classSeq, err := s.classSeqStore.Get(ctx, ctype) + switch err { + case nil: + seq = classSeq.NextClassId + case ormerrors.NotFound: + seq = 1 + default: + return 0, err + } + err = s.classSeqStore.Save(ctx, &ecocreditv1beta1.ClassSequence{ + CreditType: ctype, + NextClassId: seq + 1, + }) + return seq, err +} + +func (s serverImpl) getCreditType(ctx sdk.Context, creditTypeName string) (v1beta1.CreditType, error) { + creditTypes := s.getAllCreditTypes(ctx) + creditTypeName = ecocredit.NormalizeCreditTypeName(creditTypeName) + for _, creditType := range creditTypes { + // credit type name's stored via params have enforcement on normalization, so we can be sure they will already + // be normalized here. + if creditType.Name == creditTypeName { + return *creditType, nil + } + } + return v1beta1.CreditType{}, sdkerrors.ErrInvalidType.Wrapf("%s is not a valid credit type", creditTypeName) +} + +func (s serverImpl) getAllCreditTypes(ctx sdk.Context) []*v1beta1.CreditType { + var params ecocredit.Params + s.paramSpace.GetParamSet(ctx, ¶ms) + creditTypes := params.CreditTypes + v1beta1types := make([]*v1beta1.CreditType, len(creditTypes)) + for i, typ := range creditTypes { + v1beta1types[i] = &v1beta1.CreditType{ + Abbreviation: typ.Abbreviation, + Name: typ.Name, + Unit: typ.Unit, + Precision: typ.Precision, + } + } + return v1beta1types +} + +func (s serverImpl) getCreditClassFee(ctx sdk.Context) sdk.Coins { + var params ecocredit.Params + s.paramSpace.GetParamSet(ctx, ¶ms) + return params.CreditClassFee +} + +func (s serverImpl) chargeCreditClassFee(ctx sdk.Context, creatorAddr sdk.AccAddress) error { + creditClassFee := s.getCreditClassFee(ctx) + + // Move the fee to the ecocredit module's account + err := s.bankKeeper.SendCoinsFromAccountToModule(ctx, creatorAddr, ecocredit.ModuleName, creditClassFee) + if err != nil { + return err + } + + // Burn the coins + // TODO: Update this implementation based on the discussion at + // https://github.com/regen-network/regen-ledger/issues/351 + err = s.bankKeeper.BurnCoins(ctx, ecocredit.ModuleName, creditClassFee) + if err != nil { + return err + } + + return nil +} diff --git a/x/ecocredit/server/core/operations.go b/x/ecocredit/server/core/operations.go new file mode 100644 index 0000000000..a6e5722ab6 --- /dev/null +++ b/x/ecocredit/server/core/operations.go @@ -0,0 +1,20 @@ +package core + +import ( + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// WeightedOperations returns all the ecocredit module operations with their respective weights. +// TODO: sim refactor PR +func (s serverImpl) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + //key := s.storeKey.(servermodule.RootModuleKey) + //queryClient := ecocredit.NewQueryClient(key) + // + //return simulation.WeightedOperations( + // simState.AppParams, simState.Cdc, + // s.accountKeeper, s.bankKeeper, + // queryClient, + //) + return nil +} diff --git a/x/ecocredit/server/core/query_server.go b/x/ecocredit/server/core/query_server.go new file mode 100644 index 0000000000..ff3dc0f69d --- /dev/null +++ b/x/ecocredit/server/core/query_server.go @@ -0,0 +1,619 @@ +package core + +import ( + "context" + queryv1beta1 "github.com/cosmos/cosmos-sdk/api/cosmos/base/query/v1beta1" + "github.com/cosmos/cosmos-sdk/orm/model/ormlist" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/gogo/protobuf/types" + ecocreditv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1beta1" + "github.com/regen-network/regen-ledger/x/ecocredit" + "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Classes queries for all credit classes with pagination. +func (s serverImpl) Classes(ctx context.Context, request *v1beta1.QueryClassesRequest) (*v1beta1.QueryClassesResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if request.Pagination == nil { + request.Pagination = &query.PageRequest{} + } + p := request.Pagination + it, err := s.classInfoStore.List(ctx, &ecocreditv1beta1.ClassInfoPrimaryKey{}, ormlist.Paginate(&queryv1beta1.PageRequest{ + Key: p.Key, + Offset: p.Offset, + Limit: p.Limit, + CountTotal: p.CountTotal, + Reverse: p.Reverse, + })) + if err != nil { + return nil, err + } + infos := make([]*v1beta1.ClassInfo, 0) + for it.Next() { + info, err := it.Value() + if err != nil { + return nil, err + } + infos = append(infos, &v1beta1.ClassInfo{ + Id: info.Id, + Name: info.Name, + Admin: info.Admin, + Metadata: info.Metadata, + CreditType: info.CreditType, + }) + } + return nil, err +} + +// ClassInfo queries for information on a credit class. +func (s serverImpl) ClassInfo(ctx context.Context, request *v1beta1.QueryClassInfoRequest) (*v1beta1.QueryClassInfoResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if err := ecocredit.ValidateClassID(request.ClassId); err != nil { + return nil, err + } + classInfo, err := s.classInfoStore.GetByName(ctx, request.ClassId) + if err != nil { + return nil, err + } + + issuers := make([]string, 0) + it, err := s.classIssuerStore.List(ctx, ecocreditv1beta1.ClassIssuerClassIdIssuerIndexKey{}.WithClassId(request.ClassId)) + if err != nil { + return nil, err + } + for it.Next() { + val, err := it.Value() + if err != nil { + return nil, err + } + issuers = append(issuers, val.Issuer) + } + + return &v1beta1.QueryClassInfoResponse{Info: &v1beta1.ClassInfo{ + Id: classInfo.Id, + Name: request.ClassId, + Admin: classInfo.Admin, + Metadata: classInfo.Metadata, + CreditType: classInfo.CreditType, + }}, nil +} + +func (s serverImpl) ClassIssuers(ctx context.Context, request *v1beta1.QueryClassIssuersRequest) (*v1beta1.QueryClassIssuersResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if request.Pagination == nil { + request.Pagination = &query.PageRequest{} + } + p := request.Pagination + if err := ecocredit.ValidateClassID(request.ClassId); err != nil { + return nil, err + } + + it, err := s.classIssuerStore.List(ctx, ecocreditv1beta1.ClassIssuerClassIdIssuerIndexKey{}.WithClassId(request.ClassId), ormlist.Paginate(&queryv1beta1.PageRequest{ + Key: p.Key, + Offset: p.Offset, + Limit: p.Limit, + CountTotal: p.CountTotal, + Reverse: p.Reverse, + })) + if err != nil { + return nil, err + } + + issuers := make([]string, 0) + for it.Next() { + issuer, err := it.Value() + if err != nil { + return nil, err + } + issuers = append(issuers, issuer.Issuer) + } + pr := it.PageResponse() + + return &v1beta1.QueryClassIssuersResponse{ + Issuers: issuers, + Pagination: &query.PageResponse{ + NextKey: pr.NextKey, + Total: pr.Total, + }, + }, nil +} + +// Projects queries projects of a given credit batch. +func (s serverImpl) Projects(ctx context.Context, request *v1beta1.QueryProjectsRequest) (*v1beta1.QueryProjectsResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if request.Pagination == nil { + request.Pagination = &query.PageRequest{} + } + p := request.Pagination + cInfo, err := s.classInfoStore.GetByName(ctx, request.ClassId) + if err != nil { + return nil, err + } + it, err := s.projectInfoStore.List(ctx, ecocreditv1beta1.ProjectInfoClassIdNameIndexKey{}.WithClassId(cInfo.Id), ormlist.Paginate(&queryv1beta1.PageRequest{ + Key: p.Key, + Offset: p.Offset, + Limit: p.Limit, + CountTotal: p.CountTotal, + Reverse: p.Reverse, + })) + if err != nil { + return nil, err + } + projectInfos := make([]*v1beta1.ProjectInfo, 0) + for it.Next() { + info, err := it.Value() + if err != nil { + return nil, err + } + classInfo, err := s.classInfoStore.Get(ctx, info.ClassId) + if err != nil { + return nil, err + } + projectInfos = append(projectInfos, &v1beta1.ProjectInfo{ + Id: info.Id, + Name: info.Name, + ClassId: classInfo.Id, + ProjectLocation: info.ProjectLocation, + Metadata: info.Metadata, + }) + } + pg := it.PageResponse() + return &v1beta1.QueryProjectsResponse{ + Projects: projectInfos, + Pagination: &query.PageResponse{ + NextKey: pg.NextKey, + Total: pg.Total, + }, + }, nil +} + +func (s serverImpl) ProjectInfo(ctx context.Context, request *v1beta1.QueryProjectInfoRequest) (*v1beta1.QueryProjectInfoResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if err := ecocredit.ValidateProjectID(request.ProjectId); err != nil { + return nil, err + } + pInfo, err := s.projectInfoStore.GetByName(ctx, request.ProjectId) + if err != nil { + return nil, err + } + + cInfo, err := s.classInfoStore.Get(ctx, pInfo.ClassId) + if err != nil { + return nil, err + } + + return &v1beta1.QueryProjectInfoResponse{Info: &v1beta1.ProjectInfo{ + Id: pInfo.Id, + Name: request.ProjectId, + ClassId: cInfo.Id, + ProjectLocation: pInfo.ProjectLocation, + Metadata: pInfo.Metadata, + }}, nil +} + +// Batches queries for all batches in the given credit class. +func (s serverImpl) Batches(ctx context.Context, request *v1beta1.QueryBatchesRequest) (*v1beta1.QueryBatchesResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if request.Pagination == nil { + request.Pagination = &query.PageRequest{} + } + p := request.Pagination + project, err := s.projectInfoStore.GetByName(ctx, request.ProjectId) + if err != nil { + return nil, err + } + it, err := s.batchInfoStore.List(ctx, ecocreditv1beta1.BatchInfoProjectIdIndexKey{}.WithProjectId(project.Id), ormlist.Paginate(&queryv1beta1.PageRequest{ + Key: p.Key, + Offset: p.Offset, + Limit: p.Limit, + CountTotal: p.CountTotal, + Reverse: p.Reverse, + })) + if err != nil { + return nil, err + } + + projectName := request.ProjectId + pinfo, err := s.projectInfoStore.GetByName(ctx, projectName) + if err != nil { + return nil, err + } + + batches := make([]*v1beta1.BatchInfo, 0) + for it.Next() { + batch, err := it.Value() + if err != nil { + return nil, err + } + + protoStart, err := types.TimestampProto(batch.StartDate.AsTime()) + if err != nil { + return nil, err + } + protoEnd, err := types.TimestampProto(batch.EndDate.AsTime()) + if err != nil { + return nil, err + } + batches = append(batches, &v1beta1.BatchInfo{ + ProjectId: pinfo.Id, + BatchDenom: batch.BatchDenom, + Metadata: batch.Metadata, + StartDate: protoStart, + EndDate: protoEnd, + }) + } + pr := it.PageResponse() + return &v1beta1.QueryBatchesResponse{ + Batches: batches, + Pagination: &query.PageResponse{ + NextKey: pr.NextKey, + Total: pr.Total, + }, + }, nil +} + +// BatchInfo queries for information on a credit batch. +func (s serverImpl) BatchInfo(ctx context.Context, request *v1beta1.QueryBatchInfoRequest) (*v1beta1.QueryBatchInfoResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if err := ecocredit.ValidateDenom(request.BatchDenom); err != nil { + return nil, err + } + + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, request.BatchDenom) + if err != nil { + return nil, err + } + + project, err := s.projectInfoStore.Get(ctx, batch.ProjectId) + if err != nil { + return nil, err + } + + protoStart, err := types.TimestampProto(batch.StartDate.AsTime()) + if err != nil { + return nil, err + } + protoEnd, err := types.TimestampProto(batch.EndDate.AsTime()) + if err != nil { + return nil, err + } + return &v1beta1.QueryBatchInfoResponse{ + Info: &v1beta1.BatchInfo{ + Id: batch.Id, + ProjectId: project.Id, + BatchDenom: request.BatchDenom, + Metadata: batch.Metadata, + StartDate: protoStart, + EndDate: protoEnd, + }, + }, nil +} + +// Balance queries the balance (both tradable and retired) of a given credit +// batch for a given account. +func (s serverImpl) Balance(ctx context.Context, req *v1beta1.QueryBalanceRequest) (*v1beta1.QueryBalanceResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + if err := ecocredit.ValidateDenom(req.BatchDenom); err != nil { + return nil, err + } + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, req.BatchDenom) + if err != nil { + return nil, err + } + if batch == nil { + return nil, sdkerrors.ErrNotFound.Wrapf("batch with denom %s not found", req.BatchDenom) + } + addr, _ := sdk.AccAddressFromBech32(req.Account) + + balance, err := s.batchBalanceStore.Get(ctx, addr, batch.Id) + if err != nil { + return nil, err + } + if balance == nil { + return &v1beta1.QueryBalanceResponse{ + TradableAmount: "0", + RetiredAmount: "0", + }, nil + } + return &v1beta1.QueryBalanceResponse{ + TradableAmount: balance.Tradable, + RetiredAmount: balance.Retired, + }, nil +} + +// Supply queries the supply (tradable, retired, cancelled) of a given credit batch. +func (s serverImpl) Supply(ctx context.Context, request *v1beta1.QuerySupplyRequest) (*v1beta1.QuerySupplyResponse, error) { + if request == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + if err := ecocredit.ValidateDenom(request.BatchDenom); err != nil { + return nil, err + } + + batch, err := s.batchInfoStore.GetByBatchDenom(ctx, request.BatchDenom) + if err != nil { + return nil, err + } + + supply, err := s.batchSupplyStore.Get(ctx, batch.Id) + if err != nil { + return nil, err + } + + return &v1beta1.QuerySupplyResponse{ + TradableSupply: supply.TradableAmount, + RetiredSupply: supply.RetiredAmount, + CancelledAmount: supply.CancelledAmount, + }, nil +} + +// CreditTypes queries the list of allowed types that credit classes can have. +// TODO: migrate to v1beta1 +func (s serverImpl) CreditTypes(ctx context.Context, _ *v1beta1.QueryCreditTypesRequest) (*v1beta1.QueryCreditTypesResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + creditTypes := s.getAllCreditTypes(sdkCtx) + return &v1beta1.QueryCreditTypesResponse{CreditTypes: creditTypes}, nil +} + +// Params queries the ecocredit module parameters. +// TODO: refactor to v1beta1 +func (s serverImpl) Params(ctx context.Context, _ *v1beta1.QueryParamsRequest) (*v1beta1.QueryParamsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + var params ecocredit.Params + s.paramSpace.GetParamSet(sdkCtx, ¶ms) + v1beta1types := make([]*v1beta1.CreditType, len(params.CreditTypes)) + for i, typ := range params.CreditTypes { + v1beta1types[i] = &v1beta1.CreditType{ + Abbreviation: typ.Abbreviation, + Name: typ.Name, + Unit: typ.Unit, + Precision: typ.Precision, + } + } + v1beta1Params := v1beta1.Params{ + CreditClassFee: params.CreditClassFee, + AllowedClassCreators: params.AllowedClassCreators, + AllowlistEnabled: params.AllowlistEnabled, + CreditTypes: v1beta1types, + } + return &v1beta1.QueryParamsResponse{Params: &v1beta1Params}, nil +} + +// SellOrder queries for information about a sell order by its ID +// TODO: impl with ORM, integrate sell order? +func (s serverImpl) SellOrder(goCtx context.Context, request *ecocredit.QuerySellOrderRequest) (*ecocredit.QuerySellOrderResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //sellOrder, err := s.getSellOrder(ctx, request.SellOrderId) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QuerySellOrderResponse{SellOrder: sellOrder}, nil +} + +// SellOrders queries for all sell orders with pagination. +// TODO: impl with ORM +func (s serverImpl) SellOrders(goCtx context.Context, request *ecocredit.QuerySellOrdersRequest) (*ecocredit.QuerySellOrdersResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //ordersIter, err := s.sellOrderTable.PrefixScan(ctx, 1, math.MaxUint64) + //if err != nil { + // return nil, err + //} + // + //var orders []*ecocredit.SellOrder + //pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QuerySellOrdersResponse{ + // SellOrders: orders, + // Pagination: pageResp, + //}, nil +} + +// SellOrdersByAddress queries for all sell orders by address with pagination. +// TODO: impl with ORM +func (s serverImpl) SellOrdersByAddress(goCtx context.Context, request *ecocredit.QuerySellOrdersByAddressRequest) (*ecocredit.QuerySellOrdersByAddressResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //addr, err := sdk.AccAddressFromBech32(request.Address) + //if err != nil { + // return nil, err + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //ordersIter, err := s.sellOrderByAddressIndex.GetPaginated(ctx, addr.Bytes(), request.Pagination) + //if err != nil { + // return nil, err + //} + // + //var orders []*ecocredit.SellOrder + //pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QuerySellOrdersByAddressResponse{ + // SellOrders: orders, + // Pagination: pageResp, + //}, nil +} + +// SellOrdersByBatchDenom queries for all sell orders by address with pagination. +// TODO: impl with ORM +func (s serverImpl) SellOrdersByBatchDenom(goCtx context.Context, request *ecocredit.QuerySellOrdersByBatchDenomRequest) (*ecocredit.QuerySellOrdersByBatchDenomResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //if err := ecocredit.ValidateDenom(request.BatchDenom); err != nil { + // return nil, err + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //ordersIter, err := s.sellOrderByBatchDenomIndex.GetPaginated(ctx, request.BatchDenom, request.Pagination) + //if err != nil { + // return nil, err + //} + // + //var orders []*ecocredit.SellOrder + //pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QuerySellOrdersByBatchDenomResponse{ + // SellOrders: orders, + // Pagination: pageResp, + //}, nil +} + +// BuyOrder queries for information about a buy order by its ID +// TODO: impl with ORM +func (s serverImpl) BuyOrder(goCtx context.Context, request *ecocredit.QueryBuyOrderRequest) (*ecocredit.QueryBuyOrderResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //buyOrder, err := s.getBuyOrder(ctx, request.BuyOrderId) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QueryBuyOrderResponse{BuyOrder: buyOrder}, nil +} + +// BuyOrders queries for all buy orders with pagination. +// TODO: impl with ORM +func (s serverImpl) BuyOrders(goCtx context.Context, request *ecocredit.QueryBuyOrdersRequest) (*ecocredit.QueryBuyOrdersResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //ordersIter, err := s.buyOrderTable.PrefixScan(ctx, 1, math.MaxUint64) + //if err != nil { + // return nil, err + //} + // + //var orders []*ecocredit.BuyOrder + //pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QueryBuyOrdersResponse{ + // BuyOrders: orders, + // Pagination: pageResp, + //}, nil +} + +// BuyOrdersByAddress queries for all buy orders by address with pagination. +// TODO: impl with ORM +func (s serverImpl) BuyOrdersByAddress(goCtx context.Context, request *ecocredit.QueryBuyOrdersByAddressRequest) (*ecocredit.QueryBuyOrdersByAddressResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //addr, err := sdk.AccAddressFromBech32(request.Address) + //if err != nil { + // return nil, err + //} + // + //ordersIter, err := s.buyOrderByAddressIndex.GetPaginated(ctx, addr.Bytes(), request.Pagination) + //if err != nil { + // return nil, err + //} + // + //var orders []*ecocredit.BuyOrder + //pageResp, err := orm.Paginate(ordersIter, request.Pagination, &orders) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QueryBuyOrdersByAddressResponse{ + // BuyOrders: orders, + // Pagination: pageResp, + //}, nil +} + +// AllowedAskDenoms queries for all allowed ask denoms with pagination. +// TODO: impl with ORM +func (s serverImpl) AllowedAskDenoms(goCtx context.Context, request *ecocredit.QueryAllowedAskDenomsRequest) (*ecocredit.QueryAllowedAskDenomsResponse, error) { + panic("impl me!") + //if request == nil { + // return nil, status.Errorf(codes.InvalidArgument, "empty request") + //} + // + //ctx := types.UnwrapSDKContext(goCtx) + //denomsIter, err := s.askDenomTable.PrefixScan(ctx, nil, nil) + //if err != nil { + // return nil, err + //} + // + //var denoms []*ecocredit.AskDenom + //pageResp, err := orm.Paginate(denomsIter, request.Pagination, &denoms) + //if err != nil { + // return nil, err + //} + // + //return &ecocredit.QueryAllowedAskDenomsResponse{ + // AskDenoms: denoms, + // Pagination: pageResp, + //}, nil +} + +// TODO: baskets PR queries + +func (s serverImpl) Basket(ctx context.Context, request *ecocredit.QueryBasketRequest) (*ecocredit.QueryBasketResponse, error) { + panic("implement me") +} + +func (s serverImpl) Baskets(ctx context.Context, request *ecocredit.QueryBasketsRequest) (*ecocredit.QueryBasketsResponse, error) { + panic("implement me") +} + +func (s serverImpl) BasketCredits(ctx context.Context, request *ecocredit.QueryBasketCreditsRequest) (*ecocredit.QueryBasketCreditsResponse, error) { + panic("implement me") +} diff --git a/x/ecocredit/server/core/server.go b/x/ecocredit/server/core/server.go new file mode 100644 index 0000000000..479cace116 --- /dev/null +++ b/x/ecocredit/server/core/server.go @@ -0,0 +1,83 @@ +package core + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/orm/model/ormdb" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + ecocreditv1beta1 "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1beta1" + "github.com/regen-network/regen-ledger/types/module/server" + "github.com/regen-network/regen-ledger/types/ormstore" + "github.com/regen-network/regen-ledger/x/ecocredit" + "github.com/regen-network/regen-ledger/x/ecocredit/v1beta1" + "google.golang.org/protobuf/reflect/protoreflect" +) + +type serverImpl struct { + storeKey sdk.StoreKey + + paramSpace paramtypes.Subspace + bankKeeper ecocredit.BankKeeper + accountKeeper ecocredit.AccountKeeper + + db ormdb.ModuleDB + + creditTypeStore ecocreditv1beta1.CreditTypeStore + + batchInfoStore ecocreditv1beta1.BatchInfoStore + batchSupplyStore ecocreditv1beta1.BatchSupplyStore + batchBalanceStore ecocreditv1beta1.BatchBalanceStore + batchSeqStore ecocreditv1beta1.BatchSequenceStore + + projectInfoStore ecocreditv1beta1.ProjectInfoStore + projectSeqStore ecocreditv1beta1.ProjectSequenceStore + + classInfoStore ecocreditv1beta1.ClassInfoStore + classIssuerStore ecocreditv1beta1.ClassIssuerStore + classSeqStore ecocreditv1beta1.ClassSequenceStore +} + +var ecocreditSchema = ormdb.ModuleSchema{ + FileDescriptors: map[uint32]protoreflect.FileDescriptor{1: ecocreditv1beta1.File_regen_ecocredit_v1beta1_state_proto}, + Prefix: nil, +} + +func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, + accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper, cdc codec.Codec) serverImpl { + + s := serverImpl{ + storeKey: storeKey, + paramSpace: paramSpace, + bankKeeper: bankKeeper, + accountKeeper: accountKeeper, + } + + db, err := ormstore.NewStoreKeyDB(ecocreditSchema, storeKey, ormdb.ModuleDBOptions{}) + if err != nil { + panic(err) + } + s.db = db + + stateStore, err := ecocreditv1beta1.NewStateStore(db) + if err != nil { + panic(err) + } + s.creditTypeStore, s.classInfoStore, s.classSeqStore, s.projectInfoStore, + s.projectSeqStore, s.batchInfoStore, s.batchSeqStore, s.batchBalanceStore, + s.batchSupplyStore, s.classIssuerStore = stateStore.CreditTypeStore(), stateStore.ClassInfoStore(), stateStore.ClassSequenceStore(), + stateStore.ProjectInfoStore(), stateStore.ProjectSequenceStore(), stateStore.BatchInfoStore(), + stateStore.BatchSequenceStore(), stateStore.BatchBalanceStore(), stateStore.BatchSupplyStore(), stateStore.ClassIssuerStore() + + return s +} + +func RegisterServices(configurator server.Configurator, paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, + bankKeeper ecocredit.BankKeeper) v1beta1.MsgServer { + impl := newServer(configurator.ModuleKey(), paramSpace, accountKeeper, bankKeeper, configurator.Marshaler()) + v1beta1.RegisterMsgServer(configurator.MsgServer(), impl) + v1beta1.RegisterQueryServer(configurator.QueryServer(), impl) + configurator.RegisterGenesisHandlers(impl.InitGenesis, impl.ExportGenesis) + configurator.RegisterWeightedOperationsHandler(impl.WeightedOperations) + configurator.RegisterInvariantsHandler(impl.RegisterInvariants) + return impl +} diff --git a/x/ecocredit/v1beta1/query.pb.go b/x/ecocredit/v1beta1/query.pb.go index 1a17dbcbe8..719d3f7178 100644 --- a/x/ecocredit/v1beta1/query.pb.go +++ b/x/ecocredit/v1beta1/query.pb.go @@ -305,6 +305,116 @@ func (m *QueryClassInfoResponse) GetInfo() *ClassInfo { return nil } +// QueryClassIssuersRequest is the Query/ClassIssuers request type. +type QueryClassIssuersRequest struct { + // class_id is the unique ID of credit class to query. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassIssuersRequest) Reset() { *m = QueryClassIssuersRequest{} } +func (m *QueryClassIssuersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassIssuersRequest) ProtoMessage() {} +func (*QueryClassIssuersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_65a0fecd2f04365f, []int{6} +} +func (m *QueryClassIssuersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassIssuersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassIssuersRequest.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 *QueryClassIssuersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassIssuersRequest.Merge(m, src) +} +func (m *QueryClassIssuersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassIssuersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassIssuersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassIssuersRequest proto.InternalMessageInfo + +func (m *QueryClassIssuersRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *QueryClassIssuersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryClassIssuersRequest is the Query/ClassIssuers response type. +type QueryClassIssuersResponse struct { + // issuers is a list of issuers for the credit class + Issuers []string `protobuf:"bytes,1,rep,name=issuers,proto3" json:"issuers,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassIssuersResponse) Reset() { *m = QueryClassIssuersResponse{} } +func (m *QueryClassIssuersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassIssuersResponse) ProtoMessage() {} +func (*QueryClassIssuersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_65a0fecd2f04365f, []int{7} +} +func (m *QueryClassIssuersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassIssuersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassIssuersResponse.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 *QueryClassIssuersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassIssuersResponse.Merge(m, src) +} +func (m *QueryClassIssuersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassIssuersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassIssuersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassIssuersResponse proto.InternalMessageInfo + +func (m *QueryClassIssuersResponse) GetIssuers() []string { + if m != nil { + return m.Issuers + } + return nil +} + +func (m *QueryClassIssuersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + // QueryProjectsRequest is the Query/Projects request type. type QueryProjectsRequest struct { // class_id is the unique ID of credit class to query. @@ -317,7 +427,7 @@ func (m *QueryProjectsRequest) Reset() { *m = QueryProjectsRequest{} } func (m *QueryProjectsRequest) String() string { return proto.CompactTextString(m) } func (*QueryProjectsRequest) ProtoMessage() {} func (*QueryProjectsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{6} + return fileDescriptor_65a0fecd2f04365f, []int{8} } func (m *QueryProjectsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -372,7 +482,7 @@ func (m *QueryProjectsResponse) Reset() { *m = QueryProjectsResponse{} } func (m *QueryProjectsResponse) String() string { return proto.CompactTextString(m) } func (*QueryProjectsResponse) ProtoMessage() {} func (*QueryProjectsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{7} + return fileDescriptor_65a0fecd2f04365f, []int{9} } func (m *QueryProjectsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -425,7 +535,7 @@ func (m *QueryProjectInfoRequest) Reset() { *m = QueryProjectInfoRequest func (m *QueryProjectInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryProjectInfoRequest) ProtoMessage() {} func (*QueryProjectInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{8} + return fileDescriptor_65a0fecd2f04365f, []int{10} } func (m *QueryProjectInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,7 +581,7 @@ func (m *QueryProjectInfoResponse) Reset() { *m = QueryProjectInfoRespon func (m *QueryProjectInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryProjectInfoResponse) ProtoMessage() {} func (*QueryProjectInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{9} + return fileDescriptor_65a0fecd2f04365f, []int{11} } func (m *QueryProjectInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -519,7 +629,7 @@ func (m *QueryBatchesRequest) Reset() { *m = QueryBatchesRequest{} } func (m *QueryBatchesRequest) String() string { return proto.CompactTextString(m) } func (*QueryBatchesRequest) ProtoMessage() {} func (*QueryBatchesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{10} + return fileDescriptor_65a0fecd2f04365f, []int{12} } func (m *QueryBatchesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -574,7 +684,7 @@ func (m *QueryBatchesResponse) Reset() { *m = QueryBatchesResponse{} } func (m *QueryBatchesResponse) String() string { return proto.CompactTextString(m) } func (*QueryBatchesResponse) ProtoMessage() {} func (*QueryBatchesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{11} + return fileDescriptor_65a0fecd2f04365f, []int{13} } func (m *QueryBatchesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -627,7 +737,7 @@ func (m *QueryBatchInfoRequest) Reset() { *m = QueryBatchInfoRequest{} } func (m *QueryBatchInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryBatchInfoRequest) ProtoMessage() {} func (*QueryBatchInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{12} + return fileDescriptor_65a0fecd2f04365f, []int{14} } func (m *QueryBatchInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -673,7 +783,7 @@ func (m *QueryBatchInfoResponse) Reset() { *m = QueryBatchInfoResponse{} func (m *QueryBatchInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryBatchInfoResponse) ProtoMessage() {} func (*QueryBatchInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{13} + return fileDescriptor_65a0fecd2f04365f, []int{15} } func (m *QueryBatchInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -721,7 +831,7 @@ func (m *QueryBalanceRequest) Reset() { *m = QueryBalanceRequest{} } func (m *QueryBalanceRequest) String() string { return proto.CompactTextString(m) } func (*QueryBalanceRequest) ProtoMessage() {} func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{14} + return fileDescriptor_65a0fecd2f04365f, []int{16} } func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -776,7 +886,7 @@ func (m *QueryBalanceResponse) Reset() { *m = QueryBalanceResponse{} } func (m *QueryBalanceResponse) String() string { return proto.CompactTextString(m) } func (*QueryBalanceResponse) ProtoMessage() {} func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{15} + return fileDescriptor_65a0fecd2f04365f, []int{17} } func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -829,7 +939,7 @@ func (m *QuerySupplyRequest) Reset() { *m = QuerySupplyRequest{} } func (m *QuerySupplyRequest) String() string { return proto.CompactTextString(m) } func (*QuerySupplyRequest) ProtoMessage() {} func (*QuerySupplyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{16} + return fileDescriptor_65a0fecd2f04365f, []int{18} } func (m *QuerySupplyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -873,13 +983,16 @@ type QuerySupplyResponse struct { // retired_supply is the decimal number of retired credits in the batch // supply. RetiredSupply string `protobuf:"bytes,2,opt,name=retired_supply,json=retiredSupply,proto3" json:"retired_supply,omitempty"` + // cancelled_amount is the decimal number of cancelled credits in the batch + // supply. + CancelledAmount string `protobuf:"bytes,3,opt,name=cancelled_amount,json=cancelledAmount,proto3" json:"cancelled_amount,omitempty"` } func (m *QuerySupplyResponse) Reset() { *m = QuerySupplyResponse{} } func (m *QuerySupplyResponse) String() string { return proto.CompactTextString(m) } func (*QuerySupplyResponse) ProtoMessage() {} func (*QuerySupplyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{17} + return fileDescriptor_65a0fecd2f04365f, []int{19} } func (m *QuerySupplyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -922,6 +1035,13 @@ func (m *QuerySupplyResponse) GetRetiredSupply() string { return "" } +func (m *QuerySupplyResponse) GetCancelledAmount() string { + if m != nil { + return m.CancelledAmount + } + return "" +} + // QueryCreditTypesRequest is the Query/Credit_Types request type type QueryCreditTypesRequest struct { } @@ -930,7 +1050,7 @@ func (m *QueryCreditTypesRequest) Reset() { *m = QueryCreditTypesRequest func (m *QueryCreditTypesRequest) String() string { return proto.CompactTextString(m) } func (*QueryCreditTypesRequest) ProtoMessage() {} func (*QueryCreditTypesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{18} + return fileDescriptor_65a0fecd2f04365f, []int{20} } func (m *QueryCreditTypesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -969,7 +1089,7 @@ func (m *QueryCreditTypesResponse) Reset() { *m = QueryCreditTypesRespon func (m *QueryCreditTypesResponse) String() string { return proto.CompactTextString(m) } func (*QueryCreditTypesResponse) ProtoMessage() {} func (*QueryCreditTypesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a0fecd2f04365f, []int{19} + return fileDescriptor_65a0fecd2f04365f, []int{21} } func (m *QueryCreditTypesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1012,6 +1132,8 @@ func init() { proto.RegisterType((*QueryClassesResponse)(nil), "regen.ecocredit.v1beta1.QueryClassesResponse") proto.RegisterType((*QueryClassInfoRequest)(nil), "regen.ecocredit.v1beta1.QueryClassInfoRequest") proto.RegisterType((*QueryClassInfoResponse)(nil), "regen.ecocredit.v1beta1.QueryClassInfoResponse") + proto.RegisterType((*QueryClassIssuersRequest)(nil), "regen.ecocredit.v1beta1.QueryClassIssuersRequest") + proto.RegisterType((*QueryClassIssuersResponse)(nil), "regen.ecocredit.v1beta1.QueryClassIssuersResponse") proto.RegisterType((*QueryProjectsRequest)(nil), "regen.ecocredit.v1beta1.QueryProjectsRequest") proto.RegisterType((*QueryProjectsResponse)(nil), "regen.ecocredit.v1beta1.QueryProjectsResponse") proto.RegisterType((*QueryProjectInfoRequest)(nil), "regen.ecocredit.v1beta1.QueryProjectInfoRequest") @@ -1033,70 +1155,75 @@ func init() { } var fileDescriptor_65a0fecd2f04365f = []byte{ - // 1003 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xb3, 0x01, 0xf2, 0xe3, 0xb9, 0x14, 0x69, 0x68, 0x69, 0x6a, 0x81, 0x13, 0xb6, 0x94, - 0x44, 0xb4, 0xde, 0x69, 0x52, 0x9a, 0x06, 0xa9, 0xa0, 0x92, 0xa2, 0x42, 0x2e, 0x28, 0xa4, 0x3d, - 0x21, 0xa1, 0x68, 0xbc, 0x9e, 0xb8, 0x06, 0x7b, 0x67, 0xbb, 0x3b, 0x06, 0xa2, 0x90, 0x0b, 0x67, - 0x0e, 0x95, 0x38, 0x73, 0xa0, 0x42, 0x20, 0x71, 0xe2, 0xcf, 0xe0, 0x58, 0x89, 0x0b, 0x47, 0x94, - 0xf0, 0x07, 0xf0, 0x27, 0x20, 0xbf, 0x79, 0xfb, 0xcb, 0xce, 0x66, 0xd6, 0x55, 0x8e, 0x1e, 0xbf, - 0x1f, 0x9f, 0x79, 0x6f, 0xde, 0xf7, 0x69, 0xe1, 0x4a, 0x24, 0x3b, 0x32, 0xe0, 0xd2, 0x57, 0x7e, - 0x24, 0xdb, 0x5d, 0xcd, 0xbf, 0x5e, 0x6d, 0x49, 0x2d, 0x56, 0xf9, 0xe3, 0x81, 0x8c, 0xf6, 0xbd, - 0x30, 0x52, 0x5a, 0xb1, 0x4b, 0x68, 0xe4, 0xa5, 0x46, 0x1e, 0x19, 0xd5, 0x5f, 0xef, 0x28, 0xd5, - 0xe9, 0x49, 0x2e, 0xc2, 0x2e, 0x17, 0x41, 0xa0, 0xb4, 0xd0, 0x5d, 0x15, 0xc4, 0xc6, 0xad, 0x5e, - 0x1a, 0x3b, 0xd6, 0x42, 0x4b, 0x9b, 0x91, 0xde, 0x0f, 0x65, 0x12, 0xe9, 0x1d, 0x5f, 0xc5, 0x7d, - 0x15, 0xf3, 0x96, 0x88, 0xa5, 0x21, 0x4b, 0xcd, 0x42, 0xd1, 0xe9, 0x06, 0x98, 0xd6, 0xd8, 0xba, - 0x17, 0x80, 0x7d, 0x36, 0xb4, 0xd8, 0x16, 0x91, 0xe8, 0xc7, 0x3b, 0xf2, 0xf1, 0x40, 0xc6, 0xda, - 0xfd, 0x14, 0x5e, 0x2d, 0x9c, 0xc6, 0xa1, 0x0a, 0x62, 0xc9, 0x6e, 0xc3, 0x4c, 0x88, 0x27, 0x0b, - 0xce, 0x92, 0xb3, 0x52, 0x5b, 0x5b, 0xf4, 0x4a, 0xae, 0xea, 0x91, 0x23, 0x99, 0xbb, 0x5f, 0x50, - 0xbc, 0x7b, 0x3d, 0x11, 0xc7, 0x32, 0x49, 0xc3, 0xee, 0x03, 0x64, 0x40, 0x14, 0xf3, 0x6d, 0xcf, - 0xd0, 0x7b, 0x43, 0x7a, 0xcf, 0xd4, 0x35, 0x8b, 0xda, 0x91, 0xe4, 0xbb, 0x93, 0xf3, 0x74, 0x7f, - 0x72, 0xe0, 0x42, 0x31, 0x3e, 0x01, 0xdf, 0x81, 0x59, 0xdf, 0x1c, 0x2d, 0x38, 0x4b, 0x2f, 0xac, - 0xd4, 0xd6, 0xdc, 0x52, 0x62, 0x74, 0xdd, 0x0a, 0xf6, 0xd4, 0x4e, 0xe2, 0xc2, 0x3e, 0x2e, 0xe0, - 0x4d, 0x23, 0xde, 0xb2, 0x15, 0xcf, 0xa4, 0x2e, 0xf0, 0xad, 0xc1, 0xc5, 0x0c, 0x0f, 0x73, 0x50, - 0x01, 0x2e, 0xc3, 0x1c, 0x26, 0xdb, 0xed, 0xb6, 0xf1, 0xfa, 0xf3, 0x94, 0x7c, 0xab, 0xed, 0x6e, - 0xc3, 0x6b, 0xa3, 0x3e, 0x74, 0xa9, 0x75, 0x78, 0xb1, 0x1b, 0xec, 0x29, 0xaa, 0x57, 0x95, 0x1b, - 0xa1, 0xbd, 0xbb, 0x4f, 0x45, 0xda, 0x8e, 0xd4, 0x97, 0xd2, 0xd7, 0xb1, 0x1d, 0x62, 0xa4, 0x41, - 0xd3, 0xcf, 0xdd, 0xa0, 0xa7, 0x0e, 0x55, 0x20, 0xcb, 0x4d, 0x97, 0xb9, 0x0b, 0x73, 0x21, 0x9d, - 0x51, 0x8b, 0xde, 0x2a, 0x7f, 0x54, 0xc6, 0x10, 0xaf, 0x94, 0x7a, 0x9d, 0x5d, 0x97, 0x36, 0xe0, - 0x52, 0x9e, 0x31, 0xdf, 0xa7, 0x37, 0x00, 0x28, 0x5f, 0x56, 0xa4, 0x79, 0x3a, 0xd9, 0x6a, 0xbb, - 0x0f, 0x61, 0x61, 0xdc, 0x93, 0x2e, 0xb8, 0x51, 0xe8, 0x56, 0xb5, 0xcb, 0x99, 0x7e, 0x7d, 0x47, - 0x43, 0xb3, 0x29, 0xb4, 0xff, 0x28, 0x1b, 0x9a, 0xd3, 0x59, 0xce, 0xac, 0x65, 0xe9, 0x4c, 0xa5, - 0xe9, 0xb3, 0x99, 0x6a, 0x99, 0x23, 0xeb, 0x4c, 0xa1, 0xab, 0x99, 0x29, 0x72, 0x39, 0xcb, 0x6e, - 0x5d, 0xcc, 0xf0, 0xf2, 0xbd, 0x5a, 0x84, 0x1a, 0x26, 0xdb, 0x6d, 0xcb, 0x40, 0xf5, 0xa9, 0x40, - 0x80, 0x47, 0x1f, 0x0d, 0x4f, 0xd2, 0xc9, 0xca, 0x79, 0x4e, 0x38, 0x59, 0x99, 0xa7, 0xe9, 0xd4, - 0x76, 0xda, 0xa9, 0x9e, 0x08, 0xfc, 0xa4, 0x9c, 0x6c, 0x01, 0x66, 0x85, 0xef, 0xab, 0x41, 0xa0, - 0x93, 0xb9, 0xa2, 0x9f, 0xa3, 0x8c, 0xd3, 0x63, 0x8c, 0x7b, 0x69, 0xf1, 0x29, 0x22, 0x11, 0x2e, - 0xc3, 0x2b, 0x3a, 0x12, 0x6d, 0xd1, 0xea, 0xc9, 0x5d, 0xd1, 0xcf, 0x85, 0x3e, 0x9f, 0x1c, 0x7f, - 0x88, 0xa7, 0xec, 0x2a, 0x9c, 0x8f, 0xa4, 0xee, 0x46, 0xb2, 0x9d, 0xd8, 0x99, 0x24, 0x2f, 0xd3, - 0xa9, 0x31, 0x73, 0x6f, 0x91, 0xfc, 0x3f, 0x18, 0x84, 0x61, 0x6f, 0xbf, 0x72, 0x09, 0x25, 0x5d, - 0x38, 0x71, 0x3b, 0x81, 0x2e, 0xc6, 0xbf, 0x46, 0xe9, 0x8c, 0x43, 0x9e, 0x8e, 0xec, 0x8a, 0x74, - 0xc6, 0xcc, 0xbd, 0x4c, 0x13, 0x79, 0x0f, 0xcb, 0xff, 0x70, 0xb8, 0xe2, 0x92, 0x0d, 0xd5, 0xa2, - 0x91, 0x2b, 0xfc, 0x45, 0x18, 0xf7, 0xe1, 0x9c, 0x69, 0xd8, 0x2e, 0x6e, 0x45, 0x7a, 0xa6, 0x57, - 0xca, 0x85, 0x32, 0x8d, 0xb1, 0x53, 0xf3, 0xb3, 0x78, 0x6b, 0xff, 0x9d, 0x83, 0x97, 0x30, 0x09, - 0x7b, 0xe2, 0xc0, 0x2c, 0xed, 0x16, 0x76, 0xbd, 0x34, 0xce, 0x09, 0x2b, 0xae, 0xde, 0xac, 0x68, - 0x6d, 0xd0, 0xdd, 0x95, 0xef, 0xff, 0xfa, 0xf7, 0xc7, 0x69, 0x97, 0x2d, 0xf1, 0xb2, 0x45, 0x9f, - 0x2c, 0xa7, 0x9f, 0x1d, 0x98, 0x4f, 0x15, 0x9e, 0x79, 0x15, 0xd2, 0xe4, 0x86, 0xa4, 0xce, 0x2b, - 0xdb, 0x13, 0xd8, 0x4d, 0x04, 0x6b, 0xb2, 0x6b, 0x36, 0x30, 0x7e, 0x90, 0x2c, 0x93, 0x43, 0xf6, - 0x9b, 0x03, 0x73, 0x89, 0xe2, 0x33, 0x4b, 0x25, 0x46, 0xb6, 0x52, 0xdd, 0xab, 0x6a, 0x4e, 0x80, - 0x77, 0x10, 0x70, 0x9d, 0xbd, 0x3b, 0x01, 0x20, 0x4f, 0x97, 0xc8, 0xef, 0x0e, 0xd4, 0x72, 0x0a, - 0xcc, 0x6e, 0x54, 0xca, 0x9e, 0xaf, 0xe8, 0xea, 0x04, 0x1e, 0x84, 0xbc, 0x8e, 0xc8, 0x37, 0x98, - 0x57, 0x8a, 0x9c, 0xf0, 0xf1, 0x83, 0x4c, 0xf2, 0x0f, 0xd9, 0xaf, 0x0e, 0xcc, 0x92, 0x2a, 0xdb, - 0x5e, 0x63, 0x71, 0x77, 0xd8, 0x5e, 0xe3, 0x88, 0xd4, 0xbb, 0x1f, 0x20, 0xe0, 0x06, 0x5b, 0x9f, - 0x0c, 0x90, 0x27, 0x62, 0xff, 0x8b, 0x03, 0xf3, 0xa9, 0x56, 0xda, 0xde, 0xe8, 0xa8, 0x90, 0xdb, - 0xde, 0xe8, 0x98, 0x7c, 0x57, 0xa8, 0x27, 0x81, 0xf1, 0x83, 0x9c, 0xbc, 0x1d, 0xb2, 0x3f, 0xb0, - 0x9e, 0x28, 0xb4, 0xf6, 0x7a, 0xe6, 0x15, 0xde, 0x5e, 0xcf, 0x82, 0x7a, 0xbb, 0x9f, 0x20, 0xe0, - 0x26, 0xbb, 0x3b, 0x19, 0x20, 0x6f, 0x99, 0x38, 0xfc, 0x80, 0xf6, 0xc7, 0x21, 0x7b, 0xea, 0xc0, - 0x0c, 0x69, 0xe9, 0xb5, 0xd3, 0x19, 0x0a, 0xca, 0x5e, 0xbf, 0x5e, 0xcd, 0x98, 0x78, 0xdf, 0x47, - 0xde, 0xdb, 0xec, 0xd6, 0x84, 0xbc, 0x46, 0xd3, 0x87, 0x12, 0x55, 0xcb, 0xe9, 0xb3, 0x6d, 0xa8, - 0xc6, 0x55, 0xde, 0x36, 0x54, 0x27, 0x88, 0xbf, 0xdb, 0x44, 0xe6, 0x65, 0x76, 0xb5, 0x5c, 0x07, - 0xf0, 0x67, 0x13, 0x77, 0x03, 0xfb, 0xc1, 0x81, 0x19, 0xf3, 0xb1, 0x62, 0x2b, 0x64, 0xe1, 0x0b, - 0xc9, 0x56, 0xc8, 0xe2, 0x87, 0x93, 0xbb, 0x8c, 0x50, 0x6f, 0xb2, 0xc5, 0xf2, 0x41, 0x42, 0x87, - 0xcd, 0x07, 0x7f, 0x1e, 0x35, 0x9c, 0x67, 0x47, 0x0d, 0xe7, 0x9f, 0xa3, 0x86, 0xf3, 0xe4, 0xb8, - 0x31, 0xf5, 0xec, 0xb8, 0x31, 0xf5, 0xf7, 0x71, 0x63, 0xea, 0xf3, 0xf7, 0x3a, 0x5d, 0xfd, 0x68, - 0xd0, 0xf2, 0x7c, 0xd5, 0x37, 0x41, 0x9a, 0x81, 0xd4, 0xdf, 0xa8, 0xe8, 0x2b, 0xfa, 0xd5, 0x93, - 0xed, 0x8e, 0x8c, 0xf8, 0xb7, 0xe3, 0xb1, 0x5b, 0x33, 0xf8, 0xa9, 0x77, 0xf3, 0xff, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x4e, 0x5b, 0x07, 0x2c, 0xbe, 0x0e, 0x00, 0x00, + // 1086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x97, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xc7, 0x33, 0x29, 0x24, 0xd9, 0xb7, 0x25, 0x45, 0x43, 0x4b, 0x93, 0x15, 0x6c, 0x82, 0x4b, + 0x49, 0xa0, 0x5d, 0xbb, 0xd9, 0xd2, 0x34, 0x48, 0x05, 0x95, 0x14, 0x15, 0x72, 0x41, 0x61, 0xdb, + 0x13, 0x12, 0x8a, 0x66, 0xbd, 0x93, 0x8d, 0xc1, 0x6b, 0xbb, 0xb6, 0x17, 0x88, 0xc2, 0x72, 0xe0, + 0xcc, 0x21, 0x12, 0x67, 0x0e, 0x54, 0xa8, 0x48, 0x9c, 0x90, 0xf8, 0x27, 0x38, 0x56, 0xe2, 0xc2, + 0x11, 0x25, 0xfc, 0x21, 0x68, 0xdf, 0x3c, 0xff, 0xda, 0xac, 0x6b, 0x2f, 0x5a, 0x71, 0xf4, 0xf8, + 0xfd, 0xf8, 0xbc, 0xf7, 0x66, 0xe6, 0x6b, 0xc3, 0x15, 0x5f, 0x76, 0xa5, 0x63, 0x48, 0xd3, 0x35, + 0x7d, 0xd9, 0xb1, 0x42, 0xe3, 0xcb, 0x8d, 0xb6, 0x0c, 0xc5, 0x86, 0xf1, 0xa8, 0x2f, 0xfd, 0x43, + 0xdd, 0xf3, 0xdd, 0xd0, 0xe5, 0x97, 0xd1, 0x48, 0x8f, 0x8d, 0x74, 0x32, 0xaa, 0xbd, 0xd2, 0x75, + 0xdd, 0xae, 0x2d, 0x0d, 0xe1, 0x59, 0x86, 0x70, 0x1c, 0x37, 0x14, 0xa1, 0xe5, 0x3a, 0x81, 0x72, + 0xab, 0xe5, 0xc6, 0x0e, 0x42, 0x11, 0xca, 0x22, 0xa3, 0xf0, 0xd0, 0x93, 0x51, 0xa4, 0xb7, 0x4c, + 0x37, 0xe8, 0xb9, 0x81, 0xd1, 0x16, 0x81, 0x54, 0x64, 0xb1, 0x99, 0x27, 0xba, 0x96, 0x83, 0x69, + 0x95, 0xad, 0x76, 0x11, 0xf8, 0x27, 0x43, 0x8b, 0x5d, 0xe1, 0x8b, 0x5e, 0xd0, 0x92, 0x8f, 0xfa, + 0x32, 0x08, 0xb5, 0x8f, 0xe1, 0xa5, 0xcc, 0x6a, 0xe0, 0xb9, 0x4e, 0x20, 0xf9, 0x6d, 0x98, 0xf3, + 0x70, 0x65, 0x89, 0xad, 0xb2, 0xf5, 0x6a, 0x73, 0x45, 0xcf, 0x29, 0x55, 0x27, 0x47, 0x32, 0xd7, + 0x3e, 0xa3, 0x78, 0xf7, 0x6c, 0x11, 0x04, 0x32, 0x4a, 0xc3, 0xef, 0x03, 0x24, 0x40, 0x14, 0xf3, + 0x0d, 0x5d, 0xd1, 0xeb, 0x43, 0x7a, 0x5d, 0xf5, 0x35, 0x89, 0xda, 0x95, 0xe4, 0xdb, 0x4a, 0x79, + 0x6a, 0x3f, 0x32, 0xb8, 0x98, 0x8d, 0x4f, 0xc0, 0x77, 0x60, 0xde, 0x54, 0x4b, 0x4b, 0x6c, 0xf5, + 0xdc, 0x7a, 0xb5, 0xa9, 0xe5, 0x12, 0xa3, 0xeb, 0x8e, 0xb3, 0xef, 0xb6, 0x22, 0x17, 0xfe, 0x61, + 0x06, 0x6f, 0x16, 0xf1, 0xd6, 0x0a, 0xf1, 0x54, 0xea, 0x0c, 0x5f, 0x13, 0x2e, 0x25, 0x78, 0x98, + 0x83, 0x1a, 0xb0, 0x0c, 0x0b, 0x98, 0x6c, 0xcf, 0xea, 0x60, 0xf9, 0x15, 0x4a, 0xbe, 0xd3, 0xd1, + 0x76, 0xe1, 0xe5, 0x51, 0x1f, 0x2a, 0x6a, 0x13, 0x9e, 0xb3, 0x9c, 0x7d, 0x97, 0xfa, 0x55, 0xa6, + 0x22, 0xb4, 0xd7, 0x06, 0xb0, 0x94, 0x8a, 0x18, 0x04, 0x7d, 0xe9, 0x07, 0xc5, 0x20, 0x23, 0x43, + 0x9a, 0xfd, 0xcf, 0x43, 0xfa, 0x16, 0x96, 0xc7, 0xa4, 0xa7, 0x9a, 0x96, 0x60, 0xde, 0x52, 0x4b, + 0x38, 0xa8, 0x4a, 0x2b, 0x7a, 0x9c, 0xde, 0x10, 0x0e, 0x69, 0x8f, 0xec, 0xfa, 0xee, 0xe7, 0xd2, + 0x0c, 0xff, 0xcf, 0xd2, 0x1f, 0x33, 0xda, 0x00, 0x49, 0x6e, 0xaa, 0xfb, 0x2e, 0x2c, 0x78, 0xb4, + 0x46, 0x3b, 0xf4, 0xf5, 0xfc, 0x33, 0xa5, 0x0c, 0x71, 0xa2, 0xb1, 0xd7, 0xf4, 0xfa, 0xb3, 0x05, + 0x97, 0xd3, 0x8c, 0xe9, 0x6d, 0xfa, 0x2a, 0x00, 0xe5, 0x4b, 0x9a, 0x54, 0xa1, 0x95, 0x9d, 0x8e, + 0xf6, 0x90, 0x36, 0x56, 0xc6, 0x93, 0x0a, 0xdc, 0xca, 0x6c, 0xd6, 0x72, 0xc5, 0xa9, 0xed, 0xfa, + 0x0d, 0xdd, 0x19, 0xdb, 0x22, 0x34, 0x0f, 0x92, 0x3b, 0xe3, 0xd9, 0x2c, 0x53, 0x1b, 0x59, 0x7c, + 0xa5, 0xc4, 0xe9, 0x93, 0x2b, 0xa5, 0xad, 0x96, 0x0a, 0xaf, 0x14, 0x74, 0x55, 0x57, 0x0a, 0xb9, + 0x4c, 0x73, 0x5a, 0x97, 0x12, 0xbc, 0xf4, 0xac, 0x56, 0xa0, 0x8a, 0xc9, 0xf6, 0x3a, 0xd2, 0x71, + 0x7b, 0xd4, 0x20, 0xc0, 0xa5, 0x0f, 0x86, 0x2b, 0xf1, 0xc5, 0x92, 0xf2, 0x9c, 0xf0, 0x62, 0x49, + 0x3c, 0xd5, 0xa4, 0x76, 0xe3, 0x49, 0xd9, 0xc2, 0x31, 0xa3, 0x76, 0x0e, 0xcf, 0xb4, 0x30, 0x4d, + 0xb7, 0xef, 0x84, 0xd1, 0xb9, 0xa2, 0xc7, 0x51, 0xc6, 0xd9, 0x33, 0x8c, 0xfb, 0x71, 0xf3, 0x29, + 0x22, 0x11, 0xae, 0xc1, 0x85, 0xd0, 0x17, 0x1d, 0xd1, 0xb6, 0xe5, 0x9e, 0xe8, 0xa5, 0x42, 0x2f, + 0x46, 0xcb, 0xef, 0xe3, 0x2a, 0xbf, 0x0a, 0x8b, 0xbe, 0x0c, 0x2d, 0x5f, 0x76, 0x22, 0x3b, 0x95, + 0xe4, 0x05, 0x5a, 0x55, 0x66, 0xda, 0x2d, 0x52, 0xbf, 0x07, 0x7d, 0xcf, 0xb3, 0x0f, 0x4b, 0xb7, + 0xf0, 0x98, 0x51, 0xc5, 0x91, 0xdf, 0x18, 0xbc, 0x00, 0x5f, 0x8d, 0xe2, 0x29, 0x87, 0x34, 0x1e, + 0xd9, 0x65, 0xf1, 0xc8, 0xec, 0x4d, 0x78, 0xd1, 0x1c, 0xd6, 0x6f, 0xdb, 0x49, 0x1d, 0xe7, 0xd0, + 0xf0, 0x42, 0xbc, 0x4e, 0x95, 0x2c, 0xd3, 0xe9, 0xbd, 0x87, 0xa3, 0x7a, 0x38, 0xfc, 0x1a, 0x88, + 0xc4, 0xbc, 0x1d, 0xdd, 0xfb, 0xe9, 0x57, 0x44, 0x7c, 0x1f, 0xce, 0xab, 0xe1, 0xee, 0xe1, 0x07, + 0x04, 0x6d, 0xe9, 0x2b, 0xf9, 0x9a, 0x12, 0xc7, 0x68, 0x55, 0xcd, 0x24, 0x5e, 0xf3, 0xc9, 0x22, + 0x3c, 0x8f, 0x49, 0xf8, 0x31, 0x83, 0x79, 0x92, 0x61, 0x7e, 0x3d, 0x37, 0xce, 0x98, 0xaf, 0x81, + 0x5a, 0xa3, 0xa4, 0xb5, 0x42, 0xd7, 0xd6, 0xbf, 0xfb, 0xf3, 0x9f, 0x1f, 0x66, 0x35, 0xbe, 0x6a, + 0xe4, 0x7d, 0x13, 0x45, 0x3a, 0xfe, 0x13, 0x83, 0x4a, 0x2c, 0x86, 0x5c, 0x2f, 0x91, 0x26, 0x75, + 0xa0, 0x6a, 0x46, 0x69, 0x7b, 0x02, 0xbb, 0x89, 0x60, 0x0d, 0x7e, 0xad, 0x08, 0xcc, 0x38, 0x8a, + 0x84, 0x67, 0xc0, 0x7f, 0x67, 0x70, 0x3e, 0xad, 0x8c, 0x7c, 0xa3, 0x4c, 0xda, 0x8c, 0x88, 0xd7, + 0x9a, 0x93, 0xb8, 0x10, 0xec, 0x1d, 0x84, 0xdd, 0xe4, 0x6f, 0x8f, 0x81, 0x15, 0xb6, 0x77, 0x20, + 0x9a, 0x63, 0x68, 0x8d, 0x48, 0x9c, 0x7f, 0x61, 0xb0, 0x10, 0x69, 0x1a, 0x2f, 0x98, 0xdf, 0x88, + 0xee, 0xd6, 0xf4, 0xb2, 0xe6, 0x25, 0x48, 0xf3, 0xda, 0x6a, 0xc4, 0x32, 0xf9, 0x2b, 0x83, 0x6a, + 0x4a, 0x63, 0xf8, 0x8d, 0x52, 0xd9, 0xd3, 0xfb, 0x60, 0x63, 0x02, 0x0f, 0x42, 0xde, 0x44, 0xe4, + 0x1b, 0x5c, 0xcf, 0x45, 0x8e, 0xf8, 0x8c, 0xa3, 0x44, 0xd4, 0x06, 0xfc, 0x09, 0x83, 0x79, 0xd2, + 0x9d, 0xa2, 0x33, 0x94, 0x55, 0xc7, 0xa2, 0x33, 0x34, 0x22, 0x66, 0xda, 0x7b, 0x08, 0xb8, 0xc5, + 0x37, 0x27, 0x03, 0x34, 0x22, 0x39, 0xfb, 0x99, 0x41, 0x25, 0x56, 0x83, 0xa2, 0x93, 0x35, 0x2a, + 0x55, 0x45, 0x27, 0xeb, 0x8c, 0x40, 0x95, 0xe8, 0x27, 0x81, 0x19, 0x47, 0xa9, 0x0b, 0x7c, 0xc0, + 0x7f, 0xc3, 0x7e, 0xa2, 0x94, 0x14, 0xf7, 0x33, 0xad, 0x61, 0xc5, 0xfd, 0xcc, 0xe8, 0x93, 0xf6, + 0x11, 0x02, 0x6e, 0xf3, 0xbb, 0x93, 0x01, 0x1a, 0x6d, 0x15, 0xc7, 0x38, 0x22, 0x85, 0x1c, 0xf0, + 0xc7, 0x0c, 0xe6, 0x48, 0x05, 0xae, 0x3d, 0x9b, 0x21, 0xa3, 0x5d, 0xb5, 0xeb, 0xe5, 0x8c, 0x89, + 0xf7, 0x5d, 0xe4, 0xbd, 0xcd, 0x6f, 0x4d, 0xc8, 0xab, 0x44, 0x6b, 0x78, 0xb1, 0x56, 0x53, 0xaa, + 0x52, 0x74, 0xa8, 0xce, 0x6a, 0x53, 0xd1, 0xa1, 0x1a, 0x23, 0x59, 0x5a, 0x03, 0x99, 0xd7, 0xf8, + 0xd5, 0xfc, 0x7b, 0x00, 0x1f, 0x1b, 0xa8, 0x68, 0xfc, 0x7b, 0x06, 0x73, 0xea, 0x6f, 0xb4, 0xa8, + 0x91, 0x99, 0x5f, 0xe0, 0xa2, 0x46, 0x66, 0xff, 0x8c, 0xb5, 0x35, 0x84, 0x7a, 0x8d, 0xaf, 0xe4, + 0x1f, 0x24, 0x74, 0xd8, 0x7e, 0xf0, 0xc7, 0x49, 0x9d, 0x3d, 0x3d, 0xa9, 0xb3, 0xbf, 0x4f, 0xea, + 0xec, 0xf8, 0xb4, 0x3e, 0xf3, 0xf4, 0xb4, 0x3e, 0xf3, 0xd7, 0x69, 0x7d, 0xe6, 0xd3, 0x77, 0xba, + 0x56, 0x78, 0xd0, 0x6f, 0xeb, 0xa6, 0xdb, 0x53, 0x41, 0x1a, 0x8e, 0x0c, 0xbf, 0x72, 0xfd, 0x2f, + 0xe8, 0xc9, 0x96, 0x9d, 0xae, 0xf4, 0x8d, 0xaf, 0xcf, 0xc6, 0x6e, 0xcf, 0xe1, 0xbf, 0xfc, 0xcd, + 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xc1, 0xce, 0x32, 0x9f, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1115,6 +1242,8 @@ type QueryClient interface { Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) // ClassInfo queries for information on a credit class. ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error) + // ClassIssuers queries for the addresses of the issuers for a credit class. + ClassIssuers(ctx context.Context, in *QueryClassIssuersRequest, opts ...grpc.CallOption) (*QueryClassIssuersResponse, error) // Projects queries for all projects within a class with pagination. Projects(ctx context.Context, in *QueryProjectsRequest, opts ...grpc.CallOption) (*QueryProjectsResponse, error) // ClassInfo queries for information on a project. @@ -1161,6 +1290,15 @@ func (c *queryClient) ClassInfo(ctx context.Context, in *QueryClassInfoRequest, return out, nil } +func (c *queryClient) ClassIssuers(ctx context.Context, in *QueryClassIssuersRequest, opts ...grpc.CallOption) (*QueryClassIssuersResponse, error) { + out := new(QueryClassIssuersResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1beta1.Query/ClassIssuers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Projects(ctx context.Context, in *QueryProjectsRequest, opts ...grpc.CallOption) (*QueryProjectsResponse, error) { out := new(QueryProjectsResponse) err := c.cc.Invoke(ctx, "/regen.ecocredit.v1beta1.Query/Projects", in, out, opts...) @@ -1239,6 +1377,8 @@ type QueryServer interface { Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) // ClassInfo queries for information on a credit class. ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error) + // ClassIssuers queries for the addresses of the issuers for a credit class. + ClassIssuers(context.Context, *QueryClassIssuersRequest) (*QueryClassIssuersResponse, error) // Projects queries for all projects within a class with pagination. Projects(context.Context, *QueryProjectsRequest) (*QueryProjectsResponse, error) // ClassInfo queries for information on a project. @@ -1269,6 +1409,9 @@ func (*UnimplementedQueryServer) Classes(ctx context.Context, req *QueryClassesR func (*UnimplementedQueryServer) ClassInfo(ctx context.Context, req *QueryClassInfoRequest) (*QueryClassInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClassInfo not implemented") } +func (*UnimplementedQueryServer) ClassIssuers(ctx context.Context, req *QueryClassIssuersRequest) (*QueryClassIssuersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassIssuers not implemented") +} func (*UnimplementedQueryServer) Projects(ctx context.Context, req *QueryProjectsRequest) (*QueryProjectsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Projects not implemented") } @@ -1334,6 +1477,24 @@ func _Query_ClassInfo_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_ClassIssuers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassIssuersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassIssuers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1beta1.Query/ClassIssuers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassIssuers(ctx, req.(*QueryClassIssuersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Projects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryProjectsRequest) if err := dec(in); err != nil { @@ -1490,6 +1651,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ClassInfo", Handler: _Query_ClassInfo_Handler, }, + { + MethodName: "ClassIssuers", + Handler: _Query_ClassIssuers_Handler, + }, { MethodName: "Projects", Handler: _Query_Projects_Handler, @@ -1734,6 +1899,92 @@ func (m *QueryClassInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryClassIssuersRequest) 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 *QueryClassIssuersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassIssuersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassIssuersResponse) 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 *QueryClassIssuersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassIssuersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Issuers) > 0 { + for iNdEx := len(m.Issuers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Issuers[iNdEx]) + copy(dAtA[i:], m.Issuers[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Issuers[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryProjectsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2170,6 +2421,13 @@ func (m *QuerySupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.CancelledAmount) > 0 { + i -= len(m.CancelledAmount) + copy(dAtA[i:], m.CancelledAmount) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CancelledAmount))) + i-- + dAtA[i] = 0x1a + } if len(m.RetiredSupply) > 0 { i -= len(m.RetiredSupply) copy(dAtA[i:], m.RetiredSupply) @@ -2338,6 +2596,42 @@ func (m *QueryClassInfoResponse) Size() (n int) { return n } +func (m *QueryClassIssuersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassIssuersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Issuers) > 0 { + for _, s := range m.Issuers { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryProjectsRequest) Size() (n int) { if m == nil { return 0 @@ -2523,6 +2817,10 @@ func (m *QuerySupplyResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.CancelledAmount) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3084,6 +3382,248 @@ func (m *QueryClassInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryClassIssuersRequest) 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: QueryClassIssuersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassIssuersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassIssuersResponse) 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: QueryClassIssuersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassIssuersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Issuers = append(m.Issuers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryProjectsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4332,6 +4872,38 @@ func (m *QuerySupplyResponse) Unmarshal(dAtA []byte) error { } m.RetiredSupply = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CancelledAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CancelledAmount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/ecocredit/v1beta1/query.pb.gw.go b/x/ecocredit/v1beta1/query.pb.gw.go index 70288317e7..fd446c0ecd 100644 --- a/x/ecocredit/v1beta1/query.pb.gw.go +++ b/x/ecocredit/v1beta1/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join var ( filter_Query_Classes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -121,6 +123,78 @@ func local_request_Query_ClassInfo_0(ctx context.Context, marshaler runtime.Mars } +var ( + filter_Query_ClassIssuers_0 = &utilities.DoubleArray{Encoding: map[string]int{"class_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ClassIssuers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassIssuersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ClassIssuers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ClassIssuers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ClassIssuers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassIssuersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ClassIssuers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ClassIssuers(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_Projects_0 = &utilities.DoubleArray{Encoding: map[string]int{"class_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) @@ -542,12 +616,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_Classes_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 { @@ -555,6 +631,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Classes_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) @@ -568,6 +645,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ClassInfo_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 { @@ -575,6 +654,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ClassInfo_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) @@ -585,9 +665,34 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ClassIssuers_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_ClassIssuers_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_ClassIssuers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Projects_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 { @@ -595,6 +700,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Projects_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) @@ -608,6 +714,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ProjectInfo_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 { @@ -615,6 +723,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ProjectInfo_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) @@ -628,6 +737,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Batches_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 { @@ -635,6 +746,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Batches_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) @@ -648,6 +760,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_BatchInfo_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 { @@ -655,6 +769,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_BatchInfo_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) @@ -668,6 +783,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Balance_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 { @@ -675,6 +792,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Balance_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) @@ -688,6 +806,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Supply_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 { @@ -695,6 +815,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Supply_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) @@ -708,6 +829,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_CreditTypes_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 { @@ -715,6 +838,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_CreditTypes_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) @@ -728,6 +852,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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 { @@ -735,6 +861,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) @@ -826,6 +953,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ClassIssuers_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_ClassIssuers_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_ClassIssuers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Projects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -994,6 +1141,8 @@ var ( pattern_Query_ClassInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"regen", "ecocredit", "v1beta1", "classes", "class_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ClassIssuers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"regen", "ecocredit", "v1alpha2", "classes", "class_id", "issuers"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Projects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"regen", "ecocredit", "v1beta1", "classes", "class_id", "projects"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ProjectInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"regen", "ecocredit", "v1beta1", "projects", "project_id"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1016,6 +1165,8 @@ var ( forward_Query_ClassInfo_0 = runtime.ForwardResponseMessage + forward_Query_ClassIssuers_0 = runtime.ForwardResponseMessage + forward_Query_Projects_0 = runtime.ForwardResponseMessage forward_Query_ProjectInfo_0 = runtime.ForwardResponseMessage diff --git a/x/group/query.pb.gw.go b/x/group/query.pb.gw.go index 3f884b0b26..0ddb983760 100644 --- a/x/group/query.pb.gw.go +++ b/x/group/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Query_GroupInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGroupInfoRequest @@ -776,12 +778,14 @@ func local_request_Query_VotesByVoter_0(ctx context.Context, marshaler runtime.M // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_GroupInfo_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 { @@ -789,6 +793,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupInfo_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) @@ -802,6 +807,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GroupAccountInfo_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 { @@ -809,6 +816,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupAccountInfo_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) @@ -822,6 +830,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GroupMembers_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 { @@ -829,6 +839,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupMembers_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) @@ -842,6 +853,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GroupsByAdmin_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 { @@ -849,6 +862,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupsByAdmin_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) @@ -862,6 +876,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GroupAccountsByGroup_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 { @@ -869,6 +885,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupAccountsByGroup_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) @@ -882,6 +899,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GroupAccountsByAdmin_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 { @@ -889,6 +908,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GroupAccountsByAdmin_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) @@ -902,6 +922,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Proposal_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 { @@ -909,6 +931,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Proposal_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) @@ -922,6 +945,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ProposalsByGroupAccount_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 { @@ -929,6 +954,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ProposalsByGroupAccount_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) @@ -942,6 +968,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_VoteByProposalVoter_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 { @@ -949,6 +977,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_VoteByProposalVoter_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) @@ -962,6 +991,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_VotesByProposal_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 { @@ -969,6 +1000,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_VotesByProposal_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) @@ -982,6 +1014,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_VotesByVoter_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 { @@ -989,6 +1023,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_VotesByVoter_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)