diff --git a/proto/regen/ecocredit/v1alpha1/events.proto b/proto/regen/ecocredit/v1alpha1/events.proto new file mode 100644 index 0000000000..ecc65b3260 --- /dev/null +++ b/proto/regen/ecocredit/v1alpha1/events.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package regen.ecocredit.v1alpha1; + +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit"; + +// EventCreateClass is an event emitted when a credit class is created. +message EventCreateClass { + + // class_id is the unique ID of credit class. + string class_id = 1; + + // designer is the designer of the credit class. + string designer = 2; +} + +// EventCreateBatch is an event emitted when a credit batch is created. +message EventCreateBatch { + + // class_id is the unique ID of credit class. + string class_id = 1; + + // batch_denom is the unique ID of credit batch. + string batch_denom = 2; + + // issuer_address is the account address of the issuer of the credit batch. + string issuer_address = 3; + + // total_units is the total number of units in the credit batch. + string total_units = 4; +} + +// EventReceive is an event emitted when credits are received either upon +// creation of a new batch or upon transfer. Each batch_denom created or +// transferred will result in a separate EventReceive for easy indexing. +message EventReceive { + + // from indicates the originator of the credits - either an issuer (in the case of Msg/CreateBatch) or a + // sender (in the case of Msg/Send). + oneof from { + // issuer is the issuer of the credit batch in the case that this event is the result of a new batch being created. + // It will not be set if credits were transferred. + string issuer = 1; + + // sender is the sender of the credits in the case that this event is the result of a transfer. + // It will not be set if credits were issued. + string sender = 2; + } + + // recipient is the recipient of the credits + string recipient = 3; + + // batch_denom is the unique ID of credit batch. + string batch_denom = 4; + + // units is the decimal number of both tradable and retired credits received. + string units = 5; +} + +// EventRetire is an event emitted when credits are retired. An separate event is emitted +// for each batch_denom in the case where credits from multiple batches have been retired at once +// for easy indexing. +message EventRetire { + + // retirer is the account which has done the "retiring". This will be the account receiving credits in + // the case that credits were retired upon issuance using Msg/CreateBatch or retired upon transfer + // using Msg/Send. + string retirer = 1; + + // batch_denom is the unique ID of credit batch. + string batch_denom = 2; + + // units is the decimal number of credits that have been retired. + string units = 3; +} diff --git a/proto/regen/ecocredit/v1alpha1/query.proto b/proto/regen/ecocredit/v1alpha1/query.proto new file mode 100644 index 0000000000..ef79aa91d7 --- /dev/null +++ b/proto/regen/ecocredit/v1alpha1/query.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; + +package regen.ecocredit.v1alpha1; + +import "regen/ecocredit/v1alpha1/types.proto"; + +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit"; + +// Msg is the regen.ecocredit.v1alpha1 Query service. +service Query { + // ClassInfo queries for information on a credit class. + rpc ClassInfo(QueryClassInfoRequest) returns (QueryClassInfoResponse); + + // BatchInfo queries for information on a credit batch. + rpc BatchInfo(QueryBatchInfoRequest) returns (QueryBatchInfoResponse); + + // Balance queries the balance (both tradable and retired) of a given credit batch for a given account. + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse); + + // Supply queries the tradable and retired supply of a credit batch. + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse); + + // Precision queries the number of decimal places that can be used to represent credit batch units. + // See Tx/SetPrecision for more details. + rpc Precision(QueryPrecisionRequest) returns (QueryPrecisionResponse); +} + +// QueryClassInfoRequest is the Query/ClassInfo request type. +message QueryClassInfoRequest { + + // class_id is the unique ID of credit class to query. + string class_id = 1; +} + +// QueryClassInfoResponse is the Query/ClassInfo request type. +message QueryClassInfoResponse { + + // info is the ClassInfo for the credit class. + ClassInfo info = 1; +} + +// QueryBatchInfoRequest is the Query/BatchInfo request type. +message QueryBatchInfoRequest { + + // batch_denom is the unique ID of credit batch to query. + string batch_denom = 1; +} + +// QueryBatchInfoResponse is the Query/BatchInfo response type. +message QueryBatchInfoResponse { + + // info is the BatchInfo for the credit batch. + BatchInfo info = 1; +} + +// QueryBalanceRequest is the Query/Balance request type. +message QueryBalanceRequest { + + // account is the address of the account whose balance is being queried. + string account = 1; + + // batch_denom is the unique ID of credit batch balance to query. + string batch_denom = 2; +} + +// QueryBalanceResponse is the Query/Balance response type. +message QueryBalanceResponse { + + // tradable_units is the decimal number of tradable units. + string tradable_units = 1; + + // retired_units is the decimal number of retired units. + string retired_units = 2; +} + +// QuerySupplyRequest is the Query/Supply request type. +message QuerySupplyRequest { + + // batch_denom is the unique ID of credit batch to query. + string batch_denom = 1; +} + +// QuerySupplyResponse is the Query/Supply response type. +message QuerySupplyResponse { + + // tradable_units is the decimal number of tradable units in the batch supply. + string tradable_supply = 1; + + // retired_supply is the decimal number of retired units in the batch supply. + string retired_supply = 2; +} + + +// QueryPrecisionRequest is the Query/Precision request type. +message QueryPrecisionRequest { + + // batch_denom is the unique ID of credit batch to query. + string batch_denom = 1; +} + +// QueryPrecisionResponse is the Query/Precision response type. +message QueryPrecisionResponse { + + // max_decimal_places is the maximum number of decimal places that can be used to represent some quantity of credit units. + // It is an experimental feature to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. + uint32 max_decimal_places = 1; +} diff --git a/proto/regen/ecocredit/v1alpha1/tx.proto b/proto/regen/ecocredit/v1alpha1/tx.proto new file mode 100644 index 0000000000..07218615b8 --- /dev/null +++ b/proto/regen/ecocredit/v1alpha1/tx.proto @@ -0,0 +1,167 @@ +syntax = "proto3"; + +package regen.ecocredit.v1alpha1; + +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit"; + +// Msg is the regen.ecocredit.v1alpha1 Msg service. +service Msg { + + // CreateClass creates a new credit class with an approved list of issuers and optional metadata. + rpc CreateClass(MsgCreateClassRequest) returns (MsgCreateClassResponse); + + // CreateBatch creates a new batch of credits for an existing credit class. This will create a new batch denom + // with a fixed supply. Issued credits can be distributed to recipients in either tradable or retired form. + rpc CreateBatch(MsgCreateBatchRequest) returns (MsgCreateBatchResponse); + + // Send sends tradeable credits from one account to another account. Sent credits can either be tradable or retired on receipt. + rpc Send(MsgSendRequest) returns (MsgSendResponse); + + // Retire retires a specified number of credits in the holder's account. + rpc Retire(MsgRetireRequest) returns (MsgRetireResponse); + + // SetPrecision allows an issuer to increase the decimal precision of a credit batch. It is an experimental feature + // to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. The number of decimal + // places allowed for a credit batch is determined by the original number of decimal places used with calling CreatBatch. + // SetPrecision allows the number of allowed decimal places to be increased, effectively making the supply more + // granular without actually changing any balances. It allows asset issuers to be able to issue an asset without needing + // to think about how many subdivisions are needed upfront. While it may not be relevant for credits which likely have + // a fairly stable market value, I wanted to experiment a bit and this serves as a proof of concept for a broader + // bank redesign where say for instance a coin like the ATOM or XRN could be issued in its own units rather than + // micro or nano-units. Instead an operation like SetPrecision would allow trading in micro, nano or pico in the future + // based on market demand. Arbitrary, unbounded precision is not desirable because this can lead to spam attacks (like + // sending 0.000000000000000000000000000001 coins). This is effectively fixed precision so under the hood it is still + // basically an integer, but the fixed precision can be increased so its more adaptable long term than just an integer. + rpc SetPrecision(MsgSetPrecisionRequest) returns (MsgSetPrecisionResponse); +} + +// MsgCreateClassRequest is the Msg/CreateClass request type. +message MsgCreateClassRequest { + + // designer is the address of the account which designed the credit class. The designer has special permissions + // to change the list of issuers and perform other administrative operations. + string designer = 1; + + // issuers are the account addresses of the approved issuers. + repeated string issuers = 2; + + // metadata is any arbitrary metadata to attached to the credit class. + bytes metadata = 3; +} + +// MsgCreateClassResponse is the Msg/CreateClass response type. +message MsgCreateClassResponse { + + // class_id is the unique ID of the newly created credit class. + string class_id = 1; +} + +// MsgCreateBatchRequest is the Msg/CreateBatch request type. +message MsgCreateBatchRequest { + + // issuer is the address of the batch issuer. + string issuer = 1; + + // class_id is the unique ID of the class. + string class_id = 2; + + // issuance are the credits issued in the batch. + repeated BatchIssuance issuance = 3; + + // metadata is any arbitrary metadata to attached to the credit batch. + bytes metadata = 4; + + // BatchIssuance represents the issuance of some credits in a batch to a single recipient. + message BatchIssuance { + + // recipient is the account of the recipient. + string recipient = 1; + + // tradable_units are the units of credits in this issuance that can be traded by this recipient. + // Decimal values are acceptable. + string tradable_units = 2; + + // retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. + // Decimal values are acceptable. + string retired_units = 3; + } +} + +// MsgCreateBatchResponse is the Msg/CreateBatch response type. +message MsgCreateBatchResponse { + + // batch_denom is the unique denomination ID of the newly created batch. + string batch_denom = 1; +} + +// MsgSendRequest is the Msg/Send request type. +message MsgSendRequest { + + // sender is the address of the account sending credits. + string sender = 1; + + // sender is the address of the account receiving credits. + string recipient = 2; + + // credits are the credits being sent. + repeated SendUnits credits = 3; + + // SendUnits are the tradable and retired units of a credit batch to send. + message SendUnits { + + // batch_denom is the unique ID of the credit batch. + string batch_denom = 1; + + // tradable_units are the units of credits in this issuance that can be traded by this recipient. + // Decimal values are acceptable within the precision returned by Query/Precision. + string tradeable_units = 2; + + // retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. + // Decimal values are acceptable within the precision returned by Query/Precision. + string retired_units = 3; + } +} + +// MsgSendResponse is the Msg/Send response type. +message MsgSendResponse { } + +// MsgRetireRequest is the Msg/Retire request type. +message MsgRetireRequest { + + // holder is the credit holder address. + string holder = 1; + + // credits are the credits being retired. + repeated RetireUnits credits = 2; + + // RetireUnits are the units of the batch being retired. + message RetireUnits { + + // batch_denom is the unique ID of the credit batch. + string batch_denom = 1; + + // retired_units are the units of credits being retired. + // Decimal values are acceptable within the precision returned by Query/Precision. + string units = 2; + } +} + +// MsgRetireRequest is the Msg/Retire response type. +message MsgRetireResponse { } + +// MsgRetireRequest is the Msg/SetPrecision request type. +message MsgSetPrecisionRequest { + + // issuer is the address of the batch issuer. + string issuer = 1; + + // batch_denom is the unique ID of the credit batch. + string batch_denom = 2; + + // max_decimal_places is the new maximum number of decimal places that can be used to represent some quantity of + // credit units. It is an experimental feature to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. + uint32 max_decimal_places = 3; +} + +// MsgRetireRequest is the Msg/SetPrecision response type. +message MsgSetPrecisionResponse { } diff --git a/proto/regen/ecocredit/v1alpha1/types.proto b/proto/regen/ecocredit/v1alpha1/types.proto new file mode 100644 index 0000000000..d89755fb64 --- /dev/null +++ b/proto/regen/ecocredit/v1alpha1/types.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package regen.ecocredit.v1alpha1; + +option go_package = "github.com/regen-network/regen-ledger/x/ecocredit"; + +// ClassInfo represents the high-level on-chain information for a credit class. +message ClassInfo { + + // class_id is the unique ID of credit class. + string class_id = 1; + + // designer is the designer of the credit class. + string designer = 2; + + // issuers are the approved issuers of the credit class. + repeated string issuers = 3; + + // metadata is any arbitrary metadata to attached to the credit class. + bytes metadata = 4; +} + +// BatchInfo represents the high-level on-chain information for a credit batch. +message BatchInfo { + + // class_id is the unique ID of credit class. + string class_id = 1; + + // batch_denom is the unique ID of credit batch. + string batch_denom = 2; + + // issuer is the issuer of the credit batch. + string issuer = 3; + + // total_units is the total number of units in the credit batch and is immutable. + string total_units = 4; + + // metadata is any arbitrary metadata to attached to the credit batch. + bytes metadata = 5; +} \ No newline at end of file diff --git a/x/data/tx.pb.go b/x/data/tx.pb.go index 0fdd41e17b..17dbce0218 100644 --- a/x/data/tx.pb.go +++ b/x/data/tx.pb.go @@ -32,6 +32,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgAnchorDataRequest is the Msg/AnchorData request type. type MsgAnchorDataRequest struct { // sender is the address of the sender of the transaction. + // The sender in StoreData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing services. Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // cid is a Content Identifier for the data corresponding to the IPFS CID // specification: https://github.com/multiformats/cid. @@ -134,6 +136,9 @@ func (m *MsgAnchorDataResponse) GetTimestamp() *types.Timestamp { // MsgSignDataRequest is the Msg/SignData request type. type MsgSignDataRequest struct { // signers are the addresses of the accounts signing the data. + // By making a SignData request, the signers are attesting to the veracity + // of the data referenced by the cid. The precise meaning of this may vary + // depending on the underlying data. Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` // cid is a Content Identifier for the data corresponding to the IPFS CID // specification: https://github.com/multiformats/cid. @@ -213,6 +218,8 @@ var xxx_messageInfo_MsgSignDataResponse proto.InternalMessageInfo // MsgStoreDataRequest is the Msg/StoreData request type. type MsgStoreDataRequest struct { // sender is the address of the sender of the transaction. + // The sender in StoreData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing services. Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // cid is a Content Identifier for the data corresponding to the IPFS CID // specification: https://github.com/multiformats/cid. @@ -370,8 +377,17 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // AnchorData "anchors" a piece of data to the blockchain based on its secure hash, // effectively providing a tamper resistant timestamp. + // + // The sender in AnchorData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing timestamp services. + // SignData should be used to create a digital signature attesting to the veracity of some piece of data. AnchorData(ctx context.Context, in *MsgAnchorDataRequest, opts ...grpc.CallOption) (*MsgAnchorDataResponse, error) // SignData allows for signing of an arbitrary piece of data on the blockchain. + // By "signing" data the signers are making a statement about the veracity of the + // data itself. It is like signing a legal document, meaning that I agree to all + // conditions and to the best of my knowledge everything is true. When anchoring + // data, the sender is not attesting to the veracity of the data, they are simply + // communicating that it exists. // // On-chain signatures have the following benefits: // - on-chain identities can be managed using different cryptographic keys @@ -392,6 +408,10 @@ type MsgClient interface { // can be stored on-chain. // // StoreData implicitly calls AnchorData if the data was not already anchored. + // + // The sender in StoreData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing storage services. + // SignData should be used to create a digital signature attesting to the veracity of some piece of data. StoreData(ctx context.Context, in *MsgStoreDataRequest, opts ...grpc.CallOption) (*MsgStoreDataResponse, error) } @@ -434,8 +454,17 @@ func (c *msgClient) StoreData(ctx context.Context, in *MsgStoreDataRequest, opts type MsgServer interface { // AnchorData "anchors" a piece of data to the blockchain based on its secure hash, // effectively providing a tamper resistant timestamp. + // + // The sender in AnchorData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing timestamp services. + // SignData should be used to create a digital signature attesting to the veracity of some piece of data. AnchorData(context.Context, *MsgAnchorDataRequest) (*MsgAnchorDataResponse, error) // SignData allows for signing of an arbitrary piece of data on the blockchain. + // By "signing" data the signers are making a statement about the veracity of the + // data itself. It is like signing a legal document, meaning that I agree to all + // conditions and to the best of my knowledge everything is true. When anchoring + // data, the sender is not attesting to the veracity of the data, they are simply + // communicating that it exists. // // On-chain signatures have the following benefits: // - on-chain identities can be managed using different cryptographic keys @@ -456,6 +485,10 @@ type MsgServer interface { // can be stored on-chain. // // StoreData implicitly calls AnchorData if the data was not already anchored. + // + // The sender in StoreData is not attesting to the veracity of the underlying data. + // They can simply be a intermediary providing storage services. + // SignData should be used to create a digital signature attesting to the veracity of some piece of data. StoreData(context.Context, *MsgStoreDataRequest) (*MsgStoreDataResponse, error) } diff --git a/x/ecocredit/events.pb.go b/x/ecocredit/events.pb.go new file mode 100644 index 0000000000..337f309b64 --- /dev/null +++ b/x/ecocredit/events.pb.go @@ -0,0 +1,1457 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/v1alpha1/events.proto + +package ecocredit + +import ( + fmt "fmt" + 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 + +// EventCreateClass is an event emitted when a credit class is created. +type EventCreateClass struct { + // class_id is the unique ID of credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // designer is the designer of the credit class. + Designer string `protobuf:"bytes,2,opt,name=designer,proto3" json:"designer,omitempty"` +} + +func (m *EventCreateClass) Reset() { *m = EventCreateClass{} } +func (m *EventCreateClass) String() string { return proto.CompactTextString(m) } +func (*EventCreateClass) ProtoMessage() {} +func (*EventCreateClass) Descriptor() ([]byte, []int) { + return fileDescriptor_5b6a013b00aef3af, []int{0} +} +func (m *EventCreateClass) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventCreateClass) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventCreateClass.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 *EventCreateClass) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateClass.Merge(m, src) +} +func (m *EventCreateClass) XXX_Size() int { + return m.Size() +} +func (m *EventCreateClass) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateClass.DiscardUnknown(m) +} + +var xxx_messageInfo_EventCreateClass proto.InternalMessageInfo + +func (m *EventCreateClass) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *EventCreateClass) GetDesigner() string { + if m != nil { + return m.Designer + } + return "" +} + +// EventCreateBatch is an event emitted when a credit batch is created. +type EventCreateBatch struct { + // class_id is the unique ID of credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // batch_denom is the unique ID of credit batch. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // issuer is the issuer of the credit batch. + Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` + // total_units is the total number of units in the credit batch. + TotalUnits string `protobuf:"bytes,4,opt,name=total_units,json=totalUnits,proto3" json:"total_units,omitempty"` +} + +func (m *EventCreateBatch) Reset() { *m = EventCreateBatch{} } +func (m *EventCreateBatch) String() string { return proto.CompactTextString(m) } +func (*EventCreateBatch) ProtoMessage() {} +func (*EventCreateBatch) Descriptor() ([]byte, []int) { + return fileDescriptor_5b6a013b00aef3af, []int{1} +} +func (m *EventCreateBatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventCreateBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventCreateBatch.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 *EventCreateBatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateBatch.Merge(m, src) +} +func (m *EventCreateBatch) XXX_Size() int { + return m.Size() +} +func (m *EventCreateBatch) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateBatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EventCreateBatch proto.InternalMessageInfo + +func (m *EventCreateBatch) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *EventCreateBatch) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventCreateBatch) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *EventCreateBatch) GetTotalUnits() string { + if m != nil { + return m.TotalUnits + } + return "" +} + +// EventReceive is an event emitted when credits are received either upon +// creation of a new batch or upon transfer. Each batch_denom created or +// transferred will result in a separate EventReceive for easy indexing. +type EventReceive struct { + // from indicates the originator of the credits - either an issuer (in the case of Msg/CreateBatch) or a + // sender (in the case of Msg/Send). + // + // Types that are valid to be assigned to From: + // *EventReceive_Issuer + // *EventReceive_Sender + From isEventReceive_From `protobuf_oneof:"from"` + // recipient is the recipient of the credits + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + // batch_denom is the unique ID of credit batch. + BatchDenom string `protobuf:"bytes,4,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // units is the decimal number of both tradable and retired credits received. + Units string `protobuf:"bytes,5,opt,name=units,proto3" json:"units,omitempty"` +} + +func (m *EventReceive) Reset() { *m = EventReceive{} } +func (m *EventReceive) String() string { return proto.CompactTextString(m) } +func (*EventReceive) ProtoMessage() {} +func (*EventReceive) Descriptor() ([]byte, []int) { + return fileDescriptor_5b6a013b00aef3af, []int{2} +} +func (m *EventReceive) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventReceive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventReceive.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 *EventReceive) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventReceive.Merge(m, src) +} +func (m *EventReceive) XXX_Size() int { + return m.Size() +} +func (m *EventReceive) XXX_DiscardUnknown() { + xxx_messageInfo_EventReceive.DiscardUnknown(m) +} + +var xxx_messageInfo_EventReceive proto.InternalMessageInfo + +type isEventReceive_From interface { + isEventReceive_From() + MarshalTo([]byte) (int, error) + Size() int +} + +type EventReceive_Issuer struct { + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3,oneof" json:"issuer,omitempty"` +} +type EventReceive_Sender struct { + Sender string `protobuf:"bytes,2,opt,name=sender,proto3,oneof" json:"sender,omitempty"` +} + +func (*EventReceive_Issuer) isEventReceive_From() {} +func (*EventReceive_Sender) isEventReceive_From() {} + +func (m *EventReceive) GetFrom() isEventReceive_From { + if m != nil { + return m.From + } + return nil +} + +func (m *EventReceive) GetIssuer() string { + if x, ok := m.GetFrom().(*EventReceive_Issuer); ok { + return x.Issuer + } + return "" +} + +func (m *EventReceive) GetSender() string { + if x, ok := m.GetFrom().(*EventReceive_Sender); ok { + return x.Sender + } + return "" +} + +func (m *EventReceive) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *EventReceive) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventReceive) GetUnits() string { + if m != nil { + return m.Units + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*EventReceive) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*EventReceive_Issuer)(nil), + (*EventReceive_Sender)(nil), + } +} + +// EventRetire is an event emitted when credits are retired. An separate event is emitted +// for each batch_denom in the case where credits from multiple batches have been retired at once +// for easy indexing. +type EventRetire struct { + // retirer is the account which has done the "retiring". This will be the account receiving credits in + // the case that credits were retired upon issuance using Msg/CreateBatch or retired upon transfer + // using Msg/Send. + Retirer string `protobuf:"bytes,1,opt,name=retirer,proto3" json:"retirer,omitempty"` + // batch_denom is the unique ID of credit batch. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // units is the decimal number of credits that have been retired. + Units string `protobuf:"bytes,3,opt,name=units,proto3" json:"units,omitempty"` +} + +func (m *EventRetire) Reset() { *m = EventRetire{} } +func (m *EventRetire) String() string { return proto.CompactTextString(m) } +func (*EventRetire) ProtoMessage() {} +func (*EventRetire) Descriptor() ([]byte, []int) { + return fileDescriptor_5b6a013b00aef3af, []int{3} +} +func (m *EventRetire) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRetire) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRetire.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 *EventRetire) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRetire.Merge(m, src) +} +func (m *EventRetire) XXX_Size() int { + return m.Size() +} +func (m *EventRetire) XXX_DiscardUnknown() { + xxx_messageInfo_EventRetire.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRetire proto.InternalMessageInfo + +func (m *EventRetire) GetRetirer() string { + if m != nil { + return m.Retirer + } + return "" +} + +func (m *EventRetire) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *EventRetire) GetUnits() string { + if m != nil { + return m.Units + } + return "" +} + +func init() { + proto.RegisterType((*EventCreateClass)(nil), "regen.ecocredit.v1alpha1.EventCreateClass") + proto.RegisterType((*EventCreateBatch)(nil), "regen.ecocredit.v1alpha1.EventCreateBatch") + proto.RegisterType((*EventReceive)(nil), "regen.ecocredit.v1alpha1.EventReceive") + proto.RegisterType((*EventRetire)(nil), "regen.ecocredit.v1alpha1.EventRetire") +} + +func init() { + proto.RegisterFile("regen/ecocredit/v1alpha1/events.proto", fileDescriptor_5b6a013b00aef3af) +} + +var fileDescriptor_5b6a013b00aef3af = []byte{ + // 360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcd, 0x4a, 0x2b, 0x31, + 0x14, 0x9e, 0xdc, 0xb6, 0xd3, 0x36, 0xbd, 0x8b, 0xcb, 0x70, 0x91, 0x28, 0x32, 0xca, 0x80, 0xe0, + 0xc6, 0x19, 0x8a, 0x6f, 0xd0, 0x2a, 0x58, 0xdc, 0x15, 0xdc, 0xb8, 0xb0, 0x4c, 0x93, 0xe3, 0x34, + 0x38, 0x4d, 0x4a, 0x92, 0x56, 0xdf, 0xc0, 0xad, 0x6f, 0xe0, 0xeb, 0xb8, 0xec, 0xd2, 0xa5, 0xb4, + 0x2f, 0x22, 0xc9, 0x4c, 0xa7, 0xfe, 0x80, 0xee, 0xf2, 0xfd, 0xe4, 0xcb, 0x97, 0xc3, 0xc1, 0x47, + 0x0a, 0x32, 0x10, 0x09, 0x50, 0x49, 0x15, 0x30, 0x6e, 0x92, 0x45, 0x37, 0xcd, 0x67, 0x93, 0xb4, + 0x9b, 0xc0, 0x02, 0x84, 0xd1, 0xf1, 0x4c, 0x49, 0x23, 0x03, 0xe2, 0x6c, 0x71, 0x65, 0x8b, 0x37, + 0xb6, 0x68, 0x80, 0xff, 0x9d, 0x5b, 0x67, 0x5f, 0x41, 0x6a, 0xa0, 0x9f, 0xa7, 0x5a, 0x07, 0xbb, + 0xb8, 0x45, 0xed, 0x61, 0xc4, 0x19, 0x41, 0x87, 0xe8, 0xb8, 0x3d, 0x6c, 0x3a, 0x3c, 0x60, 0xc1, + 0x1e, 0x6e, 0x31, 0xd0, 0x3c, 0x13, 0xa0, 0xc8, 0x1f, 0x27, 0x55, 0x38, 0x7a, 0x44, 0x9f, 0xb2, + 0x7a, 0xa9, 0xa1, 0x93, 0x9f, 0xb2, 0x0e, 0x70, 0x67, 0x6c, 0x3d, 0x23, 0x06, 0x42, 0x4e, 0xcb, + 0x38, 0xec, 0xa8, 0x33, 0xcb, 0x04, 0x3b, 0xd8, 0xe7, 0x5a, 0xcf, 0x41, 0x91, 0x9a, 0xd3, 0x4a, + 0x64, 0x2f, 0x1a, 0x69, 0xd2, 0x7c, 0x34, 0x17, 0xdc, 0x68, 0x52, 0x2f, 0x2e, 0x3a, 0xea, 0xca, + 0x32, 0xd1, 0x33, 0xc2, 0x7f, 0x5d, 0x93, 0x21, 0x50, 0xe0, 0x0b, 0x08, 0x48, 0x95, 0xe4, 0x3a, + 0x5c, 0x78, 0x55, 0x16, 0xc1, 0xbe, 0x06, 0xc1, 0x36, 0xdf, 0xb1, 0x4a, 0x81, 0x83, 0x7d, 0xdc, + 0x56, 0x40, 0xf9, 0x8c, 0x83, 0x30, 0x65, 0x81, 0x2d, 0xf1, 0xb5, 0x7c, 0xfd, 0x5b, 0xf9, 0xff, + 0xb8, 0x51, 0xd4, 0x6b, 0x38, 0xa9, 0x00, 0x3d, 0x1f, 0xd7, 0x6f, 0x95, 0x9c, 0x46, 0x37, 0xb8, + 0x53, 0x16, 0x34, 0x5c, 0xd9, 0x7e, 0x4d, 0xe5, 0x4e, 0x6a, 0x33, 0xa4, 0x12, 0xfe, 0x3e, 0xa4, + 0xea, 0x9d, 0xda, 0xc7, 0x77, 0x2e, 0x5f, 0x56, 0x21, 0x5a, 0xae, 0x42, 0xf4, 0xb6, 0x0a, 0xd1, + 0xd3, 0x3a, 0xf4, 0x96, 0xeb, 0xd0, 0x7b, 0x5d, 0x87, 0xde, 0x75, 0x37, 0xe3, 0x66, 0x32, 0x1f, + 0xc7, 0x54, 0x4e, 0x13, 0xb7, 0x15, 0x27, 0x02, 0xcc, 0xbd, 0x54, 0x77, 0x25, 0xca, 0x81, 0x65, + 0xa0, 0x92, 0x87, 0xed, 0x4e, 0x8d, 0x7d, 0xb7, 0x44, 0xa7, 0xef, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x02, 0xbc, 0xdb, 0xb0, 0x6d, 0x02, 0x00, 0x00, +} + +func (m *EventCreateClass) 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 *EventCreateClass) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventCreateClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Designer) > 0 { + i -= len(m.Designer) + copy(dAtA[i:], m.Designer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Designer))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventCreateBatch) 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 *EventCreateBatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventCreateBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TotalUnits) > 0 { + i -= len(m.TotalUnits) + copy(dAtA[i:], m.TotalUnits) + i = encodeVarintEvents(dAtA, i, uint64(len(m.TotalUnits))) + i-- + dAtA[i] = 0x22 + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Issuer))) + 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 len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventReceive) 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 *EventReceive) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReceive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Units) > 0 { + i -= len(m.Units) + copy(dAtA[i:], m.Units) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Units))) + i-- + dAtA[i] = 0x2a + } + 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] = 0x22 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if m.From != nil { + { + size := m.From.Size() + i -= size + if _, err := m.From.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *EventReceive_Issuer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReceive_Issuer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *EventReceive_Sender) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReceive_Sender) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *EventRetire) 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 *EventRetire) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRetire) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Units) > 0 { + i -= len(m.Units) + copy(dAtA[i:], m.Units) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Units))) + 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 len(m.Retirer) > 0 { + i -= len(m.Retirer) + copy(dAtA[i:], m.Retirer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Retirer))) + 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 *EventCreateClass) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Designer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventCreateBatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.TotalUnits) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventReceive) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.From != nil { + n += m.From.Size() + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Units) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventReceive_Issuer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Issuer) + n += 1 + l + sovEvents(uint64(l)) + return n +} +func (m *EventReceive_Sender) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + n += 1 + l + sovEvents(uint64(l)) + return n +} +func (m *EventRetire) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Retirer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Units) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + 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 *EventCreateClass) 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: EventCreateClass: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCreateClass: 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 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Designer", 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.Designer = string(dAtA[iNdEx:postIndex]) + 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 *EventCreateBatch) 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: EventCreateBatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCreateBatch: 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 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 Issuer", 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.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalUnits", 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.TotalUnits = string(dAtA[iNdEx:postIndex]) + 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 *EventReceive) 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: EventReceive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventReceive: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.From = &EventReceive_Issuer{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.From = &EventReceive_Sender{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Units", 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.Units = string(dAtA[iNdEx:postIndex]) + 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 *EventRetire) 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: EventRetire: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRetire: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Retirer", 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.Retirer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 Units", 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.Units = string(dAtA[iNdEx:postIndex]) + 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 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/query.pb.go b/x/ecocredit/query.pb.go new file mode 100644 index 0000000000..c4531aa152 --- /dev/null +++ b/x/ecocredit/query.pb.go @@ -0,0 +1,2319 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/v1alpha1/query.proto + +package ecocredit + +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 + +// QueryClassInfoRequest is the Query/ClassInfo request type. +type QueryClassInfoRequest 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"` +} + +func (m *QueryClassInfoRequest) Reset() { *m = QueryClassInfoRequest{} } +func (m *QueryClassInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassInfoRequest) ProtoMessage() {} +func (*QueryClassInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6a16cc4c1db940dc, []int{0} +} +func (m *QueryClassInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassInfoRequest.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 *QueryClassInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassInfoRequest.Merge(m, src) +} +func (m *QueryClassInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassInfoRequest proto.InternalMessageInfo + +func (m *QueryClassInfoRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +// QueryClassInfoResponse is the Query/ClassInfo request type. +type QueryClassInfoResponse struct { + // info is the ClassInfo for the credit class. + Info *ClassInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` +} + +func (m *QueryClassInfoResponse) Reset() { *m = QueryClassInfoResponse{} } +func (m *QueryClassInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassInfoResponse) ProtoMessage() {} +func (*QueryClassInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6a16cc4c1db940dc, []int{1} +} +func (m *QueryClassInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassInfoResponse.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 *QueryClassInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassInfoResponse.Merge(m, src) +} +func (m *QueryClassInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassInfoResponse proto.InternalMessageInfo + +func (m *QueryClassInfoResponse) GetInfo() *ClassInfo { + if m != nil { + return m.Info + } + return nil +} + +// QueryBatchInfoRequest is the Query/BatchInfo request type. +type QueryBatchInfoRequest struct { + // batch_denom is the unique ID of credit batch to query. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +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_6a16cc4c1db940dc, []int{2} +} +func (m *QueryBatchInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBatchInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBatchInfoRequest.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 *QueryBatchInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBatchInfoRequest.Merge(m, src) +} +func (m *QueryBatchInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBatchInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBatchInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBatchInfoRequest proto.InternalMessageInfo + +func (m *QueryBatchInfoRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +// QueryBatchInfoResponse is the Query/BatchInfo response type. +type QueryBatchInfoResponse struct { + // info is the BatchInfo for the credit batch. + Info *BatchInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` +} + +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_6a16cc4c1db940dc, []int{3} +} +func (m *QueryBatchInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBatchInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBatchInfoResponse.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 *QueryBatchInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBatchInfoResponse.Merge(m, src) +} +func (m *QueryBatchInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBatchInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBatchInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBatchInfoResponse proto.InternalMessageInfo + +func (m *QueryBatchInfoResponse) GetInfo() *BatchInfo { + if m != nil { + return m.Info + } + return nil +} + +// QueryBalanceRequest is the Query/Balance request type. +type QueryBalanceRequest struct { + // account is the address of the account whose balance is being queried. + Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + // batch_denom is the unique ID of credit batch balance to query. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +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_6a16cc4c1db940dc, []int{4} +} +func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceRequest.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 *QueryBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceRequest.Merge(m, src) +} +func (m *QueryBalanceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceRequest proto.InternalMessageInfo + +func (m *QueryBalanceRequest) GetAccount() string { + if m != nil { + return m.Account + } + return "" +} + +func (m *QueryBalanceRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +// QueryBalanceResponse is the Query/Balance response type. +type QueryBalanceResponse struct { + // tradable_units is the decimal number of tradable units. + TradableUnits string `protobuf:"bytes,1,opt,name=tradable_units,json=tradableUnits,proto3" json:"tradable_units,omitempty"` + // retired_units is the decimal number of retired units. + RetiredUnits string `protobuf:"bytes,2,opt,name=retired_units,json=retiredUnits,proto3" json:"retired_units,omitempty"` +} + +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_6a16cc4c1db940dc, []int{5} +} +func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceResponse.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 *QueryBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceResponse.Merge(m, src) +} +func (m *QueryBalanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceResponse proto.InternalMessageInfo + +func (m *QueryBalanceResponse) GetTradableUnits() string { + if m != nil { + return m.TradableUnits + } + return "" +} + +func (m *QueryBalanceResponse) GetRetiredUnits() string { + if m != nil { + return m.RetiredUnits + } + return "" +} + +// QuerySupplyRequest is the Query/Supply request type. +type QuerySupplyRequest struct { + // batch_denom is the unique ID of credit batch to query. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +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_6a16cc4c1db940dc, []int{6} +} +func (m *QuerySupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyRequest.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 *QuerySupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyRequest.Merge(m, src) +} +func (m *QuerySupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyRequest proto.InternalMessageInfo + +func (m *QuerySupplyRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +// QuerySupplyResponse is the Query/Supply response type. +type QuerySupplyResponse struct { + // tradable_units is the decimal number of tradable units in the batch supply. + TradableSupply string `protobuf:"bytes,1,opt,name=tradable_supply,json=tradableSupply,proto3" json:"tradable_supply,omitempty"` + // retired_supply is the decimal number of retired units in the batch supply. + RetiredSupply string `protobuf:"bytes,2,opt,name=retired_supply,json=retiredSupply,proto3" json:"retired_supply,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_6a16cc4c1db940dc, []int{7} +} +func (m *QuerySupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyResponse.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 *QuerySupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyResponse.Merge(m, src) +} +func (m *QuerySupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyResponse proto.InternalMessageInfo + +func (m *QuerySupplyResponse) GetTradableSupply() string { + if m != nil { + return m.TradableSupply + } + return "" +} + +func (m *QuerySupplyResponse) GetRetiredSupply() string { + if m != nil { + return m.RetiredSupply + } + return "" +} + +// QueryPrecisionRequest is the Query/Precision request type. +type QueryPrecisionRequest struct { + // batch_denom is the unique ID of credit batch to query. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +func (m *QueryPrecisionRequest) Reset() { *m = QueryPrecisionRequest{} } +func (m *QueryPrecisionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPrecisionRequest) ProtoMessage() {} +func (*QueryPrecisionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6a16cc4c1db940dc, []int{8} +} +func (m *QueryPrecisionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPrecisionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPrecisionRequest.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 *QueryPrecisionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPrecisionRequest.Merge(m, src) +} +func (m *QueryPrecisionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPrecisionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPrecisionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPrecisionRequest proto.InternalMessageInfo + +func (m *QueryPrecisionRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +// QueryPrecisionResponse is the Query/Precision response type. +type QueryPrecisionResponse struct { + // max_decimal_places is the maximum number of decimal places that can be used to represent some quantity of credit units. + // It is an experimental feature to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. + MaxDecimalPlaces uint32 `protobuf:"varint,1,opt,name=max_decimal_places,json=maxDecimalPlaces,proto3" json:"max_decimal_places,omitempty"` +} + +func (m *QueryPrecisionResponse) Reset() { *m = QueryPrecisionResponse{} } +func (m *QueryPrecisionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPrecisionResponse) ProtoMessage() {} +func (*QueryPrecisionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6a16cc4c1db940dc, []int{9} +} +func (m *QueryPrecisionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPrecisionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPrecisionResponse.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 *QueryPrecisionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPrecisionResponse.Merge(m, src) +} +func (m *QueryPrecisionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPrecisionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPrecisionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPrecisionResponse proto.InternalMessageInfo + +func (m *QueryPrecisionResponse) GetMaxDecimalPlaces() uint32 { + if m != nil { + return m.MaxDecimalPlaces + } + return 0 +} + +func init() { + proto.RegisterType((*QueryClassInfoRequest)(nil), "regen.ecocredit.v1alpha1.QueryClassInfoRequest") + proto.RegisterType((*QueryClassInfoResponse)(nil), "regen.ecocredit.v1alpha1.QueryClassInfoResponse") + proto.RegisterType((*QueryBatchInfoRequest)(nil), "regen.ecocredit.v1alpha1.QueryBatchInfoRequest") + proto.RegisterType((*QueryBatchInfoResponse)(nil), "regen.ecocredit.v1alpha1.QueryBatchInfoResponse") + proto.RegisterType((*QueryBalanceRequest)(nil), "regen.ecocredit.v1alpha1.QueryBalanceRequest") + proto.RegisterType((*QueryBalanceResponse)(nil), "regen.ecocredit.v1alpha1.QueryBalanceResponse") + proto.RegisterType((*QuerySupplyRequest)(nil), "regen.ecocredit.v1alpha1.QuerySupplyRequest") + proto.RegisterType((*QuerySupplyResponse)(nil), "regen.ecocredit.v1alpha1.QuerySupplyResponse") + proto.RegisterType((*QueryPrecisionRequest)(nil), "regen.ecocredit.v1alpha1.QueryPrecisionRequest") + proto.RegisterType((*QueryPrecisionResponse)(nil), "regen.ecocredit.v1alpha1.QueryPrecisionResponse") +} + +func init() { + proto.RegisterFile("regen/ecocredit/v1alpha1/query.proto", fileDescriptor_6a16cc4c1db940dc) +} + +var fileDescriptor_6a16cc4c1db940dc = []byte{ + // 524 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0x63, 0x54, 0x1a, 0x32, 0x25, 0x80, 0xcc, 0x1f, 0x85, 0x1c, 0x0c, 0x4a, 0x41, 0x70, + 0x68, 0x6c, 0x12, 0x84, 0xe0, 0x5c, 0x2a, 0xa4, 0x8a, 0x4b, 0x1a, 0xc4, 0x85, 0x8b, 0xb5, 0x5e, + 0x4f, 0x13, 0x0b, 0x7b, 0xd7, 0x5d, 0xaf, 0x21, 0x79, 0x0b, 0x1e, 0x83, 0x47, 0xe1, 0xd8, 0x23, + 0x47, 0x94, 0xbc, 0x08, 0xf2, 0x7a, 0xed, 0xfc, 0x23, 0xb2, 0x39, 0xee, 0xf8, 0xfb, 0x66, 0x7e, + 0x9e, 0xfd, 0x6c, 0x78, 0x26, 0x70, 0x82, 0xcc, 0x41, 0xca, 0xa9, 0x40, 0x3f, 0x90, 0xce, 0xb7, + 0x01, 0x09, 0xe3, 0x29, 0x19, 0x38, 0x57, 0x29, 0x8a, 0xb9, 0x1d, 0x0b, 0x2e, 0xb9, 0xd9, 0x51, + 0x2a, 0xbb, 0x54, 0xd9, 0x85, 0xaa, 0xbb, 0xdf, 0x2f, 0xe7, 0x31, 0x26, 0xb9, 0xbf, 0x37, 0x84, + 0x87, 0x17, 0x59, 0xbb, 0xf7, 0x21, 0x49, 0x92, 0x73, 0x76, 0xc9, 0xc7, 0x78, 0x95, 0x62, 0x22, + 0xcd, 0xc7, 0x70, 0x8b, 0x66, 0x35, 0x37, 0xf0, 0x3b, 0xc6, 0x53, 0xe3, 0x65, 0x6b, 0xdc, 0x54, + 0xe7, 0x73, 0xbf, 0x77, 0x01, 0x8f, 0xb6, 0x3d, 0x49, 0xcc, 0x59, 0x82, 0xe6, 0x5b, 0x38, 0x08, + 0xd8, 0x25, 0x57, 0x86, 0xa3, 0xe1, 0xb1, 0xbd, 0x0f, 0xce, 0x5e, 0x59, 0x95, 0xa1, 0xf7, 0x4e, + 0x63, 0x9c, 0x12, 0x49, 0xa7, 0xeb, 0x18, 0x4f, 0xe0, 0xc8, 0xcb, 0x6a, 0xae, 0x8f, 0x8c, 0x47, + 0x9a, 0x04, 0x54, 0xe9, 0x2c, 0xab, 0x94, 0x30, 0x6b, 0xce, 0xff, 0x85, 0x59, 0x59, 0x73, 0x98, + 0x11, 0xdc, 0xd7, 0x2d, 0x43, 0xc2, 0x28, 0x16, 0x28, 0x1d, 0x68, 0x12, 0x4a, 0x79, 0xca, 0x64, + 0xb1, 0x10, 0x7d, 0xdc, 0x86, 0xbc, 0xb1, 0x03, 0xe9, 0xc1, 0x83, 0xcd, 0x8e, 0x1a, 0xf1, 0x39, + 0xdc, 0x91, 0x82, 0xf8, 0xc4, 0x0b, 0xd1, 0x4d, 0x59, 0x20, 0x13, 0xdd, 0xb9, 0x5d, 0x54, 0x3f, + 0x67, 0x45, 0xf3, 0x18, 0xda, 0x02, 0x65, 0x20, 0xd0, 0xd7, 0xaa, 0x7c, 0xc2, 0x6d, 0x5d, 0x54, + 0xa2, 0xde, 0x1b, 0x30, 0xd5, 0x8c, 0x4f, 0x69, 0x1c, 0x87, 0xf3, 0xda, 0xfb, 0x43, 0xfd, 0xb2, + 0x85, 0x4d, 0x93, 0xbd, 0x80, 0xbb, 0x25, 0x59, 0xa2, 0x1e, 0x69, 0x6f, 0x09, 0x9c, 0x1b, 0xb2, + 0x57, 0x28, 0xd8, 0xb4, 0x2e, 0x87, 0x2b, 0x88, 0x73, 0x59, 0x79, 0xc1, 0x23, 0x81, 0x34, 0x48, + 0x02, 0xce, 0x6a, 0x03, 0x7e, 0xd0, 0x17, 0xbc, 0xe6, 0xd4, 0x8c, 0x27, 0x60, 0x46, 0x64, 0xe6, + 0xfa, 0x48, 0x83, 0x88, 0x84, 0x6e, 0x1c, 0x12, 0x8a, 0xf9, 0x06, 0xdb, 0xe3, 0x7b, 0x11, 0x99, + 0x9d, 0xe5, 0x0f, 0x46, 0xaa, 0x3e, 0xfc, 0x79, 0x00, 0x37, 0x55, 0x23, 0x93, 0x41, 0xab, 0xcc, + 0x9f, 0xe9, 0xec, 0xcf, 0xc5, 0x3f, 0x3f, 0x8c, 0xee, 0xab, 0xfa, 0x06, 0xcd, 0xc9, 0xa0, 0x55, + 0x46, 0xac, 0x72, 0xde, 0xf6, 0x17, 0x50, 0x39, 0x6f, 0x37, 0xf8, 0x53, 0x68, 0xea, 0xa0, 0x99, + 0xfd, 0x4a, 0xf3, 0x7a, 0xc4, 0xbb, 0x76, 0x5d, 0xb9, 0x9e, 0x84, 0x70, 0xa8, 0x63, 0x70, 0x52, + 0xe1, 0xdc, 0x48, 0x65, 0xb7, 0x5f, 0x53, 0xbd, 0x5a, 0x60, 0x79, 0xfb, 0x95, 0x0b, 0xdc, 0x4e, + 0x58, 0xe5, 0x02, 0x77, 0x82, 0x75, 0xfa, 0xf1, 0xd7, 0xc2, 0x32, 0xae, 0x17, 0x96, 0xf1, 0x67, + 0x61, 0x19, 0x3f, 0x96, 0x56, 0xe3, 0x7a, 0x69, 0x35, 0x7e, 0x2f, 0xad, 0xc6, 0x97, 0xc1, 0x24, + 0x90, 0xd3, 0xd4, 0xb3, 0x29, 0x8f, 0x1c, 0xd5, 0xb5, 0xcf, 0x50, 0x7e, 0xe7, 0xe2, 0xab, 0x3e, + 0x85, 0xe8, 0x4f, 0x50, 0x38, 0xb3, 0xd5, 0x6f, 0xd7, 0x3b, 0x54, 0x3f, 0xda, 0xd7, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x85, 0x08, 0x47, 0x78, 0xd0, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// 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 { + // ClassInfo queries for information on a credit class. + ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error) + // BatchInfo queries for information on a credit batch. + BatchInfo(ctx context.Context, in *QueryBatchInfoRequest, opts ...grpc.CallOption) (*QueryBatchInfoResponse, error) + // Balance queries the balance (both tradable and retired) of a given credit batch for a given account. + Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) + // Supply queries the tradable and retired supply of a credit batch. + Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) + // Precision queries the number of decimal places that can be used to represent credit batch units. + // See Tx/SetPrecision for more details. + Precision(ctx context.Context, in *QueryPrecisionRequest, opts ...grpc.CallOption) (*QueryPrecisionResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) ClassInfo(ctx context.Context, in *QueryClassInfoRequest, opts ...grpc.CallOption) (*QueryClassInfoResponse, error) { + out := new(QueryClassInfoResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/ClassInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BatchInfo(ctx context.Context, in *QueryBatchInfoRequest, opts ...grpc.CallOption) (*QueryBatchInfoResponse, error) { + out := new(QueryBatchInfoResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/BatchInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + out := new(QueryBalanceResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Balance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) { + out := new(QuerySupplyResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Supply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Precision(ctx context.Context, in *QueryPrecisionRequest, opts ...grpc.CallOption) (*QueryPrecisionResponse, error) { + out := new(QueryPrecisionResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Query/Precision", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // ClassInfo queries for information on a credit class. + ClassInfo(context.Context, *QueryClassInfoRequest) (*QueryClassInfoResponse, error) + // BatchInfo queries for information on a credit batch. + BatchInfo(context.Context, *QueryBatchInfoRequest) (*QueryBatchInfoResponse, error) + // Balance queries the balance (both tradable and retired) of a given credit batch for a given account. + Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) + // Supply queries the tradable and retired supply of a credit batch. + Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) + // Precision queries the number of decimal places that can be used to represent credit batch units. + // See Tx/SetPrecision for more details. + Precision(context.Context, *QueryPrecisionRequest) (*QueryPrecisionResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) ClassInfo(ctx context.Context, req *QueryClassInfoRequest) (*QueryClassInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassInfo not implemented") +} +func (*UnimplementedQueryServer) BatchInfo(ctx context.Context, req *QueryBatchInfoRequest) (*QueryBatchInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BatchInfo not implemented") +} +func (*UnimplementedQueryServer) Balance(ctx context.Context, req *QueryBalanceRequest) (*QueryBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} +func (*UnimplementedQueryServer) Supply(ctx context.Context, req *QuerySupplyRequest) (*QuerySupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented") +} +func (*UnimplementedQueryServer) Precision(ctx context.Context, req *QueryPrecisionRequest) (*QueryPrecisionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Precision not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_ClassInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Query/ClassInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassInfo(ctx, req.(*QueryClassInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_BatchInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBatchInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BatchInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Query/BatchInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BatchInfo(ctx, req.(*QueryBatchInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Query/Balance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Supply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Query/Supply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Supply(ctx, req.(*QuerySupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Precision_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPrecisionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Precision(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Query/Precision", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Precision(ctx, req.(*QueryPrecisionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.v1alpha1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClassInfo", + Handler: _Query_ClassInfo_Handler, + }, + { + MethodName: "BatchInfo", + Handler: _Query_BatchInfo_Handler, + }, + { + MethodName: "Balance", + Handler: _Query_Balance_Handler, + }, + { + MethodName: "Supply", + Handler: _Query_Supply_Handler, + }, + { + MethodName: "Precision", + Handler: _Query_Precision_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/v1alpha1/query.proto", +} + +func (m *QueryClassInfoRequest) 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 *QueryClassInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *QueryClassInfoResponse) 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 *QueryClassInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Info != nil { + { + size, err := m.Info.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 *QueryBatchInfoRequest) 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 *QueryBatchInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBatchInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *QueryBatchInfoResponse) 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 *QueryBatchInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBatchInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Info != nil { + { + size, err := m.Info.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 *QueryBalanceRequest) 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 *QueryBalanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0x12 + } + if len(m.Account) > 0 { + i -= len(m.Account) + copy(dAtA[i:], m.Account) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Account))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBalanceResponse) 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 *QueryBalanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetiredUnits) > 0 { + i -= len(m.RetiredUnits) + copy(dAtA[i:], m.RetiredUnits) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RetiredUnits))) + i-- + dAtA[i] = 0x12 + } + if len(m.TradableUnits) > 0 { + i -= len(m.TradableUnits) + copy(dAtA[i:], m.TradableUnits) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TradableUnits))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySupplyRequest) 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 *QuerySupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *QuerySupplyResponse) 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 *QuerySupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetiredSupply) > 0 { + i -= len(m.RetiredSupply) + copy(dAtA[i:], m.RetiredSupply) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RetiredSupply))) + i-- + dAtA[i] = 0x12 + } + if len(m.TradableSupply) > 0 { + i -= len(m.TradableSupply) + copy(dAtA[i:], m.TradableSupply) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TradableSupply))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryPrecisionRequest) 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 *QueryPrecisionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPrecisionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *QueryPrecisionResponse) 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 *QueryPrecisionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPrecisionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxDecimalPlaces != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.MaxDecimalPlaces)) + i-- + dAtA[i] = 0x8 + } + 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 *QueryClassInfoRequest) 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)) + } + return n +} + +func (m *QueryClassInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBatchInfoRequest) 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)) + } + return n +} + +func (m *QueryBatchInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBalanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Account) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBalanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TradableUnits) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.RetiredUnits) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySupplyRequest) 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)) + } + return n +} + +func (m *QuerySupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TradableSupply) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.RetiredSupply) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryPrecisionRequest) 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)) + } + return n +} + +func (m *QueryPrecisionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxDecimalPlaces != 0 { + n += 1 + sovQuery(uint64(m.MaxDecimalPlaces)) + } + 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 *QueryClassInfoRequest) 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: QueryClassInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassInfoRequest: 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 + 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 *QueryClassInfoResponse) 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: QueryClassInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", 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.Info == nil { + m.Info = &ClassInfo{} + } + if err := m.Info.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 *QueryBatchInfoRequest) 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: QueryBatchInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBatchInfoRequest: 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 + 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 *QueryBatchInfoResponse) 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: QueryBatchInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBatchInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", 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.Info == nil { + m.Info = &BatchInfo{} + } + if err := m.Info.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 *QueryBalanceRequest) 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: QueryBalanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 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 + 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 *QueryBalanceResponse) 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: QueryBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradableUnits", 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.TradableUnits = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetiredUnits", 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.RetiredUnits = 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 *QuerySupplyRequest) 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: QuerySupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyRequest: 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 + 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 *QuerySupplyResponse) 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: QuerySupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradableSupply", 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.TradableSupply = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetiredSupply", 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.RetiredSupply = 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 *QueryPrecisionRequest) 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: QueryPrecisionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPrecisionRequest: 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 + 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 *QueryPrecisionResponse) 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: QueryPrecisionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPrecisionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDecimalPlaces", wireType) + } + m.MaxDecimalPlaces = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxDecimalPlaces |= uint32(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 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/tx.pb.go b/x/ecocredit/tx.pb.go new file mode 100644 index 0000000000..7166a23d22 --- /dev/null +++ b/x/ecocredit/tx.pb.go @@ -0,0 +1,3370 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/v1alpha1/tx.proto + +package ecocredit + +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 + +// MsgCreateClassRequest is the Msg/CreateClass request type. +type MsgCreateClassRequest struct { + // designer is the address of the account which designed the credit class. The designer has special permissions + // to change the list of issuers and perform other administrative operations. + Designer string `protobuf:"bytes,1,opt,name=designer,proto3" json:"designer,omitempty"` + // issuers are the addresses of the approved issuers. + Issuers []string `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` + // metadata is any arbitrary metadata to attached to the credit class. + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *MsgCreateClassRequest) Reset() { *m = MsgCreateClassRequest{} } +func (m *MsgCreateClassRequest) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClassRequest) ProtoMessage() {} +func (*MsgCreateClassRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{0} +} +func (m *MsgCreateClassRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClassRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClassRequest.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 *MsgCreateClassRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClassRequest.Merge(m, src) +} +func (m *MsgCreateClassRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClassRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClassRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClassRequest proto.InternalMessageInfo + +func (m *MsgCreateClassRequest) GetDesigner() string { + if m != nil { + return m.Designer + } + return "" +} + +func (m *MsgCreateClassRequest) GetIssuers() []string { + if m != nil { + return m.Issuers + } + return nil +} + +func (m *MsgCreateClassRequest) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + +// MsgCreateClassResponse is the Msg/CreateClass response type. +type MsgCreateClassResponse struct { + // class_id is the unique ID of the newly created credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` +} + +func (m *MsgCreateClassResponse) Reset() { *m = MsgCreateClassResponse{} } +func (m *MsgCreateClassResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClassResponse) ProtoMessage() {} +func (*MsgCreateClassResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{1} +} +func (m *MsgCreateClassResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClassResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClassResponse.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 *MsgCreateClassResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClassResponse.Merge(m, src) +} +func (m *MsgCreateClassResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClassResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClassResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClassResponse proto.InternalMessageInfo + +func (m *MsgCreateClassResponse) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +// MsgCreateBatchRequest is the Msg/CreateBatch request type. +type MsgCreateBatchRequest struct { + // issuer is the address of the batch issuer. + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // class_id is the unique ID of the class. + ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // issuance are the credits issued in the batch. + Issuance []*MsgCreateBatchRequest_BatchIssuance `protobuf:"bytes,3,rep,name=issuance,proto3" json:"issuance,omitempty"` + // metadata is any arbitrary metadata to attached to the credit batch. + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *MsgCreateBatchRequest) Reset() { *m = MsgCreateBatchRequest{} } +func (m *MsgCreateBatchRequest) String() string { return proto.CompactTextString(m) } +func (*MsgCreateBatchRequest) ProtoMessage() {} +func (*MsgCreateBatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{2} +} +func (m *MsgCreateBatchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateBatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateBatchRequest.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 *MsgCreateBatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateBatchRequest.Merge(m, src) +} +func (m *MsgCreateBatchRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateBatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateBatchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateBatchRequest proto.InternalMessageInfo + +func (m *MsgCreateBatchRequest) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *MsgCreateBatchRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *MsgCreateBatchRequest) GetIssuance() []*MsgCreateBatchRequest_BatchIssuance { + if m != nil { + return m.Issuance + } + return nil +} + +func (m *MsgCreateBatchRequest) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + +// BatchIssuance represents the issuance of some credits in a batch to a single recipient. +type MsgCreateBatchRequest_BatchIssuance struct { + // recipient is the account of the recipient. + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"` + // tradable_units are the units of credits in this issuance that can be traded by this recipient. + // Decimal values are acceptable. + TradableUnits string `protobuf:"bytes,2,opt,name=tradable_units,json=tradableUnits,proto3" json:"tradable_units,omitempty"` + // retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. + // Decimal values are acceptable. + RetiredUnits string `protobuf:"bytes,3,opt,name=retired_units,json=retiredUnits,proto3" json:"retired_units,omitempty"` +} + +func (m *MsgCreateBatchRequest_BatchIssuance) Reset() { *m = MsgCreateBatchRequest_BatchIssuance{} } +func (m *MsgCreateBatchRequest_BatchIssuance) String() string { return proto.CompactTextString(m) } +func (*MsgCreateBatchRequest_BatchIssuance) ProtoMessage() {} +func (*MsgCreateBatchRequest_BatchIssuance) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{2, 0} +} +func (m *MsgCreateBatchRequest_BatchIssuance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateBatchRequest_BatchIssuance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateBatchRequest_BatchIssuance.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 *MsgCreateBatchRequest_BatchIssuance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateBatchRequest_BatchIssuance.Merge(m, src) +} +func (m *MsgCreateBatchRequest_BatchIssuance) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateBatchRequest_BatchIssuance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateBatchRequest_BatchIssuance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateBatchRequest_BatchIssuance proto.InternalMessageInfo + +func (m *MsgCreateBatchRequest_BatchIssuance) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgCreateBatchRequest_BatchIssuance) GetTradableUnits() string { + if m != nil { + return m.TradableUnits + } + return "" +} + +func (m *MsgCreateBatchRequest_BatchIssuance) GetRetiredUnits() string { + if m != nil { + return m.RetiredUnits + } + return "" +} + +// MsgCreateBatchResponse is the Msg/CreateBatch response type. +type MsgCreateBatchResponse struct { + // batch_denom is the unique ID of the newly created batch. + BatchDenom string `protobuf:"bytes,1,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` +} + +func (m *MsgCreateBatchResponse) Reset() { *m = MsgCreateBatchResponse{} } +func (m *MsgCreateBatchResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateBatchResponse) ProtoMessage() {} +func (*MsgCreateBatchResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{3} +} +func (m *MsgCreateBatchResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateBatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateBatchResponse.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 *MsgCreateBatchResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateBatchResponse.Merge(m, src) +} +func (m *MsgCreateBatchResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateBatchResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateBatchResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateBatchResponse proto.InternalMessageInfo + +func (m *MsgCreateBatchResponse) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +// MsgSendRequest is the Msg/Send request type. +type MsgSendRequest struct { + // sender is the address of the account sending credits. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // sender is the address of the account receiving credits. + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` + // credits are the credits being sent. + Credits []*MsgSendRequest_SendUnits `protobuf:"bytes,3,rep,name=credits,proto3" json:"credits,omitempty"` +} + +func (m *MsgSendRequest) Reset() { *m = MsgSendRequest{} } +func (m *MsgSendRequest) String() string { return proto.CompactTextString(m) } +func (*MsgSendRequest) ProtoMessage() {} +func (*MsgSendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{4} +} +func (m *MsgSendRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendRequest.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 *MsgSendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendRequest.Merge(m, src) +} +func (m *MsgSendRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgSendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendRequest proto.InternalMessageInfo + +func (m *MsgSendRequest) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgSendRequest) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgSendRequest) GetCredits() []*MsgSendRequest_SendUnits { + if m != nil { + return m.Credits + } + return nil +} + +type MsgSendRequest_SendUnits 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_units are the units of credits in this issuance that can be traded by this recipient. + // Decimal values are acceptable within the precision returned by Query/Precision. + TradeableUnits string `protobuf:"bytes,2,opt,name=tradeable_units,json=tradeableUnits,proto3" json:"tradeable_units,omitempty"` + // retired_units are the units of credits in this issuance that are effectively retired by the issuer on receipt. + // Decimal values are acceptable within the precision returned by Query/Precision. + RetiredUnits string `protobuf:"bytes,3,opt,name=retired_units,json=retiredUnits,proto3" json:"retired_units,omitempty"` +} + +func (m *MsgSendRequest_SendUnits) Reset() { *m = MsgSendRequest_SendUnits{} } +func (m *MsgSendRequest_SendUnits) String() string { return proto.CompactTextString(m) } +func (*MsgSendRequest_SendUnits) ProtoMessage() {} +func (*MsgSendRequest_SendUnits) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{4, 0} +} +func (m *MsgSendRequest_SendUnits) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendRequest_SendUnits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendRequest_SendUnits.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 *MsgSendRequest_SendUnits) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendRequest_SendUnits.Merge(m, src) +} +func (m *MsgSendRequest_SendUnits) XXX_Size() int { + return m.Size() +} +func (m *MsgSendRequest_SendUnits) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendRequest_SendUnits.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendRequest_SendUnits proto.InternalMessageInfo + +func (m *MsgSendRequest_SendUnits) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *MsgSendRequest_SendUnits) GetTradeableUnits() string { + if m != nil { + return m.TradeableUnits + } + return "" +} + +func (m *MsgSendRequest_SendUnits) GetRetiredUnits() string { + if m != nil { + return m.RetiredUnits + } + return "" +} + +// MsgSendResponse is the Msg/Send response type. +type MsgSendResponse struct { +} + +func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } +func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendResponse) ProtoMessage() {} +func (*MsgSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{5} +} +func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendResponse.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 *MsgSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendResponse.Merge(m, src) +} +func (m *MsgSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo + +// MsgRetireRequest is the Msg/Retire request type. +type MsgRetireRequest struct { + // holder is the address of the holder of the credits. + Holder string `protobuf:"bytes,1,opt,name=holder,proto3" json:"holder,omitempty"` + // credits are the credits being retired. + Credits []*MsgRetireRequest_RetireUnits `protobuf:"bytes,2,rep,name=credits,proto3" json:"credits,omitempty"` +} + +func (m *MsgRetireRequest) Reset() { *m = MsgRetireRequest{} } +func (m *MsgRetireRequest) String() string { return proto.CompactTextString(m) } +func (*MsgRetireRequest) ProtoMessage() {} +func (*MsgRetireRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{6} +} +func (m *MsgRetireRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRetireRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRetireRequest.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 *MsgRetireRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRetireRequest.Merge(m, src) +} +func (m *MsgRetireRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgRetireRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRetireRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRetireRequest proto.InternalMessageInfo + +func (m *MsgRetireRequest) GetHolder() string { + if m != nil { + return m.Holder + } + return "" +} + +func (m *MsgRetireRequest) GetCredits() []*MsgRetireRequest_RetireUnits { + if m != nil { + return m.Credits + } + return nil +} + +// RetireUnits are the units of the batch being retired. +type MsgRetireRequest_RetireUnits 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"` + // retired_units are the units of credits being retired. + // Decimal values are acceptable within the precision returned by Query/Precision. + Units string `protobuf:"bytes,2,opt,name=units,proto3" json:"units,omitempty"` +} + +func (m *MsgRetireRequest_RetireUnits) Reset() { *m = MsgRetireRequest_RetireUnits{} } +func (m *MsgRetireRequest_RetireUnits) String() string { return proto.CompactTextString(m) } +func (*MsgRetireRequest_RetireUnits) ProtoMessage() {} +func (*MsgRetireRequest_RetireUnits) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{6, 0} +} +func (m *MsgRetireRequest_RetireUnits) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRetireRequest_RetireUnits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRetireRequest_RetireUnits.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 *MsgRetireRequest_RetireUnits) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRetireRequest_RetireUnits.Merge(m, src) +} +func (m *MsgRetireRequest_RetireUnits) XXX_Size() int { + return m.Size() +} +func (m *MsgRetireRequest_RetireUnits) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRetireRequest_RetireUnits.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRetireRequest_RetireUnits proto.InternalMessageInfo + +func (m *MsgRetireRequest_RetireUnits) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *MsgRetireRequest_RetireUnits) GetUnits() string { + if m != nil { + return m.Units + } + return "" +} + +// MsgRetireRequest is the Msg/Retire response type. +type MsgRetireResponse struct { +} + +func (m *MsgRetireResponse) Reset() { *m = MsgRetireResponse{} } +func (m *MsgRetireResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRetireResponse) ProtoMessage() {} +func (*MsgRetireResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{7} +} +func (m *MsgRetireResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRetireResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRetireResponse.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 *MsgRetireResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRetireResponse.Merge(m, src) +} +func (m *MsgRetireResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRetireResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRetireResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRetireResponse proto.InternalMessageInfo + +// MsgRetireRequest is the Msg/SetPrecision request type. +type MsgSetPrecisionRequest struct { + // issuer is the address of the batch issuer. + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // batch_denom is the unique ID of the credit batch. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // max_decimal_places is the new maximum number of decimal places that can be used to represent some quantity of + // credit units. It is an experimental feature to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. + MaxDecimalPlaces uint32 `protobuf:"varint,3,opt,name=max_decimal_places,json=maxDecimalPlaces,proto3" json:"max_decimal_places,omitempty"` +} + +func (m *MsgSetPrecisionRequest) Reset() { *m = MsgSetPrecisionRequest{} } +func (m *MsgSetPrecisionRequest) String() string { return proto.CompactTextString(m) } +func (*MsgSetPrecisionRequest) ProtoMessage() {} +func (*MsgSetPrecisionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{8} +} +func (m *MsgSetPrecisionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPrecisionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPrecisionRequest.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 *MsgSetPrecisionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPrecisionRequest.Merge(m, src) +} +func (m *MsgSetPrecisionRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPrecisionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPrecisionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPrecisionRequest proto.InternalMessageInfo + +func (m *MsgSetPrecisionRequest) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *MsgSetPrecisionRequest) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *MsgSetPrecisionRequest) GetMaxDecimalPlaces() uint32 { + if m != nil { + return m.MaxDecimalPlaces + } + return 0 +} + +// MsgRetireRequest is the Msg/SetPrecision response type. +type MsgSetPrecisionResponse struct { +} + +func (m *MsgSetPrecisionResponse) Reset() { *m = MsgSetPrecisionResponse{} } +func (m *MsgSetPrecisionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetPrecisionResponse) ProtoMessage() {} +func (*MsgSetPrecisionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_96891bdd11ac56ed, []int{9} +} +func (m *MsgSetPrecisionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetPrecisionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetPrecisionResponse.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 *MsgSetPrecisionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetPrecisionResponse.Merge(m, src) +} +func (m *MsgSetPrecisionResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetPrecisionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetPrecisionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetPrecisionResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateClassRequest)(nil), "regen.ecocredit.v1alpha1.MsgCreateClassRequest") + proto.RegisterType((*MsgCreateClassResponse)(nil), "regen.ecocredit.v1alpha1.MsgCreateClassResponse") + proto.RegisterType((*MsgCreateBatchRequest)(nil), "regen.ecocredit.v1alpha1.MsgCreateBatchRequest") + proto.RegisterType((*MsgCreateBatchRequest_BatchIssuance)(nil), "regen.ecocredit.v1alpha1.MsgCreateBatchRequest.BatchIssuance") + proto.RegisterType((*MsgCreateBatchResponse)(nil), "regen.ecocredit.v1alpha1.MsgCreateBatchResponse") + proto.RegisterType((*MsgSendRequest)(nil), "regen.ecocredit.v1alpha1.MsgSendRequest") + proto.RegisterType((*MsgSendRequest_SendUnits)(nil), "regen.ecocredit.v1alpha1.MsgSendRequest.SendUnits") + proto.RegisterType((*MsgSendResponse)(nil), "regen.ecocredit.v1alpha1.MsgSendResponse") + proto.RegisterType((*MsgRetireRequest)(nil), "regen.ecocredit.v1alpha1.MsgRetireRequest") + proto.RegisterType((*MsgRetireRequest_RetireUnits)(nil), "regen.ecocredit.v1alpha1.MsgRetireRequest.RetireUnits") + proto.RegisterType((*MsgRetireResponse)(nil), "regen.ecocredit.v1alpha1.MsgRetireResponse") + proto.RegisterType((*MsgSetPrecisionRequest)(nil), "regen.ecocredit.v1alpha1.MsgSetPrecisionRequest") + proto.RegisterType((*MsgSetPrecisionResponse)(nil), "regen.ecocredit.v1alpha1.MsgSetPrecisionResponse") +} + +func init() { proto.RegisterFile("regen/ecocredit/v1alpha1/tx.proto", fileDescriptor_96891bdd11ac56ed) } + +var fileDescriptor_96891bdd11ac56ed = []byte{ + // 680 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0xae, 0x9d, 0xde, 0xb6, 0x39, 0x69, 0xfa, 0x33, 0xf7, 0xde, 0xde, 0xd4, 0xba, 0x0a, 0xc1, + 0x08, 0x11, 0xfe, 0x9c, 0xa6, 0x95, 0x90, 0x58, 0xb0, 0x69, 0xbb, 0xa9, 0x20, 0x52, 0xe5, 0x8a, + 0x05, 0xb0, 0x88, 0x26, 0xf6, 0x91, 0x63, 0xe1, 0xd8, 0xc1, 0x33, 0x81, 0xc0, 0x86, 0x57, 0xe8, + 0x13, 0xf0, 0x24, 0xac, 0x58, 0xb1, 0xec, 0x92, 0x25, 0x6a, 0x5f, 0x04, 0x79, 0x3c, 0x71, 0xc6, + 0x09, 0x34, 0xee, 0x2e, 0xdf, 0x97, 0x73, 0xce, 0x77, 0xce, 0x37, 0x73, 0xc6, 0x70, 0x3b, 0x46, + 0x0f, 0xc3, 0x16, 0x3a, 0x91, 0x13, 0xa3, 0xeb, 0xf3, 0xd6, 0xfb, 0x36, 0x0d, 0x86, 0x7d, 0xda, + 0x6e, 0xf1, 0xb1, 0x35, 0x8c, 0x23, 0x1e, 0x91, 0x9a, 0x08, 0xb1, 0xb2, 0x10, 0x6b, 0x12, 0x62, + 0xfa, 0xf0, 0x6f, 0x87, 0x79, 0x47, 0x31, 0x52, 0x8e, 0x47, 0x01, 0x65, 0xcc, 0xc6, 0x77, 0x23, + 0x64, 0x9c, 0x18, 0xb0, 0xe6, 0x22, 0xf3, 0xbd, 0x10, 0xe3, 0x9a, 0xd6, 0xd0, 0x9a, 0x65, 0x3b, + 0xc3, 0xa4, 0x06, 0xab, 0x3e, 0x63, 0x23, 0x8c, 0x59, 0x4d, 0x6f, 0x94, 0x9a, 0x65, 0x7b, 0x02, + 0x93, 0xac, 0x01, 0x72, 0xea, 0x52, 0x4e, 0x6b, 0xa5, 0x86, 0xd6, 0x5c, 0xb7, 0x33, 0x6c, 0x1e, + 0xc0, 0xce, 0xac, 0x14, 0x1b, 0x46, 0x21, 0x43, 0xb2, 0x0b, 0x6b, 0x4e, 0x42, 0x74, 0x7d, 0x57, + 0x6a, 0xad, 0x0a, 0x7c, 0xe2, 0x9a, 0x5f, 0x75, 0xa5, 0xc1, 0x43, 0xca, 0x9d, 0xfe, 0xa4, 0xc1, + 0x1d, 0x58, 0x49, 0x55, 0x65, 0x8a, 0x44, 0xb9, 0x62, 0x7a, 0xae, 0x18, 0x79, 0x05, 0x6b, 0x49, + 0x10, 0x0d, 0x1d, 0xac, 0x95, 0x1a, 0xa5, 0x66, 0x65, 0xff, 0x99, 0xf5, 0x27, 0x67, 0xac, 0xdf, + 0xaa, 0x5a, 0x02, 0x9c, 0xc8, 0x22, 0x76, 0x56, 0x2e, 0x37, 0xf8, 0x72, 0x7e, 0x70, 0xe3, 0x23, + 0x54, 0x73, 0x69, 0xe4, 0x7f, 0x28, 0xc7, 0xe8, 0xf8, 0x43, 0x1f, 0x43, 0x2e, 0xbb, 0x9f, 0x12, + 0xe4, 0x2e, 0x6c, 0xf0, 0x98, 0xba, 0xb4, 0x17, 0x60, 0x77, 0x14, 0xfa, 0x9c, 0xc9, 0x31, 0xaa, + 0x13, 0xf6, 0x65, 0x42, 0x92, 0x3b, 0x50, 0x8d, 0x91, 0xfb, 0x31, 0xba, 0x32, 0xaa, 0x24, 0xa2, + 0xd6, 0x25, 0x29, 0x82, 0xcc, 0xa7, 0x8a, 0xe7, 0x72, 0x0e, 0xe9, 0xf9, 0x2d, 0xa8, 0xf4, 0x12, + 0xa2, 0xeb, 0x62, 0x18, 0x0d, 0x64, 0x17, 0x20, 0xa8, 0xe3, 0x84, 0x31, 0xcf, 0x75, 0xd8, 0xe8, + 0x30, 0xef, 0x0c, 0x43, 0x57, 0xb1, 0x9c, 0x61, 0xe8, 0x4e, 0x2d, 0x4f, 0x51, 0x7e, 0x1e, 0x7d, + 0x76, 0x9e, 0x17, 0xb0, 0x9a, 0x7a, 0xcb, 0xa4, 0xe9, 0xfb, 0xd7, 0x9a, 0xae, 0x08, 0x5a, 0xc9, + 0x6f, 0x31, 0x88, 0x3d, 0x29, 0x61, 0x7c, 0x82, 0x72, 0xc6, 0x2e, 0x1c, 0x82, 0xdc, 0x83, 0xcd, + 0xc4, 0x35, 0x9c, 0x33, 0x73, 0x23, 0xa3, 0x6f, 0xe0, 0xe6, 0x36, 0x6c, 0x66, 0x0d, 0xa6, 0x36, + 0x9a, 0xdf, 0x34, 0xd8, 0xea, 0x30, 0xcf, 0x16, 0x61, 0x8a, 0x4f, 0xfd, 0x28, 0x50, 0x7c, 0x4a, + 0x11, 0x39, 0x9d, 0x3a, 0xa1, 0x0b, 0x27, 0x9e, 0x5c, 0xeb, 0x44, 0xae, 0xa8, 0x95, 0xa2, 0x19, + 0x37, 0x8e, 0xa1, 0xa2, 0xf0, 0x8b, 0xfd, 0xf8, 0x07, 0xfe, 0x52, 0x5d, 0x48, 0x81, 0xf9, 0x37, + 0x6c, 0x2b, 0x72, 0x72, 0xb2, 0xcf, 0xe2, 0xea, 0x9c, 0x21, 0x3f, 0x4d, 0x8e, 0x92, 0xf9, 0x51, + 0xb8, 0x68, 0xf3, 0x66, 0xd4, 0xf5, 0x39, 0xf5, 0x47, 0x40, 0x06, 0x74, 0xdc, 0x75, 0xd1, 0xf1, + 0x07, 0x34, 0xe8, 0x0e, 0x03, 0xea, 0x60, 0xea, 0x74, 0xd5, 0xde, 0x1a, 0xd0, 0xf1, 0x71, 0xfa, + 0xc7, 0xa9, 0xe0, 0xcd, 0x5d, 0xf8, 0x6f, 0xae, 0x81, 0xb4, 0xb7, 0xfd, 0x2f, 0xcb, 0x50, 0xea, + 0x30, 0x8f, 0x0c, 0xa1, 0xa2, 0xbc, 0x27, 0xa4, 0x55, 0x60, 0x9b, 0xd5, 0x47, 0xce, 0xd8, 0x2b, + 0x9e, 0x20, 0xd7, 0x26, 0x53, 0x14, 0xdb, 0x54, 0x48, 0x51, 0x7d, 0x3f, 0x0a, 0x29, 0xe6, 0x17, + 0xf5, 0x0d, 0x2c, 0x27, 0x37, 0x8e, 0x34, 0x8b, 0x6e, 0x8d, 0x71, 0xbf, 0x40, 0xa4, 0x2c, 0x4e, + 0x61, 0x25, 0x3d, 0x76, 0xf2, 0xa0, 0xf8, 0x55, 0x34, 0x1e, 0x16, 0x8a, 0x95, 0x12, 0x0c, 0xd6, + 0xd5, 0x33, 0x24, 0x7b, 0x0b, 0xba, 0x9b, 0xbb, 0x6f, 0x46, 0xfb, 0x06, 0x19, 0xa9, 0xe8, 0xe1, + 0xf3, 0xef, 0x97, 0x75, 0xed, 0xe2, 0xb2, 0xae, 0xfd, 0xbc, 0xac, 0x6b, 0xe7, 0x57, 0xf5, 0xa5, + 0x8b, 0xab, 0xfa, 0xd2, 0x8f, 0xab, 0xfa, 0xd2, 0xeb, 0xb6, 0xe7, 0xf3, 0xfe, 0xa8, 0x67, 0x39, + 0xd1, 0xa0, 0x25, 0xca, 0x3e, 0x0e, 0x91, 0x7f, 0x88, 0xe2, 0xb7, 0x12, 0x05, 0xe8, 0x7a, 0x18, + 0xb7, 0xc6, 0xd3, 0xef, 0x69, 0x6f, 0x45, 0x7c, 0x44, 0x0f, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, + 0xc3, 0xd2, 0xcb, 0xd7, 0x69, 0x07, 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 { + // CreateClass creates a new credit class with an approved list of issuers and optional metadata. + CreateClass(ctx context.Context, in *MsgCreateClassRequest, opts ...grpc.CallOption) (*MsgCreateClassResponse, error) + // CreateBatch creates a new batch of credits for an existing credit class. This will create a new batch denom + // with a fixed supply. Issued credits can be distributed to recipients in either tradable or retired form. + CreateBatch(ctx context.Context, in *MsgCreateBatchRequest, opts ...grpc.CallOption) (*MsgCreateBatchResponse, error) + // Send sends tradeable credits from one account to another account. Sent credits can either be tradable or retired on receipt. + Send(ctx context.Context, in *MsgSendRequest, opts ...grpc.CallOption) (*MsgSendResponse, error) + // Retire retires a specified number of credits in the holder's account. + Retire(ctx context.Context, in *MsgRetireRequest, opts ...grpc.CallOption) (*MsgRetireResponse, error) + // SetPrecision allows an issuer to increase the decimal precision of a credit batch. It is an experimental feature + // to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. The number of decimal + // places allowed for a credit batch is determined by the original number of decimal places used with calling CreatBatch. + // SetPrecision allows the number of allowed decimal places to be increased, effectively making the supply more + // granular without actually changing any balances. It allows asset issuers to be able to issue an asset without needing + // to think about how many subdivisions are needed upfront. While it may not be relevant for credits which likely have + // a fairly stable market value, I wanted to experiment a bit and this serves as a proof of concept for a broader + // bank redesign where say for instance a coin like the ATOM or XRN could be issued in its own units rather than + // micro or nano-units. Instead an operation like SetPrecision would allow trading in micro, nano or pico in the future + // based on market demand. Arbitrary, unbounded precision is not desirable because this can lead to spam attacks (like + // sending 0.000000000000000000000000000001 coins). This is effectively fixed precision so under the hood it is still + // basically an integer, but the fixed precision can be increased so its more adaptable long term than just an integer. + SetPrecision(ctx context.Context, in *MsgSetPrecisionRequest, opts ...grpc.CallOption) (*MsgSetPrecisionResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateClass(ctx context.Context, in *MsgCreateClassRequest, opts ...grpc.CallOption) (*MsgCreateClassResponse, error) { + out := new(MsgCreateClassResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Msg/CreateClass", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateBatch(ctx context.Context, in *MsgCreateBatchRequest, opts ...grpc.CallOption) (*MsgCreateBatchResponse, error) { + out := new(MsgCreateBatchResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Msg/CreateBatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Send(ctx context.Context, in *MsgSendRequest, opts ...grpc.CallOption) (*MsgSendResponse, error) { + out := new(MsgSendResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Msg/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Retire(ctx context.Context, in *MsgRetireRequest, opts ...grpc.CallOption) (*MsgRetireResponse, error) { + out := new(MsgRetireResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Msg/Retire", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetPrecision(ctx context.Context, in *MsgSetPrecisionRequest, opts ...grpc.CallOption) (*MsgSetPrecisionResponse, error) { + out := new(MsgSetPrecisionResponse) + err := c.cc.Invoke(ctx, "/regen.ecocredit.v1alpha1.Msg/SetPrecision", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateClass creates a new credit class with an approved list of issuers and optional metadata. + CreateClass(context.Context, *MsgCreateClassRequest) (*MsgCreateClassResponse, error) + // CreateBatch creates a new batch of credits for an existing credit class. This will create a new batch denom + // with a fixed supply. Issued credits can be distributed to recipients in either tradable or retired form. + CreateBatch(context.Context, *MsgCreateBatchRequest) (*MsgCreateBatchResponse, error) + // Send sends tradeable credits from one account to another account. Sent credits can either be tradable or retired on receipt. + Send(context.Context, *MsgSendRequest) (*MsgSendResponse, error) + // Retire retires a specified number of credits in the holder's account. + Retire(context.Context, *MsgRetireRequest) (*MsgRetireResponse, error) + // SetPrecision allows an issuer to increase the decimal precision of a credit batch. It is an experimental feature + // to concretely explore an idea proposed in https://github.com/cosmos/cosmos-sdk/issues/7113. The number of decimal + // places allowed for a credit batch is determined by the original number of decimal places used with calling CreatBatch. + // SetPrecision allows the number of allowed decimal places to be increased, effectively making the supply more + // granular without actually changing any balances. It allows asset issuers to be able to issue an asset without needing + // to think about how many subdivisions are needed upfront. While it may not be relevant for credits which likely have + // a fairly stable market value, I wanted to experiment a bit and this serves as a proof of concept for a broader + // bank redesign where say for instance a coin like the ATOM or XRN could be issued in its own units rather than + // micro or nano-units. Instead an operation like SetPrecision would allow trading in micro, nano or pico in the future + // based on market demand. Arbitrary, unbounded precision is not desirable because this can lead to spam attacks (like + // sending 0.000000000000000000000000000001 coins). This is effectively fixed precision so under the hood it is still + // basically an integer, but the fixed precision can be increased so its more adaptable long term than just an integer. + SetPrecision(context.Context, *MsgSetPrecisionRequest) (*MsgSetPrecisionResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateClass(ctx context.Context, req *MsgCreateClassRequest) (*MsgCreateClassResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClass not implemented") +} +func (*UnimplementedMsgServer) CreateBatch(ctx context.Context, req *MsgCreateBatchRequest) (*MsgCreateBatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBatch not implemented") +} +func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSendRequest) (*MsgSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedMsgServer) Retire(ctx context.Context, req *MsgRetireRequest) (*MsgRetireResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Retire not implemented") +} +func (*UnimplementedMsgServer) SetPrecision(ctx context.Context, req *MsgSetPrecisionRequest) (*MsgSetPrecisionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetPrecision not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateClass_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClassRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClass(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Msg/CreateClass", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClass(ctx, req.(*MsgCreateClassRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateBatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateBatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Msg/CreateBatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateBatch(ctx, req.(*MsgCreateBatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Msg/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Send(ctx, req.(*MsgSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Retire_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRetireRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Retire(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Msg/Retire", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Retire(ctx, req.(*MsgRetireRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetPrecision_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetPrecisionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetPrecision(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/regen.ecocredit.v1alpha1.Msg/SetPrecision", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetPrecision(ctx, req.(*MsgSetPrecisionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "regen.ecocredit.v1alpha1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateClass", + Handler: _Msg_CreateClass_Handler, + }, + { + MethodName: "CreateBatch", + Handler: _Msg_CreateBatch_Handler, + }, + { + MethodName: "Send", + Handler: _Msg_Send_Handler, + }, + { + MethodName: "Retire", + Handler: _Msg_Retire_Handler, + }, + { + MethodName: "SetPrecision", + Handler: _Msg_SetPrecision_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "regen/ecocredit/v1alpha1/tx.proto", +} + +func (m *MsgCreateClassRequest) 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 *MsgCreateClassRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClassRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x1a + } + 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 = encodeVarintTx(dAtA, i, uint64(len(m.Issuers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Designer) > 0 { + i -= len(m.Designer) + copy(dAtA[i:], m.Designer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Designer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateClassResponse) 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 *MsgCreateClassResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClassResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateBatchRequest) 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 *MsgCreateBatchRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateBatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } + if len(m.Issuance) > 0 { + for iNdEx := len(m.Issuance) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Issuance[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.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateBatchRequest_BatchIssuance) 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 *MsgCreateBatchRequest_BatchIssuance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateBatchRequest_BatchIssuance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetiredUnits) > 0 { + i -= len(m.RetiredUnits) + copy(dAtA[i:], m.RetiredUnits) + i = encodeVarintTx(dAtA, i, uint64(len(m.RetiredUnits))) + i-- + dAtA[i] = 0x1a + } + if len(m.TradableUnits) > 0 { + i -= len(m.TradableUnits) + copy(dAtA[i:], m.TradableUnits) + i = encodeVarintTx(dAtA, i, uint64(len(m.TradableUnits))) + i-- + dAtA[i] = 0x12 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateBatchResponse) 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 *MsgCreateBatchResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateBatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgSendRequest) 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 *MsgSendRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendRequest) 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.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSendRequest_SendUnits) 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 *MsgSendRequest_SendUnits) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendRequest_SendUnits) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RetiredUnits) > 0 { + i -= len(m.RetiredUnits) + copy(dAtA[i:], m.RetiredUnits) + i = encodeVarintTx(dAtA, i, uint64(len(m.RetiredUnits))) + i-- + dAtA[i] = 0x1a + } + if len(m.TradeableUnits) > 0 { + i -= len(m.TradeableUnits) + copy(dAtA[i:], m.TradeableUnits) + i = encodeVarintTx(dAtA, i, uint64(len(m.TradeableUnits))) + 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 *MsgSendResponse) 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 *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRetireRequest) 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 *MsgRetireRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRetireRequest) 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] = 0x12 + } + } + if len(m.Holder) > 0 { + i -= len(m.Holder) + copy(dAtA[i:], m.Holder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Holder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRetireRequest_RetireUnits) 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 *MsgRetireRequest_RetireUnits) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRetireRequest_RetireUnits) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Units) > 0 { + i -= len(m.Units) + copy(dAtA[i:], m.Units) + i = encodeVarintTx(dAtA, i, uint64(len(m.Units))) + 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 *MsgRetireResponse) 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 *MsgRetireResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRetireResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetPrecisionRequest) 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 *MsgSetPrecisionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPrecisionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxDecimalPlaces != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MaxDecimalPlaces)) + i-- + dAtA[i] = 0x18 + } + 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] = 0x12 + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetPrecisionResponse) 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 *MsgSetPrecisionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetPrecisionResponse) 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 *MsgCreateClassRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Designer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Issuers) > 0 { + for _, s := range m.Issuers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateClassResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateBatchRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Issuance) > 0 { + for _, e := range m.Issuance { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateBatchRequest_BatchIssuance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.TradableUnits) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RetiredUnits) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateBatchResponse) 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)) + } + return n +} + +func (m *MsgSendRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Recipient) + 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 *MsgSendRequest_SendUnits) 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.TradeableUnits) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RetiredUnits) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRetireRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Holder) + 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 *MsgRetireRequest_RetireUnits) 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.Units) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRetireResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetPrecisionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.MaxDecimalPlaces != 0 { + n += 1 + sovTx(uint64(m.MaxDecimalPlaces)) + } + return n +} + +func (m *MsgSetPrecisionResponse) 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 *MsgCreateClassRequest) 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: MsgCreateClassRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClassRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Designer", 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.Designer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 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.Issuers = append(m.Issuers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + 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 *MsgCreateClassResponse) 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: MsgCreateClassResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClassResponse: 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 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.ClassId = 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 *MsgCreateBatchRequest) 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: MsgCreateBatchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateBatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Issuance", 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.Issuance = append(m.Issuance, &MsgCreateBatchRequest_BatchIssuance{}) + if err := m.Issuance[len(m.Issuance)-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 Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + 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 *MsgCreateBatchRequest_BatchIssuance) 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: BatchIssuance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchIssuance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TradableUnits", 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.TradableUnits = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetiredUnits", 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.RetiredUnits = 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 *MsgCreateBatchResponse) 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: MsgCreateBatchResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateBatchResponse: 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 + 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 *MsgSendRequest) 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: MsgSendRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", 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.Recipient = 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, &MsgSendRequest_SendUnits{}) + 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 *MsgSendRequest_SendUnits) 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: SendUnits: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SendUnits: 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 TradeableUnits", 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.TradeableUnits = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetiredUnits", 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.RetiredUnits = 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 *MsgSendResponse) 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: MsgSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendResponse: 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 *MsgRetireRequest) 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: MsgRetireRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRetireRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Holder", 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.Holder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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, &MsgRetireRequest_RetireUnits{}) + 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 *MsgRetireRequest_RetireUnits) 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: RetireUnits: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RetireUnits: 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 Units", 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.Units = 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 *MsgRetireResponse) 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: MsgRetireResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRetireResponse: 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 *MsgSetPrecisionRequest) 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: MsgSetPrecisionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPrecisionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 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 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxDecimalPlaces", wireType) + } + m.MaxDecimalPlaces = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxDecimalPlaces |= 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 *MsgSetPrecisionResponse) 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: MsgSetPrecisionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetPrecisionResponse: 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/types.pb.go b/x/ecocredit/types.pb.go new file mode 100644 index 0000000000..52f052cb3e --- /dev/null +++ b/x/ecocredit/types.pb.go @@ -0,0 +1,877 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: regen/ecocredit/v1alpha1/types.proto + +package ecocredit + +import ( + fmt "fmt" + 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 + +// ClassInfo represents the high-level on-chain information for a credit class. +type ClassInfo struct { + // class_id is the unique ID of credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // designer is the designer of the credit class. + Designer string `protobuf:"bytes,2,opt,name=designer,proto3" json:"designer,omitempty"` + // issuers are the approved issuers of the credit class. + Issuers []string `protobuf:"bytes,3,rep,name=issuers,proto3" json:"issuers,omitempty"` + // metadata is any arbitrary metadata to attached to the credit class. + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *ClassInfo) Reset() { *m = ClassInfo{} } +func (m *ClassInfo) String() string { return proto.CompactTextString(m) } +func (*ClassInfo) ProtoMessage() {} +func (*ClassInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_5342f4dcaeff1a84, []int{0} +} +func (m *ClassInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClassInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClassInfo.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 *ClassInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClassInfo.Merge(m, src) +} +func (m *ClassInfo) XXX_Size() int { + return m.Size() +} +func (m *ClassInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ClassInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ClassInfo proto.InternalMessageInfo + +func (m *ClassInfo) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *ClassInfo) GetDesigner() string { + if m != nil { + return m.Designer + } + return "" +} + +func (m *ClassInfo) GetIssuers() []string { + if m != nil { + return m.Issuers + } + return nil +} + +func (m *ClassInfo) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + +// BatchInfo represents the high-level on-chain information for a credit batch. +type BatchInfo struct { + // class_id is the unique ID of credit class. + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // batch_denom is the unique ID of credit batch. + BatchDenom string `protobuf:"bytes,2,opt,name=batch_denom,json=batchDenom,proto3" json:"batch_denom,omitempty"` + // issuer is the issuer of the credit batch. + Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"` + // total_units is the total number of units in the credit batch and is immutable. + TotalUnits string `protobuf:"bytes,4,opt,name=total_units,json=totalUnits,proto3" json:"total_units,omitempty"` + // metadata is any arbitrary metadata to attached to the credit batch. + Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *BatchInfo) Reset() { *m = BatchInfo{} } +func (m *BatchInfo) String() string { return proto.CompactTextString(m) } +func (*BatchInfo) ProtoMessage() {} +func (*BatchInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_5342f4dcaeff1a84, []int{1} +} +func (m *BatchInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BatchInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BatchInfo.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 *BatchInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchInfo.Merge(m, src) +} +func (m *BatchInfo) XXX_Size() int { + return m.Size() +} +func (m *BatchInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BatchInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchInfo proto.InternalMessageInfo + +func (m *BatchInfo) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *BatchInfo) GetBatchDenom() string { + if m != nil { + return m.BatchDenom + } + return "" +} + +func (m *BatchInfo) GetIssuer() string { + if m != nil { + return m.Issuer + } + return "" +} + +func (m *BatchInfo) GetTotalUnits() string { + if m != nil { + return m.TotalUnits + } + return "" +} + +func (m *BatchInfo) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + +func init() { + proto.RegisterType((*ClassInfo)(nil), "regen.ecocredit.v1alpha1.ClassInfo") + proto.RegisterType((*BatchInfo)(nil), "regen.ecocredit.v1alpha1.BatchInfo") +} + +func init() { + proto.RegisterFile("regen/ecocredit/v1alpha1/types.proto", fileDescriptor_5342f4dcaeff1a84) +} + +var fileDescriptor_5342f4dcaeff1a84 = []byte{ + // 294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x31, 0x4e, 0xc3, 0x30, + 0x18, 0x85, 0x6b, 0x0a, 0x6d, 0x63, 0x98, 0x32, 0x20, 0xc3, 0x60, 0xaa, 0x8a, 0xa1, 0x0b, 0x89, + 0x2a, 0x6e, 0x50, 0x58, 0x2a, 0xb6, 0x4a, 0x2c, 0x2c, 0x95, 0x13, 0xff, 0x24, 0x16, 0x89, 0x1d, + 0xd9, 0x0e, 0x94, 0x5b, 0x70, 0x00, 0x0e, 0xc4, 0xd8, 0x91, 0x11, 0x25, 0x17, 0x41, 0x36, 0x21, + 0xa8, 0x13, 0xe3, 0xf7, 0xfc, 0x9e, 0xde, 0x93, 0x7f, 0x7c, 0xa9, 0x21, 0x03, 0x19, 0x43, 0xaa, + 0x52, 0x0d, 0x5c, 0xd8, 0xf8, 0x79, 0xc1, 0x8a, 0x2a, 0x67, 0x8b, 0xd8, 0xbe, 0x56, 0x60, 0xa2, + 0x4a, 0x2b, 0xab, 0x42, 0xe2, 0x5d, 0x51, 0xef, 0x8a, 0x7e, 0x5d, 0xb3, 0x2d, 0x0e, 0x6e, 0x0a, + 0x66, 0xcc, 0x4a, 0x3e, 0xaa, 0xf0, 0x0c, 0x4f, 0x52, 0x07, 0x1b, 0xc1, 0x09, 0x9a, 0xa2, 0x79, + 0xb0, 0x1e, 0x7b, 0x5e, 0xf1, 0xf0, 0x1c, 0x4f, 0x38, 0x18, 0x91, 0x49, 0xd0, 0xe4, 0xc0, 0x3f, + 0xf5, 0x1c, 0x12, 0x3c, 0x16, 0xc6, 0xd4, 0xa0, 0x0d, 0x19, 0x4e, 0x87, 0x2e, 0xd5, 0xa1, 0x4b, + 0x95, 0x60, 0x19, 0x67, 0x96, 0x91, 0xc3, 0x29, 0x9a, 0x9f, 0xac, 0x7b, 0x9e, 0xbd, 0x23, 0x1c, + 0x2c, 0x99, 0x4d, 0xf3, 0xff, 0xaa, 0x2f, 0xf0, 0x71, 0xe2, 0x7c, 0x1b, 0x0e, 0x52, 0x95, 0x5d, + 0x3b, 0xf6, 0xd2, 0xad, 0x53, 0xc2, 0x53, 0x3c, 0xfa, 0x29, 0x24, 0x43, 0xff, 0xd6, 0x91, 0x0b, + 0x5a, 0x65, 0x59, 0xb1, 0xa9, 0xa5, 0xb0, 0xc6, 0x0f, 0x08, 0xd6, 0xd8, 0x4b, 0xf7, 0x4e, 0xd9, + 0x9b, 0x77, 0xb4, 0x3f, 0x6f, 0x79, 0xf7, 0xd1, 0x50, 0xb4, 0x6b, 0x28, 0xfa, 0x6a, 0x28, 0x7a, + 0x6b, 0xe9, 0x60, 0xd7, 0xd2, 0xc1, 0x67, 0x4b, 0x07, 0x0f, 0x8b, 0x4c, 0xd8, 0xbc, 0x4e, 0xa2, + 0x54, 0x95, 0xb1, 0xff, 0xd7, 0x2b, 0x09, 0xf6, 0x45, 0xe9, 0xa7, 0x8e, 0x0a, 0xe0, 0x19, 0xe8, + 0x78, 0xfb, 0x77, 0x94, 0x64, 0xe4, 0xcf, 0x70, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x26, 0xbd, + 0x7d, 0x8e, 0xae, 0x01, 0x00, 0x00, +} + +func (m *ClassInfo) 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 *ClassInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClassInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } + 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 = encodeVarintTypes(dAtA, i, uint64(len(m.Issuers[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Designer) > 0 { + i -= len(m.Designer) + copy(dAtA[i:], m.Designer) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Designer))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BatchInfo) 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 *BatchInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BatchInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x2a + } + if len(m.TotalUnits) > 0 { + i -= len(m.TotalUnits) + copy(dAtA[i:], m.TotalUnits) + i = encodeVarintTypes(dAtA, i, uint64(len(m.TotalUnits))) + i-- + dAtA[i] = 0x22 + } + if len(m.Issuer) > 0 { + i -= len(m.Issuer) + copy(dAtA[i:], m.Issuer) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Issuer))) + i-- + dAtA[i] = 0x1a + } + 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] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + 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 *ClassInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Designer) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Issuers) > 0 { + for _, s := range m.Issuers { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *BatchInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.BatchDenom) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Issuer) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.TotalUnits) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Metadata) + if l > 0 { + 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 *ClassInfo) 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: ClassInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClassInfo: 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 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Designer", 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.Designer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 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.Issuers = append(m.Issuers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + 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 *BatchInfo) 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: BatchInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BatchInfo: 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 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.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 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 3: + 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.Issuer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalUnits", 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.TotalUnits = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + 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") +)