diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fd0f35fe659..874f6af961b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,25 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v0.50.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.14) - 2025-07-08 + +### Bug Fixes + +* [GHSA-p22h-3m2v-cmgh](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-p22h-3m2v-cmgh) Fix x/distribution can halt when historical rewards overflow. + + +## [v0.50.13](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.13) - 2025-03-12 + +### Bug Fixes + +* [GHSA-47ww-ff84-4jrg](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-47ww-ff84-4jrg) Fix x/group can halt when erroring in EndBlocker + +## [v0.50.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.12) - 2025-02-20 + +### Bug Fixes + +* [GHSA-x5vx-95h7-rv4p](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-x5vx-95h7-rv4p) Fix Group module can halt chain when handling a malicious proposal + ## Osmosis Specific Info ## v29 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7eaf4389c4d1..3d101d3eb672 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,26 +1,15 @@ -# Cosmos SDK v0.50.11 Release Notes - -💬 [**Release Discussion**](https://github.com/orgs/cosmos/discussions/58) +# Cosmos SDK v0.50.14 Release Notes ## 🚀 Highlights -We are back on schedule for our monthly v0.50.x patch releases. -The last two months, next to ramping up on v0.52 and v2, we added a few bug fixes and (UX) improvements. +This patch release fixes [GHSA-p22h-3m2v-cmgh](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-p22h-3m2v-cmgh). +It resolves a `x/distribution` module issue that can halt chains when the historical rewards pool overflows. +Chains using the `x/distribution` module are affected by this issue. -Notable changes: +We recommended upgrading to this patch release as soon as possible. -* Fix [ABS-0043/ABS-0044](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-8wcc-m6j2-qxvm). -* New Linux-only backend that adds Linux kernel's `keyctl` support -* Skip sims test when running dry on validators +This patch is state-breaking; chains must perform a coordinated upgrade. This patch cannot be applied in a rolling upgrade. ## 📝 Changelog -Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.50.11/CHANGELOG.md) for an exhaustive list of changes, or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.50.10...v0.50.11) from the last release. - -## Maintenance Policy - -Cosmos SDK Olympus (v0.52) final release is approaching really soon. That means the Eden line (v0.50.x) will soon only be supported for bug fixes only, as per our release policy. Earlier versions are not maintained. - -Note, that the next SDK release, v0.52, does not include `x/params` migration, when migrating from < v0.47, v0.50.x **or** v0.47.x, is a mandatory migration. - -Start integrating with [Cosmos SDK Eden (v0.52)](https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#v052x) and enjoy and the new features and performance improvements. +Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.50.14/CHANGELOG.md) for an exhaustive list of changes or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.50.13...v0.50.14) from the last release. diff --git a/api/cosmos/group/v1/events.pulsar.go b/api/cosmos/group/v1/events.pulsar.go index deebbe181739..31aa8b6c7140 100644 --- a/api/cosmos/group/v1/events.pulsar.go +++ b/api/cosmos/group/v1/events.pulsar.go @@ -4388,6 +4388,474 @@ func (x *fastReflection_EventProposalPruned) ProtoMethods() *protoiface.Methods } } +var ( + md_EventTallyError protoreflect.MessageDescriptor + fd_EventTallyError_proposal_id protoreflect.FieldDescriptor + fd_EventTallyError_error_message protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_group_v1_events_proto_init() + md_EventTallyError = File_cosmos_group_v1_events_proto.Messages().ByName("EventTallyError") + fd_EventTallyError_proposal_id = md_EventTallyError.Fields().ByName("proposal_id") + fd_EventTallyError_error_message = md_EventTallyError.Fields().ByName("error_message") +} + +var _ protoreflect.Message = (*fastReflection_EventTallyError)(nil) + +type fastReflection_EventTallyError EventTallyError + +func (x *EventTallyError) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventTallyError)(x) +} + +func (x *EventTallyError) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_group_v1_events_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventTallyError_messageType fastReflection_EventTallyError_messageType +var _ protoreflect.MessageType = fastReflection_EventTallyError_messageType{} + +type fastReflection_EventTallyError_messageType struct{} + +func (x fastReflection_EventTallyError_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventTallyError)(nil) +} +func (x fastReflection_EventTallyError_messageType) New() protoreflect.Message { + return new(fastReflection_EventTallyError) +} +func (x fastReflection_EventTallyError_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventTallyError +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventTallyError) Descriptor() protoreflect.MessageDescriptor { + return md_EventTallyError +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventTallyError) Type() protoreflect.MessageType { + return _fastReflection_EventTallyError_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventTallyError) New() protoreflect.Message { + return new(fastReflection_EventTallyError) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventTallyError) Interface() protoreflect.ProtoMessage { + return (*EventTallyError)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventTallyError) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_EventTallyError_proposal_id, value) { + return + } + } + if x.ErrorMessage != "" { + value := protoreflect.ValueOfString(x.ErrorMessage) + if !f(fd_EventTallyError_error_message, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventTallyError) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + return x.ProposalId != uint64(0) + case "cosmos.group.v1.EventTallyError.error_message": + return x.ErrorMessage != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTallyError) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + x.ProposalId = uint64(0) + case "cosmos.group.v1.EventTallyError.error_message": + x.ErrorMessage = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventTallyError) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + case "cosmos.group.v1.EventTallyError.error_message": + value := x.ErrorMessage + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTallyError) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + x.ProposalId = value.Uint() + case "cosmos.group.v1.EventTallyError.error_message": + x.ErrorMessage = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTallyError) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.group.v1.EventTallyError is not mutable")) + case "cosmos.group.v1.EventTallyError.error_message": + panic(fmt.Errorf("field error_message of message cosmos.group.v1.EventTallyError is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventTallyError) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.group.v1.EventTallyError.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.group.v1.EventTallyError.error_message": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.group.v1.EventTallyError")) + } + panic(fmt.Errorf("message cosmos.group.v1.EventTallyError does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventTallyError) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.group.v1.EventTallyError", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventTallyError) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventTallyError) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventTallyError) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventTallyError) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventTallyError) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + l = len(x.ErrorMessage) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventTallyError) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ErrorMessage) > 0 { + i -= len(x.ErrorMessage) + copy(dAtA[i:], x.ErrorMessage) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if x.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventTallyError) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTallyError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventTallyError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + x.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -4818,6 +5286,52 @@ func (x *EventProposalPruned) GetTallyResult() *TallyResult { return nil } +// EventTallyError is an event emitted when a proposal tally failed with an error. +type EventTallyError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // error_message is the raw error output + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (x *EventTallyError) Reset() { + *x = EventTallyError{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_group_v1_events_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventTallyError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventTallyError) ProtoMessage() {} + +// Deprecated: Use EventTallyError.ProtoReflect.Descriptor instead. +func (*EventTallyError) Descriptor() ([]byte, []int) { + return file_cosmos_group_v1_events_proto_rawDescGZIP(), []int{10} +} + +func (x *EventTallyError) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +func (x *EventTallyError) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + var File_cosmos_group_v1_events_proto protoreflect.FileDescriptor var file_cosmos_group_v1_events_proto_rawDesc = []byte{ @@ -4878,18 +5392,24 @@ var file_cosmos_group_v1_events_proto_rawDesc = []byte{ 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0b, 0x74, - 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0xaa, 0x01, 0x0a, 0x13, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, - 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x57, 0x0a, 0x0f, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x42, 0xaa, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4904,7 +5424,7 @@ func file_cosmos_group_v1_events_proto_rawDescGZIP() []byte { return file_cosmos_group_v1_events_proto_rawDescData } -var file_cosmos_group_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_cosmos_group_v1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cosmos_group_v1_events_proto_goTypes = []interface{}{ (*EventCreateGroup)(nil), // 0: cosmos.group.v1.EventCreateGroup (*EventUpdateGroup)(nil), // 1: cosmos.group.v1.EventUpdateGroup @@ -4916,14 +5436,15 @@ var file_cosmos_group_v1_events_proto_goTypes = []interface{}{ (*EventExec)(nil), // 7: cosmos.group.v1.EventExec (*EventLeaveGroup)(nil), // 8: cosmos.group.v1.EventLeaveGroup (*EventProposalPruned)(nil), // 9: cosmos.group.v1.EventProposalPruned - (ProposalExecutorResult)(0), // 10: cosmos.group.v1.ProposalExecutorResult - (ProposalStatus)(0), // 11: cosmos.group.v1.ProposalStatus - (*TallyResult)(nil), // 12: cosmos.group.v1.TallyResult + (*EventTallyError)(nil), // 10: cosmos.group.v1.EventTallyError + (ProposalExecutorResult)(0), // 11: cosmos.group.v1.ProposalExecutorResult + (ProposalStatus)(0), // 12: cosmos.group.v1.ProposalStatus + (*TallyResult)(nil), // 13: cosmos.group.v1.TallyResult } var file_cosmos_group_v1_events_proto_depIdxs = []int32{ - 10, // 0: cosmos.group.v1.EventExec.result:type_name -> cosmos.group.v1.ProposalExecutorResult - 11, // 1: cosmos.group.v1.EventProposalPruned.status:type_name -> cosmos.group.v1.ProposalStatus - 12, // 2: cosmos.group.v1.EventProposalPruned.tally_result:type_name -> cosmos.group.v1.TallyResult + 11, // 0: cosmos.group.v1.EventExec.result:type_name -> cosmos.group.v1.ProposalExecutorResult + 12, // 1: cosmos.group.v1.EventProposalPruned.status:type_name -> cosmos.group.v1.ProposalStatus + 13, // 2: cosmos.group.v1.EventProposalPruned.tally_result:type_name -> cosmos.group.v1.TallyResult 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -5058,6 +5579,18 @@ func file_cosmos_group_v1_events_proto_init() { return nil } } + file_cosmos_group_v1_events_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventTallyError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -5065,7 +5598,7 @@ func file_cosmos_group_v1_events_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_group_v1_events_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 727718bae867..a4ecc941ec2b 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v2.0.0-beta.8] - 2025-01-29 + +* [#23544](https://github.com/cosmos/cosmos-sdk/pull/23544) Support map in queries for autocli. + ## [v2.0.0-beta.7] - 2024-12-10 ### Bug Fixes diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index dcb41bbfa25a..56bad2e3eed4 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -124,6 +124,7 @@ func (b *Builder) BuildQueryMethodCommand(ctx context.Context, descriptor protor EnumAsString: true, DoNotSortFields: true, AminoNameAsTypeURL: true, + MarshalMappings: true, TypeResolver: b.TypeResolver, FileResolver: b.FileResolver, } diff --git a/client/v2/go.mod b/client/v2/go.mod index af91c5a1ec94..edcdc1971b79 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/math v1.3.0 - cosmossdk.io/x/tx v0.13.5 + cosmossdk.io/x/tx v0.13.8 github.com/cockroachdb/errors v1.11.3 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.6 diff --git a/client/v2/go.sum b/client/v2/go.sum index dd81d4298b26..deafcc7d0478 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= -cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= +cosmossdk.io/x/tx v0.13.8 h1:dQwC8jMe7awx/edi1HPPZ40AjHnsix6KSO/jbKMUYKk= +cosmossdk.io/x/tx v0.13.8/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/docs/docs/build/building-modules/02-messages-and-queries.md b/docs/docs/build/building-modules/02-messages-and-queries.md index 573c35cd770e..a328ca725e32 100644 --- a/docs/docs/build/building-modules/02-messages-and-queries.md +++ b/docs/docs/build/building-modules/02-messages-and-queries.md @@ -24,17 +24,16 @@ When a transaction is relayed from the underlying consensus engine to the Cosmos Defining Protobuf `Msg` services is the recommended way to handle messages. A Protobuf `Msg` service should be created for each module, typically in `tx.proto` (see more info about [conventions and naming](../../learn/advanced/05-encoding.md#faq)). It must have an RPC service method defined for each message in the module. - Each `Msg` service method must have exactly one argument, which must implement the `sdk.Msg` interface, and a Protobuf response. The naming convention is to call the RPC argument `Msg` and the RPC response `MsgResponse`. For example: ```protobuf - rpc Send(MsgSend) returns (MsgSendResponse); +rpc Send(MsgSend) returns (MsgSendResponse); ``` See an example of a `Msg` service definition from `x/bank` module: ```protobuf reference -https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/bank/v1beta1/tx.proto#L13-L36 +https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/proto/cosmos/bank/v1beta1/tx.proto#L13-L41 ``` ### `sdk.Msg` Interface @@ -47,8 +46,7 @@ To attach a `ValidateBasic()` method to a message then you must add methods to t https://github.com/cosmos/cosmos-sdk/blob/9c1e8b247cd47b5d3decda6e86fbc3bc996ee5d7/types/tx_msg.go#L84-L88 ``` -In 0.50+ signers from the `GetSigners()` call is automated via a protobuf annotation. - +Signers from the `GetSigners()` call is automated via a protobuf annotation. Read more about the signer field [here](./05-protobuf-annotations.md). ```protobuf reference @@ -58,23 +56,32 @@ https://github.com/cosmos/cosmos-sdk/blob/e6848d99b55a65d014375b295bdd7f9641aac9 If there is a need for custom signers then there is an alternative path which can be taken. A function which returns `signing.CustomGetSigner` for a specific message can be defined. ```go -func ProvideBankSendTransactionGetSigners() signing.CustomGetSigner { - - // Extract the signer from the signature. - signer, err := coretypes.LatestSigner(Tx).Sender(ethTx) - if err != nil { - return nil, err - } - - // Return the signer in the required format. - return [][]byte{signer.Bytes()}, nil +func ProvideCustomMsgTransactionGetSigners() signing.CustomGetSigner { + // Extract the signer from the signature. + signer, err := coretypes.LatestSigner(Tx).Sender(ethTx) + if err != nil { + return nil, err + } + + // Return the signer in the required format. + return signing.CustomGetSigner{ + MsgType: protoreflect.FullName(gogoproto.MessageName(&types.CustomMsg{})), + Fn: func(msg proto.Message) ([][]byte, error) { + return [][]byte{signer}, nil + } + } } ``` -When using dependency injection (depinject) this can be provided to the application via the provide method. +This can be provided to the application using depinject's `Provide` method in the module that defines the type: -```go -depinject.Provide(banktypes.ProvideBankSendTransactionGetSigners) +```diff +func init() { + appconfig.RegisterModule(&modulev1.Module{}, +- appconfig.Provide(ProvideModule), ++ appconfig.Provide(ProvideModule, ProvideCustomMsgTransactionGetSigners), + ) +} ``` The Cosmos SDK uses Protobuf definitions to generate client and server code: @@ -84,7 +91,7 @@ The Cosmos SDK uses Protobuf definitions to generate client and server code: A `RegisterMsgServer` method is also generated and should be used to register the module's `MsgServer` implementation in `RegisterServices` method from the [`AppModule` interface](./01-module-manager.md#appmodule). -In order for clients (CLI and grpc-gateway) to have these URLs registered, the Cosmos SDK provides the function `RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.ServiceDesc)` that should be called inside module's [`RegisterInterfaces`](01-module-manager.md#appmodulebasic) method, using the proto-generated `&_Msg_serviceDesc` as `*grpc.ServiceDesc` argument. +In order for clients (CLI and gRPC-gateway) to have these URLs registered, the Cosmos SDK provides the function `RegisterMsgServiceDesc(registry codectypes.InterfaceRegistry, sd *grpc.ServiceDesc)` that should be called inside module's [`RegisterInterfaces`](01-module-manager.md#appmodulebasic) method, using the proto-generated `&_Msg_serviceDesc` as `*grpc.ServiceDesc` argument. ## Queries @@ -93,7 +100,7 @@ A `query` is a request for information made by end-users of applications through ### gRPC Queries -Queries should be defined using [Protobuf services](https://developers.google.com/protocol-buffers/docs/proto#services). A `Query` service should be created per module in `query.proto`. This service lists endpoints starting with `rpc`. +Queries should be defined using [Protobuf services](https://protobuf.dev/programming-guides/proto2/). A `Query` service should be created per module in `query.proto`. This service lists endpoints starting with `rpc`. Here's an example of such a `Query` service definition: @@ -105,26 +112,6 @@ As `proto.Message`s, generated `Response` types implement by default `String()` A `RegisterQueryServer` method is also generated and should be used to register the module's query server in the `RegisterServices` method from the [`AppModule` interface](./01-module-manager.md#appmodule). -### Legacy Queries - -Before the introduction of Protobuf and gRPC in the Cosmos SDK, there was usually no specific `query` object defined by module developers, contrary to `message`s. Instead, the Cosmos SDK took the simpler approach of using a simple `path` to define each `query`. The `path` contains the `query` type and all the arguments needed to process it. For most module queries, the `path` should look like the following: - -```text -queryCategory/queryRoute/queryType/arg1/arg2/... -``` - -where: - -* `queryCategory` is the category of the `query`, typically `custom` for module queries. It is used to differentiate between different kinds of queries within `BaseApp`'s [`Query` method](../../learn/advanced/00-baseapp.md#query). -* `queryRoute` is used by `BaseApp`'s [`queryRouter`](../../learn/advanced/00-baseapp.md#query-routing) to map the `query` to its module. Usually, `queryRoute` should be the name of the module. -* `queryType` is used by the module's [`querier`](./04-query-services.md#legacy-queriers) to map the `query` to the appropriate `querier function` within the module. -* `args` are the actual arguments needed to process the `query`. They are filled out by the end-user. Note that for bigger queries, you might prefer passing arguments in the `Data` field of the request `req` instead of the `path`. - -The `path` for each `query` must be defined by the module developer in the module's [command-line interface file](./09-module-interfaces.md#query-commands).Overall, there are 3 mains components module developers need to implement in order to make the subset of the state defined by their module queryable: - -* A [`querier`](./04-query-services.md#legacy-queriers), to process the `query` once it has been [routed to the module](../../learn/advanced/00-baseapp.md#query-routing). -* [Query commands](./09-module-interfaces.md#query-commands) in the module's CLI file, where the `path` for each `query` is specified. -* `query` return types. Typically defined in a file `types/querier.go`, they specify the result type of each of the module's `queries`. These custom types must implement the `String()` method of [`fmt.Stringer`](https://pkg.go.dev/fmt#Stringer). ### Store Queries diff --git a/docs/docs/user/run-node/00-keyring.md b/docs/docs/user/run-node/00-keyring.md index b4a2020068fe..f96fa7d22607 100644 --- a/docs/docs/user/run-node/00-keyring.md +++ b/docs/docs/user/run-node/00-keyring.md @@ -29,12 +29,14 @@ is a list of the most popular operating systems and their respective passwords m * GNU/Linux: * [libsecret](https://gitlab.gnome.org/GNOME/libsecret) * [kwallet](https://api.kde.org/frameworks/kwallet/html/index.html) + * [keyctl](https://www.kernel.org/doc/html/latest/security/keys/core.html) GNU/Linux distributions that use GNOME as default desktop environment typically come with [Seahorse](https://wiki.gnome.org/Apps/Seahorse). Users of KDE based distributions are commonly provided with [KDE Wallet Manager](https://userbase.kde.org/KDE_Wallet_Manager). Whilst the former is in fact a `libsecret` convenient frontend, the latter is a `kwallet` -client. +client. `keyctl` is a secure backend leverages the Linux's kernel security key management system +to store cryptographic keys securely in memory. `os` is the default option since operating system's default credentials managers are designed to meet users' most common needs and provide them with a comfortable @@ -93,6 +95,15 @@ GNU/Linux distributions that ships KDE as default desktop environment. Please re [KWallet Handbook](https://docs.kde.org/stable5/en/kdeutils/kwallet5/index.html) for more information. +### The `keyctl` backend + +The *Kernel Key Retention Service* is a security facility that +has been added to the Linux kernel relatively recently. It allows sensitive +cryptographic data such as passwords, private key, authentication tokens, etc +to be stored securely in memory. + +The `keyctl` backend is available on Linux platforms only. + ### The `test` backend The `test` backend is a password-less variation of the `file` backend. Keys are stored diff --git a/go.mod b/go.mod index fd2dfeeca6b9..72f4913c4c20 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,12 @@ require ( github.com/cockroachdb/errors v1.11.3 github.com/cometbft/cometbft v0.38.12 github.com/cosmos/btcutil v1.0.5 - github.com/cosmos/cosmos-db v1.1.0 + github.com/cosmos/cosmos-db v1.1.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogogateway v1.2.0 github.com/cosmos/gogoproto v1.7.0 - github.com/cosmos/ledger-cosmos-go v0.13.3 + github.com/cosmos/ledger-cosmos-go v0.14.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 @@ -47,11 +47,11 @@ require ( github.com/prometheus/client_golang v1.20.1 github.com/prometheus/common v0.55.0 github.com/rs/zerolog v1.33.0 - github.com/spf13/cast v1.7.0 + github.com/spf13/cast v1.7.1 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/tendermint/go-amino v0.16.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 go.opentelemetry.io/otel v1.24.0 diff --git a/go.sum b/go.sum index f2bd1daff3cf..66dad5864624 100644 --- a/go.sum +++ b/go.sum @@ -147,8 +147,8 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.1.0 h1:KLHNVQ73h7vawXTpj9UJ7ZR2IXv51tsEHkQJJ9EBDzI= -github.com/cosmos/cosmos-db v1.1.0/go.mod h1:t7c4A6cfGdpUwwVxrQ0gQLeRQqGUBJu0yvE4F/26REg= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -164,8 +164,8 @@ github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5Rtn github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= -github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -676,8 +676,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= -github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -712,8 +712,9 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= diff --git a/orm/Makefile b/orm/Makefile deleted file mode 100644 index 8914a830f72c..000000000000 --- a/orm/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -codegen: - go install ./cmd/protoc-gen-go-cosmos-orm - go install ./cmd/protoc-gen-go-cosmos-orm-proto - # generate .proto files first - (cd internal; buf generate --template buf.proto.gen.yaml) - # generate go code - (cd internal; buf generate) \ No newline at end of file diff --git a/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go b/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go deleted file mode 100644 index 0c3db5cf6b30..000000000000 --- a/orm/cmd/protoc-gen-go-cosmos-orm-proto/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "google.golang.org/protobuf/compiler/protogen" - - "cosmossdk.io/orm/internal/codegen" -) - -func main() { - protogen.Options{}.Run(codegen.QueryProtoPluginRunner) -} diff --git a/orm/cmd/protoc-gen-go-cosmos-orm/main.go b/orm/cmd/protoc-gen-go-cosmos-orm/main.go deleted file mode 100644 index bc83d887b6fe..000000000000 --- a/orm/cmd/protoc-gen-go-cosmos-orm/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "google.golang.org/protobuf/compiler/protogen" - - "cosmossdk.io/orm/internal/codegen" -) - -func main() { - protogen.Options{}.Run(codegen.ORMPluginRunner) -} diff --git a/orm/encoding/docs.go b/orm/encoding/docs.go deleted file mode 100644 index 7088a0e488e5..000000000000 --- a/orm/encoding/docs.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package encoding defines the core types and algorithms for encoding and decoding -// protobuf objects and values to/from ORM key-value pairs. -package encoding diff --git a/orm/encoding/ormfield/bytes.go b/orm/encoding/ormfield/bytes.go deleted file mode 100644 index 0eea476b8a47..000000000000 --- a/orm/encoding/ormfield/bytes.go +++ /dev/null @@ -1,121 +0,0 @@ -package ormfield - -import ( - "bytes" - "encoding/binary" - "io" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// BytesCodec encodes bytes as raw bytes. It errors if the byte array is longer -// than 255 bytes. -type BytesCodec struct{} - -func (b BytesCodec) FixedBufferSize() int { - return -1 -} - -// ComputeBufferSize returns the bytes size of the value. -func (b BytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - return bytesSize(value), nil -} - -func bytesSize(value protoreflect.Value) int { - if !value.IsValid() { - return 0 - } - return len(value.Bytes()) -} - -func (b BytesCodec) IsOrdered() bool { - return false -} - -func (b BytesCodec) Decode(r Reader) (protoreflect.Value, error) { - bz, err := io.ReadAll(r) - return protoreflect.ValueOfBytes(bz), err -} - -func (b BytesCodec) Encode(value protoreflect.Value, w io.Writer) error { - if !value.IsValid() { - return nil - } - _, err := w.Write(value.Bytes()) - return err -} - -func (b BytesCodec) Compare(v1, v2 protoreflect.Value) int { - return compareBytes(v1, v2) -} - -// NonTerminalBytesCodec encodes bytes as raw bytes length prefixed by a single -// byte. It errors if the byte array is longer than 255 bytes. -type NonTerminalBytesCodec struct{} - -func (b NonTerminalBytesCodec) FixedBufferSize() int { - return -1 -} - -// ComputeBufferSize returns the bytes size of the value plus the length of the -// varint length-prefix. -func (b NonTerminalBytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) { - n := bytesSize(value) - prefixLen := 1 - // we use varint, if the first bit of a byte is 1 then we need to signal continuation - for n >= 0x80 { - prefixLen++ - n >>= 7 - } - return n + prefixLen, nil -} - -func (b NonTerminalBytesCodec) IsOrdered() bool { - return false -} - -func (b NonTerminalBytesCodec) Compare(v1, v2 protoreflect.Value) int { - return compareBytes(v1, v2) -} - -func (b NonTerminalBytesCodec) Decode(r Reader) (protoreflect.Value, error) { - n, err := binary.ReadUvarint(r) - if err != nil { - return protoreflect.Value{}, err - } - - if n == 0 { - return protoreflect.ValueOfBytes([]byte{}), nil - } - - bz := make([]byte, n) - _, err = r.Read(bz) - return protoreflect.ValueOfBytes(bz), err -} - -func (b NonTerminalBytesCodec) Encode(value protoreflect.Value, w io.Writer) error { - var bz []byte - if value.IsValid() { - bz = value.Bytes() - } - n := len(bz) - var prefix [binary.MaxVarintLen64]byte - prefixLen := binary.PutUvarint(prefix[:], uint64(n)) - _, err := w.Write(prefix[:prefixLen]) - if err != nil { - return err - } - _, err = w.Write(bz) - return err -} - -func compareBytes(v1, v2 protoreflect.Value) int { - var bz1, bz2 []byte - if v1.IsValid() { - bz1 = v1.Bytes() - } - if v2.IsValid() { - bz2 = v2.Bytes() - } - return bytes.Compare(bz1, bz2) -} diff --git a/orm/encoding/ormfield/codec.go b/orm/encoding/ormfield/codec.go deleted file mode 100644 index f90a98f8d912..000000000000 --- a/orm/encoding/ormfield/codec.go +++ /dev/null @@ -1,113 +0,0 @@ -package ormfield - -import ( - "io" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - - "cosmossdk.io/orm/types/ormerrors" -) - -// Codec defines an interface for decoding and encoding values in ORM index keys. -type Codec interface { - // Decode decodes a value in a key. - Decode(r Reader) (protoreflect.Value, error) - - // Encode encodes a value in a key. - Encode(value protoreflect.Value, w io.Writer) error - - // Compare compares two values of this type and should primarily be used - // for testing. - Compare(v1, v2 protoreflect.Value) int - - // IsOrdered returns true if callers can always assume that this ordering - // is suitable for sorted iteration. - IsOrdered() bool - - // FixedBufferSize returns a positive value if encoders should assume a - // fixed size buffer for encoding. Encoders will use at most this much size - // to encode the value. - FixedBufferSize() int - - // ComputeBufferSize estimates the buffer size needed to encode the field. - // Encoders will use at most this much size to encode the value. - ComputeBufferSize(value protoreflect.Value) (int, error) -} - -type Reader interface { - io.Reader - io.ByteReader -} - -var ( - timestampMsgType = (×tamppb.Timestamp{}).ProtoReflect().Type() - timestampFullName = timestampMsgType.Descriptor().FullName() - durationMsgType = (&durationpb.Duration{}).ProtoReflect().Type() - durationFullName = durationMsgType.Descriptor().FullName() -) - -// GetCodec returns the Codec for the provided field if one is defined. -// nonTerminal should be set to true if this value is being encoded as a -// non-terminal segment of a multi-part key. -func GetCodec(field protoreflect.FieldDescriptor, nonTerminal bool) (Codec, error) { - if field == nil { - return nil, ormerrors.InvalidKeyField.Wrap("nil field") - } - if field.IsList() { - return nil, ormerrors.InvalidKeyField.Wrapf("repeated field %s", field.FullName()) - } - - if field.ContainingOneof() != nil { - return nil, ormerrors.InvalidKeyField.Wrapf("oneof field %s", field.FullName()) - } - - if field.HasOptionalKeyword() { - return nil, ormerrors.InvalidKeyField.Wrapf("optional field %s", field.FullName()) - } - - switch field.Kind() { - case protoreflect.BytesKind: - if nonTerminal { - return NonTerminalBytesCodec{}, nil - } - - return BytesCodec{}, nil - case protoreflect.StringKind: - if nonTerminal { - return NonTerminalStringCodec{}, nil - } - - return StringCodec{}, nil - - case protoreflect.Uint32Kind: - return CompactUint32Codec{}, nil - case protoreflect.Fixed32Kind: - return FixedUint32Codec{}, nil - case protoreflect.Uint64Kind: - return CompactUint64Codec{}, nil - case protoreflect.Fixed64Kind: - return FixedUint64Codec{}, nil - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - return Int32Codec{}, nil - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return Int64Codec{}, nil - case protoreflect.BoolKind: - return BoolCodec{}, nil - case protoreflect.EnumKind: - return EnumCodec{}, nil - case protoreflect.MessageKind: - msgName := field.Message().FullName() - switch msgName { - case timestampFullName: - return TimestampCodec{}, nil - case durationFullName: - return DurationCodec{}, nil - default: - return nil, ormerrors.InvalidKeyField.Wrapf("%s of type %s", field.FullName(), msgName) - } - default: - return nil, ormerrors.InvalidKeyField.Wrapf("%s of kind %s", field.FullName(), field.Kind()) - } -} diff --git a/orm/encoding/ormkv/codec.go b/orm/encoding/ormkv/codec.go deleted file mode 100644 index 1f93b9e54220..000000000000 --- a/orm/encoding/ormkv/codec.go +++ /dev/null @@ -1,47 +0,0 @@ -package ormkv - -import "google.golang.org/protobuf/reflect/protoreflect" - -// EntryCodec defines an interfaces for decoding and encoding entries in the -// kv-store backing an ORM instance. EntryCodec's enable full logical decoding -// of ORM data. -type EntryCodec interface { - // DecodeEntry decodes a kv-pair into an Entry. - DecodeEntry(k, v []byte) (Entry, error) - - // EncodeEntry encodes an entry into a kv-pair. - EncodeEntry(entry Entry) (k, v []byte, err error) -} - -// IndexCodec defines an interfaces for encoding and decoding index-keys in the -// kv-store. -type IndexCodec interface { - EntryCodec - - // MessageType returns the message type this index codec applies to. - MessageType() protoreflect.MessageType - - // GetFieldNames returns the field names in the key of this index. - GetFieldNames() []protoreflect.Name - - // DecodeIndexKey decodes a kv-pair into index-fields and primary-key field - // values. These fields may or may not overlap depending on the index. - DecodeIndexKey(k, v []byte) (indexFields, primaryKey []protoreflect.Value, err error) - - // EncodeKVFromMessage encodes a kv-pair for the index from a message. - EncodeKVFromMessage(message protoreflect.Message) (k, v []byte, err error) - - // CompareKeys compares the provided values which must correspond to the - // fields in this key. Prefix keys of different lengths are supported but the - // function will panic if either array is too long. A negative value is returned - // if values1 is less than values2, 0 is returned if the two arrays are equal, - // and a positive value is returned if values2 is greater. - CompareKeys(key1, key2 []protoreflect.Value) int - - // EncodeKeyFromMessage encodes the key part of this index and returns both - // index values and encoded key. - EncodeKeyFromMessage(message protoreflect.Message) (keyValues []protoreflect.Value, key []byte, err error) - - // IsFullyOrdered returns true if all fields in the key are also ordered. - IsFullyOrdered() bool -} diff --git a/orm/encoding/ormkv/entry.go b/orm/encoding/ormkv/entry.go deleted file mode 100644 index fd44833994cc..000000000000 --- a/orm/encoding/ormkv/entry.go +++ /dev/null @@ -1,135 +0,0 @@ -package ormkv - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/internal/stablejson" -) - -// Entry defines a logical representation of a kv-store entry for ORM instances. -type Entry interface { - fmt.Stringer - - // GetTableName returns the table-name (equivalent to the fully-qualified - // proto message name) this entry corresponds to. - GetTableName() protoreflect.FullName - - // to allow new methods to be added without breakage, this interface - // shouldn't be implemented outside this package, - // see https://go.dev/blog/module-compatibility - doNotImplement() -} - -// PrimaryKeyEntry represents a logically decoded primary-key entry. -type PrimaryKeyEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Key represents the primary key values. - Key []protoreflect.Value - - // Value represents the message stored under the primary key. - Value proto.Message -} - -func (p *PrimaryKeyEntry) GetTableName() protoreflect.FullName { - return p.TableName -} - -func (p *PrimaryKeyEntry) String() string { - if p.Value == nil { - return fmt.Sprintf("PK %s %s -> _", p.TableName, fmtValues(p.Key)) - } - - valBz, err := stablejson.Marshal(p.Value) - valStr := string(valBz) - if err != nil { - valStr = fmt.Sprintf("ERR %v", err) - } - return fmt.Sprintf("PK %s %s -> %s", p.TableName, fmtValues(p.Key), valStr) -} - -func fmtValues(values []protoreflect.Value) string { - if len(values) == 0 { - return "_" - } - - parts := make([]string, len(values)) - for i, v := range values { - parts[i] = fmt.Sprintf("%v", v.Interface()) - } - - return strings.Join(parts, "/") -} - -func (p *PrimaryKeyEntry) doNotImplement() {} - -// IndexKeyEntry represents a logically decoded index entry. -type IndexKeyEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Fields are the index fields this entry represents. - Fields []protoreflect.Name - - // IsUnique indicates whether this index is unique or not. - IsUnique bool - - // IndexValues represent the index values. - IndexValues []protoreflect.Value - - // PrimaryKey represents the primary key values, it is empty if this is a - // prefix key - PrimaryKey []protoreflect.Value -} - -func (i *IndexKeyEntry) GetTableName() protoreflect.FullName { - return i.TableName -} - -func (i *IndexKeyEntry) doNotImplement() {} - -func (i *IndexKeyEntry) string() string { - return fmt.Sprintf("%s %s : %s -> %s", i.TableName, fmtFields(i.Fields), fmtValues(i.IndexValues), fmtValues(i.PrimaryKey)) -} - -func fmtFields(fields []protoreflect.Name) string { - strs := make([]string, len(fields)) - for i, field := range fields { - strs[i] = string(field) - } - return strings.Join(strs, "/") -} - -func (i *IndexKeyEntry) String() string { - if i.IsUnique { - return fmt.Sprintf("UNIQ %s", i.string()) - } - - return fmt.Sprintf("IDX %s", i.string()) -} - -// SeqEntry represents a sequence for tables with auto-incrementing primary keys. -type SeqEntry struct { - // TableName is the table this entry represents. - TableName protoreflect.FullName - - // Value is the uint64 value stored for this sequence. - Value uint64 -} - -func (s *SeqEntry) GetTableName() protoreflect.FullName { - return s.TableName -} - -func (s *SeqEntry) doNotImplement() {} - -func (s *SeqEntry) String() string { - return fmt.Sprintf("SEQ %s %d", s.TableName, s.Value) -} - -var _, _, _ Entry = &PrimaryKeyEntry{}, &IndexKeyEntry{}, &SeqEntry{} diff --git a/orm/encoding/ormkv/entry_test.go b/orm/encoding/ormkv/entry_test.go deleted file mode 100644 index 91c9fd9e251e..000000000000 --- a/orm/encoding/ormkv/entry_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package ormkv_test - -import ( - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -var aFullName = (&testpb.ExampleTable{}).ProtoReflect().Descriptor().FullName() - -func TestPrimaryKeyEntry(t *testing.T) { - entry := &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: encodeutil.ValuesOf(uint32(1), "abc"), - Value: &testpb.ExampleTable{I32: -1}, - } - assert.Equal(t, `PK testpb.ExampleTable 1/abc -> {"i32":-1}`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: encodeutil.ValuesOf(uint32(1), "abc"), - Value: nil, - } - assert.Equal(t, `PK testpb.ExampleTable 1/abc -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) -} - -func TestIndexKeyEntry(t *testing.T) { - entry := &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32", "i32", "str"}, - IsUnique: false, - IndexValues: encodeutil.ValuesOf(uint32(10), int32(-1), "abc"), - PrimaryKey: encodeutil.ValuesOf("abc", int32(-1)), - } - assert.Equal(t, `IDX testpb.ExampleTable u32/i32/str : 10/-1/abc -> abc/-1`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32"}, - IsUnique: true, - IndexValues: encodeutil.ValuesOf(uint32(10)), - PrimaryKey: encodeutil.ValuesOf("abc", int32(-1)), - } - assert.Equal(t, `UNIQ testpb.ExampleTable u32 : 10 -> abc/-1`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"u32", "i32", "str"}, - IsUnique: false, - IndexValues: encodeutil.ValuesOf(uint32(10), int32(-1)), - } - assert.Equal(t, `IDX testpb.ExampleTable u32/i32/str : 10/-1 -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) - - // prefix key - entry = &ormkv.IndexKeyEntry{ - TableName: aFullName, - Fields: []protoreflect.Name{"str", "i32"}, - IsUnique: true, - IndexValues: encodeutil.ValuesOf("abc", int32(1)), - } - assert.Equal(t, `UNIQ testpb.ExampleTable str/i32 : abc/1 -> _`, entry.String()) - assert.Equal(t, aFullName, entry.GetTableName()) -} diff --git a/orm/encoding/ormkv/index_key_test.go b/orm/encoding/ormkv/index_key_test.go deleted file mode 100644 index eefcef35e205..000000000000 --- a/orm/encoding/ormkv/index_key_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "fmt" - "testing" - - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestIndexKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - idxPartCdc := testutil.TestKeyCodecGen(1, 5).Draw(t, "idxPartCdc") - pkCodec := testutil.TestKeyCodecGen(1, 5).Draw(t, "pkCdc") - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - messageType := (&testpb.ExampleTable{}).ProtoReflect().Type() - indexKeyCdc, err := ormkv.NewIndexKeyCodec( - prefix, - messageType, - idxPartCdc.Codec.GetFieldNames(), - pkCodec.Codec.GetFieldNames(), - ) - assert.NilError(t, err) - for i := 0; i < 100; i++ { - a := testutil.GenA.Draw(t, fmt.Sprintf("a%d", i)) - key := indexKeyCdc.GetKeyValues(a.ProtoReflect()) - pk := pkCodec.Codec.GetKeyValues(a.ProtoReflect()) - idx1 := &ormkv.IndexKeyEntry{ - TableName: messageType.Descriptor().FullName(), - Fields: indexKeyCdc.GetFieldNames(), - IsUnique: false, - IndexValues: key, - PrimaryKey: pk, - } - k, v, err := indexKeyCdc.EncodeEntry(idx1) - assert.NilError(t, err) - - k2, v2, err := indexKeyCdc.EncodeKVFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, k2)) - assert.Assert(t, bytes.Equal(v, v2)) - - entry2, err := indexKeyCdc.DecodeEntry(k, v) - assert.NilError(t, err) - idx2 := entry2.(*ormkv.IndexKeyEntry) - assert.Equal(t, 0, indexKeyCdc.CompareKeys(idx1.IndexValues, idx2.IndexValues)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(idx1.PrimaryKey, idx2.PrimaryKey)) - assert.Equal(t, false, idx2.IsUnique) - assert.Equal(t, messageType.Descriptor().FullName(), idx2.TableName) - assert.DeepEqual(t, idx1.Fields, idx2.Fields) - - idxFields, pk2, err := indexKeyCdc.DecodeIndexKey(k, v) - assert.NilError(t, err) - assert.Equal(t, 0, indexKeyCdc.CompareKeys(key, idxFields)) - assert.Equal(t, 0, pkCodec.Codec.CompareKeys(pk, pk2)) - } - }) -} diff --git a/orm/encoding/ormkv/key_codec_test.go b/orm/encoding/ormkv/key_codec_test.go deleted file mode 100644 index 7f078504fb35..000000000000 --- a/orm/encoding/ormkv/key_codec_test.go +++ /dev/null @@ -1,317 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "io" - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - key := testutil.TestKeyCodecGen(0, 5).Draw(t, "key") - for i := 0; i < 100; i++ { - keyValues := key.Draw(t, "values") - - bz1 := assertEncDecKey(t, key, keyValues) - - if key.Codec.IsFullyOrdered() { - // check if ordered keys have ordered encodings - keyValues2 := key.Draw(t, "values2") - bz2 := assertEncDecKey(t, key, keyValues2) - // bytes comparison should equal comparison of values - assert.Equal(t, key.Codec.CompareKeys(keyValues, keyValues2), bytes.Compare(bz1, bz2)) - } - } - }) -} - -func assertEncDecKey(t *rapid.T, key testutil.TestKeyCodec, keyValues []protoreflect.Value) []byte { - bz, err := key.Codec.EncodeKey(keyValues) - assert.NilError(t, err) - keyValues2, err := key.Codec.DecodeKey(bytes.NewReader(bz)) - assert.NilError(t, err) - assert.Equal(t, 0, key.Codec.CompareKeys(keyValues, keyValues2)) - return bz -} - -func TestCompareValues(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "i32"}) - assert.NilError(t, err) - - tests := []struct { - name string - values1 []protoreflect.Value - values2 []protoreflect.Value - expect int - validRange bool - }{ - { - "eq", - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - 0, - false, - }, - { - "eq prefix 0", - encodeutil.ValuesOf(), - encodeutil.ValuesOf(), - 0, - false, - }, - { - "eq prefix 1", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0)), - 0, - false, - }, - { - "eq prefix 2", - encodeutil.ValuesOf(uint32(0), "abc"), - encodeutil.ValuesOf(uint32(0), "abc"), - 0, - false, - }, - { - "lt1", - encodeutil.ValuesOf(uint32(0), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(1), "abc", int32(-3)), - -1, - true, - }, - { - "lt2", - encodeutil.ValuesOf(uint32(1), "abb", int32(-3)), - encodeutil.ValuesOf(uint32(1), "abc", int32(-3)), - -1, - true, - }, - { - "lt3", - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-3)), - -1, - true, - }, - { - "less prefix 0", - encodeutil.ValuesOf(), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "less prefix 1", - encodeutil.ValuesOf(uint32(1)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "less prefix 2", - encodeutil.ValuesOf(uint32(1), "abb"), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - -1, - true, - }, - { - "gt1", - encodeutil.ValuesOf(uint32(2), "abb", int32(-4)), - encodeutil.ValuesOf(uint32(1), "abb", int32(-4)), - 1, - false, - }, - { - "gt2", - encodeutil.ValuesOf(uint32(2), "abc", int32(-4)), - encodeutil.ValuesOf(uint32(2), "abb", int32(-4)), - 1, - false, - }, - { - "gt3", - encodeutil.ValuesOf(uint32(2), "abc", int32(1)), - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - 1, - false, - }, - { - "gt prefix 0", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(), - 1, - true, - }, - { - "gt prefix 1", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(2)), - 1, - true, - }, - { - "gt prefix 2", - encodeutil.ValuesOf(uint32(2), "abc", int32(-3)), - encodeutil.ValuesOf(uint32(2), "abc"), - 1, - true, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - assert.Equal( - t, test.expect, - cdc.CompareKeys(test.values1, test.values2), - ) - // CheckValidRangeIterationKeys should give comparable results - err := cdc.CheckValidRangeIterationKeys(test.values1, test.values2) - if test.validRange { - assert.NilError(t, err) - } else { - assert.ErrorContains(t, err, "") - } - }) - } -} - -func TestDecodePrefixKey(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "bz", "i32"}) - - assert.NilError(t, err) - tests := []struct { - name string - values []protoreflect.Value - }{ - { - "1", - encodeutil.ValuesOf(uint32(5), "abc"), - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - bz, err := cdc.EncodeKey(test.values) - assert.NilError(t, err) - values, err := cdc.DecodeKey(bytes.NewReader(bz)) - assert.ErrorIs(t, err, io.EOF) - assert.Equal(t, 0, cdc.CompareKeys(test.values, values)) - }) - } -} - -func TestValidRangeIterationKeys(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "bz", "i32"}) - assert.NilError(t, err) - - tests := []struct { - name string - values1 []protoreflect.Value - values2 []protoreflect.Value - expectErr bool - }{ - { - "1 eq", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0)), - true, - }, - { - "1 lt", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(1)), - false, - }, - { - "1 gt", - encodeutil.ValuesOf(uint32(1)), - encodeutil.ValuesOf(uint32(0)), - true, - }, - { - "1,2 lt", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0), "abc"), - false, - }, - { - "1,2 gt", - encodeutil.ValuesOf(uint32(0), "abc"), - encodeutil.ValuesOf(uint32(0)), - false, - }, - { - "1,2,3", - encodeutil.ValuesOf(uint32(0)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}), - true, - }, - { - "1,2,3,4 lt", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - false, - }, - { - "too long", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1), int32(1)), - true, - }, - { - "1,2,3,4 eq", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(1)), - true, - }, - { - "1,2,3,4 bz err", - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2}, int32(-1)), - encodeutil.ValuesOf(uint32(0), "abc", []byte{1, 2, 3}, int32(1)), - true, - }, - } - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - err := cdc.CheckValidRangeIterationKeys(test.values1, test.values2) - if test.expectErr { - assert.ErrorContains(t, err, "") - } else { - assert.NilError(t, err) - } - }) - } -} - -func TestGetSet(t *testing.T) { - cdc, err := ormkv.NewKeyCodec(nil, - (&testpb.ExampleTable{}).ProtoReflect().Type(), - []protoreflect.Name{"u32", "str", "i32"}) - assert.NilError(t, err) - - var a testpb.ExampleTable - values := encodeutil.ValuesOf(uint32(4), "abc", int32(1)) - cdc.SetKeyValues(a.ProtoReflect(), values) - values2 := cdc.GetKeyValues(a.ProtoReflect()) - assert.Equal(t, 0, cdc.CompareKeys(values, values2)) - bz, err := cdc.EncodeKey(values) - assert.NilError(t, err) - values3, bz2, err := cdc.EncodeKeyFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Equal(t, 0, cdc.CompareKeys(values, values3)) - assert.Assert(t, bytes.Equal(bz, bz2)) -} diff --git a/orm/encoding/ormkv/primary_key_test.go b/orm/encoding/ormkv/primary_key_test.go deleted file mode 100644 index 6ae43a8c0ba7..000000000000 --- a/orm/encoding/ormkv/primary_key_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "fmt" - "testing" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/internal/testutil" -) - -func TestPrimaryKeyCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - keyCodec := testutil.TestKeyCodecGen(0, 5).Draw(t, "keyCodec") - pkCodec, err := ormkv.NewPrimaryKeyCodec( - keyCodec.Codec.Prefix(), - (&testpb.ExampleTable{}).ProtoReflect().Type(), - keyCodec.Codec.GetFieldNames(), - proto.UnmarshalOptions{}, - ) - assert.NilError(t, err) - for i := 0; i < 100; i++ { - a := testutil.GenA.Draw(t, fmt.Sprintf("a%d", i)) - key := keyCodec.Codec.GetKeyValues(a.ProtoReflect()) - pk1 := &ormkv.PrimaryKeyEntry{ - TableName: aFullName, - Key: key, - Value: a, - } - k, v, err := pkCodec.EncodeEntry(pk1) - assert.NilError(t, err) - - k2, v2, err := pkCodec.EncodeKVFromMessage(a.ProtoReflect()) - assert.NilError(t, err) - assert.Assert(t, bytes.Equal(k, k2)) - assert.Assert(t, bytes.Equal(v, v2)) - - entry2, err := pkCodec.DecodeEntry(k, v) - assert.NilError(t, err) - pk2 := entry2.(*ormkv.PrimaryKeyEntry) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, pk2.Key)) - assert.DeepEqual(t, pk1.Value, pk2.Value, protocmp.Transform()) - - idxFields, pk3, err := pkCodec.DecodeIndexKey(k, v) - assert.NilError(t, err) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, pk3)) - assert.Equal(t, 0, pkCodec.CompareKeys(pk1.Key, idxFields)) - - pkCodec.ClearValues(a.ProtoReflect()) - pkCodec.SetKeyValues(a.ProtoReflect(), pk1.Key) - assert.DeepEqual(t, a, pk2.Value, protocmp.Transform()) - } - }) -} diff --git a/orm/encoding/ormkv/seq.go b/orm/encoding/ormkv/seq.go deleted file mode 100644 index ace5fe3d2eba..000000000000 --- a/orm/encoding/ormkv/seq.go +++ /dev/null @@ -1,69 +0,0 @@ -package ormkv - -import ( - "bytes" - "encoding/binary" - - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/types/ormerrors" -) - -// SeqCodec is the codec for auto-incrementing uint64 primary key sequences. -type SeqCodec struct { - messageType protoreflect.FullName - prefix []byte -} - -// NewSeqCodec creates a new SeqCodec. -func NewSeqCodec(messageType protoreflect.MessageType, prefix []byte) *SeqCodec { - return &SeqCodec{messageType: messageType.Descriptor().FullName(), prefix: prefix} -} - -var _ EntryCodec = &SeqCodec{} - -func (s SeqCodec) DecodeEntry(k, v []byte) (Entry, error) { - if !bytes.Equal(k, s.prefix) { - return nil, ormerrors.UnexpectedDecodePrefix - } - - x, err := s.DecodeValue(v) - if err != nil { - return nil, err - } - - return &SeqEntry{ - TableName: s.messageType, - Value: x, - }, nil -} - -func (s SeqCodec) EncodeEntry(entry Entry) (k, v []byte, err error) { - seqEntry, ok := entry.(*SeqEntry) - if !ok { - return nil, nil, ormerrors.BadDecodeEntry - } - - if seqEntry.TableName != s.messageType { - return nil, nil, ormerrors.BadDecodeEntry - } - - return s.prefix, s.EncodeValue(seqEntry.Value), nil -} - -func (s SeqCodec) Prefix() []byte { - return s.prefix -} - -func (s SeqCodec) EncodeValue(seq uint64) (v []byte) { - bz := make([]byte, binary.MaxVarintLen64) - n := binary.PutUvarint(bz, seq) - return bz[:n] -} - -func (s SeqCodec) DecodeValue(v []byte) (uint64, error) { - if len(v) == 0 { - return 0, nil - } - return binary.ReadUvarint(bytes.NewReader(v)) -} diff --git a/orm/encoding/ormkv/seq_test.go b/orm/encoding/ormkv/seq_test.go deleted file mode 100644 index 4b9742a25719..000000000000 --- a/orm/encoding/ormkv/seq_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package ormkv_test - -import ( - "bytes" - "testing" - - "gotest.tools/v3/assert" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -func TestSeqCodec(t *testing.T) { - rapid.Check(t, func(t *rapid.T) { - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - typ := (&testpb.ExampleTable{}).ProtoReflect().Type() - tableName := typ.Descriptor().FullName() - cdc := ormkv.NewSeqCodec(typ, prefix) - - seq, err := cdc.DecodeValue(nil) - assert.NilError(t, err) - assert.Equal(t, uint64(0), seq) - - seq, err = cdc.DecodeValue([]byte{}) - assert.NilError(t, err) - assert.Equal(t, uint64(0), seq) - - seq = rapid.Uint64().Draw(t, "seq") - - v := cdc.EncodeValue(seq) - seq2, err := cdc.DecodeValue(v) - assert.NilError(t, err) - assert.Equal(t, seq, seq2) - - entry := &ormkv.SeqEntry{ - TableName: tableName, - Value: seq, - } - k, v, err := cdc.EncodeEntry(entry) - assert.NilError(t, err) - entry2, err := cdc.DecodeEntry(k, v) - assert.NilError(t, err) - assert.DeepEqual(t, entry, entry2) - assert.Assert(t, bytes.Equal(cdc.Prefix(), k)) - }) -} diff --git a/orm/features/table/saving.feature b/orm/features/table/saving.feature deleted file mode 100644 index 59c6151971b9..000000000000 --- a/orm/features/table/saving.feature +++ /dev/null @@ -1,49 +0,0 @@ -Feature: inserting, updating and saving entities - - Scenario: can't insert an entity with a duplicate primary key - Given an existing entity - """ - {"name": "foo", "not_unique": "bar"} - """ - When I insert - """ - {"name": "foo", "not_unique": "baz"} - """ - Then expect a "already exists" error - And expect grpc error code "ALREADY_EXISTS" - - Scenario: can't update entity that doesn't exist - When I update - """ - {"name":"foo"} - """ - Then expect a "not found" error - And expect grpc error code "NOT_FOUND" -# - Scenario: can't violate unique constraint on insert - Given an existing entity - """ - {"name": "foo", "unique": "bar"} - """ - When I insert - """ - {"name": "baz", "unique": "bar"} - """ - Then expect a "unique key violation" error - And expect grpc error code "FAILED_PRECONDITION" - - Scenario: can't violate unique constraint on update - Given an existing entity - """ - {"name": "foo", "unique": "bar"} - """ - And an existing entity - """ - {"name": "baz", "unique": "bam"} - """ - When I update - """ - {"name": "baz", "unique": "bar"} - """ - Then expect a "unique key violation" error - And expect grpc error code "FAILED_PRECONDITION" diff --git a/orm/internal/buf.gen.yaml b/orm/internal/buf.gen.yaml deleted file mode 100644 index 7baeb94c19a7..000000000000 --- a/orm/internal/buf.gen.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: cosmossdk.io/orm/internal - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api -plugins: - - name: go - out: . - opt: paths=source_relative - - name: go-grpc - out: . - opt: paths=source_relative - - name: go-cosmos-orm - out: . - opt: paths=source_relative diff --git a/orm/internal/buf.proto.gen.yaml b/orm/internal/buf.proto.gen.yaml deleted file mode 100644 index 8f6ad94efa82..000000000000 --- a/orm/internal/buf.proto.gen.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: cosmossdk.io/orm/internal - override: - buf.build/cosmos/cosmos-sdk: cosmossdk.io/api -plugins: - - name: go-cosmos-orm-proto - out: . - opt: paths=source_relative diff --git a/orm/internal/buf.yaml b/orm/internal/buf.yaml deleted file mode 100644 index ac1df238ebec..000000000000 --- a/orm/internal/buf.yaml +++ /dev/null @@ -1,9 +0,0 @@ -version: v1 -lint: - use: - - DEFAULT - except: - - PACKAGE_VERSION_SUFFIX -breaking: - ignore: - - testpb diff --git a/orm/internal/codegen/codegen.go b/orm/internal/codegen/codegen.go deleted file mode 100644 index 8f253f3f672b..000000000000 --- a/orm/internal/codegen/codegen.go +++ /dev/null @@ -1,91 +0,0 @@ -package codegen - -import ( - "fmt" - "os" - - "github.com/cosmos/cosmos-proto/generator" - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/pluginpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" -) - -const ( - contextPkg = protogen.GoImportPath("context") - ormListPkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormlist") - ormErrPkg = protogen.GoImportPath("cosmossdk.io/orm/types/ormerrors") - ormTablePkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormtable") -) - -func ORMPluginRunner(p *protogen.Plugin) error { - p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) - for _, f := range p.Files { - if !f.Generate { - continue - } - - if !hasTables(f) { - continue - } - - gen := p.NewGeneratedFile(fmt.Sprintf("%s.cosmos_orm.go", f.GeneratedFilenamePrefix), f.GoImportPath) - cgen := &generator.GeneratedFile{ - GeneratedFile: gen, - LocalPackages: map[string]bool{}, - } - fgen := fileGen{GeneratedFile: cgen, file: f} - err := fgen.gen() - if err != nil { - return err - } - } - - return nil -} - -func QueryProtoPluginRunner(p *protogen.Plugin) error { - p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) - for _, f := range p.Files { - if !f.Generate { - continue - } - - if !hasTables(f) { - continue - } - - out, err := os.OpenFile(fmt.Sprintf("%s_query.proto", f.GeneratedFilenamePrefix), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o644) - if err != nil { - return err - } - - err = queryProtoGen{ - File: f, - svc: newWriter(), - msgs: newWriter(), - outFile: out, - imports: map[string]bool{}, - }.gen() - if err != nil { - return err - } - } - - return nil -} - -func hasTables(file *protogen.File) bool { - for _, message := range file.Messages { - if proto.GetExtension(message.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) != nil { - return true - } - - if proto.GetExtension(message.Desc.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) != nil { - return true - } - } - - return false -} diff --git a/orm/internal/codegen/singleton.go b/orm/internal/codegen/singleton.go deleted file mode 100644 index 639fe256b9f2..000000000000 --- a/orm/internal/codegen/singleton.go +++ /dev/null @@ -1,85 +0,0 @@ -package codegen - -import ( - "fmt" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/types/dynamicpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - "cosmossdk.io/orm/model/ormtable" -) - -type singletonGen struct { - fileGen - msg *protogen.Message - table *ormv1.SingletonDescriptor - ormTable ormtable.Table -} - -func newSingletonGen(fileGen fileGen, msg *protogen.Message, table *ormv1.SingletonDescriptor) (*singletonGen, error) { - s := &singletonGen{fileGen: fileGen, msg: msg, table: table} - var err error - s.ormTable, err = ormtable.Build(ormtable.Options{ - MessageType: dynamicpb.NewMessageType(msg.Desc), - SingletonDescriptor: table, - }) - return s, err -} - -func (s singletonGen) gen() { - s.genInterface() - s.genStruct() - s.genInterfaceGuard() - s.genMethods() - s.genConstructor() -} - -func (s singletonGen) genInterface() { - s.P("// singleton store") - s.P("type ", s.messageTableInterfaceName(s.msg), " interface {") - s.P("Get(ctx ", contextPkg.Ident("Context"), ") (*", s.msg.GoIdent.GoName, ", error)") - s.P("Save(ctx ", contextPkg.Ident("Context"), ", ", s.param(s.msg.GoIdent.GoName), "*", s.msg.GoIdent.GoName, ") error") - s.P("}") - s.P() -} - -func (s singletonGen) genStruct() { - s.P("type ", s.messageTableReceiverName(s.msg), " struct {") - s.P("table ", ormTablePkg.Ident("Table")) - s.P("}") - s.P() -} - -func (s singletonGen) genInterfaceGuard() { - s.P("var _ ", s.messageTableInterfaceName(s.msg), " = ", s.messageTableReceiverName(s.msg), "{}") -} - -func (s singletonGen) genMethods() { - receiver := fmt.Sprintf("func (x %s) ", s.messageTableReceiverName(s.msg)) - varName := s.param(s.msg.GoIdent.GoName) - // Get - s.P(receiver, "Get(ctx ", contextPkg.Ident("Context"), ") (*", s.msg.GoIdent.GoName, ", error) {") - s.P(varName, " := &", s.msg.GoIdent.GoName, "{}") - s.P("_, err := x.table.Get(ctx, ", varName, ")") - s.P("return ", varName, ", err") - s.P("}") - s.P() - - // Save - s.P(receiver, "Save(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", s.msg.GoIdent.GoName, ") error {") - s.P("return x.table.Save(ctx, ", varName, ")") - s.P("}") - s.P() -} - -func (s singletonGen) genConstructor() { - iface := s.messageTableInterfaceName(s.msg) - s.P("func New", iface, "(db ", ormTablePkg.Ident("Schema"), ") (", iface, ", error) {") - s.P("table := db.GetTable(&", s.msg.GoIdent.GoName, "{})") - s.P("if table == nil {") - s.P("return nil, ", ormErrPkg.Ident("TableNotFound.Wrap"), "(string((&", s.msg.GoIdent.GoName, "{}).ProtoReflect().Descriptor().FullName()))") - s.P("}") - s.P("return &", s.messageTableReceiverName(s.msg), "{table}, nil") - s.P("}") -} diff --git a/orm/internal/codegen/table.go b/orm/internal/codegen/table.go deleted file mode 100644 index 9363fab03696..000000000000 --- a/orm/internal/codegen/table.go +++ /dev/null @@ -1,304 +0,0 @@ -//nolint:unused // ignore unused code linting -package codegen - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/compiler/protogen" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/dynamicpb" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormtable" -) - -type tableGen struct { - fileGen - msg *protogen.Message - table *ormv1.TableDescriptor - primaryKeyFields fieldnames.FieldNames - fields map[protoreflect.Name]*protogen.Field - uniqueIndexes []*ormv1.SecondaryIndexDescriptor - ormTable ormtable.Table -} - -const notFoundDocs = " returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found." - -func newTableGen(fileGen fileGen, msg *protogen.Message, table *ormv1.TableDescriptor) (*tableGen, error) { - t := &tableGen{fileGen: fileGen, msg: msg, table: table, fields: map[protoreflect.Name]*protogen.Field{}} - t.primaryKeyFields = fieldnames.CommaSeparatedFieldNames(table.PrimaryKey.Fields) - for _, field := range msg.Fields { - t.fields[field.Desc.Name()] = field - } - uniqIndexes := make([]*ormv1.SecondaryIndexDescriptor, 0) - for _, idx := range t.table.Index { - if idx.Unique { - uniqIndexes = append(uniqIndexes, idx) - } - } - t.uniqueIndexes = uniqIndexes - var err error - t.ormTable, err = ormtable.Build(ormtable.Options{ - MessageType: dynamicpb.NewMessageType(msg.Desc), - TableDescriptor: table, - }) - return t, err -} - -func (t tableGen) gen() { - t.getTableInterface() - t.genIterator() - t.genIndexKeys() - t.genStruct() - t.genTableImpl() - t.genTableImplGuard() - t.genConstructor() -} - -func (t tableGen) getTableInterface() { - t.P("type ", t.messageTableInterfaceName(t.msg), " interface {") - t.P("Insert(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - if t.table.PrimaryKey.AutoIncrement { - t.P("InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") (uint64, error)") - t.P("LastInsertedSequence(ctx ", contextPkg.Ident("Context"), ") (uint64, error)") - } - t.P("Update(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Save(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Delete(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error") - t.P("Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error)") - t.P("// Get", notFoundDocs) - t.P("Get(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (*", t.QualifiedGoIdent(t.msg.GoIdent), ", error)") - - for _, idx := range t.uniqueIndexes { - t.genUniqueIndexSig(idx) - } - t.P("List(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") ", "(", t.iteratorName(), ", error)") - t.P("ListRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") ", "(", t.iteratorName(), ", error)") - t.P("DeleteBy(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ") error") - t.P("DeleteRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ") error") - t.P() - t.P("doNotImplement()") - t.P("}") - t.P() -} - -// returns the has and get (in that order) function signature for unique indexes. -func (t tableGen) uniqueIndexSig(idxFields string) (string, string, string) { - fieldsSlc := strings.Split(idxFields, ",") - camelFields := fieldsToCamelCase(idxFields) - - hasFuncName := "HasBy" + camelFields - getFuncName := "GetBy" + camelFields - args := t.fieldArgsFromStringSlice(fieldsSlc) - - hasFuncSig := fmt.Sprintf("%s (ctx context.Context, %s) (found bool, err error)", hasFuncName, args) - getFuncSig := fmt.Sprintf("%s (ctx context.Context, %s) (*%s, error)", getFuncName, args, t.msg.GoIdent.GoName) - return hasFuncSig, getFuncSig, getFuncName -} - -func (t tableGen) genUniqueIndexSig(idx *ormv1.SecondaryIndexDescriptor) { - hasSig, getSig, getFuncName := t.uniqueIndexSig(idx.Fields) - t.P(hasSig) - t.P("// ", getFuncName, notFoundDocs) - t.P(getSig) -} - -func (t tableGen) iteratorName() string { - return t.msg.GoIdent.GoName + "Iterator" -} - -func (t tableGen) getSig() string { - res := "Get" + t.msg.GoIdent.GoName + "(" - res += t.fieldsArgs(t.primaryKeyFields.Names()) - res += ") (*" + t.QualifiedGoIdent(t.msg.GoIdent) + ", error)" - return res -} - -func (t tableGen) hasSig() string { - t.P("Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error)") - return "" -} - -func (t tableGen) listSig() string { - res := "List" + t.msg.GoIdent.GoName + "(" - res += t.indexKeyInterfaceName() - res += ") (" - res += t.iteratorName() - res += ", error)" - return res -} - -func (t tableGen) fieldArgsFromStringSlice(names []string) string { - args := make([]string, len(names)) - for i, name := range names { - args[i] = t.fieldArg(protoreflect.Name(name)) - } - return strings.Join(args, ",") -} - -func (t tableGen) fieldsArgs(names []protoreflect.Name) string { - var params []string - for _, name := range names { - params = append(params, t.fieldArg(name)) - } - return strings.Join(params, ",") -} - -func (t tableGen) fieldArg(name protoreflect.Name) string { - typ, pointer := t.GeneratedFile.FieldGoType(t.fields[name]) - if pointer { - typ = "*" + typ - } - return string(name) + " " + typ -} - -func (t tableGen) genStruct() { - t.P("type ", t.messageTableReceiverName(t.msg), " struct {") - if t.table.PrimaryKey.AutoIncrement { - t.P("table ", ormTablePkg.Ident("AutoIncrementTable")) - } else { - t.P("table ", ormTablePkg.Ident("Table")) - } - t.P("}") - t.storeStructName() -} - -func (t tableGen) genTableImpl() { - receiverVar := "this" - receiver := fmt.Sprintf("func (%s %s) ", receiverVar, t.messageTableReceiverName(t.msg)) - varName := t.param(t.msg.GoIdent.GoName) - varTypeName := t.QualifiedGoIdent(t.msg.GoIdent) - - // these methods all have the same impl sans their names. so we can just loop and replace. - methods := []string{"Insert", "Update", "Save", "Delete"} - for _, method := range methods { - t.P(receiver, method, "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") error {") - t.P("return ", receiverVar, ".table.", method, "(ctx, ", varName, ")") - t.P("}") - t.P() - } - - if t.table.PrimaryKey.AutoIncrement { - t.P(receiver, "InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") (uint64, error) {") - t.P("return ", receiverVar, ".table.InsertReturningPKey(ctx, ", varName, ")") - t.P("}") - t.P() - - t.P(receiver, "LastInsertedSequence(ctx ", contextPkg.Ident("Context"), ") (uint64, error) {") - t.P("return ", receiverVar, ".table.LastInsertedSequence(ctx)") - t.P("}") - t.P() - } - - // Has - t.P(receiver, "Has(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (found bool, err error) {") - t.P("return ", receiverVar, ".table.PrimaryKey().Has(ctx, ", t.primaryKeyFields.String(), ")") - t.P("}") - t.P() - - // Get - t.P(receiver, "Get(ctx ", contextPkg.Ident("Context"), ", ", t.fieldsArgs(t.primaryKeyFields.Names()), ") (*", varTypeName, ", error) {") - t.P("var ", varName, " ", varTypeName) - t.P("found, err := ", receiverVar, ".table.PrimaryKey().Get(ctx, &", varName, ", ", t.primaryKeyFields.String(), ")") - t.P("if err != nil {") - t.P("return nil, err") - t.P("}") - t.P("if !found {") - t.P("return nil, ", ormErrPkg.Ident("NotFound")) - t.P("}") - t.P("return &", varName, ", nil") - t.P("}") - t.P() - - for _, idx := range t.uniqueIndexes { - fields := strings.Split(idx.Fields, ",") - hasName, getName, _ := t.uniqueIndexSig(idx.Fields) - - // has - t.P("func (", receiverVar, " ", t.messageTableReceiverName(t.msg), ") ", hasName, "{") - t.P("return ", receiverVar, ".table.GetIndexByID(", idx.Id, ").(", - ormTablePkg.Ident("UniqueIndex"), ").Has(ctx,") - for _, field := range fields { - t.P(field, ",") - } - t.P(")") - t.P("}") - t.P() - - // get - varName := t.param(t.msg.GoIdent.GoName) - varTypeName := t.msg.GoIdent.GoName - t.P("func (", receiverVar, " ", t.messageTableReceiverName(t.msg), ") ", getName, "{") - t.P("var ", varName, " ", varTypeName) - t.P("found, err := ", receiverVar, ".table.GetIndexByID(", idx.Id, ").(", - ormTablePkg.Ident("UniqueIndex"), ").Get(ctx, &", varName, ",") - for _, field := range fields { - t.P(field, ",") - } - t.P(")") - t.P("if err != nil {") - t.P("return nil, err") - t.P("}") - t.P("if !found {") - t.P("return nil, ", ormErrPkg.Ident("NotFound")) - t.P("}") - t.P("return &", varName, ", nil") - t.P("}") - t.P() - } - - // List - t.P(receiver, "List(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") (", t.iteratorName(), ", error) {") - t.P("it, err := ", receiverVar, ".table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)") - t.P("return ", t.iteratorName(), "{it}, err") - t.P("}") - t.P() - - // ListRange - t.P(receiver, "ListRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ", opts ...", ormListPkg.Ident("Option"), ") (", t.iteratorName(), ", error) {") - t.P("it, err := ", receiverVar, ".table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)") - t.P("return ", t.iteratorName(), "{it}, err") - t.P("}") - t.P() - - // DeleteBy - t.P(receiver, "DeleteBy(ctx ", contextPkg.Ident("Context"), ", prefixKey ", t.indexKeyInterfaceName(), ") error {") - t.P("return ", receiverVar, ".table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)") - t.P("}") - t.P() - t.P() - - // DeleteRange - t.P(receiver, "DeleteRange(ctx ", contextPkg.Ident("Context"), ", from, to ", t.indexKeyInterfaceName(), ") error {") - t.P("return ", receiverVar, ".table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())") - t.P("}") - t.P() - t.P() - - t.P(receiver, "doNotImplement() {}") - t.P() -} - -func (t tableGen) genTableImplGuard() { - t.P("var _ ", t.messageTableInterfaceName(t.msg), " = ", t.messageTableReceiverName(t.msg), "{}") -} - -func (t tableGen) genConstructor() { - iface := t.messageTableInterfaceName(t.msg) - t.P("func New", iface, "(db ", ormTablePkg.Ident("Schema"), ") (", iface, ", error) {") - t.P("table := db.GetTable(&", t.msg.GoIdent.GoName, "{})") - t.P("if table == nil {") - t.P("return nil,", ormErrPkg.Ident("TableNotFound.Wrap"), "(string((&", t.msg.GoIdent.GoName, "{}).ProtoReflect().Descriptor().FullName()))") - t.P("}") - if t.table.PrimaryKey.AutoIncrement { - t.P( - "return ", t.messageTableReceiverName(t.msg), "{table.(", - ormTablePkg.Ident("AutoIncrementTable"), ")}, nil", - ) - } else { - t.P("return ", t.messageTableReceiverName(t.msg), "{table}, nil") - } - t.P("}") -} diff --git a/orm/internal/fieldnames/fieldnames.go b/orm/internal/fieldnames/fieldnames.go deleted file mode 100644 index e348e3a1971b..000000000000 --- a/orm/internal/fieldnames/fieldnames.go +++ /dev/null @@ -1,55 +0,0 @@ -package fieldnames - -import ( - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -// FieldNames abstractly represents a list of fields with a comparable type which -// can be used as a map key. It is used primarily to lookup indexes. -type FieldNames struct { - fields string -} - -// CommaSeparatedFieldNames creates a FieldNames instance from a list of comma-separated -// fields. -func CommaSeparatedFieldNames(fields string) FieldNames { - // normalize cases where there are spaces - if strings.IndexByte(fields, ' ') >= 0 { - parts := strings.Split(fields, ",") - for i, part := range parts { - parts[i] = strings.TrimSpace(part) - } - fields = strings.Join(parts, ",") - } - return FieldNames{fields: fields} -} - -// FieldsFromNames creates a FieldNames instance from an array of field -// names. -func FieldsFromNames(fnames []protoreflect.Name) FieldNames { - var names []string - for _, name := range fnames { - names = append(names, string(name)) - } - return FieldNames{fields: strings.Join(names, ",")} -} - -// Names returns the array of names this FieldNames instance represents. -func (f FieldNames) Names() []protoreflect.Name { - if f.fields == "" { - return nil - } - - fields := strings.Split(f.fields, ",") - names := make([]protoreflect.Name, len(fields)) - for i, field := range fields { - names[i] = protoreflect.Name(field) - } - return names -} - -func (f FieldNames) String() string { - return f.fields -} diff --git a/orm/internal/fieldnames/fieldnames_test.go b/orm/internal/fieldnames/fieldnames_test.go deleted file mode 100644 index 0bade00de8c2..000000000000 --- a/orm/internal/fieldnames/fieldnames_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package fieldnames - -import ( - "testing" - - "google.golang.org/protobuf/reflect/protoreflect" - "gotest.tools/v3/assert" -) - -func TestFieldNames(t *testing.T) { - names := []protoreflect.Name{"a", "b", "c"} - - abc := "a,b,c" - f := CommaSeparatedFieldNames(abc) - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - f = CommaSeparatedFieldNames("a, b ,c") - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - // empty okay - f = CommaSeparatedFieldNames("") - assert.Equal(t, FieldNames{""}, f) - assert.Equal(t, 0, len(f.Names())) - assert.Equal(t, "", f.String()) - - f = FieldsFromNames(names) - assert.Equal(t, FieldNames{abc}, f) - assert.DeepEqual(t, names, f.Names()) - assert.Equal(t, abc, f.String()) - - // empty okay - f = FieldsFromNames([]protoreflect.Name{}) - assert.Equal(t, FieldNames{""}, f) - f = FieldsFromNames(nil) - assert.Equal(t, FieldNames{""}, f) - assert.Equal(t, 0, len(f.Names())) - assert.Equal(t, "", f.String()) -} diff --git a/orm/internal/stablejson/encode.go b/orm/internal/stablejson/encode.go deleted file mode 100644 index e9dd143773d0..000000000000 --- a/orm/internal/stablejson/encode.go +++ /dev/null @@ -1,93 +0,0 @@ -package stablejson - -import ( - "bytes" - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protopath" - "google.golang.org/protobuf/reflect/protorange" - "google.golang.org/protobuf/reflect/protoreflect" -) - -// Marshal marshals the provided message to JSON with a stable ordering based -// on ascending field numbers. -func Marshal(message proto.Message) ([]byte, error) { - buf := &bytes.Buffer{} - firstStack := []bool{true} - err := protorange.Options{ - Stable: true, - }.Range(message.ProtoReflect(), - func(p protopath.Values) error { - // Starting printing the value. - if !firstStack[len(firstStack)-1] { - _, _ = fmt.Fprintf(buf, ",") - } - firstStack[len(firstStack)-1] = false - - // Print the key. - var fd protoreflect.FieldDescriptor - last := p.Index(-1) - beforeLast := p.Index(-2) - switch last.Step.Kind() { - case protopath.FieldAccessStep: - fd = last.Step.FieldDescriptor() - _, _ = fmt.Fprintf(buf, "%q:", fd.Name()) - case protopath.ListIndexStep: - fd = beforeLast.Step.FieldDescriptor() // lists always appear in the context of a repeated field - case protopath.MapIndexStep: - fd = beforeLast.Step.FieldDescriptor() // maps always appear in the context of a repeated field - _, _ = fmt.Fprintf(buf, "%v:", last.Step.MapIndex().Interface()) - case protopath.AnyExpandStep: - _, _ = fmt.Fprintf(buf, `"@type":%q`, last.Value.Message().Descriptor().FullName()) - return nil - case protopath.UnknownAccessStep: - _, _ = fmt.Fprintf(buf, "?: ") - } - - switch v := last.Value.Interface().(type) { - case protoreflect.Message: - _, _ = fmt.Fprintf(buf, "{") - firstStack = append(firstStack, true) - case protoreflect.List: - _, _ = fmt.Fprintf(buf, "[") - firstStack = append(firstStack, true) - case protoreflect.Map: - _, _ = fmt.Fprintf(buf, "{") - firstStack = append(firstStack, true) - case protoreflect.EnumNumber: - var ev protoreflect.EnumValueDescriptor - if fd != nil { - ev = fd.Enum().Values().ByNumber(v) - } - if ev != nil { - _, _ = fmt.Fprintf(buf, "%v", ev.Name()) - } else { - _, _ = fmt.Fprintf(buf, "%v", v) - } - case string, []byte: - _, _ = fmt.Fprintf(buf, "%q", v) - default: - _, _ = fmt.Fprintf(buf, "%v", v) - } - return nil - }, - func(p protopath.Values) error { - last := p.Index(-1) - switch last.Value.Interface().(type) { - case protoreflect.Message: - if last.Step.Kind() != protopath.AnyExpandStep { - _, _ = fmt.Fprintf(buf, "}") - } - case protoreflect.List: - _, _ = fmt.Fprintf(buf, "]") - firstStack = firstStack[:len(firstStack)-1] - case protoreflect.Map: - _, _ = fmt.Fprintf(buf, "}") - firstStack = firstStack[:len(firstStack)-1] - } - return nil - }, - ) - return buf.Bytes(), err -} diff --git a/orm/internal/stablejson/encode_test.go b/orm/internal/stablejson/encode_test.go deleted file mode 100644 index a874f04e37be..000000000000 --- a/orm/internal/stablejson/encode_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package stablejson_test - -import ( - "testing" - - "github.com/cosmos/cosmos-proto/anyutil" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/types/known/anypb" - - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/orm/internal/stablejson" -) - -func TestStableJSON(t *testing.T) { - msg, err := anyutil.New(&bankv1beta1.MsgSend{ - FromAddress: "foo213325", - ToAddress: "foo32t5sdfh", - Amount: []*basev1beta1.Coin{ - { - Denom: "bar", - Amount: "1234", - }, - { - Denom: "baz", - Amount: "321", - }, - }, - }) - require.NoError(t, err) - bz, err := stablejson.Marshal(&txv1beta1.TxBody{Messages: []*anypb.Any{msg}}) - require.NoError(t, err) - require.Equal(t, - `{"messages":[{"@type":"cosmos.bank.v1beta1.MsgSend","from_address":"foo213325","to_address":"foo32t5sdfh","amount":[{"denom":"bar","amount":"1234"},{"denom":"baz","amount":"321"}]}]}`, - string(bz)) -} diff --git a/orm/internal/testpb/bank.cosmos_orm.go b/orm/internal/testpb/bank.cosmos_orm.go deleted file mode 100644 index f7fa09cdc16b..000000000000 --- a/orm/internal/testpb/bank.cosmos_orm.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. - -package testpb - -import ( - context "context" - ormlist "cosmossdk.io/orm/model/ormlist" - ormtable "cosmossdk.io/orm/model/ormtable" - ormerrors "cosmossdk.io/orm/types/ormerrors" -) - -type BalanceTable interface { - Insert(ctx context.Context, balance *Balance) error - Update(ctx context.Context, balance *Balance) error - Save(ctx context.Context, balance *Balance) error - Delete(ctx context.Context, balance *Balance) error - Has(ctx context.Context, address string, denom string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, address string, denom string) (*Balance, error) - List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) - DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error - DeleteRange(ctx context.Context, from, to BalanceIndexKey) error - - doNotImplement() -} - -type BalanceIterator struct { - ormtable.Iterator -} - -func (i BalanceIterator) Value() (*Balance, error) { - var balance Balance - err := i.UnmarshalMessage(&balance) - return &balance, err -} - -type BalanceIndexKey interface { - id() uint32 - values() []interface{} - balanceIndexKey() -} - -// primary key starting index.. -type BalancePrimaryKey = BalanceAddressDenomIndexKey - -type BalanceAddressDenomIndexKey struct { - vs []interface{} -} - -func (x BalanceAddressDenomIndexKey) id() uint32 { return 0 } -func (x BalanceAddressDenomIndexKey) values() []interface{} { return x.vs } -func (x BalanceAddressDenomIndexKey) balanceIndexKey() {} - -func (this BalanceAddressDenomIndexKey) WithAddress(address string) BalanceAddressDenomIndexKey { - this.vs = []interface{}{address} - return this -} - -func (this BalanceAddressDenomIndexKey) WithAddressDenom(address string, denom string) BalanceAddressDenomIndexKey { - this.vs = []interface{}{address, denom} - return this -} - -type BalanceDenomIndexKey struct { - vs []interface{} -} - -func (x BalanceDenomIndexKey) id() uint32 { return 1 } -func (x BalanceDenomIndexKey) values() []interface{} { return x.vs } -func (x BalanceDenomIndexKey) balanceIndexKey() {} - -func (this BalanceDenomIndexKey) WithDenom(denom string) BalanceDenomIndexKey { - this.vs = []interface{}{denom} - return this -} - -type balanceTable struct { - table ormtable.Table -} - -func (this balanceTable) Insert(ctx context.Context, balance *Balance) error { - return this.table.Insert(ctx, balance) -} - -func (this balanceTable) Update(ctx context.Context, balance *Balance) error { - return this.table.Update(ctx, balance) -} - -func (this balanceTable) Save(ctx context.Context, balance *Balance) error { - return this.table.Save(ctx, balance) -} - -func (this balanceTable) Delete(ctx context.Context, balance *Balance) error { - return this.table.Delete(ctx, balance) -} - -func (this balanceTable) Has(ctx context.Context, address string, denom string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, address, denom) -} - -func (this balanceTable) Get(ctx context.Context, address string, denom string) (*Balance, error) { - var balance Balance - found, err := this.table.PrimaryKey().Get(ctx, &balance, address, denom) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &balance, nil -} - -func (this balanceTable) List(ctx context.Context, prefixKey BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) ListRange(ctx context.Context, from, to BalanceIndexKey, opts ...ormlist.Option) (BalanceIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return BalanceIterator{it}, err -} - -func (this balanceTable) DeleteBy(ctx context.Context, prefixKey BalanceIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this balanceTable) DeleteRange(ctx context.Context, from, to BalanceIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this balanceTable) doNotImplement() {} - -var _ BalanceTable = balanceTable{} - -func NewBalanceTable(db ormtable.Schema) (BalanceTable, error) { - table := db.GetTable(&Balance{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Balance{}).ProtoReflect().Descriptor().FullName())) - } - return balanceTable{table}, nil -} - -type SupplyTable interface { - Insert(ctx context.Context, supply *Supply) error - Update(ctx context.Context, supply *Supply) error - Save(ctx context.Context, supply *Supply) error - Delete(ctx context.Context, supply *Supply) error - Has(ctx context.Context, denom string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, denom string) (*Supply, error) - List(ctx context.Context, prefixKey SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) - ListRange(ctx context.Context, from, to SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) - DeleteBy(ctx context.Context, prefixKey SupplyIndexKey) error - DeleteRange(ctx context.Context, from, to SupplyIndexKey) error - - doNotImplement() -} - -type SupplyIterator struct { - ormtable.Iterator -} - -func (i SupplyIterator) Value() (*Supply, error) { - var supply Supply - err := i.UnmarshalMessage(&supply) - return &supply, err -} - -type SupplyIndexKey interface { - id() uint32 - values() []interface{} - supplyIndexKey() -} - -// primary key starting index.. -type SupplyPrimaryKey = SupplyDenomIndexKey - -type SupplyDenomIndexKey struct { - vs []interface{} -} - -func (x SupplyDenomIndexKey) id() uint32 { return 0 } -func (x SupplyDenomIndexKey) values() []interface{} { return x.vs } -func (x SupplyDenomIndexKey) supplyIndexKey() {} - -func (this SupplyDenomIndexKey) WithDenom(denom string) SupplyDenomIndexKey { - this.vs = []interface{}{denom} - return this -} - -type supplyTable struct { - table ormtable.Table -} - -func (this supplyTable) Insert(ctx context.Context, supply *Supply) error { - return this.table.Insert(ctx, supply) -} - -func (this supplyTable) Update(ctx context.Context, supply *Supply) error { - return this.table.Update(ctx, supply) -} - -func (this supplyTable) Save(ctx context.Context, supply *Supply) error { - return this.table.Save(ctx, supply) -} - -func (this supplyTable) Delete(ctx context.Context, supply *Supply) error { - return this.table.Delete(ctx, supply) -} - -func (this supplyTable) Has(ctx context.Context, denom string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, denom) -} - -func (this supplyTable) Get(ctx context.Context, denom string) (*Supply, error) { - var supply Supply - found, err := this.table.PrimaryKey().Get(ctx, &supply, denom) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &supply, nil -} - -func (this supplyTable) List(ctx context.Context, prefixKey SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return SupplyIterator{it}, err -} - -func (this supplyTable) ListRange(ctx context.Context, from, to SupplyIndexKey, opts ...ormlist.Option) (SupplyIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return SupplyIterator{it}, err -} - -func (this supplyTable) DeleteBy(ctx context.Context, prefixKey SupplyIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this supplyTable) DeleteRange(ctx context.Context, from, to SupplyIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this supplyTable) doNotImplement() {} - -var _ SupplyTable = supplyTable{} - -func NewSupplyTable(db ormtable.Schema) (SupplyTable, error) { - table := db.GetTable(&Supply{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&Supply{}).ProtoReflect().Descriptor().FullName())) - } - return supplyTable{table}, nil -} - -type BankStore interface { - BalanceTable() BalanceTable - SupplyTable() SupplyTable - - doNotImplement() -} - -type bankStore struct { - balance BalanceTable - supply SupplyTable -} - -func (x bankStore) BalanceTable() BalanceTable { - return x.balance -} - -func (x bankStore) SupplyTable() SupplyTable { - return x.supply -} - -func (bankStore) doNotImplement() {} - -var _ BankStore = bankStore{} - -func NewBankStore(db ormtable.Schema) (BankStore, error) { - balanceTable, err := NewBalanceTable(db) - if err != nil { - return nil, err - } - - supplyTable, err := NewSupplyTable(db) - if err != nil { - return nil, err - } - - return bankStore{ - balanceTable, - supplyTable, - }, nil -} diff --git a/orm/internal/testpb/bank.pb.go b/orm/internal/testpb/bank.pb.go deleted file mode 100644 index e3320c6e8a80..000000000000 --- a/orm/internal/testpb/bank.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/bank.proto - -package testpb - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - _ "cosmossdk.io/api/cosmos/orm/v1" - _ "cosmossdk.io/api/cosmos/orm/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Module is a test module for demonstrating how to use the ORM with appconfig. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{0} -} - -type Balance struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Balance) Reset() { - *x = Balance{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Balance) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Balance) ProtoMessage() {} - -func (x *Balance) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Balance.ProtoReflect.Descriptor instead. -func (*Balance) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{1} -} - -func (x *Balance) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *Balance) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -func (x *Balance) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -type Supply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Supply) Reset() { - *x = Supply{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Supply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Supply) ProtoMessage() {} - -func (x *Supply) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Supply.ProtoReflect.Descriptor instead. -func (*Supply) Descriptor() ([]byte, []int) { - return file_testpb_bank_proto_rawDescGZIP(), []int{2} -} - -func (x *Supply) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -func (x *Supply) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -var File_testpb_bank_proto protoreflect.FileDescriptor - -var file_testpb_bank_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 0x17, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, - 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x3a, 0x46, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x23, 0x0a, 0x21, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, - 0x6d, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6f, 0x72, 0x6d, 0x64, 0x62, 0x82, 0x9f, 0xd3, - 0x8e, 0x03, 0x17, 0x0a, 0x15, 0x08, 0x01, 0x12, 0x11, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, - 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x07, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x24, 0xf2, - 0x9e, 0xd3, 0x8e, 0x03, 0x1e, 0x0a, 0x0f, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x2c, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x10, - 0x01, 0x18, 0x01, 0x22, 0x49, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x11, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x42, 0x71, - 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x42, 0x61, - 0x6e, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_bank_proto_rawDescOnce sync.Once - file_testpb_bank_proto_rawDescData = file_testpb_bank_proto_rawDesc -) - -func file_testpb_bank_proto_rawDescGZIP() []byte { - file_testpb_bank_proto_rawDescOnce.Do(func() { - file_testpb_bank_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_bank_proto_rawDescData) - }) - return file_testpb_bank_proto_rawDescData -} - -var file_testpb_bank_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_testpb_bank_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: testpb.Module - (*Balance)(nil), // 1: testpb.Balance - (*Supply)(nil), // 2: testpb.Supply -} -var file_testpb_bank_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_testpb_bank_proto_init() } -func file_testpb_bank_proto_init() { - if File_testpb_bank_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_testpb_bank_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Balance); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Supply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_bank_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_testpb_bank_proto_goTypes, - DependencyIndexes: file_testpb_bank_proto_depIdxs, - MessageInfos: file_testpb_bank_proto_msgTypes, - }.Build() - File_testpb_bank_proto = out.File - file_testpb_bank_proto_rawDesc = nil - file_testpb_bank_proto_goTypes = nil - file_testpb_bank_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/bank.proto b/orm/internal/testpb/bank.proto deleted file mode 100644 index 1778aacd4b35..000000000000 --- a/orm/internal/testpb/bank.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package testpb; - -import "cosmos/orm/v1/orm.proto"; -import "cosmos/orm/v1alpha1/schema.proto"; -import "cosmos/app/v1alpha1/module.proto"; - -// This is a simulated bank schema used for testing. - -// Module is a test module for demonstrating how to use the ORM with appconfig. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/orm/model/ormdb" - }; - option (cosmos.orm.v1alpha1.module_schema) = { - schema_file: {id: 1 proto_file_name: "testpb/bank.proto"} - }; -} - -message Balance { - option (cosmos.orm.v1.table) = { - id: 1; -primary_key: { -fields: - "address,denom" -} -index: { -id: - 1 fields: "denom" -} -}; - -string address = 1; -string denom = 2; -uint64 amount = 3; -} - -message Supply { - option (cosmos.orm.v1.table) = { - id: 2; -primary_key: { -fields: - "denom" -} -}; - -string denom = 1; -uint64 amount = 2; -} diff --git a/orm/internal/testpb/bank_query.pb.go b/orm/internal/testpb/bank_query.pb.go deleted file mode 100644 index fc75fcfff5e8..000000000000 --- a/orm/internal/testpb/bank_query.pb.go +++ /dev/null @@ -1,1411 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/bank_query.proto - -package testpb - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetBalanceRequest is the BankQuery/GetBalanceRequest request type. -type GetBalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // address specifies the value of the address field in the primary key. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // denom specifies the value of the denom field in the primary key. - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (x *GetBalanceRequest) Reset() { - *x = GetBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceRequest) ProtoMessage() {} - -func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBalanceRequest.ProtoReflect.Descriptor instead. -func (*GetBalanceRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{0} -} - -func (x *GetBalanceRequest) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *GetBalanceRequest) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -// GetBalanceResponse is the BankQuery/GetBalanceResponse response type. -type GetBalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *Balance `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetBalanceResponse) Reset() { - *x = GetBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceResponse) ProtoMessage() {} - -func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBalanceResponse.ProtoReflect.Descriptor instead. -func (*GetBalanceResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{1} -} - -func (x *GetBalanceResponse) GetValue() *Balance { - if x != nil { - return x.Value - } - return nil -} - -// ListBalanceRequest is the BankQuery/ListBalanceRequest request type. -type ListBalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListBalanceRequest_PrefixQuery - // *ListBalanceRequest_RangeQuery_ - Query isListBalanceRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListBalanceRequest) Reset() { - *x = ListBalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest) ProtoMessage() {} - -func (x *ListBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceRequest.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2} -} - -func (m *ListBalanceRequest) GetQuery() isListBalanceRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListBalanceRequest) GetPrefixQuery() *ListBalanceRequest_IndexKey { - if x, ok := x.GetQuery().(*ListBalanceRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListBalanceRequest) GetRangeQuery() *ListBalanceRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListBalanceRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListBalanceRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListBalanceRequest_Query interface { - isListBalanceRequest_Query() -} - -type ListBalanceRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListBalanceRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListBalanceRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListBalanceRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListBalanceRequest_PrefixQuery) isListBalanceRequest_Query() {} - -func (*ListBalanceRequest_RangeQuery_) isListBalanceRequest_Query() {} - -// ListBalanceResponse is the BankQuery/ListBalanceResponse response type. -type ListBalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*Balance `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListBalanceResponse) Reset() { - *x = ListBalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceResponse) ProtoMessage() {} - -func (x *ListBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceResponse.ProtoReflect.Descriptor instead. -func (*ListBalanceResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{3} -} - -func (x *ListBalanceResponse) GetValues() []*Balance { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListBalanceResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetSupplyRequest is the BankQuery/GetSupplyRequest request type. -type GetSupplyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom specifies the value of the denom field in the primary key. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (x *GetSupplyRequest) Reset() { - *x = GetSupplyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSupplyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSupplyRequest) ProtoMessage() {} - -func (x *GetSupplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSupplyRequest.ProtoReflect.Descriptor instead. -func (*GetSupplyRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{4} -} - -func (x *GetSupplyRequest) GetDenom() string { - if x != nil { - return x.Denom - } - return "" -} - -// GetSupplyResponse is the BankQuery/GetSupplyResponse response type. -type GetSupplyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *Supply `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSupplyResponse) Reset() { - *x = GetSupplyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSupplyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSupplyResponse) ProtoMessage() {} - -func (x *GetSupplyResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSupplyResponse.ProtoReflect.Descriptor instead. -func (*GetSupplyResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{5} -} - -func (x *GetSupplyResponse) GetValue() *Supply { - if x != nil { - return x.Value - } - return nil -} - -// ListSupplyRequest is the BankQuery/ListSupplyRequest request type. -type ListSupplyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListSupplyRequest_PrefixQuery - // *ListSupplyRequest_RangeQuery_ - Query isListSupplyRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSupplyRequest) Reset() { - *x = ListSupplyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest) ProtoMessage() {} - -func (x *ListSupplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6} -} - -func (m *ListSupplyRequest) GetQuery() isListSupplyRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListSupplyRequest) GetPrefixQuery() *ListSupplyRequest_IndexKey { - if x, ok := x.GetQuery().(*ListSupplyRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListSupplyRequest) GetRangeQuery() *ListSupplyRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListSupplyRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListSupplyRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListSupplyRequest_Query interface { - isListSupplyRequest_Query() -} - -type ListSupplyRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListSupplyRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListSupplyRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListSupplyRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListSupplyRequest_PrefixQuery) isListSupplyRequest_Query() {} - -func (*ListSupplyRequest_RangeQuery_) isListSupplyRequest_Query() {} - -// ListSupplyResponse is the BankQuery/ListSupplyResponse response type. -type ListSupplyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*Supply `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSupplyResponse) Reset() { - *x = ListSupplyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyResponse) ProtoMessage() {} - -func (x *ListSupplyResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyResponse.ProtoReflect.Descriptor instead. -func (*ListSupplyResponse) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{7} -} - -func (x *ListSupplyResponse) GetValues() []*Supply { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListSupplyResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListBalanceRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListBalanceRequest_IndexKey_AddressDenom_ - // *ListBalanceRequest_IndexKey_Denom_ - Key isListBalanceRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListBalanceRequest_IndexKey) Reset() { - *x = ListBalanceRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0} -} - -func (m *ListBalanceRequest_IndexKey) GetKey() isListBalanceRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListBalanceRequest_IndexKey) GetAddressDenom() *ListBalanceRequest_IndexKey_AddressDenom { - if x, ok := x.GetKey().(*ListBalanceRequest_IndexKey_AddressDenom_); ok { - return x.AddressDenom - } - return nil -} - -func (x *ListBalanceRequest_IndexKey) GetDenom() *ListBalanceRequest_IndexKey_Denom { - if x, ok := x.GetKey().(*ListBalanceRequest_IndexKey_Denom_); ok { - return x.Denom - } - return nil -} - -type isListBalanceRequest_IndexKey_Key interface { - isListBalanceRequest_IndexKey_Key() -} - -type ListBalanceRequest_IndexKey_AddressDenom_ struct { - // address_denom specifies the value of the AddressDenom index key to use in the query. - AddressDenom *ListBalanceRequest_IndexKey_AddressDenom `protobuf:"bytes,1,opt,name=address_denom,json=addressDenom,proto3,oneof"` -} - -type ListBalanceRequest_IndexKey_Denom_ struct { - // denom specifies the value of the Denom index key to use in the query. - Denom *ListBalanceRequest_IndexKey_Denom `protobuf:"bytes,2,opt,name=denom,proto3,oneof"` -} - -func (*ListBalanceRequest_IndexKey_AddressDenom_) isListBalanceRequest_IndexKey_Key() {} - -func (*ListBalanceRequest_IndexKey_Denom_) isListBalanceRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListBalanceRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListBalanceRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListBalanceRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListBalanceRequest_RangeQuery) Reset() { - *x = ListBalanceRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_RangeQuery) ProtoMessage() {} - -func (x *ListBalanceRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *ListBalanceRequest_RangeQuery) GetFrom() *ListBalanceRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListBalanceRequest_RangeQuery) GetTo() *ListBalanceRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListBalanceRequest_IndexKey_AddressDenom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // address is the value of the address field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Address *string `protobuf:"bytes,1,opt,name=address,proto3,oneof" json:"address,omitempty"` - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,2,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) Reset() { - *x = ListBalanceRequest_IndexKey_AddressDenom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey_AddressDenom) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceRequest_IndexKey_AddressDenom.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey_AddressDenom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0, 0} -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) GetAddress() string { - if x != nil && x.Address != nil { - return *x.Address - } - return "" -} - -func (x *ListBalanceRequest_IndexKey_AddressDenom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -type ListBalanceRequest_IndexKey_Denom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,1,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListBalanceRequest_IndexKey_Denom) Reset() { - *x = ListBalanceRequest_IndexKey_Denom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBalanceRequest_IndexKey_Denom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBalanceRequest_IndexKey_Denom) ProtoMessage() {} - -func (x *ListBalanceRequest_IndexKey_Denom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListBalanceRequest_IndexKey_Denom.ProtoReflect.Descriptor instead. -func (*ListBalanceRequest_IndexKey_Denom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{2, 0, 1} -} - -func (x *ListBalanceRequest_IndexKey_Denom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListSupplyRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListSupplyRequest_IndexKey_Denom_ - Key isListSupplyRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListSupplyRequest_IndexKey) Reset() { - *x = ListSupplyRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_IndexKey) ProtoMessage() {} - -func (x *ListSupplyRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 0} -} - -func (m *ListSupplyRequest_IndexKey) GetKey() isListSupplyRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListSupplyRequest_IndexKey) GetDenom() *ListSupplyRequest_IndexKey_Denom { - if x, ok := x.GetKey().(*ListSupplyRequest_IndexKey_Denom_); ok { - return x.Denom - } - return nil -} - -type isListSupplyRequest_IndexKey_Key interface { - isListSupplyRequest_IndexKey_Key() -} - -type ListSupplyRequest_IndexKey_Denom_ struct { - // denom specifies the value of the Denom index key to use in the query. - Denom *ListSupplyRequest_IndexKey_Denom `protobuf:"bytes,1,opt,name=denom,proto3,oneof"` -} - -func (*ListSupplyRequest_IndexKey_Denom_) isListSupplyRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListSupplyRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListSupplyRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListSupplyRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListSupplyRequest_RangeQuery) Reset() { - *x = ListSupplyRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_RangeQuery) ProtoMessage() {} - -func (x *ListSupplyRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 1} -} - -func (x *ListSupplyRequest_RangeQuery) GetFrom() *ListSupplyRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListSupplyRequest_RangeQuery) GetTo() *ListSupplyRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListSupplyRequest_IndexKey_Denom struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Denom *string `protobuf:"bytes,1,opt,name=denom,proto3,oneof" json:"denom,omitempty"` -} - -func (x *ListSupplyRequest_IndexKey_Denom) Reset() { - *x = ListSupplyRequest_IndexKey_Denom{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_bank_query_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSupplyRequest_IndexKey_Denom) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSupplyRequest_IndexKey_Denom) ProtoMessage() {} - -func (x *ListSupplyRequest_IndexKey_Denom) ProtoReflect() protoreflect.Message { - mi := &file_testpb_bank_query_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSupplyRequest_IndexKey_Denom.ProtoReflect.Descriptor instead. -func (*ListSupplyRequest_IndexKey_Denom) Descriptor() ([]byte, []int) { - return file_testpb_bank_query_proto_rawDescGZIP(), []int{6, 0, 0} -} - -func (x *ListSupplyRequest_IndexKey_Denom) GetDenom() string { - if x != nil && x.Denom != nil { - return *x.Denom - } - return "" -} - -var File_testpb_bank_query_proto protoreflect.FileDescriptor - -var file_testpb_bank_query_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x3b, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xb3, 0x05, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0c, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x48, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, - 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xbb, 0x02, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, - 0x65, 0x79, 0x12, 0x57, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x0c, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x41, 0x0a, 0x05, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, - 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x5e, - 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1d, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x2c, - 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x19, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, - 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x05, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x1a, 0x7a, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x37, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x33, 0x0a, 0x02, 0x74, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, - 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, - 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x27, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x28, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x39, 0x0a, 0x11, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf4, 0x03, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x47, 0x0a, - 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x81, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x48, 0x00, 0x52, - 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x1a, 0x2c, 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, - 0x19, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x78, 0x0a, 0x0a, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x36, 0x0a, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x12, 0x32, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x85, - 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xae, 0x02, 0x0a, 0x10, 0x42, 0x61, 0x6e, 0x6b, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x45, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x19, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0e, 0x42, 0x61, 0x6e, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, - 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_bank_query_proto_rawDescOnce sync.Once - file_testpb_bank_query_proto_rawDescData = file_testpb_bank_query_proto_rawDesc -) - -func file_testpb_bank_query_proto_rawDescGZIP() []byte { - file_testpb_bank_query_proto_rawDescOnce.Do(func() { - file_testpb_bank_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_bank_query_proto_rawDescData) - }) - return file_testpb_bank_query_proto_rawDescData -} - -var file_testpb_bank_query_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_testpb_bank_query_proto_goTypes = []interface{}{ - (*GetBalanceRequest)(nil), // 0: testpb.GetBalanceRequest - (*GetBalanceResponse)(nil), // 1: testpb.GetBalanceResponse - (*ListBalanceRequest)(nil), // 2: testpb.ListBalanceRequest - (*ListBalanceResponse)(nil), // 3: testpb.ListBalanceResponse - (*GetSupplyRequest)(nil), // 4: testpb.GetSupplyRequest - (*GetSupplyResponse)(nil), // 5: testpb.GetSupplyResponse - (*ListSupplyRequest)(nil), // 6: testpb.ListSupplyRequest - (*ListSupplyResponse)(nil), // 7: testpb.ListSupplyResponse - (*ListBalanceRequest_IndexKey)(nil), // 8: testpb.ListBalanceRequest.IndexKey - (*ListBalanceRequest_RangeQuery)(nil), // 9: testpb.ListBalanceRequest.RangeQuery - (*ListBalanceRequest_IndexKey_AddressDenom)(nil), // 10: testpb.ListBalanceRequest.IndexKey.AddressDenom - (*ListBalanceRequest_IndexKey_Denom)(nil), // 11: testpb.ListBalanceRequest.IndexKey.Denom - (*ListSupplyRequest_IndexKey)(nil), // 12: testpb.ListSupplyRequest.IndexKey - (*ListSupplyRequest_RangeQuery)(nil), // 13: testpb.ListSupplyRequest.RangeQuery - (*ListSupplyRequest_IndexKey_Denom)(nil), // 14: testpb.ListSupplyRequest.IndexKey.Denom - (*Balance)(nil), // 15: testpb.Balance - (*v1beta1.PageRequest)(nil), // 16: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 17: cosmos.base.query.v1beta1.PageResponse - (*Supply)(nil), // 18: testpb.Supply -} -var file_testpb_bank_query_proto_depIdxs = []int32{ - 15, // 0: testpb.GetBalanceResponse.value:type_name -> testpb.Balance - 8, // 1: testpb.ListBalanceRequest.prefix_query:type_name -> testpb.ListBalanceRequest.IndexKey - 9, // 2: testpb.ListBalanceRequest.range_query:type_name -> testpb.ListBalanceRequest.RangeQuery - 16, // 3: testpb.ListBalanceRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 15, // 4: testpb.ListBalanceResponse.values:type_name -> testpb.Balance - 17, // 5: testpb.ListBalanceResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 18, // 6: testpb.GetSupplyResponse.value:type_name -> testpb.Supply - 12, // 7: testpb.ListSupplyRequest.prefix_query:type_name -> testpb.ListSupplyRequest.IndexKey - 13, // 8: testpb.ListSupplyRequest.range_query:type_name -> testpb.ListSupplyRequest.RangeQuery - 16, // 9: testpb.ListSupplyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 18, // 10: testpb.ListSupplyResponse.values:type_name -> testpb.Supply - 17, // 11: testpb.ListSupplyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 10, // 12: testpb.ListBalanceRequest.IndexKey.address_denom:type_name -> testpb.ListBalanceRequest.IndexKey.AddressDenom - 11, // 13: testpb.ListBalanceRequest.IndexKey.denom:type_name -> testpb.ListBalanceRequest.IndexKey.Denom - 8, // 14: testpb.ListBalanceRequest.RangeQuery.from:type_name -> testpb.ListBalanceRequest.IndexKey - 8, // 15: testpb.ListBalanceRequest.RangeQuery.to:type_name -> testpb.ListBalanceRequest.IndexKey - 14, // 16: testpb.ListSupplyRequest.IndexKey.denom:type_name -> testpb.ListSupplyRequest.IndexKey.Denom - 12, // 17: testpb.ListSupplyRequest.RangeQuery.from:type_name -> testpb.ListSupplyRequest.IndexKey - 12, // 18: testpb.ListSupplyRequest.RangeQuery.to:type_name -> testpb.ListSupplyRequest.IndexKey - 0, // 19: testpb.BankQueryService.GetBalance:input_type -> testpb.GetBalanceRequest - 2, // 20: testpb.BankQueryService.ListBalance:input_type -> testpb.ListBalanceRequest - 4, // 21: testpb.BankQueryService.GetSupply:input_type -> testpb.GetSupplyRequest - 6, // 22: testpb.BankQueryService.ListSupply:input_type -> testpb.ListSupplyRequest - 1, // 23: testpb.BankQueryService.GetBalance:output_type -> testpb.GetBalanceResponse - 3, // 24: testpb.BankQueryService.ListBalance:output_type -> testpb.ListBalanceResponse - 5, // 25: testpb.BankQueryService.GetSupply:output_type -> testpb.GetSupplyResponse - 7, // 26: testpb.BankQueryService.ListSupply:output_type -> testpb.ListSupplyResponse - 23, // [23:27] is the sub-list for method output_type - 19, // [19:23] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name -} - -func init() { file_testpb_bank_query_proto_init() } -func file_testpb_bank_query_proto_init() { - if File_testpb_bank_query_proto != nil { - return - } - file_testpb_bank_proto_init() - if !protoimpl.UnsafeEnabled { - file_testpb_bank_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSupplyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSupplyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey_AddressDenom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBalanceRequest_IndexKey_Denom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_bank_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSupplyRequest_IndexKey_Denom); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_bank_query_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ListBalanceRequest_PrefixQuery)(nil), - (*ListBalanceRequest_RangeQuery_)(nil), - } - file_testpb_bank_query_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*ListSupplyRequest_PrefixQuery)(nil), - (*ListSupplyRequest_RangeQuery_)(nil), - } - file_testpb_bank_query_proto_msgTypes[8].OneofWrappers = []interface{}{ - (*ListBalanceRequest_IndexKey_AddressDenom_)(nil), - (*ListBalanceRequest_IndexKey_Denom_)(nil), - } - file_testpb_bank_query_proto_msgTypes[10].OneofWrappers = []interface{}{} - file_testpb_bank_query_proto_msgTypes[11].OneofWrappers = []interface{}{} - file_testpb_bank_query_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*ListSupplyRequest_IndexKey_Denom_)(nil), - } - file_testpb_bank_query_proto_msgTypes[14].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_bank_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_testpb_bank_query_proto_goTypes, - DependencyIndexes: file_testpb_bank_query_proto_depIdxs, - MessageInfos: file_testpb_bank_query_proto_msgTypes, - }.Build() - File_testpb_bank_query_proto = out.File - file_testpb_bank_query_proto_rawDesc = nil - file_testpb_bank_query_proto_goTypes = nil - file_testpb_bank_query_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/bank_query.proto b/orm/internal/testpb/bank_query.proto deleted file mode 100644 index 6335d52eaf58..000000000000 --- a/orm/internal/testpb/bank_query.proto +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. -syntax = "proto3"; -package testpb; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "testpb/bank.proto"; - -// BankQueryService queries the state of the tables specified by testpb/bank.proto. -service BankQueryService { - // Get queries the Balance table by its primary key. - rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) {} - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - rpc ListBalance(ListBalanceRequest) returns (ListBalanceResponse) {} - // Get queries the Supply table by its primary key. - rpc GetSupply(GetSupplyRequest) returns (GetSupplyResponse) {} - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - rpc ListSupply(ListSupplyRequest) returns (ListSupplyResponse) {} -} - -// GetBalanceRequest is the BankQuery/GetBalanceRequest request type. -message GetBalanceRequest { - // address specifies the value of the address field in the primary key. - string address = 1; - // denom specifies the value of the denom field in the primary key. - string denom = 2; -} - -// GetBalanceResponse is the BankQuery/GetBalanceResponse response type. -message GetBalanceResponse { - // value is the response value. - Balance value = 1; -} - -// ListBalanceRequest is the BankQuery/ListBalanceRequest request type. -message ListBalanceRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // address_denom specifies the value of the AddressDenom index key to use in the query. - AddressDenom address_denom = 1; - // denom specifies the value of the Denom index key to use in the query. - Denom denom = 2; - } - - message AddressDenom { - // address is the value of the address field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string address = 1; - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 2; - } - - message Denom { - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListBalanceResponse is the BankQuery/ListBalanceResponse response type. -message ListBalanceResponse { - // values are the results of the query. - repeated Balance values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetSupplyRequest is the BankQuery/GetSupplyRequest request type. -message GetSupplyRequest { - // denom specifies the value of the denom field in the primary key. - string denom = 1; -} - -// GetSupplyResponse is the BankQuery/GetSupplyResponse response type. -message GetSupplyResponse { - // value is the response value. - Supply value = 1; -} - -// ListSupplyRequest is the BankQuery/ListSupplyRequest request type. -message ListSupplyRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // denom specifies the value of the Denom index key to use in the query. - Denom denom = 1; - } - - message Denom { - // denom is the value of the denom field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string denom = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListSupplyResponse is the BankQuery/ListSupplyResponse response type. -message ListSupplyResponse { - // values are the results of the query. - repeated Supply values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/orm/internal/testpb/bank_query_grpc.pb.go b/orm/internal/testpb/bank_query_grpc.pb.go deleted file mode 100644 index dc8eac20dbd6..000000000000 --- a/orm/internal/testpb/bank_query_grpc.pb.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: testpb/bank_query.proto - -package testpb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - BankQueryService_GetBalance_FullMethodName = "/testpb.BankQueryService/GetBalance" - BankQueryService_ListBalance_FullMethodName = "/testpb.BankQueryService/ListBalance" - BankQueryService_GetSupply_FullMethodName = "/testpb.BankQueryService/GetSupply" - BankQueryService_ListSupply_FullMethodName = "/testpb.BankQueryService/ListSupply" -) - -// BankQueryServiceClient is the client API for BankQueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BankQueryServiceClient interface { - // Get queries the Balance table by its primary key. - GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) - // Get queries the Supply table by its primary key. - GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) -} - -type bankQueryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewBankQueryServiceClient(cc grpc.ClientConnInterface) BankQueryServiceClient { - return &bankQueryServiceClient{cc} -} - -func (c *bankQueryServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { - out := new(GetBalanceResponse) - err := c.cc.Invoke(ctx, BankQueryService_GetBalance_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) { - out := new(ListBalanceResponse) - err := c.cc.Invoke(ctx, BankQueryService_ListBalance_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) { - out := new(GetSupplyResponse) - err := c.cc.Invoke(ctx, BankQueryService_GetSupply_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *bankQueryServiceClient) ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) { - out := new(ListSupplyResponse) - err := c.cc.Invoke(ctx, BankQueryService_ListSupply_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BankQueryServiceServer is the server API for BankQueryService service. -// All implementations must embed UnimplementedBankQueryServiceServer -// for forward compatibility -type BankQueryServiceServer interface { - // Get queries the Balance table by its primary key. - GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) - // ListBalance queries the Balance table using prefix and range queries against defined indexes. - ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error) - // Get queries the Supply table by its primary key. - GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error) - // ListSupply queries the Supply table using prefix and range queries against defined indexes. - ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error) - mustEmbedUnimplementedBankQueryServiceServer() -} - -// UnimplementedBankQueryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedBankQueryServiceServer struct { -} - -func (UnimplementedBankQueryServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented") -} -func (UnimplementedBankQueryServiceServer) ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListBalance not implemented") -} -func (UnimplementedBankQueryServiceServer) GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSupply not implemented") -} -func (UnimplementedBankQueryServiceServer) ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSupply not implemented") -} -func (UnimplementedBankQueryServiceServer) mustEmbedUnimplementedBankQueryServiceServer() {} - -// UnsafeBankQueryServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BankQueryServiceServer will -// result in compilation errors. -type UnsafeBankQueryServiceServer interface { - mustEmbedUnimplementedBankQueryServiceServer() -} - -func RegisterBankQueryServiceServer(s grpc.ServiceRegistrar, srv BankQueryServiceServer) { - s.RegisterService(&BankQueryService_ServiceDesc, srv) -} - -func _BankQueryService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).GetBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_GetBalance_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).GetBalance(ctx, req.(*GetBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_ListBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).ListBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_ListBalance_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).ListBalance(ctx, req.(*ListBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_GetSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).GetSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_GetSupply_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).GetSupply(ctx, req.(*GetSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BankQueryService_ListSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BankQueryServiceServer).ListSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BankQueryService_ListSupply_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BankQueryServiceServer).ListSupply(ctx, req.(*ListSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BankQueryService_ServiceDesc is the grpc.ServiceDesc for BankQueryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BankQueryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.BankQueryService", - HandlerType: (*BankQueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetBalance", - Handler: _BankQueryService_GetBalance_Handler, - }, - { - MethodName: "ListBalance", - Handler: _BankQueryService_ListBalance_Handler, - }, - { - MethodName: "GetSupply", - Handler: _BankQueryService_GetSupply_Handler, - }, - { - MethodName: "ListSupply", - Handler: _BankQueryService_ListSupply_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "testpb/bank_query.proto", -} diff --git a/orm/internal/testpb/test_schema.cosmos_orm.go b/orm/internal/testpb/test_schema.cosmos_orm.go deleted file mode 100644 index 177886eee338..000000000000 --- a/orm/internal/testpb/test_schema.cosmos_orm.go +++ /dev/null @@ -1,1054 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT. - -package testpb - -import ( - context "context" - ormlist "cosmossdk.io/orm/model/ormlist" - ormtable "cosmossdk.io/orm/model/ormtable" - ormerrors "cosmossdk.io/orm/types/ormerrors" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -type ExampleTableTable interface { - Insert(ctx context.Context, exampleTable *ExampleTable) error - Update(ctx context.Context, exampleTable *ExampleTable) error - Save(ctx context.Context, exampleTable *ExampleTable) error - Delete(ctx context.Context, exampleTable *ExampleTable) error - Has(ctx context.Context, u32 uint32, i64 int64, str string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, u32 uint32, i64 int64, str string) (*ExampleTable, error) - HasByU64Str(ctx context.Context, u64 uint64, str string) (found bool, err error) - // GetByU64Str returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByU64Str(ctx context.Context, u64 uint64, str string) (*ExampleTable, error) - List(ctx context.Context, prefixKey ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) - ListRange(ctx context.Context, from, to ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleTableIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleTableIndexKey) error - - doNotImplement() -} - -type ExampleTableIterator struct { - ormtable.Iterator -} - -func (i ExampleTableIterator) Value() (*ExampleTable, error) { - var exampleTable ExampleTable - err := i.UnmarshalMessage(&exampleTable) - return &exampleTable, err -} - -type ExampleTableIndexKey interface { - id() uint32 - values() []interface{} - exampleTableIndexKey() -} - -// primary key starting index.. -type ExampleTablePrimaryKey = ExampleTableU32I64StrIndexKey - -type ExampleTableU32I64StrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableU32I64StrIndexKey) id() uint32 { return 0 } -func (x ExampleTableU32I64StrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableU32I64StrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableU32I64StrIndexKey) WithU32(u32 uint32) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32} - return this -} - -func (this ExampleTableU32I64StrIndexKey) WithU32I64(u32 uint32, i64 int64) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32, i64} - return this -} - -func (this ExampleTableU32I64StrIndexKey) WithU32I64Str(u32 uint32, i64 int64, str string) ExampleTableU32I64StrIndexKey { - this.vs = []interface{}{u32, i64, str} - return this -} - -type ExampleTableU64StrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableU64StrIndexKey) id() uint32 { return 1 } -func (x ExampleTableU64StrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableU64StrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableU64StrIndexKey) WithU64(u64 uint64) ExampleTableU64StrIndexKey { - this.vs = []interface{}{u64} - return this -} - -func (this ExampleTableU64StrIndexKey) WithU64Str(u64 uint64, str string) ExampleTableU64StrIndexKey { - this.vs = []interface{}{u64, str} - return this -} - -type ExampleTableStrU32IndexKey struct { - vs []interface{} -} - -func (x ExampleTableStrU32IndexKey) id() uint32 { return 2 } -func (x ExampleTableStrU32IndexKey) values() []interface{} { return x.vs } -func (x ExampleTableStrU32IndexKey) exampleTableIndexKey() {} - -func (this ExampleTableStrU32IndexKey) WithStr(str string) ExampleTableStrU32IndexKey { - this.vs = []interface{}{str} - return this -} - -func (this ExampleTableStrU32IndexKey) WithStrU32(str string, u32 uint32) ExampleTableStrU32IndexKey { - this.vs = []interface{}{str, u32} - return this -} - -type ExampleTableBzStrIndexKey struct { - vs []interface{} -} - -func (x ExampleTableBzStrIndexKey) id() uint32 { return 3 } -func (x ExampleTableBzStrIndexKey) values() []interface{} { return x.vs } -func (x ExampleTableBzStrIndexKey) exampleTableIndexKey() {} - -func (this ExampleTableBzStrIndexKey) WithBz(bz []byte) ExampleTableBzStrIndexKey { - this.vs = []interface{}{bz} - return this -} - -func (this ExampleTableBzStrIndexKey) WithBzStr(bz []byte, str string) ExampleTableBzStrIndexKey { - this.vs = []interface{}{bz, str} - return this -} - -type exampleTableTable struct { - table ormtable.Table -} - -func (this exampleTableTable) Insert(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Insert(ctx, exampleTable) -} - -func (this exampleTableTable) Update(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Update(ctx, exampleTable) -} - -func (this exampleTableTable) Save(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Save(ctx, exampleTable) -} - -func (this exampleTableTable) Delete(ctx context.Context, exampleTable *ExampleTable) error { - return this.table.Delete(ctx, exampleTable) -} - -func (this exampleTableTable) Has(ctx context.Context, u32 uint32, i64 int64, str string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, u32, i64, str) -} - -func (this exampleTableTable) Get(ctx context.Context, u32 uint32, i64 int64, str string) (*ExampleTable, error) { - var exampleTable ExampleTable - found, err := this.table.PrimaryKey().Get(ctx, &exampleTable, u32, i64, str) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTable, nil -} - -func (this exampleTableTable) HasByU64Str(ctx context.Context, u64 uint64, str string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - u64, - str, - ) -} - -func (this exampleTableTable) GetByU64Str(ctx context.Context, u64 uint64, str string) (*ExampleTable, error) { - var exampleTable ExampleTable - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &exampleTable, - u64, - str, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTable, nil -} - -func (this exampleTableTable) List(ctx context.Context, prefixKey ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleTableIterator{it}, err -} - -func (this exampleTableTable) ListRange(ctx context.Context, from, to ExampleTableIndexKey, opts ...ormlist.Option) (ExampleTableIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleTableIterator{it}, err -} - -func (this exampleTableTable) DeleteBy(ctx context.Context, prefixKey ExampleTableIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleTableTable) DeleteRange(ctx context.Context, from, to ExampleTableIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleTableTable) doNotImplement() {} - -var _ ExampleTableTable = exampleTableTable{} - -func NewExampleTableTable(db ormtable.Schema) (ExampleTableTable, error) { - table := db.GetTable(&ExampleTable{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleTable{}).ProtoReflect().Descriptor().FullName())) - } - return exampleTableTable{table}, nil -} - -type ExampleAutoIncrementTableTable interface { - Insert(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - InsertReturningId(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Save(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Delete(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleAutoIncrementTable, error) - HasByX(ctx context.Context, x string) (found bool, err error) - // GetByX returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByX(ctx context.Context, x string) (*ExampleAutoIncrementTable, error) - List(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) - ListRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey) error - - doNotImplement() -} - -type ExampleAutoIncrementTableIterator struct { - ormtable.Iterator -} - -func (i ExampleAutoIncrementTableIterator) Value() (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - err := i.UnmarshalMessage(&exampleAutoIncrementTable) - return &exampleAutoIncrementTable, err -} - -type ExampleAutoIncrementTableIndexKey interface { - id() uint32 - values() []interface{} - exampleAutoIncrementTableIndexKey() -} - -// primary key starting index.. -type ExampleAutoIncrementTablePrimaryKey = ExampleAutoIncrementTableIdIndexKey - -type ExampleAutoIncrementTableIdIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncrementTableIdIndexKey) id() uint32 { return 0 } -func (x ExampleAutoIncrementTableIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncrementTableIdIndexKey) exampleAutoIncrementTableIndexKey() {} - -func (this ExampleAutoIncrementTableIdIndexKey) WithId(id uint64) ExampleAutoIncrementTableIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleAutoIncrementTableXIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncrementTableXIndexKey) id() uint32 { return 1 } -func (x ExampleAutoIncrementTableXIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncrementTableXIndexKey) exampleAutoIncrementTableIndexKey() {} - -func (this ExampleAutoIncrementTableXIndexKey) WithX(x string) ExampleAutoIncrementTableXIndexKey { - this.vs = []interface{}{x} - return this -} - -type exampleAutoIncrementTableTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleAutoIncrementTableTable) Insert(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Insert(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Update(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Update(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Save(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Save(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) Delete(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) error { - return this.table.Delete(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) InsertReturningId(ctx context.Context, exampleAutoIncrementTable *ExampleAutoIncrementTable) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleAutoIncrementTable) -} - -func (this exampleAutoIncrementTableTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleAutoIncrementTableTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleAutoIncrementTableTable) Get(ctx context.Context, id uint64) (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - found, err := this.table.PrimaryKey().Get(ctx, &exampleAutoIncrementTable, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncrementTable, nil -} - -func (this exampleAutoIncrementTableTable) HasByX(ctx context.Context, x string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - x, - ) -} - -func (this exampleAutoIncrementTableTable) GetByX(ctx context.Context, x string) (*ExampleAutoIncrementTable, error) { - var exampleAutoIncrementTable ExampleAutoIncrementTable - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &exampleAutoIncrementTable, - x, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncrementTable, nil -} - -func (this exampleAutoIncrementTableTable) List(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleAutoIncrementTableIterator{it}, err -} - -func (this exampleAutoIncrementTableTable) ListRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey, opts ...ormlist.Option) (ExampleAutoIncrementTableIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleAutoIncrementTableIterator{it}, err -} - -func (this exampleAutoIncrementTableTable) DeleteBy(ctx context.Context, prefixKey ExampleAutoIncrementTableIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleAutoIncrementTableTable) DeleteRange(ctx context.Context, from, to ExampleAutoIncrementTableIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleAutoIncrementTableTable) doNotImplement() {} - -var _ ExampleAutoIncrementTableTable = exampleAutoIncrementTableTable{} - -func NewExampleAutoIncrementTableTable(db ormtable.Schema) (ExampleAutoIncrementTableTable, error) { - table := db.GetTable(&ExampleAutoIncrementTable{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleAutoIncrementTable{}).ProtoReflect().Descriptor().FullName())) - } - return exampleAutoIncrementTableTable{table.(ormtable.AutoIncrementTable)}, nil -} - -// singleton store -type ExampleSingletonTable interface { - Get(ctx context.Context) (*ExampleSingleton, error) - Save(ctx context.Context, exampleSingleton *ExampleSingleton) error -} - -type exampleSingletonTable struct { - table ormtable.Table -} - -var _ ExampleSingletonTable = exampleSingletonTable{} - -func (x exampleSingletonTable) Get(ctx context.Context) (*ExampleSingleton, error) { - exampleSingleton := &ExampleSingleton{} - _, err := x.table.Get(ctx, exampleSingleton) - return exampleSingleton, err -} - -func (x exampleSingletonTable) Save(ctx context.Context, exampleSingleton *ExampleSingleton) error { - return x.table.Save(ctx, exampleSingleton) -} - -func NewExampleSingletonTable(db ormtable.Schema) (ExampleSingletonTable, error) { - table := db.GetTable(&ExampleSingleton{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleSingleton{}).ProtoReflect().Descriptor().FullName())) - } - return &exampleSingletonTable{table}, nil -} - -type ExampleTimestampTable interface { - Insert(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - InsertReturningId(ctx context.Context, exampleTimestamp *ExampleTimestamp) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Save(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Delete(ctx context.Context, exampleTimestamp *ExampleTimestamp) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleTimestamp, error) - List(ctx context.Context, prefixKey ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) - ListRange(ctx context.Context, from, to ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleTimestampIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleTimestampIndexKey) error - - doNotImplement() -} - -type ExampleTimestampIterator struct { - ormtable.Iterator -} - -func (i ExampleTimestampIterator) Value() (*ExampleTimestamp, error) { - var exampleTimestamp ExampleTimestamp - err := i.UnmarshalMessage(&exampleTimestamp) - return &exampleTimestamp, err -} - -type ExampleTimestampIndexKey interface { - id() uint32 - values() []interface{} - exampleTimestampIndexKey() -} - -// primary key starting index.. -type ExampleTimestampPrimaryKey = ExampleTimestampIdIndexKey - -type ExampleTimestampIdIndexKey struct { - vs []interface{} -} - -func (x ExampleTimestampIdIndexKey) id() uint32 { return 0 } -func (x ExampleTimestampIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleTimestampIdIndexKey) exampleTimestampIndexKey() {} - -func (this ExampleTimestampIdIndexKey) WithId(id uint64) ExampleTimestampIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleTimestampTsIndexKey struct { - vs []interface{} -} - -func (x ExampleTimestampTsIndexKey) id() uint32 { return 1 } -func (x ExampleTimestampTsIndexKey) values() []interface{} { return x.vs } -func (x ExampleTimestampTsIndexKey) exampleTimestampIndexKey() {} - -func (this ExampleTimestampTsIndexKey) WithTs(ts *timestamppb.Timestamp) ExampleTimestampTsIndexKey { - this.vs = []interface{}{ts} - return this -} - -type exampleTimestampTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleTimestampTable) Insert(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Insert(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Update(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Update(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Save(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Save(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) Delete(ctx context.Context, exampleTimestamp *ExampleTimestamp) error { - return this.table.Delete(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) InsertReturningId(ctx context.Context, exampleTimestamp *ExampleTimestamp) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleTimestamp) -} - -func (this exampleTimestampTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleTimestampTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleTimestampTable) Get(ctx context.Context, id uint64) (*ExampleTimestamp, error) { - var exampleTimestamp ExampleTimestamp - found, err := this.table.PrimaryKey().Get(ctx, &exampleTimestamp, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleTimestamp, nil -} - -func (this exampleTimestampTable) List(ctx context.Context, prefixKey ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleTimestampIterator{it}, err -} - -func (this exampleTimestampTable) ListRange(ctx context.Context, from, to ExampleTimestampIndexKey, opts ...ormlist.Option) (ExampleTimestampIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleTimestampIterator{it}, err -} - -func (this exampleTimestampTable) DeleteBy(ctx context.Context, prefixKey ExampleTimestampIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleTimestampTable) DeleteRange(ctx context.Context, from, to ExampleTimestampIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleTimestampTable) doNotImplement() {} - -var _ ExampleTimestampTable = exampleTimestampTable{} - -func NewExampleTimestampTable(db ormtable.Schema) (ExampleTimestampTable, error) { - table := db.GetTable(&ExampleTimestamp{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleTimestamp{}).ProtoReflect().Descriptor().FullName())) - } - return exampleTimestampTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type ExampleDurationTable interface { - Insert(ctx context.Context, exampleDuration *ExampleDuration) error - InsertReturningId(ctx context.Context, exampleDuration *ExampleDuration) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleDuration *ExampleDuration) error - Save(ctx context.Context, exampleDuration *ExampleDuration) error - Delete(ctx context.Context, exampleDuration *ExampleDuration) error - Has(ctx context.Context, id uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, id uint64) (*ExampleDuration, error) - List(ctx context.Context, prefixKey ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) - ListRange(ctx context.Context, from, to ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleDurationIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleDurationIndexKey) error - - doNotImplement() -} - -type ExampleDurationIterator struct { - ormtable.Iterator -} - -func (i ExampleDurationIterator) Value() (*ExampleDuration, error) { - var exampleDuration ExampleDuration - err := i.UnmarshalMessage(&exampleDuration) - return &exampleDuration, err -} - -type ExampleDurationIndexKey interface { - id() uint32 - values() []interface{} - exampleDurationIndexKey() -} - -// primary key starting index.. -type ExampleDurationPrimaryKey = ExampleDurationIdIndexKey - -type ExampleDurationIdIndexKey struct { - vs []interface{} -} - -func (x ExampleDurationIdIndexKey) id() uint32 { return 0 } -func (x ExampleDurationIdIndexKey) values() []interface{} { return x.vs } -func (x ExampleDurationIdIndexKey) exampleDurationIndexKey() {} - -func (this ExampleDurationIdIndexKey) WithId(id uint64) ExampleDurationIdIndexKey { - this.vs = []interface{}{id} - return this -} - -type ExampleDurationDurIndexKey struct { - vs []interface{} -} - -func (x ExampleDurationDurIndexKey) id() uint32 { return 1 } -func (x ExampleDurationDurIndexKey) values() []interface{} { return x.vs } -func (x ExampleDurationDurIndexKey) exampleDurationIndexKey() {} - -func (this ExampleDurationDurIndexKey) WithDur(dur *durationpb.Duration) ExampleDurationDurIndexKey { - this.vs = []interface{}{dur} - return this -} - -type exampleDurationTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleDurationTable) Insert(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Insert(ctx, exampleDuration) -} - -func (this exampleDurationTable) Update(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Update(ctx, exampleDuration) -} - -func (this exampleDurationTable) Save(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Save(ctx, exampleDuration) -} - -func (this exampleDurationTable) Delete(ctx context.Context, exampleDuration *ExampleDuration) error { - return this.table.Delete(ctx, exampleDuration) -} - -func (this exampleDurationTable) InsertReturningId(ctx context.Context, exampleDuration *ExampleDuration) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleDuration) -} - -func (this exampleDurationTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleDurationTable) Has(ctx context.Context, id uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, id) -} - -func (this exampleDurationTable) Get(ctx context.Context, id uint64) (*ExampleDuration, error) { - var exampleDuration ExampleDuration - found, err := this.table.PrimaryKey().Get(ctx, &exampleDuration, id) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleDuration, nil -} - -func (this exampleDurationTable) List(ctx context.Context, prefixKey ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleDurationIterator{it}, err -} - -func (this exampleDurationTable) ListRange(ctx context.Context, from, to ExampleDurationIndexKey, opts ...ormlist.Option) (ExampleDurationIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleDurationIterator{it}, err -} - -func (this exampleDurationTable) DeleteBy(ctx context.Context, prefixKey ExampleDurationIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleDurationTable) DeleteRange(ctx context.Context, from, to ExampleDurationIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleDurationTable) doNotImplement() {} - -var _ ExampleDurationTable = exampleDurationTable{} - -func NewExampleDurationTable(db ormtable.Schema) (ExampleDurationTable, error) { - table := db.GetTable(&ExampleDuration{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleDuration{}).ProtoReflect().Descriptor().FullName())) - } - return exampleDurationTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type SimpleExampleTable interface { - Insert(ctx context.Context, simpleExample *SimpleExample) error - Update(ctx context.Context, simpleExample *SimpleExample) error - Save(ctx context.Context, simpleExample *SimpleExample) error - Delete(ctx context.Context, simpleExample *SimpleExample) error - Has(ctx context.Context, name string) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, name string) (*SimpleExample, error) - HasByUnique(ctx context.Context, unique string) (found bool, err error) - // GetByUnique returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - GetByUnique(ctx context.Context, unique string) (*SimpleExample, error) - List(ctx context.Context, prefixKey SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) - ListRange(ctx context.Context, from, to SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) - DeleteBy(ctx context.Context, prefixKey SimpleExampleIndexKey) error - DeleteRange(ctx context.Context, from, to SimpleExampleIndexKey) error - - doNotImplement() -} - -type SimpleExampleIterator struct { - ormtable.Iterator -} - -func (i SimpleExampleIterator) Value() (*SimpleExample, error) { - var simpleExample SimpleExample - err := i.UnmarshalMessage(&simpleExample) - return &simpleExample, err -} - -type SimpleExampleIndexKey interface { - id() uint32 - values() []interface{} - simpleExampleIndexKey() -} - -// primary key starting index.. -type SimpleExamplePrimaryKey = SimpleExampleNameIndexKey - -type SimpleExampleNameIndexKey struct { - vs []interface{} -} - -func (x SimpleExampleNameIndexKey) id() uint32 { return 0 } -func (x SimpleExampleNameIndexKey) values() []interface{} { return x.vs } -func (x SimpleExampleNameIndexKey) simpleExampleIndexKey() {} - -func (this SimpleExampleNameIndexKey) WithName(name string) SimpleExampleNameIndexKey { - this.vs = []interface{}{name} - return this -} - -type SimpleExampleUniqueIndexKey struct { - vs []interface{} -} - -func (x SimpleExampleUniqueIndexKey) id() uint32 { return 1 } -func (x SimpleExampleUniqueIndexKey) values() []interface{} { return x.vs } -func (x SimpleExampleUniqueIndexKey) simpleExampleIndexKey() {} - -func (this SimpleExampleUniqueIndexKey) WithUnique(unique string) SimpleExampleUniqueIndexKey { - this.vs = []interface{}{unique} - return this -} - -type simpleExampleTable struct { - table ormtable.Table -} - -func (this simpleExampleTable) Insert(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Insert(ctx, simpleExample) -} - -func (this simpleExampleTable) Update(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Update(ctx, simpleExample) -} - -func (this simpleExampleTable) Save(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Save(ctx, simpleExample) -} - -func (this simpleExampleTable) Delete(ctx context.Context, simpleExample *SimpleExample) error { - return this.table.Delete(ctx, simpleExample) -} - -func (this simpleExampleTable) Has(ctx context.Context, name string) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, name) -} - -func (this simpleExampleTable) Get(ctx context.Context, name string) (*SimpleExample, error) { - var simpleExample SimpleExample - found, err := this.table.PrimaryKey().Get(ctx, &simpleExample, name) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &simpleExample, nil -} - -func (this simpleExampleTable) HasByUnique(ctx context.Context, unique string) (found bool, err error) { - return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, - unique, - ) -} - -func (this simpleExampleTable) GetByUnique(ctx context.Context, unique string) (*SimpleExample, error) { - var simpleExample SimpleExample - found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &simpleExample, - unique, - ) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &simpleExample, nil -} - -func (this simpleExampleTable) List(ctx context.Context, prefixKey SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return SimpleExampleIterator{it}, err -} - -func (this simpleExampleTable) ListRange(ctx context.Context, from, to SimpleExampleIndexKey, opts ...ormlist.Option) (SimpleExampleIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return SimpleExampleIterator{it}, err -} - -func (this simpleExampleTable) DeleteBy(ctx context.Context, prefixKey SimpleExampleIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this simpleExampleTable) DeleteRange(ctx context.Context, from, to SimpleExampleIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this simpleExampleTable) doNotImplement() {} - -var _ SimpleExampleTable = simpleExampleTable{} - -func NewSimpleExampleTable(db ormtable.Schema) (SimpleExampleTable, error) { - table := db.GetTable(&SimpleExample{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&SimpleExample{}).ProtoReflect().Descriptor().FullName())) - } - return simpleExampleTable{table}, nil -} - -type ExampleAutoIncFieldNameTable interface { - Insert(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - InsertReturningFoo(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) (uint64, error) - LastInsertedSequence(ctx context.Context) (uint64, error) - Update(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Save(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Delete(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error - Has(ctx context.Context, foo uint64) (found bool, err error) - // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. - Get(ctx context.Context, foo uint64) (*ExampleAutoIncFieldName, error) - List(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) - ListRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) - DeleteBy(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey) error - DeleteRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey) error - - doNotImplement() -} - -type ExampleAutoIncFieldNameIterator struct { - ormtable.Iterator -} - -func (i ExampleAutoIncFieldNameIterator) Value() (*ExampleAutoIncFieldName, error) { - var exampleAutoIncFieldName ExampleAutoIncFieldName - err := i.UnmarshalMessage(&exampleAutoIncFieldName) - return &exampleAutoIncFieldName, err -} - -type ExampleAutoIncFieldNameIndexKey interface { - id() uint32 - values() []interface{} - exampleAutoIncFieldNameIndexKey() -} - -// primary key starting index.. -type ExampleAutoIncFieldNamePrimaryKey = ExampleAutoIncFieldNameFooIndexKey - -type ExampleAutoIncFieldNameFooIndexKey struct { - vs []interface{} -} - -func (x ExampleAutoIncFieldNameFooIndexKey) id() uint32 { return 0 } -func (x ExampleAutoIncFieldNameFooIndexKey) values() []interface{} { return x.vs } -func (x ExampleAutoIncFieldNameFooIndexKey) exampleAutoIncFieldNameIndexKey() {} - -func (this ExampleAutoIncFieldNameFooIndexKey) WithFoo(foo uint64) ExampleAutoIncFieldNameFooIndexKey { - this.vs = []interface{}{foo} - return this -} - -type exampleAutoIncFieldNameTable struct { - table ormtable.AutoIncrementTable -} - -func (this exampleAutoIncFieldNameTable) Insert(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Insert(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Update(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Update(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Save(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Save(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) Delete(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) error { - return this.table.Delete(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) InsertReturningFoo(ctx context.Context, exampleAutoIncFieldName *ExampleAutoIncFieldName) (uint64, error) { - return this.table.InsertReturningPKey(ctx, exampleAutoIncFieldName) -} - -func (this exampleAutoIncFieldNameTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - return this.table.LastInsertedSequence(ctx) -} - -func (this exampleAutoIncFieldNameTable) Has(ctx context.Context, foo uint64) (found bool, err error) { - return this.table.PrimaryKey().Has(ctx, foo) -} - -func (this exampleAutoIncFieldNameTable) Get(ctx context.Context, foo uint64) (*ExampleAutoIncFieldName, error) { - var exampleAutoIncFieldName ExampleAutoIncFieldName - found, err := this.table.PrimaryKey().Get(ctx, &exampleAutoIncFieldName, foo) - if err != nil { - return nil, err - } - if !found { - return nil, ormerrors.NotFound - } - return &exampleAutoIncFieldName, nil -} - -func (this exampleAutoIncFieldNameTable) List(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) { - it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...) - return ExampleAutoIncFieldNameIterator{it}, err -} - -func (this exampleAutoIncFieldNameTable) ListRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey, opts ...ormlist.Option) (ExampleAutoIncFieldNameIterator, error) { - it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...) - return ExampleAutoIncFieldNameIterator{it}, err -} - -func (this exampleAutoIncFieldNameTable) DeleteBy(ctx context.Context, prefixKey ExampleAutoIncFieldNameIndexKey) error { - return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...) -} - -func (this exampleAutoIncFieldNameTable) DeleteRange(ctx context.Context, from, to ExampleAutoIncFieldNameIndexKey) error { - return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values()) -} - -func (this exampleAutoIncFieldNameTable) doNotImplement() {} - -var _ ExampleAutoIncFieldNameTable = exampleAutoIncFieldNameTable{} - -func NewExampleAutoIncFieldNameTable(db ormtable.Schema) (ExampleAutoIncFieldNameTable, error) { - table := db.GetTable(&ExampleAutoIncFieldName{}) - if table == nil { - return nil, ormerrors.TableNotFound.Wrap(string((&ExampleAutoIncFieldName{}).ProtoReflect().Descriptor().FullName())) - } - return exampleAutoIncFieldNameTable{table.(ormtable.AutoIncrementTable)}, nil -} - -type TestSchemaStore interface { - ExampleTableTable() ExampleTableTable - ExampleAutoIncrementTableTable() ExampleAutoIncrementTableTable - ExampleSingletonTable() ExampleSingletonTable - ExampleTimestampTable() ExampleTimestampTable - ExampleDurationTable() ExampleDurationTable - SimpleExampleTable() SimpleExampleTable - ExampleAutoIncFieldNameTable() ExampleAutoIncFieldNameTable - - doNotImplement() -} - -type testSchemaStore struct { - exampleTable ExampleTableTable - exampleAutoIncrementTable ExampleAutoIncrementTableTable - exampleSingleton ExampleSingletonTable - exampleTimestamp ExampleTimestampTable - exampleDuration ExampleDurationTable - simpleExample SimpleExampleTable - exampleAutoIncFieldName ExampleAutoIncFieldNameTable -} - -func (x testSchemaStore) ExampleTableTable() ExampleTableTable { - return x.exampleTable -} - -func (x testSchemaStore) ExampleAutoIncrementTableTable() ExampleAutoIncrementTableTable { - return x.exampleAutoIncrementTable -} - -func (x testSchemaStore) ExampleSingletonTable() ExampleSingletonTable { - return x.exampleSingleton -} - -func (x testSchemaStore) ExampleTimestampTable() ExampleTimestampTable { - return x.exampleTimestamp -} - -func (x testSchemaStore) ExampleDurationTable() ExampleDurationTable { - return x.exampleDuration -} - -func (x testSchemaStore) SimpleExampleTable() SimpleExampleTable { - return x.simpleExample -} - -func (x testSchemaStore) ExampleAutoIncFieldNameTable() ExampleAutoIncFieldNameTable { - return x.exampleAutoIncFieldName -} - -func (testSchemaStore) doNotImplement() {} - -var _ TestSchemaStore = testSchemaStore{} - -func NewTestSchemaStore(db ormtable.Schema) (TestSchemaStore, error) { - exampleTableTable, err := NewExampleTableTable(db) - if err != nil { - return nil, err - } - - exampleAutoIncrementTableTable, err := NewExampleAutoIncrementTableTable(db) - if err != nil { - return nil, err - } - - exampleSingletonTable, err := NewExampleSingletonTable(db) - if err != nil { - return nil, err - } - - exampleTimestampTable, err := NewExampleTimestampTable(db) - if err != nil { - return nil, err - } - - exampleDurationTable, err := NewExampleDurationTable(db) - if err != nil { - return nil, err - } - - simpleExampleTable, err := NewSimpleExampleTable(db) - if err != nil { - return nil, err - } - - exampleAutoIncFieldNameTable, err := NewExampleAutoIncFieldNameTable(db) - if err != nil { - return nil, err - } - - return testSchemaStore{ - exampleTableTable, - exampleAutoIncrementTableTable, - exampleSingletonTable, - exampleTimestampTable, - exampleDurationTable, - simpleExampleTable, - exampleAutoIncFieldNameTable, - }, nil -} diff --git a/orm/internal/testpb/test_schema.pb.go b/orm/internal/testpb/test_schema.pb.go deleted file mode 100644 index 79f8f8655356..000000000000 --- a/orm/internal/testpb/test_schema.pb.go +++ /dev/null @@ -1,999 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/test_schema.proto - -package testpb - -import ( - _ "cosmossdk.io/api/cosmos/orm/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Enum int32 - -const ( - Enum_ENUM_UNSPECIFIED Enum = 0 - Enum_ENUM_ONE Enum = 1 - Enum_ENUM_TWO Enum = 2 - Enum_ENUM_FIVE Enum = 5 - Enum_ENUM_NEG_THREE Enum = -3 -) - -// Enum value maps for Enum. -var ( - Enum_name = map[int32]string{ - 0: "ENUM_UNSPECIFIED", - 1: "ENUM_ONE", - 2: "ENUM_TWO", - 5: "ENUM_FIVE", - -3: "ENUM_NEG_THREE", - } - Enum_value = map[string]int32{ - "ENUM_UNSPECIFIED": 0, - "ENUM_ONE": 1, - "ENUM_TWO": 2, - "ENUM_FIVE": 5, - "ENUM_NEG_THREE": -3, - } -) - -func (x Enum) Enum() *Enum { - p := new(Enum) - *p = x - return p -} - -func (x Enum) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Enum) Descriptor() protoreflect.EnumDescriptor { - return file_testpb_test_schema_proto_enumTypes[0].Descriptor() -} - -func (Enum) Type() protoreflect.EnumType { - return &file_testpb_test_schema_proto_enumTypes[0] -} - -func (x Enum) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Enum.Descriptor instead. -func (Enum) EnumDescriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0} -} - -type ExampleTable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Valid key fields: - U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` - U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"` - Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` - Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"` - Ts *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ts,proto3" json:"ts,omitempty"` - Dur *durationpb.Duration `protobuf:"bytes,6,opt,name=dur,proto3" json:"dur,omitempty"` - I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"` - S32 int32 `protobuf:"zigzag32,8,opt,name=s32,proto3" json:"s32,omitempty"` - Sf32 int32 `protobuf:"fixed32,9,opt,name=sf32,proto3" json:"sf32,omitempty"` - I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"` - S64 int64 `protobuf:"zigzag64,11,opt,name=s64,proto3" json:"s64,omitempty"` - Sf64 int64 `protobuf:"fixed64,12,opt,name=sf64,proto3" json:"sf64,omitempty"` - F32 uint32 `protobuf:"fixed32,13,opt,name=f32,proto3" json:"f32,omitempty"` - F64 uint64 `protobuf:"fixed64,14,opt,name=f64,proto3" json:"f64,omitempty"` - B bool `protobuf:"varint,15,opt,name=b,proto3" json:"b,omitempty"` - E Enum `protobuf:"varint,16,opt,name=e,proto3,enum=testpb.Enum" json:"e,omitempty"` - // Invalid key fields: - Repeated []uint32 `protobuf:"varint,17,rep,packed,name=repeated,proto3" json:"repeated,omitempty"` - Map map[string]uint32 `protobuf:"bytes,18,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Msg *ExampleTable_ExampleMessage `protobuf:"bytes,19,opt,name=msg,proto3" json:"msg,omitempty"` - // Types that are assignable to Sum: - // - // *ExampleTable_Oneof - Sum isExampleTable_Sum `protobuf_oneof:"sum"` -} - -func (x *ExampleTable) Reset() { - *x = ExampleTable{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTable) ProtoMessage() {} - -func (x *ExampleTable) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleTable.ProtoReflect.Descriptor instead. -func (*ExampleTable) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0} -} - -func (x *ExampleTable) GetU32() uint32 { - if x != nil { - return x.U32 - } - return 0 -} - -func (x *ExampleTable) GetU64() uint64 { - if x != nil { - return x.U64 - } - return 0 -} - -func (x *ExampleTable) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -func (x *ExampleTable) GetBz() []byte { - if x != nil { - return x.Bz - } - return nil -} - -func (x *ExampleTable) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -func (x *ExampleTable) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -func (x *ExampleTable) GetI32() int32 { - if x != nil { - return x.I32 - } - return 0 -} - -func (x *ExampleTable) GetS32() int32 { - if x != nil { - return x.S32 - } - return 0 -} - -func (x *ExampleTable) GetSf32() int32 { - if x != nil { - return x.Sf32 - } - return 0 -} - -func (x *ExampleTable) GetI64() int64 { - if x != nil { - return x.I64 - } - return 0 -} - -func (x *ExampleTable) GetS64() int64 { - if x != nil { - return x.S64 - } - return 0 -} - -func (x *ExampleTable) GetSf64() int64 { - if x != nil { - return x.Sf64 - } - return 0 -} - -func (x *ExampleTable) GetF32() uint32 { - if x != nil { - return x.F32 - } - return 0 -} - -func (x *ExampleTable) GetF64() uint64 { - if x != nil { - return x.F64 - } - return 0 -} - -func (x *ExampleTable) GetB() bool { - if x != nil { - return x.B - } - return false -} - -func (x *ExampleTable) GetE() Enum { - if x != nil { - return x.E - } - return Enum_ENUM_UNSPECIFIED -} - -func (x *ExampleTable) GetRepeated() []uint32 { - if x != nil { - return x.Repeated - } - return nil -} - -func (x *ExampleTable) GetMap() map[string]uint32 { - if x != nil { - return x.Map - } - return nil -} - -func (x *ExampleTable) GetMsg() *ExampleTable_ExampleMessage { - if x != nil { - return x.Msg - } - return nil -} - -func (m *ExampleTable) GetSum() isExampleTable_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (x *ExampleTable) GetOneof() uint32 { - if x, ok := x.GetSum().(*ExampleTable_Oneof); ok { - return x.Oneof - } - return 0 -} - -type isExampleTable_Sum interface { - isExampleTable_Sum() -} - -type ExampleTable_Oneof struct { - Oneof uint32 `protobuf:"varint,20,opt,name=oneof,proto3,oneof"` -} - -func (*ExampleTable_Oneof) isExampleTable_Sum() {} - -type ExampleAutoIncrementTable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` - Y int32 `protobuf:"varint,3,opt,name=y,proto3" json:"y,omitempty"` -} - -func (x *ExampleAutoIncrementTable) Reset() { - *x = ExampleAutoIncrementTable{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleAutoIncrementTable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleAutoIncrementTable) ProtoMessage() {} - -func (x *ExampleAutoIncrementTable) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleAutoIncrementTable.ProtoReflect.Descriptor instead. -func (*ExampleAutoIncrementTable) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{1} -} - -func (x *ExampleAutoIncrementTable) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleAutoIncrementTable) GetX() string { - if x != nil { - return x.X - } - return "" -} - -func (x *ExampleAutoIncrementTable) GetY() int32 { - if x != nil { - return x.Y - } - return 0 -} - -type ExampleSingleton struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleSingleton) Reset() { - *x = ExampleSingleton{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleSingleton) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleSingleton) ProtoMessage() {} - -func (x *ExampleSingleton) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleSingleton.ProtoReflect.Descriptor instead. -func (*ExampleSingleton) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{2} -} - -func (x *ExampleSingleton) GetFoo() string { - if x != nil { - return x.Foo - } - return "" -} - -func (x *ExampleSingleton) GetBar() int32 { - if x != nil { - return x.Bar - } - return 0 -} - -type ExampleTimestamp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Ts *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=ts,proto3" json:"ts,omitempty"` -} - -func (x *ExampleTimestamp) Reset() { - *x = ExampleTimestamp{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTimestamp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTimestamp) ProtoMessage() {} - -func (x *ExampleTimestamp) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleTimestamp.ProtoReflect.Descriptor instead. -func (*ExampleTimestamp) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{3} -} - -func (x *ExampleTimestamp) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleTimestamp) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ExampleTimestamp) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -type ExampleDuration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Dur *durationpb.Duration `protobuf:"bytes,3,opt,name=dur,proto3" json:"dur,omitempty"` -} - -func (x *ExampleDuration) Reset() { - *x = ExampleDuration{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleDuration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleDuration) ProtoMessage() {} - -func (x *ExampleDuration) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleDuration.ProtoReflect.Descriptor instead. -func (*ExampleDuration) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{4} -} - -func (x *ExampleDuration) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ExampleDuration) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ExampleDuration) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -type SimpleExample struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Unique string `protobuf:"bytes,2,opt,name=unique,proto3" json:"unique,omitempty"` - NotUnique string `protobuf:"bytes,3,opt,name=not_unique,json=notUnique,proto3" json:"not_unique,omitempty"` -} - -func (x *SimpleExample) Reset() { - *x = SimpleExample{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleExample) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleExample) ProtoMessage() {} - -func (x *SimpleExample) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleExample.ProtoReflect.Descriptor instead. -func (*SimpleExample) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{5} -} - -func (x *SimpleExample) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SimpleExample) GetUnique() string { - if x != nil { - return x.Unique - } - return "" -} - -func (x *SimpleExample) GetNotUnique() string { - if x != nil { - return x.NotUnique - } - return "" -} - -// ExampleAutoIncFieldName is a table for testing InsertReturning. -type ExampleAutoIncFieldName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo uint64 `protobuf:"varint,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar uint64 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleAutoIncFieldName) Reset() { - *x = ExampleAutoIncFieldName{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleAutoIncFieldName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleAutoIncFieldName) ProtoMessage() {} - -func (x *ExampleAutoIncFieldName) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleAutoIncFieldName.ProtoReflect.Descriptor instead. -func (*ExampleAutoIncFieldName) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{6} -} - -func (x *ExampleAutoIncFieldName) GetFoo() uint64 { - if x != nil { - return x.Foo - } - return 0 -} - -func (x *ExampleAutoIncFieldName) GetBar() uint64 { - if x != nil { - return x.Bar - } - return 0 -} - -type ExampleTable_ExampleMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"` - Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"` -} - -func (x *ExampleTable_ExampleMessage) Reset() { - *x = ExampleTable_ExampleMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleTable_ExampleMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleTable_ExampleMessage) ProtoMessage() {} - -func (x *ExampleTable_ExampleMessage) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleTable_ExampleMessage.ProtoReflect.Descriptor instead. -func (*ExampleTable_ExampleMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *ExampleTable_ExampleMessage) GetFoo() string { - if x != nil { - return x.Foo - } - return "" -} - -func (x *ExampleTable_ExampleMessage) GetBar() int32 { - if x != nil { - return x.Bar - } - return 0 -} - -var File_testpb_test_schema_proto protoreflect.FileDescriptor - -var file_testpb_test_schema_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, - 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x05, 0x0a, - 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, - 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x73, 0x74, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x02, 0x62, 0x7a, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x12, - 0x2b, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x64, 0x75, 0x72, 0x12, 0x10, 0x0a, 0x03, - 0x69, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10, - 0x0a, 0x03, 0x73, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x73, 0x33, 0x32, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, - 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x36, 0x34, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x12, 0x52, 0x03, 0x73, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, - 0x66, 0x33, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x66, 0x33, 0x32, 0x12, 0x10, - 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, 0x34, - 0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x01, 0x62, 0x12, 0x1a, - 0x0a, 0x01, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x01, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x35, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x13, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x16, - 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, - 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x1a, 0x36, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x34, - 0x0a, 0x0e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, - 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x62, 0x61, 0x72, 0x3a, 0x3f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x39, 0x0a, 0x0d, 0x0a, 0x0b, - 0x75, 0x33, 0x32, 0x2c, 0x69, 0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x12, 0x0d, 0x0a, 0x07, 0x75, - 0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x10, 0x01, 0x18, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x74, - 0x72, 0x2c, 0x75, 0x33, 0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x62, 0x7a, 0x2c, 0x73, 0x74, - 0x72, 0x10, 0x03, 0x18, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x62, 0x0a, 0x19, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x01, 0x79, 0x3a, 0x19, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x13, 0x0a, 0x06, 0x0a, - 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x01, 0x78, 0x10, 0x01, 0x18, 0x01, 0x18, 0x03, - 0x22, 0x40, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x08, 0xfa, 0x9e, 0xd3, 0x8e, 0x03, 0x02, - 0x08, 0x02, 0x22, 0x7c, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x3a, 0x18, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x12, 0x0a, 0x06, - 0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x74, 0x73, 0x10, 0x01, 0x18, 0x04, - 0x22, 0x7d, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x03, 0x64, 0x75, 0x72, 0x3a, 0x19, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x13, 0x0a, 0x06, 0x0a, 0x02, - 0x69, 0x64, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x10, 0x01, 0x18, 0x04, 0x22, - 0x7a, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x6e, 0x6f, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x3a, 0x1e, 0xf2, 0x9e, 0xd3, - 0x8e, 0x03, 0x18, 0x0a, 0x06, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0c, 0x0a, 0x06, 0x75, - 0x6e, 0x69, 0x71, 0x75, 0x65, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 0x22, 0x50, 0x0a, 0x17, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x11, 0xf2, 0x9e, 0xd3, 0x8e, - 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x10, 0x01, 0x18, 0x06, 0x2a, 0x64, 0x0a, - 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, - 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e, 0x55, - 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, - 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4e, - 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x01, 0x42, 0x77, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x42, 0x0f, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_test_schema_proto_rawDescOnce sync.Once - file_testpb_test_schema_proto_rawDescData = file_testpb_test_schema_proto_rawDesc -) - -func file_testpb_test_schema_proto_rawDescGZIP() []byte { - file_testpb_test_schema_proto_rawDescOnce.Do(func() { - file_testpb_test_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_test_schema_proto_rawDescData) - }) - return file_testpb_test_schema_proto_rawDescData -} - -var file_testpb_test_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_testpb_test_schema_proto_goTypes = []interface{}{ - (Enum)(0), // 0: testpb.Enum - (*ExampleTable)(nil), // 1: testpb.ExampleTable - (*ExampleAutoIncrementTable)(nil), // 2: testpb.ExampleAutoIncrementTable - (*ExampleSingleton)(nil), // 3: testpb.ExampleSingleton - (*ExampleTimestamp)(nil), // 4: testpb.ExampleTimestamp - (*ExampleDuration)(nil), // 5: testpb.ExampleDuration - (*SimpleExample)(nil), // 6: testpb.SimpleExample - (*ExampleAutoIncFieldName)(nil), // 7: testpb.ExampleAutoIncFieldName - nil, // 8: testpb.ExampleTable.MapEntry - (*ExampleTable_ExampleMessage)(nil), // 9: testpb.ExampleTable.ExampleMessage - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 11: google.protobuf.Duration -} -var file_testpb_test_schema_proto_depIdxs = []int32{ - 10, // 0: testpb.ExampleTable.ts:type_name -> google.protobuf.Timestamp - 11, // 1: testpb.ExampleTable.dur:type_name -> google.protobuf.Duration - 0, // 2: testpb.ExampleTable.e:type_name -> testpb.Enum - 8, // 3: testpb.ExampleTable.map:type_name -> testpb.ExampleTable.MapEntry - 9, // 4: testpb.ExampleTable.msg:type_name -> testpb.ExampleTable.ExampleMessage - 10, // 5: testpb.ExampleTimestamp.ts:type_name -> google.protobuf.Timestamp - 11, // 6: testpb.ExampleDuration.dur:type_name -> google.protobuf.Duration - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_testpb_test_schema_proto_init() } -func file_testpb_test_schema_proto_init() { - if File_testpb_test_schema_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_testpb_test_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleAutoIncrementTable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleSingleton); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTimestamp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleDuration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleExample); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleAutoIncFieldName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleTable_ExampleMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_test_schema_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*ExampleTable_Oneof)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_test_schema_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_testpb_test_schema_proto_goTypes, - DependencyIndexes: file_testpb_test_schema_proto_depIdxs, - EnumInfos: file_testpb_test_schema_proto_enumTypes, - MessageInfos: file_testpb_test_schema_proto_msgTypes, - }.Build() - File_testpb_test_schema_proto = out.File - file_testpb_test_schema_proto_rawDesc = nil - file_testpb_test_schema_proto_goTypes = nil - file_testpb_test_schema_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/test_schema.proto b/orm/internal/testpb/test_schema.proto deleted file mode 100644 index 3aed58319e3f..000000000000 --- a/orm/internal/testpb/test_schema.proto +++ /dev/null @@ -1,142 +0,0 @@ -syntax = "proto3"; - -package testpb; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; -import "cosmos/orm/v1/orm.proto"; - -message ExampleTable { - // clang-format off - option (cosmos.orm.v1.table) = { - id: 1; - primary_key: { - fields: - "u32,i64,str" - } - index: { - id: - 1; - fields: - "u64,str" unique: true - } - index: { - id: - 2; - fields: - "str,u32" - } - index: { - id: - 3; - fields: - "bz,str" - } - }; -// clang-format on - -// Valid key fields: -uint32 u32 = 1; -uint64 u64 = 2; -string str = 3; -bytes bz = 4; -google.protobuf.Timestamp ts = 5; -google.protobuf.Duration dur = 6; -int32 i32 = 7; -sint32 s32 = 8; -sfixed32 sf32 = 9; -int64 i64 = 10; -sint64 s64 = 11; -sfixed64 sf64 = 12; -fixed32 f32 = 13; -fixed64 f64 = 14; -bool b = 15; -Enum e = 16; - -// Invalid key fields: -repeated uint32 repeated = 17; -map map = 18; -ExampleMessage msg = 19; -oneof sum { - uint32 oneof = 20; -} - -message ExampleMessage { - string foo = 1; - int32 bar = 2; -} -} - -enum Enum { - ENUM_UNSPECIFIED = 0; - ENUM_ONE = 1; - ENUM_TWO = 2; - ENUM_FIVE = 5; - ENUM_NEG_THREE = -3; -} - -message ExampleAutoIncrementTable { - option (cosmos.orm.v1.table) = { - id: 3 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "x" unique: true} - }; - - uint64 id = 1; - string x = 2; - int32 y = 3; -} - -message ExampleSingleton { - option (cosmos.orm.v1.singleton) = { - id: 2 - }; - string foo = 1; - int32 bar = 2; -} - -message ExampleTimestamp { - option (cosmos.orm.v1.table) = { - id: 4 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "ts"} - }; - - uint64 id = 1; - string name = 2; - google.protobuf.Timestamp ts = 3; -} - -message ExampleDuration { - option (cosmos.orm.v1.table) = { - id: 4 - primary_key: {fields: "id" auto_increment: true} - index: {id: 1 fields: "dur"} - }; - - uint64 id = 1; - string name = 2; - google.protobuf.Duration dur = 3; -} - -message SimpleExample { - option (cosmos.orm.v1.table) = { - id: 5 - primary_key: {fields: "name"} - index: {id: 1, fields: "unique", unique: true} - }; - - string name = 1; - string unique = 2; - string not_unique = 3; -} - -// ExampleAutoIncFieldName is a table for testing InsertReturning. -message ExampleAutoIncFieldName { - option (cosmos.orm.v1.table) = { - id: 6 - primary_key: {fields: "foo" auto_increment: true} - }; - uint64 foo = 1; - uint64 bar = 2; -} \ No newline at end of file diff --git a/orm/internal/testpb/test_schema_query.pb.go b/orm/internal/testpb/test_schema_query.pb.go deleted file mode 100644 index 48d7a1339a74..000000000000 --- a/orm/internal/testpb/test_schema_query.pb.go +++ /dev/null @@ -1,5036 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: testpb/test_schema_query.proto - -package testpb - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetExampleTableRequest is the TestSchemaQuery/GetExampleTableRequest request type. -type GetExampleTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u32 specifies the value of the u32 field in the primary key. - U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"` - // i64 specifies the value of the i64 field in the primary key. - I64 int64 `protobuf:"varint,2,opt,name=i64,proto3" json:"i64,omitempty"` - // str specifies the value of the str field in the primary key. - Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"` -} - -func (x *GetExampleTableRequest) Reset() { - *x = GetExampleTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableRequest) ProtoMessage() {} - -func (x *GetExampleTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{0} -} - -func (x *GetExampleTableRequest) GetU32() uint32 { - if x != nil { - return x.U32 - } - return 0 -} - -func (x *GetExampleTableRequest) GetI64() int64 { - if x != nil { - return x.I64 - } - return 0 -} - -func (x *GetExampleTableRequest) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -// GetExampleTableResponse is the TestSchemaQuery/GetExampleTableResponse response type. -type GetExampleTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTableResponse) Reset() { - *x = GetExampleTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableResponse) ProtoMessage() {} - -func (x *GetExampleTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{1} -} - -func (x *GetExampleTableResponse) GetValue() *ExampleTable { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleTableByU64StrRequest is the TestSchemaQuery/GetExampleTableByU64StrRequest request type. -type GetExampleTableByU64StrRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - U64 uint64 `protobuf:"varint,1,opt,name=u64,proto3" json:"u64,omitempty"` - Str string `protobuf:"bytes,2,opt,name=str,proto3" json:"str,omitempty"` -} - -func (x *GetExampleTableByU64StrRequest) Reset() { - *x = GetExampleTableByU64StrRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableByU64StrRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableByU64StrRequest) ProtoMessage() {} - -func (x *GetExampleTableByU64StrRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableByU64StrRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTableByU64StrRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{2} -} - -func (x *GetExampleTableByU64StrRequest) GetU64() uint64 { - if x != nil { - return x.U64 - } - return 0 -} - -func (x *GetExampleTableByU64StrRequest) GetStr() string { - if x != nil { - return x.Str - } - return "" -} - -// GetExampleTableByU64StrResponse is the TestSchemaQuery/GetExampleTableByU64StrResponse response type. -type GetExampleTableByU64StrResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTableByU64StrResponse) Reset() { - *x = GetExampleTableByU64StrResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTableByU64StrResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTableByU64StrResponse) ProtoMessage() {} - -func (x *GetExampleTableByU64StrResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTableByU64StrResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTableByU64StrResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{3} -} - -func (x *GetExampleTableByU64StrResponse) GetValue() *ExampleTable { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleTableRequest is the TestSchemaQuery/ListExampleTableRequest request type. -type ListExampleTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleTableRequest_PrefixQuery - // *ListExampleTableRequest_RangeQuery_ - Query isListExampleTableRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTableRequest) Reset() { - *x = ListExampleTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest) ProtoMessage() {} - -func (x *ListExampleTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4} -} - -func (m *ListExampleTableRequest) GetQuery() isListExampleTableRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleTableRequest) GetPrefixQuery() *ListExampleTableRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleTableRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleTableRequest) GetRangeQuery() *ListExampleTableRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleTableRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleTableRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleTableRequest_Query interface { - isListExampleTableRequest_Query() -} - -type ListExampleTableRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleTableRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleTableRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleTableRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleTableRequest_PrefixQuery) isListExampleTableRequest_Query() {} - -func (*ListExampleTableRequest_RangeQuery_) isListExampleTableRequest_Query() {} - -// ListExampleTableResponse is the TestSchemaQuery/ListExampleTableResponse response type. -type ListExampleTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleTable `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTableResponse) Reset() { - *x = ListExampleTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableResponse) ProtoMessage() {} - -func (x *ListExampleTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableResponse.ProtoReflect.Descriptor instead. -func (*ListExampleTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{5} -} - -func (x *ListExampleTableResponse) GetValues() []*ExampleTable { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleTableResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleAutoIncrementTableRequest is the TestSchemaQuery/GetExampleAutoIncrementTableRequest request type. -type GetExampleAutoIncrementTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleAutoIncrementTableRequest) Reset() { - *x = GetExampleAutoIncrementTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncrementTableRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{6} -} - -func (x *GetExampleAutoIncrementTableRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleAutoIncrementTableResponse is the TestSchemaQuery/GetExampleAutoIncrementTableResponse response type. -type GetExampleAutoIncrementTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleAutoIncrementTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncrementTableResponse) Reset() { - *x = GetExampleAutoIncrementTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncrementTableResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{7} -} - -func (x *GetExampleAutoIncrementTableResponse) GetValue() *ExampleAutoIncrementTable { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleAutoIncrementTableByXRequest is the TestSchemaQuery/GetExampleAutoIncrementTableByXRequest request type. -type GetExampleAutoIncrementTableByXRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - X string `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` -} - -func (x *GetExampleAutoIncrementTableByXRequest) Reset() { - *x = GetExampleAutoIncrementTableByXRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableByXRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableByXRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableByXRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncrementTableByXRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableByXRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{8} -} - -func (x *GetExampleAutoIncrementTableByXRequest) GetX() string { - if x != nil { - return x.X - } - return "" -} - -// GetExampleAutoIncrementTableByXResponse is the TestSchemaQuery/GetExampleAutoIncrementTableByXResponse response type. -type GetExampleAutoIncrementTableByXResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleAutoIncrementTable `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncrementTableByXResponse) Reset() { - *x = GetExampleAutoIncrementTableByXResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncrementTableByXResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncrementTableByXResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncrementTableByXResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncrementTableByXResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncrementTableByXResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{9} -} - -func (x *GetExampleAutoIncrementTableByXResponse) GetValue() *ExampleAutoIncrementTable { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleAutoIncrementTableRequest is the TestSchemaQuery/ListExampleAutoIncrementTableRequest request type. -type ListExampleAutoIncrementTableRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleAutoIncrementTableRequest_PrefixQuery - // *ListExampleAutoIncrementTableRequest_RangeQuery_ - Query isListExampleAutoIncrementTableRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest) Reset() { - *x = ListExampleAutoIncrementTableRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10} -} - -func (m *ListExampleAutoIncrementTableRequest) GetQuery() isListExampleAutoIncrementTableRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetPrefixQuery() *ListExampleAutoIncrementTableRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleAutoIncrementTableRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetRangeQuery() *ListExampleAutoIncrementTableRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleAutoIncrementTableRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleAutoIncrementTableRequest_Query interface { - isListExampleAutoIncrementTableRequest_Query() -} - -type ListExampleAutoIncrementTableRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleAutoIncrementTableRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleAutoIncrementTableRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleAutoIncrementTableRequest_PrefixQuery) isListExampleAutoIncrementTableRequest_Query() { -} - -func (*ListExampleAutoIncrementTableRequest_RangeQuery_) isListExampleAutoIncrementTableRequest_Query() { -} - -// ListExampleAutoIncrementTableResponse is the TestSchemaQuery/ListExampleAutoIncrementTableResponse response type. -type ListExampleAutoIncrementTableResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleAutoIncrementTable `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncrementTableResponse) Reset() { - *x = ListExampleAutoIncrementTableResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableResponse) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableResponse.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{11} -} - -func (x *ListExampleAutoIncrementTableResponse) GetValues() []*ExampleAutoIncrementTable { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleAutoIncrementTableResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type. -type GetExampleSingletonRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetExampleSingletonRequest) Reset() { - *x = GetExampleSingletonRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleSingletonRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleSingletonRequest) ProtoMessage() {} - -func (x *GetExampleSingletonRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleSingletonRequest.ProtoReflect.Descriptor instead. -func (*GetExampleSingletonRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{12} -} - -// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type. -type GetExampleSingletonResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *ExampleSingleton `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleSingletonResponse) Reset() { - *x = GetExampleSingletonResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleSingletonResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleSingletonResponse) ProtoMessage() {} - -func (x *GetExampleSingletonResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleSingletonResponse.ProtoReflect.Descriptor instead. -func (*GetExampleSingletonResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{13} -} - -func (x *GetExampleSingletonResponse) GetValue() *ExampleSingleton { - if x != nil { - return x.Value - } - return nil -} - -// GetExampleTimestampRequest is the TestSchemaQuery/GetExampleTimestampRequest request type. -type GetExampleTimestampRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleTimestampRequest) Reset() { - *x = GetExampleTimestampRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTimestampRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTimestampRequest) ProtoMessage() {} - -func (x *GetExampleTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTimestampRequest.ProtoReflect.Descriptor instead. -func (*GetExampleTimestampRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{14} -} - -func (x *GetExampleTimestampRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleTimestampResponse is the TestSchemaQuery/GetExampleTimestampResponse response type. -type GetExampleTimestampResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleTimestamp `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleTimestampResponse) Reset() { - *x = GetExampleTimestampResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleTimestampResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleTimestampResponse) ProtoMessage() {} - -func (x *GetExampleTimestampResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleTimestampResponse.ProtoReflect.Descriptor instead. -func (*GetExampleTimestampResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{15} -} - -func (x *GetExampleTimestampResponse) GetValue() *ExampleTimestamp { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleTimestampRequest is the TestSchemaQuery/ListExampleTimestampRequest request type. -type ListExampleTimestampRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleTimestampRequest_PrefixQuery - // *ListExampleTimestampRequest_RangeQuery_ - Query isListExampleTimestampRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTimestampRequest) Reset() { - *x = ListExampleTimestampRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest) ProtoMessage() {} - -func (x *ListExampleTimestampRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16} -} - -func (m *ListExampleTimestampRequest) GetQuery() isListExampleTimestampRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleTimestampRequest) GetPrefixQuery() *ListExampleTimestampRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleTimestampRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleTimestampRequest) GetRangeQuery() *ListExampleTimestampRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleTimestampRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleTimestampRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleTimestampRequest_Query interface { - isListExampleTimestampRequest_Query() -} - -type ListExampleTimestampRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleTimestampRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleTimestampRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleTimestampRequest_PrefixQuery) isListExampleTimestampRequest_Query() {} - -func (*ListExampleTimestampRequest_RangeQuery_) isListExampleTimestampRequest_Query() {} - -// ListExampleTimestampResponse is the TestSchemaQuery/ListExampleTimestampResponse response type. -type ListExampleTimestampResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleTimestamp `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleTimestampResponse) Reset() { - *x = ListExampleTimestampResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampResponse) ProtoMessage() {} - -func (x *ListExampleTimestampResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampResponse.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{17} -} - -func (x *ListExampleTimestampResponse) GetValues() []*ExampleTimestamp { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleTimestampResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleDurationRequest is the TestSchemaQuery/GetExampleDurationRequest request type. -type GetExampleDurationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id specifies the value of the id field in the primary key. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetExampleDurationRequest) Reset() { - *x = GetExampleDurationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleDurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleDurationRequest) ProtoMessage() {} - -func (x *GetExampleDurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleDurationRequest.ProtoReflect.Descriptor instead. -func (*GetExampleDurationRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{18} -} - -func (x *GetExampleDurationRequest) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -// GetExampleDurationResponse is the TestSchemaQuery/GetExampleDurationResponse response type. -type GetExampleDurationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleDuration `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleDurationResponse) Reset() { - *x = GetExampleDurationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleDurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleDurationResponse) ProtoMessage() {} - -func (x *GetExampleDurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleDurationResponse.ProtoReflect.Descriptor instead. -func (*GetExampleDurationResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{19} -} - -func (x *GetExampleDurationResponse) GetValue() *ExampleDuration { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleDurationRequest is the TestSchemaQuery/ListExampleDurationRequest request type. -type ListExampleDurationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleDurationRequest_PrefixQuery - // *ListExampleDurationRequest_RangeQuery_ - Query isListExampleDurationRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleDurationRequest) Reset() { - *x = ListExampleDurationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest) ProtoMessage() {} - -func (x *ListExampleDurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20} -} - -func (m *ListExampleDurationRequest) GetQuery() isListExampleDurationRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleDurationRequest) GetPrefixQuery() *ListExampleDurationRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleDurationRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleDurationRequest) GetRangeQuery() *ListExampleDurationRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleDurationRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleDurationRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleDurationRequest_Query interface { - isListExampleDurationRequest_Query() -} - -type ListExampleDurationRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleDurationRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleDurationRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleDurationRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleDurationRequest_PrefixQuery) isListExampleDurationRequest_Query() {} - -func (*ListExampleDurationRequest_RangeQuery_) isListExampleDurationRequest_Query() {} - -// ListExampleDurationResponse is the TestSchemaQuery/ListExampleDurationResponse response type. -type ListExampleDurationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleDuration `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleDurationResponse) Reset() { - *x = ListExampleDurationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationResponse) ProtoMessage() {} - -func (x *ListExampleDurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationResponse.ProtoReflect.Descriptor instead. -func (*ListExampleDurationResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{21} -} - -func (x *ListExampleDurationResponse) GetValues() []*ExampleDuration { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleDurationResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetSimpleExampleRequest is the TestSchemaQuery/GetSimpleExampleRequest request type. -type GetSimpleExampleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name specifies the value of the name field in the primary key. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetSimpleExampleRequest) Reset() { - *x = GetSimpleExampleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleRequest) ProtoMessage() {} - -func (x *GetSimpleExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleRequest.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{22} -} - -func (x *GetSimpleExampleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// GetSimpleExampleResponse is the TestSchemaQuery/GetSimpleExampleResponse response type. -type GetSimpleExampleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *SimpleExample `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSimpleExampleResponse) Reset() { - *x = GetSimpleExampleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleResponse) ProtoMessage() {} - -func (x *GetSimpleExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleResponse.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{23} -} - -func (x *GetSimpleExampleResponse) GetValue() *SimpleExample { - if x != nil { - return x.Value - } - return nil -} - -// GetSimpleExampleByUniqueRequest is the TestSchemaQuery/GetSimpleExampleByUniqueRequest request type. -type GetSimpleExampleByUniqueRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Unique string `protobuf:"bytes,1,opt,name=unique,proto3" json:"unique,omitempty"` -} - -func (x *GetSimpleExampleByUniqueRequest) Reset() { - *x = GetSimpleExampleByUniqueRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleByUniqueRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleByUniqueRequest) ProtoMessage() {} - -func (x *GetSimpleExampleByUniqueRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleByUniqueRequest.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleByUniqueRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{24} -} - -func (x *GetSimpleExampleByUniqueRequest) GetUnique() string { - if x != nil { - return x.Unique - } - return "" -} - -// GetSimpleExampleByUniqueResponse is the TestSchemaQuery/GetSimpleExampleByUniqueResponse response type. -type GetSimpleExampleByUniqueResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *SimpleExample `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetSimpleExampleByUniqueResponse) Reset() { - *x = GetSimpleExampleByUniqueResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSimpleExampleByUniqueResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSimpleExampleByUniqueResponse) ProtoMessage() {} - -func (x *GetSimpleExampleByUniqueResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSimpleExampleByUniqueResponse.ProtoReflect.Descriptor instead. -func (*GetSimpleExampleByUniqueResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{25} -} - -func (x *GetSimpleExampleByUniqueResponse) GetValue() *SimpleExample { - if x != nil { - return x.Value - } - return nil -} - -// ListSimpleExampleRequest is the TestSchemaQuery/ListSimpleExampleRequest request type. -type ListSimpleExampleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListSimpleExampleRequest_PrefixQuery - // *ListSimpleExampleRequest_RangeQuery_ - Query isListSimpleExampleRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSimpleExampleRequest) Reset() { - *x = ListSimpleExampleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest) ProtoMessage() {} - -func (x *ListSimpleExampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26} -} - -func (m *ListSimpleExampleRequest) GetQuery() isListSimpleExampleRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListSimpleExampleRequest) GetPrefixQuery() *ListSimpleExampleRequest_IndexKey { - if x, ok := x.GetQuery().(*ListSimpleExampleRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListSimpleExampleRequest) GetRangeQuery() *ListSimpleExampleRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListSimpleExampleRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListSimpleExampleRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListSimpleExampleRequest_Query interface { - isListSimpleExampleRequest_Query() -} - -type ListSimpleExampleRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListSimpleExampleRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListSimpleExampleRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListSimpleExampleRequest_PrefixQuery) isListSimpleExampleRequest_Query() {} - -func (*ListSimpleExampleRequest_RangeQuery_) isListSimpleExampleRequest_Query() {} - -// ListSimpleExampleResponse is the TestSchemaQuery/ListSimpleExampleResponse response type. -type ListSimpleExampleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*SimpleExample `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListSimpleExampleResponse) Reset() { - *x = ListSimpleExampleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleResponse) ProtoMessage() {} - -func (x *ListSimpleExampleResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleResponse.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{27} -} - -func (x *ListSimpleExampleResponse) GetValues() []*SimpleExample { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListSimpleExampleResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// GetExampleAutoIncFieldNameRequest is the TestSchemaQuery/GetExampleAutoIncFieldNameRequest request type. -type GetExampleAutoIncFieldNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // foo specifies the value of the foo field in the primary key. - Foo uint64 `protobuf:"varint,1,opt,name=foo,proto3" json:"foo,omitempty"` -} - -func (x *GetExampleAutoIncFieldNameRequest) Reset() { - *x = GetExampleAutoIncFieldNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncFieldNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncFieldNameRequest) ProtoMessage() {} - -func (x *GetExampleAutoIncFieldNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncFieldNameRequest.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncFieldNameRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{28} -} - -func (x *GetExampleAutoIncFieldNameRequest) GetFoo() uint64 { - if x != nil { - return x.Foo - } - return 0 -} - -// GetExampleAutoIncFieldNameResponse is the TestSchemaQuery/GetExampleAutoIncFieldNameResponse response type. -type GetExampleAutoIncFieldNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // value is the response value. - Value *ExampleAutoIncFieldName `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetExampleAutoIncFieldNameResponse) Reset() { - *x = GetExampleAutoIncFieldNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetExampleAutoIncFieldNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExampleAutoIncFieldNameResponse) ProtoMessage() {} - -func (x *GetExampleAutoIncFieldNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetExampleAutoIncFieldNameResponse.ProtoReflect.Descriptor instead. -func (*GetExampleAutoIncFieldNameResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{29} -} - -func (x *GetExampleAutoIncFieldNameResponse) GetValue() *ExampleAutoIncFieldName { - if x != nil { - return x.Value - } - return nil -} - -// ListExampleAutoIncFieldNameRequest is the TestSchemaQuery/ListExampleAutoIncFieldNameRequest request type. -type ListExampleAutoIncFieldNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // query specifies the type of query - either a prefix or range query. - // - // Types that are assignable to Query: - // - // *ListExampleAutoIncFieldNameRequest_PrefixQuery - // *ListExampleAutoIncFieldNameRequest_RangeQuery_ - Query isListExampleAutoIncFieldNameRequest_Query `protobuf_oneof:"query"` - // pagination specifies optional pagination parameters. - Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest) Reset() { - *x = ListExampleAutoIncFieldNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30} -} - -func (m *ListExampleAutoIncFieldNameRequest) GetQuery() isListExampleAutoIncFieldNameRequest_Query { - if m != nil { - return m.Query - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetPrefixQuery() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x, ok := x.GetQuery().(*ListExampleAutoIncFieldNameRequest_PrefixQuery); ok { - return x.PrefixQuery - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetRangeQuery() *ListExampleAutoIncFieldNameRequest_RangeQuery { - if x, ok := x.GetQuery().(*ListExampleAutoIncFieldNameRequest_RangeQuery_); ok { - return x.RangeQuery - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type isListExampleAutoIncFieldNameRequest_Query interface { - isListExampleAutoIncFieldNameRequest_Query() -} - -type ListExampleAutoIncFieldNameRequest_PrefixQuery struct { - // prefix_query specifies the index key value to use for the prefix query. - PrefixQuery *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,1,opt,name=prefix_query,json=prefixQuery,proto3,oneof"` -} - -type ListExampleAutoIncFieldNameRequest_RangeQuery_ struct { - // range_query specifies the index key from/to values to use for the range query. - RangeQuery *ListExampleAutoIncFieldNameRequest_RangeQuery `protobuf:"bytes,2,opt,name=range_query,json=rangeQuery,proto3,oneof"` -} - -func (*ListExampleAutoIncFieldNameRequest_PrefixQuery) isListExampleAutoIncFieldNameRequest_Query() {} - -func (*ListExampleAutoIncFieldNameRequest_RangeQuery_) isListExampleAutoIncFieldNameRequest_Query() {} - -// ListExampleAutoIncFieldNameResponse is the TestSchemaQuery/ListExampleAutoIncFieldNameResponse response type. -type ListExampleAutoIncFieldNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // values are the results of the query. - Values []*ExampleAutoIncFieldName `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - // pagination is the pagination response. - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameResponse) Reset() { - *x = ListExampleAutoIncFieldNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameResponse) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameResponse.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameResponse) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{31} -} - -func (x *ListExampleAutoIncFieldNameResponse) GetValues() []*ExampleAutoIncFieldName { - if x != nil { - return x.Values - } - return nil -} - -func (x *ListExampleAutoIncFieldNameResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleTableRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleTableRequest_IndexKey_U_32I_64Str - // *ListExampleTableRequest_IndexKey_U_64Str - // *ListExampleTableRequest_IndexKey_StrU_32 - // *ListExampleTableRequest_IndexKey_BzStr_ - Key isListExampleTableRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleTableRequest_IndexKey) Reset() { - *x = ListExampleTableRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0} -} - -func (m *ListExampleTableRequest_IndexKey) GetKey() isListExampleTableRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetU_32I_64Str() *ListExampleTableRequest_IndexKey_U32I64Str { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_U_32I_64Str); ok { - return x.U_32I_64Str - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetU_64Str() *ListExampleTableRequest_IndexKey_U64Str { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_U_64Str); ok { - return x.U_64Str - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetStrU_32() *ListExampleTableRequest_IndexKey_StrU32 { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_StrU_32); ok { - return x.StrU_32 - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey) GetBzStr() *ListExampleTableRequest_IndexKey_BzStr { - if x, ok := x.GetKey().(*ListExampleTableRequest_IndexKey_BzStr_); ok { - return x.BzStr - } - return nil -} - -type isListExampleTableRequest_IndexKey_Key interface { - isListExampleTableRequest_IndexKey_Key() -} - -type ListExampleTableRequest_IndexKey_U_32I_64Str struct { - // u_32_i_64_str specifies the value of the U32I64Str index key to use in the query. - U_32I_64Str *ListExampleTableRequest_IndexKey_U32I64Str `protobuf:"bytes,1,opt,name=u_32_i_64_str,json=u32I64Str,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_U_64Str struct { - // u_64_str specifies the value of the U64Str index key to use in the query. - U_64Str *ListExampleTableRequest_IndexKey_U64Str `protobuf:"bytes,2,opt,name=u_64_str,json=u64Str,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_StrU_32 struct { - // str_u_32 specifies the value of the StrU32 index key to use in the query. - StrU_32 *ListExampleTableRequest_IndexKey_StrU32 `protobuf:"bytes,3,opt,name=str_u_32,json=strU32,proto3,oneof"` -} - -type ListExampleTableRequest_IndexKey_BzStr_ struct { - // bz_str specifies the value of the BzStr index key to use in the query. - BzStr *ListExampleTableRequest_IndexKey_BzStr `protobuf:"bytes,4,opt,name=bz_str,json=bzStr,proto3,oneof"` -} - -func (*ListExampleTableRequest_IndexKey_U_32I_64Str) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_U_64Str) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_StrU_32) isListExampleTableRequest_IndexKey_Key() {} - -func (*ListExampleTableRequest_IndexKey_BzStr_) isListExampleTableRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleTableRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleTableRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleTableRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleTableRequest_RangeQuery) Reset() { - *x = ListExampleTableRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleTableRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 1} -} - -func (x *ListExampleTableRequest_RangeQuery) GetFrom() *ListExampleTableRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleTableRequest_RangeQuery) GetTo() *ListExampleTableRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleTableRequest_IndexKey_U32I64Str struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U32 *uint32 `protobuf:"varint,1,opt,name=u32,proto3,oneof" json:"u32,omitempty"` - // i64 is the value of the i64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - I64 *int64 `protobuf:"varint,2,opt,name=i64,proto3,oneof" json:"i64,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,3,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) Reset() { - *x = ListExampleTableRequest_IndexKey_U32I64Str{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_U32I64Str) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_U32I64Str.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_U32I64Str) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 0} -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetU32() uint32 { - if x != nil && x.U32 != nil { - return *x.U32 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetI64() int64 { - if x != nil && x.I64 != nil { - return *x.I64 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U32I64Str) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -type ListExampleTableRequest_IndexKey_U64Str struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // u64 is the value of the u64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U64 *uint64 `protobuf:"varint,1,opt,name=u64,proto3,oneof" json:"u64,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,2,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) Reset() { - *x = ListExampleTableRequest_IndexKey_U64Str{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_U64Str) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_U64Str) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_U64Str.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_U64Str) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 1} -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) GetU64() uint64 { - if x != nil && x.U64 != nil { - return *x.U64 - } - return 0 -} - -func (x *ListExampleTableRequest_IndexKey_U64Str) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -type ListExampleTableRequest_IndexKey_StrU32 struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,1,opt,name=str,proto3,oneof" json:"str,omitempty"` - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - U32 *uint32 `protobuf:"varint,2,opt,name=u32,proto3,oneof" json:"u32,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) Reset() { - *x = ListExampleTableRequest_IndexKey_StrU32{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_StrU32) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_StrU32) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_StrU32.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_StrU32) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 2} -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -func (x *ListExampleTableRequest_IndexKey_StrU32) GetU32() uint32 { - if x != nil && x.U32 != nil { - return *x.U32 - } - return 0 -} - -type ListExampleTableRequest_IndexKey_BzStr struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // bz is the value of the bz field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Bz []byte `protobuf:"bytes,1,opt,name=bz,proto3,oneof" json:"bz,omitempty"` - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Str *string `protobuf:"bytes,2,opt,name=str,proto3,oneof" json:"str,omitempty"` -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) Reset() { - *x = ListExampleTableRequest_IndexKey_BzStr{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTableRequest_IndexKey_BzStr) ProtoMessage() {} - -func (x *ListExampleTableRequest_IndexKey_BzStr) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTableRequest_IndexKey_BzStr.ProtoReflect.Descriptor instead. -func (*ListExampleTableRequest_IndexKey_BzStr) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{4, 0, 3} -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) GetBz() []byte { - if x != nil { - return x.Bz - } - return nil -} - -func (x *ListExampleTableRequest_IndexKey_BzStr) GetStr() string { - if x != nil && x.Str != nil { - return *x.Str - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleAutoIncrementTableRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleAutoIncrementTableRequest_IndexKey_Id_ - // *ListExampleAutoIncrementTableRequest_IndexKey_X_ - Key isListExampleAutoIncrementTableRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0} -} - -func (m *ListExampleAutoIncrementTableRequest_IndexKey) GetKey() isListExampleAutoIncrementTableRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) GetId() *ListExampleAutoIncrementTableRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleAutoIncrementTableRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey) GetX() *ListExampleAutoIncrementTableRequest_IndexKey_X { - if x, ok := x.GetKey().(*ListExampleAutoIncrementTableRequest_IndexKey_X_); ok { - return x.X - } - return nil -} - -type isListExampleAutoIncrementTableRequest_IndexKey_Key interface { - isListExampleAutoIncrementTableRequest_IndexKey_Key() -} - -type ListExampleAutoIncrementTableRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleAutoIncrementTableRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleAutoIncrementTableRequest_IndexKey_X_ struct { - // x specifies the value of the X index key to use in the query. - X *ListExampleAutoIncrementTableRequest_IndexKey_X `protobuf:"bytes,2,opt,name=x,proto3,oneof"` -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id_) isListExampleAutoIncrementTableRequest_IndexKey_Key() { -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_X_) isListExampleAutoIncrementTableRequest_IndexKey_Key() { -} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleAutoIncrementTableRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleAutoIncrementTableRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) Reset() { - *x = ListExampleAutoIncrementTableRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 1} -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) GetFrom() *ListExampleAutoIncrementTableRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleAutoIncrementTableRequest_RangeQuery) GetTo() *ListExampleAutoIncrementTableRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleAutoIncrementTableRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0, 0} -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleAutoIncrementTableRequest_IndexKey_X struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // x is the value of the x field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - X *string `protobuf:"bytes,1,opt,name=x,proto3,oneof" json:"x,omitempty"` -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) Reset() { - *x = ListExampleAutoIncrementTableRequest_IndexKey_X{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncrementTableRequest_IndexKey_X) ProtoMessage() {} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncrementTableRequest_IndexKey_X.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncrementTableRequest_IndexKey_X) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{10, 0, 1} -} - -func (x *ListExampleAutoIncrementTableRequest_IndexKey_X) GetX() string { - if x != nil && x.X != nil { - return *x.X - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleTimestampRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleTimestampRequest_IndexKey_Id_ - // *ListExampleTimestampRequest_IndexKey_Ts_ - Key isListExampleTimestampRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleTimestampRequest_IndexKey) Reset() { - *x = ListExampleTimestampRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[42] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0} -} - -func (m *ListExampleTimestampRequest_IndexKey) GetKey() isListExampleTimestampRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleTimestampRequest_IndexKey) GetId() *ListExampleTimestampRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleTimestampRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleTimestampRequest_IndexKey) GetTs() *ListExampleTimestampRequest_IndexKey_Ts { - if x, ok := x.GetKey().(*ListExampleTimestampRequest_IndexKey_Ts_); ok { - return x.Ts - } - return nil -} - -type isListExampleTimestampRequest_IndexKey_Key interface { - isListExampleTimestampRequest_IndexKey_Key() -} - -type ListExampleTimestampRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleTimestampRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleTimestampRequest_IndexKey_Ts_ struct { - // ts specifies the value of the Ts index key to use in the query. - Ts *ListExampleTimestampRequest_IndexKey_Ts `protobuf:"bytes,2,opt,name=ts,proto3,oneof"` -} - -func (*ListExampleTimestampRequest_IndexKey_Id_) isListExampleTimestampRequest_IndexKey_Key() {} - -func (*ListExampleTimestampRequest_IndexKey_Ts_) isListExampleTimestampRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleTimestampRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleTimestampRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleTimestampRequest_RangeQuery) Reset() { - *x = ListExampleTimestampRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 1} -} - -func (x *ListExampleTimestampRequest_RangeQuery) GetFrom() *ListExampleTimestampRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleTimestampRequest_RangeQuery) GetTo() *ListExampleTimestampRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleTimestampRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) Reset() { - *x = ListExampleTimestampRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[44] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0, 0} -} - -func (x *ListExampleTimestampRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleTimestampRequest_IndexKey_Ts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ts is the value of the ts field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Ts *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=ts,proto3,oneof" json:"ts,omitempty"` -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) Reset() { - *x = ListExampleTimestampRequest_IndexKey_Ts{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleTimestampRequest_IndexKey_Ts) ProtoMessage() {} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[45] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleTimestampRequest_IndexKey_Ts.ProtoReflect.Descriptor instead. -func (*ListExampleTimestampRequest_IndexKey_Ts) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{16, 0, 1} -} - -func (x *ListExampleTimestampRequest_IndexKey_Ts) GetTs() *timestamppb.Timestamp { - if x != nil { - return x.Ts - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleDurationRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleDurationRequest_IndexKey_Id_ - // *ListExampleDurationRequest_IndexKey_Dur_ - Key isListExampleDurationRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleDurationRequest_IndexKey) Reset() { - *x = ListExampleDurationRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[46] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0} -} - -func (m *ListExampleDurationRequest_IndexKey) GetKey() isListExampleDurationRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleDurationRequest_IndexKey) GetId() *ListExampleDurationRequest_IndexKey_Id { - if x, ok := x.GetKey().(*ListExampleDurationRequest_IndexKey_Id_); ok { - return x.Id - } - return nil -} - -func (x *ListExampleDurationRequest_IndexKey) GetDur() *ListExampleDurationRequest_IndexKey_Dur { - if x, ok := x.GetKey().(*ListExampleDurationRequest_IndexKey_Dur_); ok { - return x.Dur - } - return nil -} - -type isListExampleDurationRequest_IndexKey_Key interface { - isListExampleDurationRequest_IndexKey_Key() -} - -type ListExampleDurationRequest_IndexKey_Id_ struct { - // id specifies the value of the Id index key to use in the query. - Id *ListExampleDurationRequest_IndexKey_Id `protobuf:"bytes,1,opt,name=id,proto3,oneof"` -} - -type ListExampleDurationRequest_IndexKey_Dur_ struct { - // dur specifies the value of the Dur index key to use in the query. - Dur *ListExampleDurationRequest_IndexKey_Dur `protobuf:"bytes,2,opt,name=dur,proto3,oneof"` -} - -func (*ListExampleDurationRequest_IndexKey_Id_) isListExampleDurationRequest_IndexKey_Key() {} - -func (*ListExampleDurationRequest_IndexKey_Dur_) isListExampleDurationRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleDurationRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleDurationRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleDurationRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleDurationRequest_RangeQuery) Reset() { - *x = ListExampleDurationRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleDurationRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 1} -} - -func (x *ListExampleDurationRequest_RangeQuery) GetFrom() *ListExampleDurationRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleDurationRequest_RangeQuery) GetTo() *ListExampleDurationRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleDurationRequest_IndexKey_Id struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` -} - -func (x *ListExampleDurationRequest_IndexKey_Id) Reset() { - *x = ListExampleDurationRequest_IndexKey_Id{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey_Id) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey_Id) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey_Id) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[48] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey_Id.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey_Id) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0, 0} -} - -func (x *ListExampleDurationRequest_IndexKey_Id) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type ListExampleDurationRequest_IndexKey_Dur struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // dur is the value of the dur field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Dur *durationpb.Duration `protobuf:"bytes,1,opt,name=dur,proto3,oneof" json:"dur,omitempty"` -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) Reset() { - *x = ListExampleDurationRequest_IndexKey_Dur{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleDurationRequest_IndexKey_Dur) ProtoMessage() {} - -func (x *ListExampleDurationRequest_IndexKey_Dur) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[49] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleDurationRequest_IndexKey_Dur.ProtoReflect.Descriptor instead. -func (*ListExampleDurationRequest_IndexKey_Dur) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{20, 0, 1} -} - -func (x *ListExampleDurationRequest_IndexKey_Dur) GetDur() *durationpb.Duration { - if x != nil { - return x.Dur - } - return nil -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListSimpleExampleRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListSimpleExampleRequest_IndexKey_Name_ - // *ListSimpleExampleRequest_IndexKey_Unique_ - Key isListSimpleExampleRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListSimpleExampleRequest_IndexKey) Reset() { - *x = ListSimpleExampleRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[50] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0} -} - -func (m *ListSimpleExampleRequest_IndexKey) GetKey() isListSimpleExampleRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListSimpleExampleRequest_IndexKey) GetName() *ListSimpleExampleRequest_IndexKey_Name { - if x, ok := x.GetKey().(*ListSimpleExampleRequest_IndexKey_Name_); ok { - return x.Name - } - return nil -} - -func (x *ListSimpleExampleRequest_IndexKey) GetUnique() *ListSimpleExampleRequest_IndexKey_Unique { - if x, ok := x.GetKey().(*ListSimpleExampleRequest_IndexKey_Unique_); ok { - return x.Unique - } - return nil -} - -type isListSimpleExampleRequest_IndexKey_Key interface { - isListSimpleExampleRequest_IndexKey_Key() -} - -type ListSimpleExampleRequest_IndexKey_Name_ struct { - // name specifies the value of the Name index key to use in the query. - Name *ListSimpleExampleRequest_IndexKey_Name `protobuf:"bytes,1,opt,name=name,proto3,oneof"` -} - -type ListSimpleExampleRequest_IndexKey_Unique_ struct { - // unique specifies the value of the Unique index key to use in the query. - Unique *ListSimpleExampleRequest_IndexKey_Unique `protobuf:"bytes,2,opt,name=unique,proto3,oneof"` -} - -func (*ListSimpleExampleRequest_IndexKey_Name_) isListSimpleExampleRequest_IndexKey_Key() {} - -func (*ListSimpleExampleRequest_IndexKey_Unique_) isListSimpleExampleRequest_IndexKey_Key() {} - -// RangeQuery specifies the from/to index keys for a range query. -type ListSimpleExampleRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListSimpleExampleRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListSimpleExampleRequest_RangeQuery) Reset() { - *x = ListSimpleExampleRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_RangeQuery) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[51] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 1} -} - -func (x *ListSimpleExampleRequest_RangeQuery) GetFrom() *ListSimpleExampleRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListSimpleExampleRequest_RangeQuery) GetTo() *ListSimpleExampleRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListSimpleExampleRequest_IndexKey_Name struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name is the value of the name field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) Reset() { - *x = ListSimpleExampleRequest_IndexKey_Name{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey_Name) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey_Name) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[52] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey_Name.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey_Name) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0, 0} -} - -func (x *ListSimpleExampleRequest_IndexKey_Name) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -type ListSimpleExampleRequest_IndexKey_Unique struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // unique is the value of the unique field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Unique *string `protobuf:"bytes,1,opt,name=unique,proto3,oneof" json:"unique,omitempty"` -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) Reset() { - *x = ListSimpleExampleRequest_IndexKey_Unique{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSimpleExampleRequest_IndexKey_Unique) ProtoMessage() {} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[53] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSimpleExampleRequest_IndexKey_Unique.ProtoReflect.Descriptor instead. -func (*ListSimpleExampleRequest_IndexKey_Unique) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{26, 0, 1} -} - -func (x *ListSimpleExampleRequest_IndexKey_Unique) GetUnique() string { - if x != nil && x.Unique != nil { - return *x.Unique - } - return "" -} - -// IndexKey specifies the value of an index key to use in prefix and range queries. -type ListExampleAutoIncFieldNameRequest_IndexKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // key specifies the index key value. - // - // Types that are assignable to Key: - // - // *ListExampleAutoIncFieldNameRequest_IndexKey_Foo_ - Key isListExampleAutoIncFieldNameRequest_IndexKey_Key `protobuf_oneof:"key"` -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) Reset() { - *x = ListExampleAutoIncFieldNameRequest_IndexKey{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[54] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_IndexKey.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_IndexKey) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 0} -} - -func (m *ListExampleAutoIncFieldNameRequest_IndexKey) GetKey() isListExampleAutoIncFieldNameRequest_IndexKey_Key { - if m != nil { - return m.Key - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey) GetFoo() *ListExampleAutoIncFieldNameRequest_IndexKey_Foo { - if x, ok := x.GetKey().(*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_); ok { - return x.Foo - } - return nil -} - -type isListExampleAutoIncFieldNameRequest_IndexKey_Key interface { - isListExampleAutoIncFieldNameRequest_IndexKey_Key() -} - -type ListExampleAutoIncFieldNameRequest_IndexKey_Foo_ struct { - // foo specifies the value of the Foo index key to use in the query. - Foo *ListExampleAutoIncFieldNameRequest_IndexKey_Foo `protobuf:"bytes,1,opt,name=foo,proto3,oneof"` -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_) isListExampleAutoIncFieldNameRequest_IndexKey_Key() { -} - -// RangeQuery specifies the from/to index keys for a range query. -type ListExampleAutoIncFieldNameRequest_RangeQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - From *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - To *ListExampleAutoIncFieldNameRequest_IndexKey `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) Reset() { - *x = ListExampleAutoIncFieldNameRequest_RangeQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_RangeQuery) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[55] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_RangeQuery.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_RangeQuery) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 1} -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) GetFrom() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x != nil { - return x.From - } - return nil -} - -func (x *ListExampleAutoIncFieldNameRequest_RangeQuery) GetTo() *ListExampleAutoIncFieldNameRequest_IndexKey { - if x != nil { - return x.To - } - return nil -} - -type ListExampleAutoIncFieldNameRequest_IndexKey_Foo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // foo is the value of the foo field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - Foo *uint64 `protobuf:"varint,1,opt,name=foo,proto3,oneof" json:"foo,omitempty"` -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) Reset() { - *x = ListExampleAutoIncFieldNameRequest_IndexKey_Foo{} - if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_schema_query_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo) ProtoMessage() {} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) ProtoReflect() protoreflect.Message { - mi := &file_testpb_test_schema_query_proto_msgTypes[56] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListExampleAutoIncFieldNameRequest_IndexKey_Foo.ProtoReflect.Descriptor instead. -func (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo) Descriptor() ([]byte, []int) { - return file_testpb_test_schema_query_proto_rawDescGZIP(), []int{30, 0, 0} -} - -func (x *ListExampleAutoIncFieldNameRequest_IndexKey_Foo) GetFoo() uint64 { - if x != nil && x.Foo != nil { - return *x.Foo - } - return 0 -} - -var File_testpb_test_schema_query_proto protoreflect.FileDescriptor - -var file_testpb_test_schema_query_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x4e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, - 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, - 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x22, - 0x45, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x44, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x22, 0x4d, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, - 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9c, 0x08, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4d, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x8a, 0x05, - 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x56, 0x0a, 0x0d, 0x75, 0x5f, - 0x33, 0x32, 0x5f, 0x69, 0x5f, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, 0x33, 0x32, 0x49, - 0x36, 0x34, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x09, 0x75, 0x33, 0x32, 0x49, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x4b, 0x0a, 0x08, 0x75, 0x5f, 0x36, 0x34, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, - 0x36, 0x34, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x06, 0x75, 0x36, 0x34, 0x53, 0x74, 0x72, 0x12, - 0x4b, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x5f, 0x75, 0x5f, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x53, 0x74, 0x72, 0x55, - 0x33, 0x32, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x55, 0x33, 0x32, 0x12, 0x47, 0x0a, 0x06, - 0x62, 0x7a, 0x5f, 0x73, 0x74, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x42, 0x7a, 0x53, 0x74, 0x72, 0x48, 0x00, 0x52, 0x05, - 0x62, 0x7a, 0x53, 0x74, 0x72, 0x1a, 0x68, 0x0a, 0x09, 0x55, 0x33, 0x32, 0x49, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, - 0x00, 0x52, 0x03, 0x75, 0x33, 0x32, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x69, 0x36, 0x34, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x69, 0x36, 0x34, 0x88, 0x01, 0x01, - 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, - 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x33, 0x32, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x69, 0x36, 0x34, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x1a, - 0x46, 0x0a, 0x06, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x36, 0x34, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x03, 0x75, 0x36, 0x34, 0x88, 0x01, 0x01, - 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x36, 0x34, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x1a, 0x46, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x55, 0x33, - 0x32, 0x12, 0x15, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x03, 0x73, 0x74, 0x72, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x03, 0x75, 0x33, 0x32, 0x88, 0x01, 0x01, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x73, 0x74, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x33, 0x32, 0x1a, - 0x42, 0x0a, 0x05, 0x42, 0x7a, 0x53, 0x74, 0x72, 0x12, 0x13, 0x0a, 0x02, 0x62, 0x7a, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x02, 0x62, 0x7a, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, - 0x03, 0x73, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x73, 0x74, - 0x72, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x62, 0x7a, 0x42, 0x06, 0x0a, 0x04, 0x5f, - 0x73, 0x74, 0x72, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x84, 0x01, 0x0a, 0x0a, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3c, 0x0a, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x38, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, - 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, - 0x0a, 0x23, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5f, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x22, 0x62, - 0x0a, 0x27, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, - 0x58, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0xb9, 0x05, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x5a, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xe6, 0x01, 0x0a, 0x08, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, 0x48, 0x00, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x47, 0x0a, 0x01, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x37, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x58, 0x48, 0x00, 0x52, 0x01, 0x78, 0x1a, 0x20, 0x0a, - 0x02, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, - 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, - 0x1c, 0x0a, 0x01, 0x58, 0x12, 0x11, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x01, 0x78, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x78, 0x42, 0x05, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x9e, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x49, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x45, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xab, - 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x1c, 0x0a, 0x1a, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x1b, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, - 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x1a, 0x47, 0x65, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9d, 0x05, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x51, 0x0a, 0x0b, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, - 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xf7, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, - 0x79, 0x12, 0x41, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, 0x48, 0x00, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x41, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x54, - 0x73, 0x48, 0x00, 0x52, 0x02, 0x74, 0x73, 0x1a, 0x20, 0x0a, 0x02, 0x49, 0x64, 0x12, 0x13, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, - 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, 0x3c, 0x0a, 0x02, 0x54, 0x73, 0x12, - 0x2f, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x02, 0x74, 0x73, 0x88, 0x01, 0x01, - 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x74, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x8c, - 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x40, 0x0a, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, - 0x3c, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x2b, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x4b, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9c, 0x05, 0x0a, - 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x0c, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, - 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x50, 0x0a, - 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xfb, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x49, 0x64, - 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, - 0x2e, 0x44, 0x75, 0x72, 0x48, 0x00, 0x52, 0x03, 0x64, 0x75, 0x72, 0x1a, 0x20, 0x0a, 0x02, 0x49, - 0x64, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, - 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x1a, 0x3f, 0x0a, - 0x03, 0x44, 0x75, 0x72, 0x12, 0x30, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, - 0x64, 0x75, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x64, 0x75, 0x72, 0x42, 0x05, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x8a, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x3f, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x3b, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, - 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x97, 0x01, 0x0a, 0x1b, - 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x47, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x39, 0x0a, - 0x1f, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, - 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x96, 0x05, 0x0a, 0x18, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x4e, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xff, - 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x44, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x4a, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x48, 0x00, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x1a, 0x28, 0x0a, - 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, - 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x1a, 0x30, 0x0a, 0x06, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x09, - 0x0a, 0x07, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x1a, 0x86, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x3d, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x39, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x22, 0x93, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, - 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x22, - 0x5b, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xcd, 0x04, 0x0a, - 0x22, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x48, 0x00, - 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x58, 0x0a, - 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x84, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x12, 0x4b, 0x0a, 0x03, - 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, - 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x2e, 0x46, - 0x6f, 0x6f, 0x48, 0x00, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x1a, 0x24, 0x0a, 0x03, 0x46, 0x6f, 0x6f, - 0x12, 0x15, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, - 0x03, 0x66, 0x6f, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x66, 0x6f, 0x6f, 0x42, - 0x05, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x1a, 0x9a, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x43, - 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4b, 0x65, 0x79, 0x52, - 0x02, 0x74, 0x6f, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xa7, 0x01, 0x0a, - 0x23, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xba, 0x0d, 0x0a, 0x16, 0x54, 0x65, 0x73, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x54, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, - 0x74, 0x72, 0x12, 0x26, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, - 0x53, 0x74, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x36, 0x34, 0x53, 0x74, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7b, - 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, - 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x2b, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, - 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x12, - 0x2e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x79, 0x58, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x7e, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x2c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, - 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x21, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x13, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x10, - 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x12, 0x1f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, - 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, - 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x12, 0x27, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, - 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, - 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x75, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x29, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, - 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x78, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, - 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x42, 0x14, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, - 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_testpb_test_schema_query_proto_rawDescOnce sync.Once - file_testpb_test_schema_query_proto_rawDescData = file_testpb_test_schema_query_proto_rawDesc -) - -func file_testpb_test_schema_query_proto_rawDescGZIP() []byte { - file_testpb_test_schema_query_proto_rawDescOnce.Do(func() { - file_testpb_test_schema_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_test_schema_query_proto_rawDescData) - }) - return file_testpb_test_schema_query_proto_rawDescData -} - -var file_testpb_test_schema_query_proto_msgTypes = make([]protoimpl.MessageInfo, 57) -var file_testpb_test_schema_query_proto_goTypes = []interface{}{ - (*GetExampleTableRequest)(nil), // 0: testpb.GetExampleTableRequest - (*GetExampleTableResponse)(nil), // 1: testpb.GetExampleTableResponse - (*GetExampleTableByU64StrRequest)(nil), // 2: testpb.GetExampleTableByU64StrRequest - (*GetExampleTableByU64StrResponse)(nil), // 3: testpb.GetExampleTableByU64StrResponse - (*ListExampleTableRequest)(nil), // 4: testpb.ListExampleTableRequest - (*ListExampleTableResponse)(nil), // 5: testpb.ListExampleTableResponse - (*GetExampleAutoIncrementTableRequest)(nil), // 6: testpb.GetExampleAutoIncrementTableRequest - (*GetExampleAutoIncrementTableResponse)(nil), // 7: testpb.GetExampleAutoIncrementTableResponse - (*GetExampleAutoIncrementTableByXRequest)(nil), // 8: testpb.GetExampleAutoIncrementTableByXRequest - (*GetExampleAutoIncrementTableByXResponse)(nil), // 9: testpb.GetExampleAutoIncrementTableByXResponse - (*ListExampleAutoIncrementTableRequest)(nil), // 10: testpb.ListExampleAutoIncrementTableRequest - (*ListExampleAutoIncrementTableResponse)(nil), // 11: testpb.ListExampleAutoIncrementTableResponse - (*GetExampleSingletonRequest)(nil), // 12: testpb.GetExampleSingletonRequest - (*GetExampleSingletonResponse)(nil), // 13: testpb.GetExampleSingletonResponse - (*GetExampleTimestampRequest)(nil), // 14: testpb.GetExampleTimestampRequest - (*GetExampleTimestampResponse)(nil), // 15: testpb.GetExampleTimestampResponse - (*ListExampleTimestampRequest)(nil), // 16: testpb.ListExampleTimestampRequest - (*ListExampleTimestampResponse)(nil), // 17: testpb.ListExampleTimestampResponse - (*GetExampleDurationRequest)(nil), // 18: testpb.GetExampleDurationRequest - (*GetExampleDurationResponse)(nil), // 19: testpb.GetExampleDurationResponse - (*ListExampleDurationRequest)(nil), // 20: testpb.ListExampleDurationRequest - (*ListExampleDurationResponse)(nil), // 21: testpb.ListExampleDurationResponse - (*GetSimpleExampleRequest)(nil), // 22: testpb.GetSimpleExampleRequest - (*GetSimpleExampleResponse)(nil), // 23: testpb.GetSimpleExampleResponse - (*GetSimpleExampleByUniqueRequest)(nil), // 24: testpb.GetSimpleExampleByUniqueRequest - (*GetSimpleExampleByUniqueResponse)(nil), // 25: testpb.GetSimpleExampleByUniqueResponse - (*ListSimpleExampleRequest)(nil), // 26: testpb.ListSimpleExampleRequest - (*ListSimpleExampleResponse)(nil), // 27: testpb.ListSimpleExampleResponse - (*GetExampleAutoIncFieldNameRequest)(nil), // 28: testpb.GetExampleAutoIncFieldNameRequest - (*GetExampleAutoIncFieldNameResponse)(nil), // 29: testpb.GetExampleAutoIncFieldNameResponse - (*ListExampleAutoIncFieldNameRequest)(nil), // 30: testpb.ListExampleAutoIncFieldNameRequest - (*ListExampleAutoIncFieldNameResponse)(nil), // 31: testpb.ListExampleAutoIncFieldNameResponse - (*ListExampleTableRequest_IndexKey)(nil), // 32: testpb.ListExampleTableRequest.IndexKey - (*ListExampleTableRequest_RangeQuery)(nil), // 33: testpb.ListExampleTableRequest.RangeQuery - (*ListExampleTableRequest_IndexKey_U32I64Str)(nil), // 34: testpb.ListExampleTableRequest.IndexKey.U32I64Str - (*ListExampleTableRequest_IndexKey_U64Str)(nil), // 35: testpb.ListExampleTableRequest.IndexKey.U64Str - (*ListExampleTableRequest_IndexKey_StrU32)(nil), // 36: testpb.ListExampleTableRequest.IndexKey.StrU32 - (*ListExampleTableRequest_IndexKey_BzStr)(nil), // 37: testpb.ListExampleTableRequest.IndexKey.BzStr - (*ListExampleAutoIncrementTableRequest_IndexKey)(nil), // 38: testpb.ListExampleAutoIncrementTableRequest.IndexKey - (*ListExampleAutoIncrementTableRequest_RangeQuery)(nil), // 39: testpb.ListExampleAutoIncrementTableRequest.RangeQuery - (*ListExampleAutoIncrementTableRequest_IndexKey_Id)(nil), // 40: testpb.ListExampleAutoIncrementTableRequest.IndexKey.Id - (*ListExampleAutoIncrementTableRequest_IndexKey_X)(nil), // 41: testpb.ListExampleAutoIncrementTableRequest.IndexKey.X - (*ListExampleTimestampRequest_IndexKey)(nil), // 42: testpb.ListExampleTimestampRequest.IndexKey - (*ListExampleTimestampRequest_RangeQuery)(nil), // 43: testpb.ListExampleTimestampRequest.RangeQuery - (*ListExampleTimestampRequest_IndexKey_Id)(nil), // 44: testpb.ListExampleTimestampRequest.IndexKey.Id - (*ListExampleTimestampRequest_IndexKey_Ts)(nil), // 45: testpb.ListExampleTimestampRequest.IndexKey.Ts - (*ListExampleDurationRequest_IndexKey)(nil), // 46: testpb.ListExampleDurationRequest.IndexKey - (*ListExampleDurationRequest_RangeQuery)(nil), // 47: testpb.ListExampleDurationRequest.RangeQuery - (*ListExampleDurationRequest_IndexKey_Id)(nil), // 48: testpb.ListExampleDurationRequest.IndexKey.Id - (*ListExampleDurationRequest_IndexKey_Dur)(nil), // 49: testpb.ListExampleDurationRequest.IndexKey.Dur - (*ListSimpleExampleRequest_IndexKey)(nil), // 50: testpb.ListSimpleExampleRequest.IndexKey - (*ListSimpleExampleRequest_RangeQuery)(nil), // 51: testpb.ListSimpleExampleRequest.RangeQuery - (*ListSimpleExampleRequest_IndexKey_Name)(nil), // 52: testpb.ListSimpleExampleRequest.IndexKey.Name - (*ListSimpleExampleRequest_IndexKey_Unique)(nil), // 53: testpb.ListSimpleExampleRequest.IndexKey.Unique - (*ListExampleAutoIncFieldNameRequest_IndexKey)(nil), // 54: testpb.ListExampleAutoIncFieldNameRequest.IndexKey - (*ListExampleAutoIncFieldNameRequest_RangeQuery)(nil), // 55: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery - (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo)(nil), // 56: testpb.ListExampleAutoIncFieldNameRequest.IndexKey.Foo - (*ExampleTable)(nil), // 57: testpb.ExampleTable - (*v1beta1.PageRequest)(nil), // 58: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 59: cosmos.base.query.v1beta1.PageResponse - (*ExampleAutoIncrementTable)(nil), // 60: testpb.ExampleAutoIncrementTable - (*ExampleSingleton)(nil), // 61: testpb.ExampleSingleton - (*ExampleTimestamp)(nil), // 62: testpb.ExampleTimestamp - (*ExampleDuration)(nil), // 63: testpb.ExampleDuration - (*SimpleExample)(nil), // 64: testpb.SimpleExample - (*ExampleAutoIncFieldName)(nil), // 65: testpb.ExampleAutoIncFieldName - (*timestamppb.Timestamp)(nil), // 66: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 67: google.protobuf.Duration -} -var file_testpb_test_schema_query_proto_depIdxs = []int32{ - 57, // 0: testpb.GetExampleTableResponse.value:type_name -> testpb.ExampleTable - 57, // 1: testpb.GetExampleTableByU64StrResponse.value:type_name -> testpb.ExampleTable - 32, // 2: testpb.ListExampleTableRequest.prefix_query:type_name -> testpb.ListExampleTableRequest.IndexKey - 33, // 3: testpb.ListExampleTableRequest.range_query:type_name -> testpb.ListExampleTableRequest.RangeQuery - 58, // 4: testpb.ListExampleTableRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 57, // 5: testpb.ListExampleTableResponse.values:type_name -> testpb.ExampleTable - 59, // 6: testpb.ListExampleTableResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 60, // 7: testpb.GetExampleAutoIncrementTableResponse.value:type_name -> testpb.ExampleAutoIncrementTable - 60, // 8: testpb.GetExampleAutoIncrementTableByXResponse.value:type_name -> testpb.ExampleAutoIncrementTable - 38, // 9: testpb.ListExampleAutoIncrementTableRequest.prefix_query:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 39, // 10: testpb.ListExampleAutoIncrementTableRequest.range_query:type_name -> testpb.ListExampleAutoIncrementTableRequest.RangeQuery - 58, // 11: testpb.ListExampleAutoIncrementTableRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 60, // 12: testpb.ListExampleAutoIncrementTableResponse.values:type_name -> testpb.ExampleAutoIncrementTable - 59, // 13: testpb.ListExampleAutoIncrementTableResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 61, // 14: testpb.GetExampleSingletonResponse.value:type_name -> testpb.ExampleSingleton - 62, // 15: testpb.GetExampleTimestampResponse.value:type_name -> testpb.ExampleTimestamp - 42, // 16: testpb.ListExampleTimestampRequest.prefix_query:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 43, // 17: testpb.ListExampleTimestampRequest.range_query:type_name -> testpb.ListExampleTimestampRequest.RangeQuery - 58, // 18: testpb.ListExampleTimestampRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 62, // 19: testpb.ListExampleTimestampResponse.values:type_name -> testpb.ExampleTimestamp - 59, // 20: testpb.ListExampleTimestampResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 63, // 21: testpb.GetExampleDurationResponse.value:type_name -> testpb.ExampleDuration - 46, // 22: testpb.ListExampleDurationRequest.prefix_query:type_name -> testpb.ListExampleDurationRequest.IndexKey - 47, // 23: testpb.ListExampleDurationRequest.range_query:type_name -> testpb.ListExampleDurationRequest.RangeQuery - 58, // 24: testpb.ListExampleDurationRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 63, // 25: testpb.ListExampleDurationResponse.values:type_name -> testpb.ExampleDuration - 59, // 26: testpb.ListExampleDurationResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 64, // 27: testpb.GetSimpleExampleResponse.value:type_name -> testpb.SimpleExample - 64, // 28: testpb.GetSimpleExampleByUniqueResponse.value:type_name -> testpb.SimpleExample - 50, // 29: testpb.ListSimpleExampleRequest.prefix_query:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 51, // 30: testpb.ListSimpleExampleRequest.range_query:type_name -> testpb.ListSimpleExampleRequest.RangeQuery - 58, // 31: testpb.ListSimpleExampleRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 64, // 32: testpb.ListSimpleExampleResponse.values:type_name -> testpb.SimpleExample - 59, // 33: testpb.ListSimpleExampleResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 65, // 34: testpb.GetExampleAutoIncFieldNameResponse.value:type_name -> testpb.ExampleAutoIncFieldName - 54, // 35: testpb.ListExampleAutoIncFieldNameRequest.prefix_query:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 55, // 36: testpb.ListExampleAutoIncFieldNameRequest.range_query:type_name -> testpb.ListExampleAutoIncFieldNameRequest.RangeQuery - 58, // 37: testpb.ListExampleAutoIncFieldNameRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 65, // 38: testpb.ListExampleAutoIncFieldNameResponse.values:type_name -> testpb.ExampleAutoIncFieldName - 59, // 39: testpb.ListExampleAutoIncFieldNameResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 34, // 40: testpb.ListExampleTableRequest.IndexKey.u_32_i_64_str:type_name -> testpb.ListExampleTableRequest.IndexKey.U32I64Str - 35, // 41: testpb.ListExampleTableRequest.IndexKey.u_64_str:type_name -> testpb.ListExampleTableRequest.IndexKey.U64Str - 36, // 42: testpb.ListExampleTableRequest.IndexKey.str_u_32:type_name -> testpb.ListExampleTableRequest.IndexKey.StrU32 - 37, // 43: testpb.ListExampleTableRequest.IndexKey.bz_str:type_name -> testpb.ListExampleTableRequest.IndexKey.BzStr - 32, // 44: testpb.ListExampleTableRequest.RangeQuery.from:type_name -> testpb.ListExampleTableRequest.IndexKey - 32, // 45: testpb.ListExampleTableRequest.RangeQuery.to:type_name -> testpb.ListExampleTableRequest.IndexKey - 40, // 46: testpb.ListExampleAutoIncrementTableRequest.IndexKey.id:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey.Id - 41, // 47: testpb.ListExampleAutoIncrementTableRequest.IndexKey.x:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey.X - 38, // 48: testpb.ListExampleAutoIncrementTableRequest.RangeQuery.from:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 38, // 49: testpb.ListExampleAutoIncrementTableRequest.RangeQuery.to:type_name -> testpb.ListExampleAutoIncrementTableRequest.IndexKey - 44, // 50: testpb.ListExampleTimestampRequest.IndexKey.id:type_name -> testpb.ListExampleTimestampRequest.IndexKey.Id - 45, // 51: testpb.ListExampleTimestampRequest.IndexKey.ts:type_name -> testpb.ListExampleTimestampRequest.IndexKey.Ts - 42, // 52: testpb.ListExampleTimestampRequest.RangeQuery.from:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 42, // 53: testpb.ListExampleTimestampRequest.RangeQuery.to:type_name -> testpb.ListExampleTimestampRequest.IndexKey - 66, // 54: testpb.ListExampleTimestampRequest.IndexKey.Ts.ts:type_name -> google.protobuf.Timestamp - 48, // 55: testpb.ListExampleDurationRequest.IndexKey.id:type_name -> testpb.ListExampleDurationRequest.IndexKey.Id - 49, // 56: testpb.ListExampleDurationRequest.IndexKey.dur:type_name -> testpb.ListExampleDurationRequest.IndexKey.Dur - 46, // 57: testpb.ListExampleDurationRequest.RangeQuery.from:type_name -> testpb.ListExampleDurationRequest.IndexKey - 46, // 58: testpb.ListExampleDurationRequest.RangeQuery.to:type_name -> testpb.ListExampleDurationRequest.IndexKey - 67, // 59: testpb.ListExampleDurationRequest.IndexKey.Dur.dur:type_name -> google.protobuf.Duration - 52, // 60: testpb.ListSimpleExampleRequest.IndexKey.name:type_name -> testpb.ListSimpleExampleRequest.IndexKey.Name - 53, // 61: testpb.ListSimpleExampleRequest.IndexKey.unique:type_name -> testpb.ListSimpleExampleRequest.IndexKey.Unique - 50, // 62: testpb.ListSimpleExampleRequest.RangeQuery.from:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 50, // 63: testpb.ListSimpleExampleRequest.RangeQuery.to:type_name -> testpb.ListSimpleExampleRequest.IndexKey - 56, // 64: testpb.ListExampleAutoIncFieldNameRequest.IndexKey.foo:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey.Foo - 54, // 65: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery.from:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 54, // 66: testpb.ListExampleAutoIncFieldNameRequest.RangeQuery.to:type_name -> testpb.ListExampleAutoIncFieldNameRequest.IndexKey - 0, // 67: testpb.TestSchemaQueryService.GetExampleTable:input_type -> testpb.GetExampleTableRequest - 2, // 68: testpb.TestSchemaQueryService.GetExampleTableByU64Str:input_type -> testpb.GetExampleTableByU64StrRequest - 4, // 69: testpb.TestSchemaQueryService.ListExampleTable:input_type -> testpb.ListExampleTableRequest - 6, // 70: testpb.TestSchemaQueryService.GetExampleAutoIncrementTable:input_type -> testpb.GetExampleAutoIncrementTableRequest - 8, // 71: testpb.TestSchemaQueryService.GetExampleAutoIncrementTableByX:input_type -> testpb.GetExampleAutoIncrementTableByXRequest - 10, // 72: testpb.TestSchemaQueryService.ListExampleAutoIncrementTable:input_type -> testpb.ListExampleAutoIncrementTableRequest - 12, // 73: testpb.TestSchemaQueryService.GetExampleSingleton:input_type -> testpb.GetExampleSingletonRequest - 14, // 74: testpb.TestSchemaQueryService.GetExampleTimestamp:input_type -> testpb.GetExampleTimestampRequest - 16, // 75: testpb.TestSchemaQueryService.ListExampleTimestamp:input_type -> testpb.ListExampleTimestampRequest - 18, // 76: testpb.TestSchemaQueryService.GetExampleDuration:input_type -> testpb.GetExampleDurationRequest - 20, // 77: testpb.TestSchemaQueryService.ListExampleDuration:input_type -> testpb.ListExampleDurationRequest - 22, // 78: testpb.TestSchemaQueryService.GetSimpleExample:input_type -> testpb.GetSimpleExampleRequest - 24, // 79: testpb.TestSchemaQueryService.GetSimpleExampleByUnique:input_type -> testpb.GetSimpleExampleByUniqueRequest - 26, // 80: testpb.TestSchemaQueryService.ListSimpleExample:input_type -> testpb.ListSimpleExampleRequest - 28, // 81: testpb.TestSchemaQueryService.GetExampleAutoIncFieldName:input_type -> testpb.GetExampleAutoIncFieldNameRequest - 30, // 82: testpb.TestSchemaQueryService.ListExampleAutoIncFieldName:input_type -> testpb.ListExampleAutoIncFieldNameRequest - 1, // 83: testpb.TestSchemaQueryService.GetExampleTable:output_type -> testpb.GetExampleTableResponse - 3, // 84: testpb.TestSchemaQueryService.GetExampleTableByU64Str:output_type -> testpb.GetExampleTableByU64StrResponse - 5, // 85: testpb.TestSchemaQueryService.ListExampleTable:output_type -> testpb.ListExampleTableResponse - 7, // 86: testpb.TestSchemaQueryService.GetExampleAutoIncrementTable:output_type -> testpb.GetExampleAutoIncrementTableResponse - 9, // 87: testpb.TestSchemaQueryService.GetExampleAutoIncrementTableByX:output_type -> testpb.GetExampleAutoIncrementTableByXResponse - 11, // 88: testpb.TestSchemaQueryService.ListExampleAutoIncrementTable:output_type -> testpb.ListExampleAutoIncrementTableResponse - 13, // 89: testpb.TestSchemaQueryService.GetExampleSingleton:output_type -> testpb.GetExampleSingletonResponse - 15, // 90: testpb.TestSchemaQueryService.GetExampleTimestamp:output_type -> testpb.GetExampleTimestampResponse - 17, // 91: testpb.TestSchemaQueryService.ListExampleTimestamp:output_type -> testpb.ListExampleTimestampResponse - 19, // 92: testpb.TestSchemaQueryService.GetExampleDuration:output_type -> testpb.GetExampleDurationResponse - 21, // 93: testpb.TestSchemaQueryService.ListExampleDuration:output_type -> testpb.ListExampleDurationResponse - 23, // 94: testpb.TestSchemaQueryService.GetSimpleExample:output_type -> testpb.GetSimpleExampleResponse - 25, // 95: testpb.TestSchemaQueryService.GetSimpleExampleByUnique:output_type -> testpb.GetSimpleExampleByUniqueResponse - 27, // 96: testpb.TestSchemaQueryService.ListSimpleExample:output_type -> testpb.ListSimpleExampleResponse - 29, // 97: testpb.TestSchemaQueryService.GetExampleAutoIncFieldName:output_type -> testpb.GetExampleAutoIncFieldNameResponse - 31, // 98: testpb.TestSchemaQueryService.ListExampleAutoIncFieldName:output_type -> testpb.ListExampleAutoIncFieldNameResponse - 83, // [83:99] is the sub-list for method output_type - 67, // [67:83] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name -} - -func init() { file_testpb_test_schema_query_proto_init() } -func file_testpb_test_schema_query_proto_init() { - if File_testpb_test_schema_query_proto != nil { - return - } - file_testpb_test_schema_proto_init() - if !protoimpl.UnsafeEnabled { - file_testpb_test_schema_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableByU64StrRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTableByU64StrResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableByXRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncrementTableByXResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleSingletonRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleSingletonResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTimestampRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleTimestampResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleDurationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleDurationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleByUniqueRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSimpleExampleByUniqueResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncFieldNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetExampleAutoIncFieldNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_U32I64Str); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_U64Str); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_StrU32); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTableRequest_IndexKey_BzStr); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncrementTableRequest_IndexKey_X); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleTimestampRequest_IndexKey_Ts); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey_Id); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleDurationRequest_IndexKey_Dur); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey_Name); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSimpleExampleRequest_IndexKey_Unique); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_IndexKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_RangeQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_testpb_test_schema_query_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListExampleAutoIncFieldNameRequest_IndexKey_Foo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_testpb_test_schema_query_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*ListExampleTableRequest_PrefixQuery)(nil), - (*ListExampleTableRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[10].OneofWrappers = []interface{}{ - (*ListExampleAutoIncrementTableRequest_PrefixQuery)(nil), - (*ListExampleAutoIncrementTableRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[16].OneofWrappers = []interface{}{ - (*ListExampleTimestampRequest_PrefixQuery)(nil), - (*ListExampleTimestampRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[20].OneofWrappers = []interface{}{ - (*ListExampleDurationRequest_PrefixQuery)(nil), - (*ListExampleDurationRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[26].OneofWrappers = []interface{}{ - (*ListSimpleExampleRequest_PrefixQuery)(nil), - (*ListSimpleExampleRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[30].OneofWrappers = []interface{}{ - (*ListExampleAutoIncFieldNameRequest_PrefixQuery)(nil), - (*ListExampleAutoIncFieldNameRequest_RangeQuery_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[32].OneofWrappers = []interface{}{ - (*ListExampleTableRequest_IndexKey_U_32I_64Str)(nil), - (*ListExampleTableRequest_IndexKey_U_64Str)(nil), - (*ListExampleTableRequest_IndexKey_StrU_32)(nil), - (*ListExampleTableRequest_IndexKey_BzStr_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[34].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[35].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[36].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[37].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[38].OneofWrappers = []interface{}{ - (*ListExampleAutoIncrementTableRequest_IndexKey_Id_)(nil), - (*ListExampleAutoIncrementTableRequest_IndexKey_X_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[40].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[41].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[42].OneofWrappers = []interface{}{ - (*ListExampleTimestampRequest_IndexKey_Id_)(nil), - (*ListExampleTimestampRequest_IndexKey_Ts_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[44].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[45].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[46].OneofWrappers = []interface{}{ - (*ListExampleDurationRequest_IndexKey_Id_)(nil), - (*ListExampleDurationRequest_IndexKey_Dur_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[48].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[49].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[50].OneofWrappers = []interface{}{ - (*ListSimpleExampleRequest_IndexKey_Name_)(nil), - (*ListSimpleExampleRequest_IndexKey_Unique_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[52].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[53].OneofWrappers = []interface{}{} - file_testpb_test_schema_query_proto_msgTypes[54].OneofWrappers = []interface{}{ - (*ListExampleAutoIncFieldNameRequest_IndexKey_Foo_)(nil), - } - file_testpb_test_schema_query_proto_msgTypes[56].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_testpb_test_schema_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 57, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_testpb_test_schema_query_proto_goTypes, - DependencyIndexes: file_testpb_test_schema_query_proto_depIdxs, - MessageInfos: file_testpb_test_schema_query_proto_msgTypes, - }.Build() - File_testpb_test_schema_query_proto = out.File - file_testpb_test_schema_query_proto_rawDesc = nil - file_testpb_test_schema_query_proto_goTypes = nil - file_testpb_test_schema_query_proto_depIdxs = nil -} diff --git a/orm/internal/testpb/test_schema_query.proto b/orm/internal/testpb/test_schema_query.proto deleted file mode 100644 index c3dbcfd5d885..000000000000 --- a/orm/internal/testpb/test_schema_query.proto +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. -syntax = "proto3"; -package testpb; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "testpb/test_schema.proto"; - -// TestSchemaQueryService queries the state of the tables specified by testpb/test_schema.proto. -service TestSchemaQueryService { - // Get queries the ExampleTable table by its primary key. - rpc GetExampleTable(GetExampleTableRequest) returns (GetExampleTableResponse) {} - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - rpc GetExampleTableByU64Str(GetExampleTableByU64StrRequest) returns (GetExampleTableByU64StrResponse) {} - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - rpc ListExampleTable(ListExampleTableRequest) returns (ListExampleTableResponse) {} - // Get queries the ExampleAutoIncrementTable table by its primary key. - rpc GetExampleAutoIncrementTable(GetExampleAutoIncrementTableRequest) returns (GetExampleAutoIncrementTableResponse) { - } - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - rpc GetExampleAutoIncrementTableByX(GetExampleAutoIncrementTableByXRequest) - returns (GetExampleAutoIncrementTableByXResponse) {} - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against - // defined indexes. - rpc ListExampleAutoIncrementTable(ListExampleAutoIncrementTableRequest) - returns (ListExampleAutoIncrementTableResponse) {} - // GetExampleSingleton queries the ExampleSingleton singleton. - rpc GetExampleSingleton(GetExampleSingletonRequest) returns (GetExampleSingletonResponse) {} - // Get queries the ExampleTimestamp table by its primary key. - rpc GetExampleTimestamp(GetExampleTimestampRequest) returns (GetExampleTimestampResponse) {} - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - rpc ListExampleTimestamp(ListExampleTimestampRequest) returns (ListExampleTimestampResponse) {} - // Get queries the ExampleDuration table by its primary key. - rpc GetExampleDuration(GetExampleDurationRequest) returns (GetExampleDurationResponse) {} - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - rpc ListExampleDuration(ListExampleDurationRequest) returns (ListExampleDurationResponse) {} - // Get queries the SimpleExample table by its primary key. - rpc GetSimpleExample(GetSimpleExampleRequest) returns (GetSimpleExampleResponse) {} - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - rpc GetSimpleExampleByUnique(GetSimpleExampleByUniqueRequest) returns (GetSimpleExampleByUniqueResponse) {} - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - rpc ListSimpleExample(ListSimpleExampleRequest) returns (ListSimpleExampleResponse) {} - // Get queries the ExampleAutoIncFieldName table by its primary key. - rpc GetExampleAutoIncFieldName(GetExampleAutoIncFieldNameRequest) returns (GetExampleAutoIncFieldNameResponse) {} - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against - // defined indexes. - rpc ListExampleAutoIncFieldName(ListExampleAutoIncFieldNameRequest) returns (ListExampleAutoIncFieldNameResponse) {} -} - -// GetExampleTableRequest is the TestSchemaQuery/GetExampleTableRequest request type. -message GetExampleTableRequest { - // u32 specifies the value of the u32 field in the primary key. - uint32 u32 = 1; - // i64 specifies the value of the i64 field in the primary key. - int64 i64 = 2; - // str specifies the value of the str field in the primary key. - string str = 3; -} - -// GetExampleTableResponse is the TestSchemaQuery/GetExampleTableResponse response type. -message GetExampleTableResponse { - // value is the response value. - ExampleTable value = 1; -} - -// GetExampleTableByU64StrRequest is the TestSchemaQuery/GetExampleTableByU64StrRequest request type. -message GetExampleTableByU64StrRequest { - uint64 u64 = 1; - string str = 2; -} - -// GetExampleTableByU64StrResponse is the TestSchemaQuery/GetExampleTableByU64StrResponse response type. -message GetExampleTableByU64StrResponse { - ExampleTable value = 1; -} - -// ListExampleTableRequest is the TestSchemaQuery/ListExampleTableRequest request type. -message ListExampleTableRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // u_32_i_64_str specifies the value of the U32I64Str index key to use in the query. - U32I64Str u_32_i_64_str = 1; - // u_64_str specifies the value of the U64Str index key to use in the query. - U64Str u_64_str = 2; - // str_u_32 specifies the value of the StrU32 index key to use in the query. - StrU32 str_u_32 = 3; - // bz_str specifies the value of the BzStr index key to use in the query. - BzStr bz_str = 4; - } - - message U32I64Str { - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint32 u32 = 1; - // i64 is the value of the i64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional int64 i64 = 2; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 3; - } - - message U64Str { - // u64 is the value of the u64 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 u64 = 1; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 2; - } - - message StrU32 { - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 1; - // u32 is the value of the u32 field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint32 u32 = 2; - } - - message BzStr { - // bz is the value of the bz field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional bytes bz = 1; - // str is the value of the str field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string str = 2; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleTableResponse is the TestSchemaQuery/ListExampleTableResponse response type. -message ListExampleTableResponse { - // values are the results of the query. - repeated ExampleTable values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleAutoIncrementTableRequest is the TestSchemaQuery/GetExampleAutoIncrementTableRequest request type. -message GetExampleAutoIncrementTableRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleAutoIncrementTableResponse is the TestSchemaQuery/GetExampleAutoIncrementTableResponse response type. -message GetExampleAutoIncrementTableResponse { - // value is the response value. - ExampleAutoIncrementTable value = 1; -} - -// GetExampleAutoIncrementTableByXRequest is the TestSchemaQuery/GetExampleAutoIncrementTableByXRequest request type. -message GetExampleAutoIncrementTableByXRequest { - string x = 1; -} - -// GetExampleAutoIncrementTableByXResponse is the TestSchemaQuery/GetExampleAutoIncrementTableByXResponse response type. -message GetExampleAutoIncrementTableByXResponse { - ExampleAutoIncrementTable value = 1; -} - -// ListExampleAutoIncrementTableRequest is the TestSchemaQuery/ListExampleAutoIncrementTableRequest request type. -message ListExampleAutoIncrementTableRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // x specifies the value of the X index key to use in the query. - X x = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message X { - // x is the value of the x field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string x = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleAutoIncrementTableResponse is the TestSchemaQuery/ListExampleAutoIncrementTableResponse response type. -message ListExampleAutoIncrementTableResponse { - // values are the results of the query. - repeated ExampleAutoIncrementTable values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type. -message GetExampleSingletonRequest {} - -// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type. -message GetExampleSingletonResponse { - ExampleSingleton value = 1; -} - -// GetExampleTimestampRequest is the TestSchemaQuery/GetExampleTimestampRequest request type. -message GetExampleTimestampRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleTimestampResponse is the TestSchemaQuery/GetExampleTimestampResponse response type. -message GetExampleTimestampResponse { - // value is the response value. - ExampleTimestamp value = 1; -} - -// ListExampleTimestampRequest is the TestSchemaQuery/ListExampleTimestampRequest request type. -message ListExampleTimestampRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // ts specifies the value of the Ts index key to use in the query. - Ts ts = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message Ts { - // ts is the value of the ts field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional google.protobuf.Timestamp ts = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleTimestampResponse is the TestSchemaQuery/ListExampleTimestampResponse response type. -message ListExampleTimestampResponse { - // values are the results of the query. - repeated ExampleTimestamp values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleDurationRequest is the TestSchemaQuery/GetExampleDurationRequest request type. -message GetExampleDurationRequest { - // id specifies the value of the id field in the primary key. - uint64 id = 1; -} - -// GetExampleDurationResponse is the TestSchemaQuery/GetExampleDurationResponse response type. -message GetExampleDurationResponse { - // value is the response value. - ExampleDuration value = 1; -} - -// ListExampleDurationRequest is the TestSchemaQuery/ListExampleDurationRequest request type. -message ListExampleDurationRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // id specifies the value of the Id index key to use in the query. - Id id = 1; - // dur specifies the value of the Dur index key to use in the query. - Dur dur = 2; - } - - message Id { - // id is the value of the id field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 id = 1; - } - - message Dur { - // dur is the value of the dur field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional google.protobuf.Duration dur = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleDurationResponse is the TestSchemaQuery/ListExampleDurationResponse response type. -message ListExampleDurationResponse { - // values are the results of the query. - repeated ExampleDuration values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetSimpleExampleRequest is the TestSchemaQuery/GetSimpleExampleRequest request type. -message GetSimpleExampleRequest { - // name specifies the value of the name field in the primary key. - string name = 1; -} - -// GetSimpleExampleResponse is the TestSchemaQuery/GetSimpleExampleResponse response type. -message GetSimpleExampleResponse { - // value is the response value. - SimpleExample value = 1; -} - -// GetSimpleExampleByUniqueRequest is the TestSchemaQuery/GetSimpleExampleByUniqueRequest request type. -message GetSimpleExampleByUniqueRequest { - string unique = 1; -} - -// GetSimpleExampleByUniqueResponse is the TestSchemaQuery/GetSimpleExampleByUniqueResponse response type. -message GetSimpleExampleByUniqueResponse { - SimpleExample value = 1; -} - -// ListSimpleExampleRequest is the TestSchemaQuery/ListSimpleExampleRequest request type. -message ListSimpleExampleRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // name specifies the value of the Name index key to use in the query. - Name name = 1; - // unique specifies the value of the Unique index key to use in the query. - Unique unique = 2; - } - - message Name { - // name is the value of the name field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string name = 1; - } - - message Unique { - // unique is the value of the unique field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional string unique = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListSimpleExampleResponse is the TestSchemaQuery/ListSimpleExampleResponse response type. -message ListSimpleExampleResponse { - // values are the results of the query. - repeated SimpleExample values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// GetExampleAutoIncFieldNameRequest is the TestSchemaQuery/GetExampleAutoIncFieldNameRequest request type. -message GetExampleAutoIncFieldNameRequest { - // foo specifies the value of the foo field in the primary key. - uint64 foo = 1; -} - -// GetExampleAutoIncFieldNameResponse is the TestSchemaQuery/GetExampleAutoIncFieldNameResponse response type. -message GetExampleAutoIncFieldNameResponse { - // value is the response value. - ExampleAutoIncFieldName value = 1; -} - -// ListExampleAutoIncFieldNameRequest is the TestSchemaQuery/ListExampleAutoIncFieldNameRequest request type. -message ListExampleAutoIncFieldNameRequest { - // IndexKey specifies the value of an index key to use in prefix and range queries. - message IndexKey { - // key specifies the index key value. - oneof key { - // foo specifies the value of the Foo index key to use in the query. - Foo foo = 1; - } - - message Foo { - // foo is the value of the foo field in the index. - // It can be omitted to query for all valid values of that field in this segment of the index. - optional uint64 foo = 1; - } - } - - // query specifies the type of query - either a prefix or range query. - oneof query { - // prefix_query specifies the index key value to use for the prefix query. - IndexKey prefix_query = 1; - // range_query specifies the index key from/to values to use for the range query. - RangeQuery range_query = 2; - } - // pagination specifies optional pagination parameters. - cosmos.base.query.v1beta1.PageRequest pagination = 3; - - // RangeQuery specifies the from/to index keys for a range query. - message RangeQuery { - // from is the index key to use for the start of the range query. - // To query from the start of an index, specify an index key for that index with empty values. - IndexKey from = 1; - // to is the index key to use for the end of the range query. - // The index key type MUST be the same as the index key type used for from. - // To query from to the end of an index it can be omitted. - IndexKey to = 2; - } -} - -// ListExampleAutoIncFieldNameResponse is the TestSchemaQuery/ListExampleAutoIncFieldNameResponse response type. -message ListExampleAutoIncFieldNameResponse { - // values are the results of the query. - repeated ExampleAutoIncFieldName values = 1; - // pagination is the pagination response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/orm/internal/testpb/test_schema_query_grpc.pb.go b/orm/internal/testpb/test_schema_query_grpc.pb.go deleted file mode 100644 index 3043f57c516d..000000000000 --- a/orm/internal/testpb/test_schema_query_grpc.pb.go +++ /dev/null @@ -1,699 +0,0 @@ -// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: testpb/test_schema_query.proto - -package testpb - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - TestSchemaQueryService_GetExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTable" - TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTableByU64Str" - TestSchemaQueryService_ListExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTable" - TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTable" - TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTableByX" - TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncrementTable" - TestSchemaQueryService_GetExampleSingleton_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleSingleton" - TestSchemaQueryService_GetExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTimestamp" - TestSchemaQueryService_ListExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTimestamp" - TestSchemaQueryService_GetExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleDuration" - TestSchemaQueryService_ListExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleDuration" - TestSchemaQueryService_GetSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExample" - TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExampleByUnique" - TestSchemaQueryService_ListSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/ListSimpleExample" - TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncFieldName" - TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncFieldName" -) - -// TestSchemaQueryServiceClient is the client API for TestSchemaQueryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TestSchemaQueryServiceClient interface { - // Get queries the ExampleTable table by its primary key. - GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) - // Get queries the ExampleAutoIncrementTable table by its primary key. - GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) - // GetExampleSingleton queries the ExampleSingleton singleton. - GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) - // Get queries the ExampleTimestamp table by its primary key. - GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) - // Get queries the ExampleDuration table by its primary key. - GetExampleDuration(ctx context.Context, in *GetExampleDurationRequest, opts ...grpc.CallOption) (*GetExampleDurationResponse, error) - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - ListExampleDuration(ctx context.Context, in *ListExampleDurationRequest, opts ...grpc.CallOption) (*ListExampleDurationResponse, error) - // Get queries the SimpleExample table by its primary key. - GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) - // Get queries the ExampleAutoIncFieldName table by its primary key. - GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. - ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) -} - -type testSchemaQueryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewTestSchemaQueryServiceClient(cc grpc.ClientConnInterface) TestSchemaQueryServiceClient { - return &testSchemaQueryServiceClient{cc} -} - -func (c *testSchemaQueryServiceClient) GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) { - out := new(GetExampleTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) { - out := new(GetExampleTableByU64StrResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) { - out := new(ListExampleTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) { - out := new(GetExampleAutoIncrementTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) { - out := new(GetExampleAutoIncrementTableByXResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) { - out := new(ListExampleAutoIncrementTableResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) { - out := new(GetExampleSingletonResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleSingleton_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) { - out := new(GetExampleTimestampResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTimestamp_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) { - out := new(ListExampleTimestampResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTimestamp_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleDuration(ctx context.Context, in *GetExampleDurationRequest, opts ...grpc.CallOption) (*GetExampleDurationResponse, error) { - out := new(GetExampleDurationResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleDuration_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleDuration(ctx context.Context, in *ListExampleDurationRequest, opts ...grpc.CallOption) (*ListExampleDurationResponse, error) { - out := new(ListExampleDurationResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleDuration_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) { - out := new(GetSimpleExampleResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExample_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) { - out := new(GetSimpleExampleByUniqueResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) { - out := new(ListSimpleExampleResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListSimpleExample_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) { - out := new(GetExampleAutoIncFieldNameResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testSchemaQueryServiceClient) ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) { - out := new(ListExampleAutoIncFieldNameResponse) - err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TestSchemaQueryServiceServer is the server API for TestSchemaQueryService service. -// All implementations must embed UnimplementedTestSchemaQueryServiceServer -// for forward compatibility -type TestSchemaQueryServiceServer interface { - // Get queries the ExampleTable table by its primary key. - GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error) - // GetExampleTableByU64Str queries the ExampleTable table by its U64Str index - GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error) - // ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes. - ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error) - // Get queries the ExampleAutoIncrementTable table by its primary key. - GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error) - // GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index - GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error) - // ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes. - ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error) - // GetExampleSingleton queries the ExampleSingleton singleton. - GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error) - // Get queries the ExampleTimestamp table by its primary key. - GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error) - // ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes. - ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error) - // Get queries the ExampleDuration table by its primary key. - GetExampleDuration(context.Context, *GetExampleDurationRequest) (*GetExampleDurationResponse, error) - // ListExampleDuration queries the ExampleDuration table using prefix and range queries against defined indexes. - ListExampleDuration(context.Context, *ListExampleDurationRequest) (*ListExampleDurationResponse, error) - // Get queries the SimpleExample table by its primary key. - GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error) - // GetSimpleExampleByUnique queries the SimpleExample table by its Unique index - GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error) - // ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes. - ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error) - // Get queries the ExampleAutoIncFieldName table by its primary key. - GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error) - // ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes. - ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error) - mustEmbedUnimplementedTestSchemaQueryServiceServer() -} - -// UnimplementedTestSchemaQueryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedTestSchemaQueryServiceServer struct { -} - -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTableByU64Str not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTableByX not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncrementTable not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleSingleton not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleTimestamp not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleTimestamp not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleDuration(context.Context, *GetExampleDurationRequest) (*GetExampleDurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleDuration not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleDuration(context.Context, *ListExampleDurationRequest) (*ListExampleDurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleDuration not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExample not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExampleByUnique not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListSimpleExample not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncFieldName not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncFieldName not implemented") -} -func (UnimplementedTestSchemaQueryServiceServer) mustEmbedUnimplementedTestSchemaQueryServiceServer() { -} - -// UnsafeTestSchemaQueryServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TestSchemaQueryServiceServer will -// result in compilation errors. -type UnsafeTestSchemaQueryServiceServer interface { - mustEmbedUnimplementedTestSchemaQueryServiceServer() -} - -func RegisterTestSchemaQueryServiceServer(s grpc.ServiceRegistrar, srv TestSchemaQueryServiceServer) { - s.RegisterService(&TestSchemaQueryService_ServiceDesc, srv) -} - -func _TestSchemaQueryService_GetExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTable(ctx, req.(*GetExampleTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleTableByU64Str_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTableByU64StrRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTableByU64Str(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTableByU64Str(ctx, req.(*GetExampleTableByU64StrRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleTable(ctx, req.(*ListExampleTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncrementTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTable(ctx, req.(*GetExampleAutoIncrementTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncrementTableByX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncrementTableByXRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTableByX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTableByX(ctx, req.(*GetExampleAutoIncrementTableByXRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleAutoIncrementTableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncrementTable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncrementTable(ctx, req.(*ListExampleAutoIncrementTableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleSingleton_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleSingletonRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleSingleton(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleSingleton_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleSingleton(ctx, req.(*GetExampleSingletonRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleTimestampRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleTimestamp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleTimestamp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleTimestamp(ctx, req.(*GetExampleTimestampRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleTimestampRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleTimestamp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleTimestamp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleTimestamp(ctx, req.(*ListExampleTimestampRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleDurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleDuration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleDuration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleDuration(ctx, req.(*GetExampleDurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleDuration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleDurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleDuration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleDuration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleDuration(ctx, req.(*ListExampleDurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSimpleExampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetSimpleExample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetSimpleExample_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetSimpleExample(ctx, req.(*GetSimpleExampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetSimpleExampleByUnique_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSimpleExampleByUniqueRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetSimpleExampleByUnique(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetSimpleExampleByUnique(ctx, req.(*GetSimpleExampleByUniqueRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListSimpleExampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListSimpleExample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListSimpleExample_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListSimpleExample(ctx, req.(*ListSimpleExampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_GetExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExampleAutoIncFieldNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncFieldName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncFieldName(ctx, req.(*GetExampleAutoIncFieldNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TestSchemaQueryService_ListExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListExampleAutoIncFieldNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncFieldName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncFieldName(ctx, req.(*ListExampleAutoIncFieldNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TestSchemaQueryService_ServiceDesc is the grpc.ServiceDesc for TestSchemaQueryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TestSchemaQueryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.TestSchemaQueryService", - HandlerType: (*TestSchemaQueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetExampleTable", - Handler: _TestSchemaQueryService_GetExampleTable_Handler, - }, - { - MethodName: "GetExampleTableByU64Str", - Handler: _TestSchemaQueryService_GetExampleTableByU64Str_Handler, - }, - { - MethodName: "ListExampleTable", - Handler: _TestSchemaQueryService_ListExampleTable_Handler, - }, - { - MethodName: "GetExampleAutoIncrementTable", - Handler: _TestSchemaQueryService_GetExampleAutoIncrementTable_Handler, - }, - { - MethodName: "GetExampleAutoIncrementTableByX", - Handler: _TestSchemaQueryService_GetExampleAutoIncrementTableByX_Handler, - }, - { - MethodName: "ListExampleAutoIncrementTable", - Handler: _TestSchemaQueryService_ListExampleAutoIncrementTable_Handler, - }, - { - MethodName: "GetExampleSingleton", - Handler: _TestSchemaQueryService_GetExampleSingleton_Handler, - }, - { - MethodName: "GetExampleTimestamp", - Handler: _TestSchemaQueryService_GetExampleTimestamp_Handler, - }, - { - MethodName: "ListExampleTimestamp", - Handler: _TestSchemaQueryService_ListExampleTimestamp_Handler, - }, - { - MethodName: "GetExampleDuration", - Handler: _TestSchemaQueryService_GetExampleDuration_Handler, - }, - { - MethodName: "ListExampleDuration", - Handler: _TestSchemaQueryService_ListExampleDuration_Handler, - }, - { - MethodName: "GetSimpleExample", - Handler: _TestSchemaQueryService_GetSimpleExample_Handler, - }, - { - MethodName: "GetSimpleExampleByUnique", - Handler: _TestSchemaQueryService_GetSimpleExampleByUnique_Handler, - }, - { - MethodName: "ListSimpleExample", - Handler: _TestSchemaQueryService_ListSimpleExample_Handler, - }, - { - MethodName: "GetExampleAutoIncFieldName", - Handler: _TestSchemaQueryService_GetExampleAutoIncFieldName_Handler, - }, - { - MethodName: "ListExampleAutoIncFieldName", - Handler: _TestSchemaQueryService_ListExampleAutoIncFieldName_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "testpb/test_schema_query.proto", -} diff --git a/orm/internal/testutil/testutil.go b/orm/internal/testutil/testutil.go deleted file mode 100644 index ea9c29f33efd..000000000000 --- a/orm/internal/testutil/testutil.go +++ /dev/null @@ -1,199 +0,0 @@ -package testutil - -import ( - "fmt" - "math" - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/known/durationpb" - "google.golang.org/protobuf/types/known/timestamppb" - "pgregory.net/rapid" - - "cosmossdk.io/orm/encoding/ormfield" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/testpb" -) - -// TestFieldSpec defines a test field against the testpb.ExampleTable message. -type TestFieldSpec struct { - FieldName protoreflect.Name - Gen *rapid.Generator[any] -} - -var TestFieldSpecs = []TestFieldSpec{ - { - "u32", - rapid.Uint32().AsAny(), - }, - { - "u64", - rapid.Uint64().AsAny(), - }, - { - "str", - rapid.String().Filter(func(x string) bool { - // filter out null terminators - return strings.IndexByte(x, 0) < 0 - }).AsAny(), - }, - { - "bz", - rapid.SliceOfN(rapid.Byte(), 0, math.MaxUint32).AsAny(), - }, - { - "i32", - rapid.Int32().AsAny(), - }, - { - "f32", - rapid.Uint32().AsAny(), - }, - { - "s32", - rapid.Int32().AsAny(), - }, - { - "sf32", - rapid.Int32().AsAny(), - }, - { - "i64", - rapid.Int64().AsAny(), - }, - { - "f64", - rapid.Uint64().AsAny(), - }, - { - "s64", - rapid.Int64().AsAny(), - }, - { - "sf64", - rapid.Int64().AsAny(), - }, - { - "b", - rapid.Bool().AsAny(), - }, - { - "ts", - rapid.Custom(func(t *rapid.T) protoreflect.Message { - isNil := rapid.Float32().Draw(t, "isNil") - if isNil >= 0.95 { // draw a nil 5% of the time - return nil - } - seconds := rapid.Int64Range(ormfield.TimestampSecondsMin, ormfield.TimestampSecondsMax).Draw(t, "seconds") - nanos := rapid.Int32Range(0, ormfield.TimestampNanosMax).Draw(t, "nanos") - return (×tamppb.Timestamp{ - Seconds: seconds, - Nanos: nanos, - }).ProtoReflect() - }).AsAny(), - }, - { - "dur", - rapid.Custom(func(t *rapid.T) protoreflect.Message { - isNil := rapid.Float32().Draw(t, "isNil") - if isNil >= 0.95 { // draw a nil 5% of the time - return nil - } - seconds := rapid.Int64Range(ormfield.DurationNanosMin, ormfield.DurationNanosMax).Draw(t, "seconds") - nanos := rapid.Int32Range(0, ormfield.DurationNanosMax).Draw(t, "nanos") - if seconds < 0 { - nanos = -nanos - } - return (&durationpb.Duration{ - Seconds: seconds, - Nanos: nanos, - }).ProtoReflect() - }).AsAny(), - }, - { - "e", - rapid.Map(rapid.Int32(), func(x int32) protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) - }).AsAny(), - }, -} - -func MakeTestCodec(fname protoreflect.Name, nonTerminal bool) (ormfield.Codec, error) { - field := GetTestField(fname) - if field == nil { - return nil, fmt.Errorf("can't find field %s", fname) - } - return ormfield.GetCodec(field, nonTerminal) -} - -func GetTestField(fname protoreflect.Name) protoreflect.FieldDescriptor { - a := &testpb.ExampleTable{} - return a.ProtoReflect().Descriptor().Fields().ByName(fname) -} - -type TestKeyCodec struct { - KeySpecs []TestFieldSpec - Codec *ormkv.KeyCodec -} - -func TestFieldSpecsGen(minLen, maxLen int) *rapid.Generator[[]TestFieldSpec] { - return rapid.Custom(func(t *rapid.T) []TestFieldSpec { - xs := rapid.SliceOfNDistinct(rapid.IntRange(0, len(TestFieldSpecs)-1), minLen, maxLen, func(i int) int { return i }). - Draw(t, "fieldSpecIndexes") - - var specs []TestFieldSpec - - for _, x := range xs { - spec := TestFieldSpecs[x] - specs = append(specs, spec) - } - - return specs - }) -} - -func TestKeyCodecGen(minLen, maxLen int) *rapid.Generator[TestKeyCodec] { - return rapid.Custom(func(t *rapid.T) TestKeyCodec { - specs := TestFieldSpecsGen(minLen, maxLen).Draw(t, "fieldSpecs") - - var fields []protoreflect.Name - for _, spec := range specs { - fields = append(fields, spec.FieldName) - } - - prefix := rapid.SliceOfN(rapid.Byte(), 0, 5).Draw(t, "prefix") - - msgType := (&testpb.ExampleTable{}).ProtoReflect().Type() - cdc, err := ormkv.NewKeyCodec(prefix, msgType, fields) - if err != nil { - panic(err) - } - - return TestKeyCodec{ - Codec: cdc, - KeySpecs: specs, - } - }) -} - -func (k TestKeyCodec) Draw(t *rapid.T, id string) []protoreflect.Value { - n := len(k.KeySpecs) - keyValues := make([]protoreflect.Value, n) - for i, k := range k.KeySpecs { - keyValues[i] = protoreflect.ValueOf(k.Gen.Draw(t, fmt.Sprintf("%s[%d]", id, i))) - } - return keyValues -} - -var GenA = rapid.Custom(func(t *rapid.T) *testpb.ExampleTable { - a := &testpb.ExampleTable{} - ref := a.ProtoReflect() - for _, spec := range TestFieldSpecs { - field := GetTestField(spec.FieldName) - value := spec.Gen.Draw(t, string(spec.FieldName)) - if value != nil { - ref.Set(field, protoreflect.ValueOf(value)) - } - } - return a -}) diff --git a/orm/model/doc.go b/orm/model/doc.go deleted file mode 100644 index af731c839ca3..000000000000 --- a/orm/model/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package model contains packages which define ORM data "model" types -// such as tables, indexes, and schemas. -package model diff --git a/orm/model/ormdb/file.go b/orm/model/ormdb/file.go deleted file mode 100644 index 2fda9396f05c..000000000000 --- a/orm/model/ormdb/file.go +++ /dev/null @@ -1,123 +0,0 @@ -package ormdb - -import ( - "bytes" - "encoding/binary" - "errors" - "math" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/types/ormerrors" -) - -type fileDescriptorDBOptions struct { - Prefix []byte - ID uint32 - TypeResolver ormtable.TypeResolver - JSONValidator func(proto.Message) error - BackendResolver ormtable.BackendResolver -} - -type fileDescriptorDB struct { - id uint32 - prefix []byte - tablesByID map[uint32]ormtable.Table - tablesByName map[protoreflect.FullName]ormtable.Table - fileDescriptor protoreflect.FileDescriptor -} - -func newFileDescriptorDB(fileDescriptor protoreflect.FileDescriptor, options fileDescriptorDBOptions) (*fileDescriptorDB, error) { - prefix := encodeutil.AppendVarUInt32(options.Prefix, options.ID) - - schema := &fileDescriptorDB{ - id: options.ID, - prefix: prefix, - tablesByID: map[uint32]ormtable.Table{}, - tablesByName: map[protoreflect.FullName]ormtable.Table{}, - fileDescriptor: fileDescriptor, - } - - resolver := options.TypeResolver - if resolver == nil { - resolver = protoregistry.GlobalTypes - } - - messages := fileDescriptor.Messages() - n := messages.Len() - for i := 0; i < n; i++ { - messageDescriptor := messages.Get(i) - tableName := messageDescriptor.FullName() - messageType, err := resolver.FindMessageByName(tableName) - if err != nil { - return nil, err - } - - table, err := ormtable.Build(ormtable.Options{ - Prefix: prefix, - MessageType: messageType, - TypeResolver: resolver, - JSONValidator: options.JSONValidator, - BackendResolver: options.BackendResolver, - }) - if errors.Is(err, ormerrors.NoTableDescriptor) { - continue - } - if err != nil { - return nil, err - } - - id := table.ID() - if _, ok := schema.tablesByID[id]; ok { - return nil, ormerrors.InvalidTableId.Wrapf("duplicate ID %d for %s", id, tableName) - } - schema.tablesByID[id] = table - - if _, ok := schema.tablesByName[tableName]; ok { - return nil, ormerrors.InvalidTableDefinition.Wrapf("duplicate table %s", tableName) - } - schema.tablesByName[tableName] = table - } - - return schema, nil -} - -func (f fileDescriptorDB) DecodeEntry(k, v []byte) (ormkv.Entry, error) { - r := bytes.NewReader(k) - err := encodeutil.SkipPrefix(r, f.prefix) - if err != nil { - return nil, err - } - - id, err := binary.ReadUvarint(r) - if err != nil { - return nil, err - } - - if id > math.MaxUint32 { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("uint32 varint id out of range %d", id) - } - - table, ok := f.tablesByID[uint32(id)] - if !ok { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("can't find table with id %d", id) - } - - return table.DecodeEntry(k, v) -} - -func (f fileDescriptorDB) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - table, ok := f.tablesByName[entry.GetTableName()] - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("can't find table %s", entry.GetTableName()) - } - - return table.EncodeEntry(entry) -} - -var _ ormkv.EntryCodec = fileDescriptorDB{} diff --git a/orm/model/ormdb/testdata/bank_scenario.golden b/orm/model/ormdb/testdata/bank_scenario.golden deleted file mode 100644 index 29c61ebb91f5..000000000000 --- a/orm/model/ormdb/testdata/bank_scenario.golden +++ /dev/null @@ -1,64 +0,0 @@ -GET 010200666f6f - PK testpb.Supply foo -> {"denom":"foo"} -GET 010200666f6f - PK testpb.Supply foo -> {"denom":"foo"} -ORM BEFORE INSERT testpb.Supply {"denom":"foo","amount":100} -SET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -ORM AFTER INSERT testpb.Supply {"denom":"foo","amount":100} -GET 010100626f6200666f6f - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo"} -GET 010100626f6200666f6f - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo"} -ORM BEFORE INSERT testpb.Balance {"address":"bob","denom":"foo","amount":100} -SET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -SET 010101666f6f00626f62 - IDX testpb.Balance denom/address : foo/bob -> bob/foo -ORM AFTER INSERT testpb.Balance {"address":"bob","denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -GET 010100626f6200666f6f 1864 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":100} -ORM BEFORE UPDATE testpb.Balance {"address":"bob","denom":"foo","amount":100} -> {"address":"bob","denom":"foo","amount":70} -SET 010100626f6200666f6f 1846 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":70} -ORM AFTER UPDATE testpb.Balance {"address":"bob","denom":"foo","amount":100} -> {"address":"bob","denom":"foo","amount":70} -GET 01010073616c6c7900666f6f - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo"} -GET 01010073616c6c7900666f6f - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo"} -ORM BEFORE INSERT testpb.Balance {"address":"sally","denom":"foo","amount":30} -SET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -SET 010101666f6f0073616c6c79 - IDX testpb.Balance denom/address : foo/sally -> sally/foo -ORM AFTER INSERT testpb.Balance {"address":"sally","denom":"foo","amount":30} -GET 010100626f6200666f6f 1846 - PK testpb.Balance bob/foo -> {"address":"bob","denom":"foo","amount":70} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -GET 010200666f6f 1064 - PK testpb.Supply foo -> {"denom":"foo","amount":100} -ORM BEFORE UPDATE testpb.Supply {"denom":"foo","amount":100} -> {"denom":"foo","amount":97} -SET 010200666f6f 1061 - PK testpb.Supply foo -> {"denom":"foo","amount":97} -ORM AFTER UPDATE testpb.Supply {"denom":"foo","amount":100} -> {"denom":"foo","amount":97} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -GET 01010073616c6c7900666f6f 181e - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":30} -ORM BEFORE UPDATE testpb.Balance {"address":"sally","denom":"foo","amount":30} -> {"address":"sally","denom":"foo","amount":27} -SET 01010073616c6c7900666f6f 181b - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":27} -ORM AFTER UPDATE testpb.Balance {"address":"sally","denom":"foo","amount":30} -> {"address":"sally","denom":"foo","amount":27} -GET 01010073616c6c7900666f6f 181b - PK testpb.Balance sally/foo -> {"address":"sally","denom":"foo","amount":27} -GET 010200666f6f 1061 - PK testpb.Supply foo -> {"denom":"foo","amount":97} diff --git a/orm/model/ormdb/testdata/default_json.golden b/orm/model/ormdb/testdata/default_json.golden deleted file mode 100644 index 89cfec2aafcb..000000000000 --- a/orm/model/ormdb/testdata/default_json.golden +++ /dev/null @@ -1,4 +0,0 @@ -{ - "testpb.Balance": [], - "testpb.Supply": [] -} \ No newline at end of file diff --git a/orm/model/ormlist/options.go b/orm/model/ormlist/options.go deleted file mode 100644 index 52c8cc3463e6..000000000000 --- a/orm/model/ormlist/options.go +++ /dev/null @@ -1,81 +0,0 @@ -// Package ormlist defines options for listing items from ORM indexes. -package ormlist - -import ( - "google.golang.org/protobuf/proto" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - "cosmossdk.io/orm/internal/listinternal" -) - -// Option represents a list option. -type Option = listinternal.Option - -// Reverse reverses the direction of iteration. If Reverse is -// provided twice, iteration will happen in the forward direction. -func Reverse() Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Reverse = !options.Reverse - }) -} - -// Filter returns an option which applies a filter function to each item -// and skips over it when the filter function returns false. -func Filter(filterFn func(message proto.Message) bool) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Filter = filterFn - }) -} - -// Cursor specifies a cursor after which to restart iteration. Cursor values -// are returned by iterators and in pagination results. -func Cursor(cursor CursorT) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.Cursor = cursor - }) -} - -// Paginate paginates iterator output based on the provided page request. -// The Iterator.PageRequest value on the returned iterator will be non-nil -// after Iterator.Next() returns false when this option is provided. -// -// Care should be taken when using Paginate together with Reverse and/or Cursor. -// In the case of combining Reverse and Paginate, if pageRequest.Reverse is -// true then iteration will proceed in the forward direction. This allows -// the default iteration direction for a query to be reverse with the option -// to switch this (to forward in this case) using PageRequest. If Cursor -// and Paginate are used together, whichever option is used first wins. -// If pageRequest is nil, this option will be a no-op so the caller does not -// need to do a nil check. This function defines no default limit, so if -// the caller does not define a limit, this will return all results. To -// specify a default limit use the DefaultLimit option. -func Paginate(pageRequest *queryv1beta1.PageRequest) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - if pageRequest == nil { - return - } - - if pageRequest.Reverse { - // if the reverse is true we invert the direction of iteration, - // meaning if iteration was already reversed we set it forward. - options.Reverse = !options.Reverse - } - - options.Cursor = pageRequest.Key - options.Offset = pageRequest.Offset - options.Limit = pageRequest.Limit - options.CountTotal = pageRequest.CountTotal - }) -} - -// DefaultLimit specifies a default limit for iteration. This option can be -// combined with Paginate to ensure that there is a default limit if none -// is specified in PageRequest. -func DefaultLimit(defaultLimit uint64) Option { - return listinternal.FuncOption(func(options *listinternal.Options) { - options.DefaultLimit = defaultLimit - }) -} - -// CursorT defines a cursor type. -type CursorT []byte diff --git a/orm/model/ormtable/auto_increment.go b/orm/model/ormtable/auto_increment.go deleted file mode 100644 index e483f27286ec..000000000000 --- a/orm/model/ormtable/auto_increment.go +++ /dev/null @@ -1,250 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "fmt" - "io" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -// autoIncrementTable is a Table implementation for tables with an -// auto-incrementing uint64 primary key. -type autoIncrementTable struct { - *tableImpl - autoIncField protoreflect.FieldDescriptor - seqCodec *ormkv.SeqCodec -} - -func (t autoIncrementTable) InsertReturningPKey(ctx context.Context, message proto.Message) (newPK uint64, err error) { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return 0, err - } - - return t.save(ctx, backend, message, saveModeInsert) -} - -func (t autoIncrementTable) Save(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeDefault) - return err -} - -func (t autoIncrementTable) Insert(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeInsert) - return err -} - -func (t autoIncrementTable) Update(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - _, err = t.save(ctx, backend, message, saveModeUpdate) - return err -} - -func (t autoIncrementTable) LastInsertedSequence(ctx context.Context) (uint64, error) { - backend, err := t.getBackend(ctx) - if err != nil { - return 0, err - } - - return t.curSeqValue(backend.IndexStoreReader()) -} - -func (t *autoIncrementTable) save(ctx context.Context, backend Backend, message proto.Message, mode saveMode) (newPK uint64, err error) { - messageRef := message.ProtoReflect() - val := messageRef.Get(t.autoIncField).Uint() - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - if val == 0 { - if mode == saveModeUpdate { - return 0, ormerrors.PrimaryKeyInvalidOnUpdate - } - - mode = saveModeInsert - newPK, err = t.nextSeqValue(writer.IndexStore()) - if err != nil { - return 0, err - } - - messageRef.Set(t.autoIncField, protoreflect.ValueOfUint64(newPK)) - } else { - if mode == saveModeInsert { - return 0, ormerrors.AutoIncrementKeyAlreadySet - } - - mode = saveModeUpdate - } - - return newPK, t.tableImpl.doSave(ctx, writer, message, mode) -} - -func (t *autoIncrementTable) curSeqValue(kv kv.ReadonlyStore) (uint64, error) { - bz, err := kv.Get(t.seqCodec.Prefix()) - if err != nil { - return 0, err - } - - return t.seqCodec.DecodeValue(bz) -} - -func (t *autoIncrementTable) nextSeqValue(kv kv.Store) (uint64, error) { - seq, err := t.curSeqValue(kv) - if err != nil { - return 0, err - } - - seq++ - return seq, t.setSeqValue(kv, seq) -} - -func (t *autoIncrementTable) setSeqValue(kv kv.Store, seq uint64) error { - return kv.Set(t.seqCodec.Prefix(), t.seqCodec.EncodeValue(seq)) -} - -func (t autoIncrementTable) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - if _, ok := entry.(*ormkv.SeqEntry); ok { - return t.seqCodec.EncodeEntry(entry) - } - return t.tableImpl.EncodeEntry(entry) -} - -func (t autoIncrementTable) ValidateJSON(reader io.Reader) error { - return t.decodeAutoIncJSON(nil, reader, func(message proto.Message, maxSeq uint64) error { - messageRef := message.ProtoReflect() - pkey := messageRef.Get(t.autoIncField).Uint() - if pkey > maxSeq { - return fmt.Errorf("invalid auto increment primary key %d, expected a value <= %d, the highest "+ - "sequence number", pkey, maxSeq) - } - - if t.customJSONValidator != nil { - return t.customJSONValidator(message) - } - - return DefaultJSONValidator(message) - }) -} - -func (t autoIncrementTable) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.decodeAutoIncJSON(backend, reader, func(message proto.Message, maxSeq uint64) error { - messageRef := message.ProtoReflect() - pkey := messageRef.Get(t.autoIncField).Uint() - if pkey == 0 { - // we don't have a primary key in the JSON, so we call Save to insert and - // generate one - _, err = t.save(ctx, backend, message, saveModeInsert) - return err - } - - if pkey > maxSeq { - return fmt.Errorf("invalid auto increment primary key %d, expected a value <= %d, the highest "+ - "sequence number", pkey, maxSeq) - } - // we do have a primary key and calling Save will fail because it expects - // either no primary key or SAVE_MODE_UPDATE. So instead we drop one level - // down and insert using tableImpl which doesn't know about - // auto-incrementing primary keys. - return t.tableImpl.save(ctx, backend, message, saveModeInsert) - }) -} - -func (t autoIncrementTable) decodeAutoIncJSON(backend Backend, reader io.Reader, onMsg func(message proto.Message, maxID uint64) error) error { - decoder, err := t.startDecodeJSON(reader) - if err != nil { - return err - } - - var seq uint64 - - return t.doDecodeJSON(decoder, - func(message json.RawMessage) bool { - err = json.Unmarshal(message, &seq) - if err == nil { - // writer is nil during validation - if backend != nil { - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - err = t.setSeqValue(writer.IndexStore(), seq) - if err != nil { - panic(err) - } - err = writer.Write() - if err != nil { - panic(err) - } - } - return true - } - return false - }, - func(message proto.Message) error { - return onMsg(message, seq) - }) -} - -func (t autoIncrementTable) ExportJSON(ctx context.Context, writer io.Writer) error { - backend, err := t.getBackend(ctx) - if err != nil { - return err - } - - _, err = writer.Write([]byte("[")) - if err != nil { - return err - } - - seq, err := t.curSeqValue(backend.IndexStoreReader()) - if err != nil { - return err - } - - start := true - if seq != 0 { - start = false - bz, err := json.Marshal(seq) - if err != nil { - return err - } - _, err = writer.Write(bz) - if err != nil { - return err - } - } - - return t.doExportJSON(ctx, writer, start) -} - -func (t *autoIncrementTable) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} - -var _ AutoIncrementTable = &autoIncrementTable{} diff --git a/orm/model/ormtable/build.go b/orm/model/ormtable/build.go deleted file mode 100644 index 4a7b8cd7a9c9..000000000000 --- a/orm/model/ormtable/build.go +++ /dev/null @@ -1,289 +0,0 @@ -package ormtable - -import ( - "fmt" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - - ormv1 "cosmossdk.io/api/cosmos/orm/v1" - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/types/ormerrors" -) - -const ( - primaryKeyID uint32 = 0 - indexIDLimit uint32 = 32768 - seqID = indexIDLimit -) - -// Options are options for building a Table. -type Options struct { - // Prefix is an optional prefix used to build the table's prefix. - Prefix []byte - - // MessageType is the protobuf message type of the table. - MessageType protoreflect.MessageType - - // TableDescriptor is an optional table descriptor to be explicitly used - // with the table. Generally this should be nil and the table descriptor - // should be pulled from the table message option. TableDescriptor - // cannot be used together with SingletonDescriptor. - TableDescriptor *ormv1.TableDescriptor - - // SingletonDescriptor is an optional singleton descriptor to be explicitly used. - // Generally this should be nil and the table descriptor - // should be pulled from the singleton message option. SingletonDescriptor - // cannot be used together with TableDescriptor. - SingletonDescriptor *ormv1.SingletonDescriptor - - // TypeResolver is an optional type resolver to be used when unmarshaling - // protobuf messages. - TypeResolver TypeResolver - - // JSONValidator is an optional validator that can be used for validating - // messaging when using ValidateJSON. If it is nil, DefaultJSONValidator - // will be used - JSONValidator func(proto.Message) error - - // BackendResolver is an optional function which retrieves a Backend from the context. - // If it is nil, the default behavior will be to attempt to retrieve a - // backend using the method that WrapContextDefault uses. This method - // can be used to implement things like "store keys" which would allow a - // table to only be used with a specific backend and to hide direct - // access to the backend other than through the table interface. - // Mutating operations will attempt to cast ReadBackend to Backend and - // will return an error if that fails. - BackendResolver BackendResolver -} - -// TypeResolver is an interface that can be used for the protoreflect.UnmarshalOptions.Resolver option. -type TypeResolver interface { - protoregistry.MessageTypeResolver - protoregistry.ExtensionTypeResolver -} - -// Build builds a Table instance from the provided Options. -func Build(options Options) (Table, error) { - messageDescriptor := options.MessageType.Descriptor() - - backendResolver := options.BackendResolver - if backendResolver == nil { - backendResolver = getBackendDefault - } - - table := &tableImpl{ - primaryKeyIndex: &primaryKeyIndex{ - indexers: []indexer{}, - getBackend: backendResolver, - }, - indexes: []Index{}, - indexesByFields: map[fieldnames.FieldNames]concreteIndex{}, - uniqueIndexesByFields: map[fieldnames.FieldNames]UniqueIndex{}, - entryCodecsByID: map[uint32]ormkv.EntryCodec{}, - indexesByID: map[uint32]Index{}, - typeResolver: options.TypeResolver, - customJSONValidator: options.JSONValidator, - } - - pkIndex := table.primaryKeyIndex - - tableDesc := options.TableDescriptor - if tableDesc == nil { - tableDesc = proto.GetExtension(messageDescriptor.Options(), ormv1.E_Table).(*ormv1.TableDescriptor) - } - - singletonDesc := options.SingletonDescriptor - if singletonDesc == nil { - singletonDesc = proto.GetExtension(messageDescriptor.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor) - } - - switch { - case tableDesc != nil: - if singletonDesc != nil { - return nil, ormerrors.InvalidTableDefinition.Wrapf("message %s cannot be declared as both a table and a singleton", messageDescriptor.FullName()) - } - case singletonDesc != nil: - if singletonDesc.Id == 0 { - return nil, ormerrors.InvalidTableId.Wrapf("%s", messageDescriptor.FullName()) - } - - prefix := encodeutil.AppendVarUInt32(options.Prefix, singletonDesc.Id) - pkCodec, err := ormkv.NewPrimaryKeyCodec( - prefix, - options.MessageType, - nil, - proto.UnmarshalOptions{Resolver: options.TypeResolver}, - ) - if err != nil { - return nil, err - } - - pkIndex.PrimaryKeyCodec = pkCodec - table.tablePrefix = prefix - table.tableID = singletonDesc.Id - - return &singleton{table}, nil - default: - return nil, ormerrors.NoTableDescriptor.Wrapf("missing table descriptor for %s", messageDescriptor.FullName()) - } - - tableID := tableDesc.Id - if tableID == 0 { - return nil, ormerrors.InvalidTableId.Wrapf("table %s", messageDescriptor.FullName()) - } - - prefix := options.Prefix - prefix = encodeutil.AppendVarUInt32(prefix, tableID) - table.tablePrefix = prefix - table.tableID = tableID - - if tableDesc.PrimaryKey == nil { - return nil, ormerrors.MissingPrimaryKey.Wrap(string(messageDescriptor.FullName())) - } - - pkFields := fieldnames.CommaSeparatedFieldNames(tableDesc.PrimaryKey.Fields) - table.primaryKeyIndex.fields = pkFields - pkFieldNames := pkFields.Names() - if len(pkFieldNames) == 0 { - return nil, ormerrors.InvalidTableDefinition.Wrapf("empty primary key fields for %s", messageDescriptor.FullName()) - } - - pkPrefix := encodeutil.AppendVarUInt32(prefix, primaryKeyID) - pkCodec, err := ormkv.NewPrimaryKeyCodec( - pkPrefix, - options.MessageType, - pkFieldNames, - proto.UnmarshalOptions{Resolver: options.TypeResolver}, - ) - if err != nil { - return nil, err - } - - pkIndex.PrimaryKeyCodec = pkCodec - table.indexesByFields[pkFields] = pkIndex - table.uniqueIndexesByFields[pkFields] = pkIndex - table.entryCodecsByID[primaryKeyID] = pkIndex - table.indexesByID[primaryKeyID] = pkIndex - table.indexes = append(table.indexes, pkIndex) - - for _, idxDesc := range tableDesc.Index { - id := idxDesc.Id - if id == 0 || id >= indexIDLimit { - return nil, ormerrors.InvalidIndexId.Wrapf("index on table %s with fields %s, invalid id %d", messageDescriptor.FullName(), idxDesc.Fields, id) - } - - if _, ok := table.entryCodecsByID[id]; ok { - return nil, ormerrors.DuplicateIndexId.Wrapf("id %d on table %s", id, messageDescriptor.FullName()) - } - - idxFields := fieldnames.CommaSeparatedFieldNames(idxDesc.Fields) - idxPrefix := encodeutil.AppendVarUInt32(prefix, id) - var index concreteIndex - - // altNames contains all the alternative "names" of this index - altNames := map[fieldnames.FieldNames]bool{idxFields: true} - - if idxDesc.Unique && isNonTrivialUniqueKey(idxFields.Names(), pkFieldNames) { - uniqCdc, err := ormkv.NewUniqueKeyCodec( - idxPrefix, - options.MessageType, - idxFields.Names(), - pkFieldNames, - ) - if err != nil { - return nil, err - } - uniqIdx := &uniqueKeyIndex{ - UniqueKeyCodec: uniqCdc, - fields: idxFields, - primaryKey: pkIndex, - getReadBackend: backendResolver, - } - table.uniqueIndexesByFields[idxFields] = uniqIdx - index = uniqIdx - } else { - idxCdc, err := ormkv.NewIndexKeyCodec( - idxPrefix, - options.MessageType, - idxFields.Names(), - pkFieldNames, - ) - if err != nil { - return nil, err - } - index = &indexKeyIndex{ - IndexKeyCodec: idxCdc, - fields: idxFields, - primaryKey: pkIndex, - getReadBackend: backendResolver, - } - - // non-unique indexes can sometimes be named by several sub-lists of - // fields and we need to handle all of them. For example consider, - // a primary key for fields "a,b,c" and an index on field "c". Because the - // rest of the primary key gets appended to the index key, the index for "c" - // is actually stored as "c,a,b". So this index can be referred to - // by the fields "c", "c,a", or "c,a,b". - allFields := index.GetFieldNames() - allFieldNames := fieldnames.FieldsFromNames(allFields) - altNames[allFieldNames] = true - for i := 1; i < len(allFields); i++ { - altName := fieldnames.FieldsFromNames(allFields[:i]) - if altNames[altName] { - continue - } - - // we check by generating a codec for each sub-list of fields, - // then we see if the full list of fields matches. - altIdxCdc, err := ormkv.NewIndexKeyCodec( - idxPrefix, - options.MessageType, - allFields[:i], - pkFieldNames, - ) - if err != nil { - return nil, err - } - - if fieldnames.FieldsFromNames(altIdxCdc.GetFieldNames()) == allFieldNames { - altNames[altName] = true - } - } - } - - for name := range altNames { - if _, ok := table.indexesByFields[name]; ok { - return nil, fmt.Errorf("duplicate index for fields %s", name) - } - - table.indexesByFields[name] = index - } - - table.entryCodecsByID[id] = index - table.indexesByID[id] = index - table.indexes = append(table.indexes, index) - table.indexers = append(table.indexers, index.(indexer)) - } - - if tableDesc.PrimaryKey.AutoIncrement { - autoIncField := pkCodec.GetFieldDescriptors()[0] - if len(pkFieldNames) != 1 && autoIncField.Kind() != protoreflect.Uint64Kind { - return nil, ormerrors.InvalidAutoIncrementKey.Wrapf("field %s", autoIncField.FullName()) - } - - seqPrefix := encodeutil.AppendVarUInt32(prefix, seqID) - seqCodec := ormkv.NewSeqCodec(options.MessageType, seqPrefix) - table.entryCodecsByID[seqID] = seqCodec - return &autoIncrementTable{ - tableImpl: table, - autoIncField: autoIncField, - seqCodec: seqCodec, - }, nil - } - - return table, nil -} diff --git a/orm/model/ormtable/doc.go b/orm/model/ormtable/doc.go deleted file mode 100644 index 4421dd69abbd..000000000000 --- a/orm/model/ormtable/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package ormtable defines the interfaces and implementations of tables and -// indexes. -package ormtable diff --git a/orm/model/ormtable/duration_test.go b/orm/model/ormtable/duration_test.go deleted file mode 100644 index 7309eb4a0767..000000000000 --- a/orm/model/ormtable/duration_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package ormtable_test - -import ( - "testing" - "time" - - "google.golang.org/protobuf/types/known/durationpb" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestDurationIndex(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleDuration{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewDebugBackend(testkv.NewSplitMemBackend(), &testkv.EntryCodecDebugger{ - EntryCodec: table, - }) - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleDurationTable(table) - assert.NilError(t, err) - - neg, err := time.ParseDuration("-1h") - assert.NilError(t, err) - zero, err := time.ParseDuration("0") - assert.NilError(t, err) - pos, err := time.ParseDuration("11000ms") - assert.NilError(t, err) - - negPb, zeroPb, posPb := durationpb.New(neg), durationpb.New(zero), durationpb.New(pos) - durOrder := []*durationpb.Duration{negPb, zeroPb, posPb} - - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "foo", - Dur: negPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "bar", - Dur: zeroPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleDuration{ - Name: "baz", - Dur: posPb, - })) - - from, to := testpb.ExampleDurationDurIndexKey{}.WithDur(durationpb.New(neg)), - testpb.ExampleDurationDurIndexKey{}.WithDur(durationpb.New(pos)) - it, err := store.ListRange(ctx, from, to) - assert.NilError(t, err) - - i := 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Equal(t, durOrder[i].String(), v.Dur.String()) - i++ - } - - // insert a nil entry - id, err := store.InsertReturningId(ctx, &testpb.ExampleDuration{ - Name: "nil", - Dur: nil, - }) - assert.NilError(t, err) - - res, err := store.Get(ctx, id) - assert.NilError(t, err) - assert.Assert(t, res.Dur == nil) - - it, err = store.List(ctx, testpb.ExampleDurationDurIndexKey{}) - assert.NilError(t, err) - - // make sure nils are ordered last - durOrder = append(durOrder, nil) - i = 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Assert(t, v != nil) - x := durOrder[i] - if x == nil { - assert.Assert(t, v.Dur == nil) - } else { - assert.Equal(t, x.String(), v.Dur.String()) - } - i++ - } - it.Close() - - // try iterating over just nil timestamps - it, err = store.List(ctx, testpb.ExampleDurationDurIndexKey{}.WithDur(nil)) - assert.NilError(t, err) - assert.Assert(t, it.Next()) - res, err = it.Value() - assert.NilError(t, err) - assert.Assert(t, res.Dur == nil) - assert.Assert(t, !it.Next()) - it.Close() -} diff --git a/orm/model/ormtable/filter.go b/orm/model/ormtable/filter.go deleted file mode 100644 index a7df4ff62bb7..000000000000 --- a/orm/model/ormtable/filter.go +++ /dev/null @@ -1,28 +0,0 @@ -package ormtable - -import "google.golang.org/protobuf/proto" - -type filterIterator struct { - Iterator - filter func(proto.Message) bool - msg proto.Message -} - -func (f *filterIterator) Next() bool { - for f.Iterator.Next() { - msg, err := f.Iterator.GetMessage() - if err != nil { - return false - } - - if f.filter(msg) { - f.msg = msg - return true - } - } - return false -} - -func (f filterIterator) GetMessage() (proto.Message, error) { - return f.msg, nil -} diff --git a/orm/model/ormtable/index.go b/orm/model/ormtable/index.go deleted file mode 100644 index 8b1b625734c6..000000000000 --- a/orm/model/ormtable/index.go +++ /dev/null @@ -1,78 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" -) - -// Index defines an index on a table. Index instances -// are stateless, with all state existing only in the store passed -// to index methods. -type Index interface { - // List does iteration over the index with the provided prefix key and options. - // Prefix key values must correspond in type to the index's fields and the - // number of values provided cannot exceed the number of fields in the index, - // although fewer values can be provided. - List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) - - // ListRange does range iteration over the index with the provided from and to - // values and options. - // - // From and to values must correspond in type to the index's fields and the number of values - // provided cannot exceed the number of fields in the index, although fewer - // values can be provided. - // - // Range iteration can only be done for from and to values which are - // well-ordered, meaning that any unordered components must be equal. Ex. - // the bytes type is considered unordered, so a range iterator is created - // over an index with a bytes field, both start and end must have the same - // value for bytes. - // - // Range iteration is inclusive at both ends. - ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) - - // DeleteBy deletes any entries which match the provided prefix key. - DeleteBy(context context.Context, prefixKey ...interface{}) error - - // DeleteRange deletes any entries between the provided range keys. - DeleteRange(context context.Context, from, to []interface{}) error - - // MessageType returns the protobuf message type of the index. - MessageType() protoreflect.MessageType - - // Fields returns the canonical field names of the index. - Fields() string - - doNotImplement() -} - -// concreteIndex is used internally by table implementations. -type concreteIndex interface { - Index - ormkv.IndexCodec - - readValueFromIndexKey(context ReadBackend, primaryKey []protoreflect.Value, value []byte, message proto.Message) error -} - -// UniqueIndex defines an unique index on a table. -type UniqueIndex interface { - Index - - // Has returns true if the key values are present in the store for this index. - Has(context context.Context, keyValues ...interface{}) (found bool, err error) - - // Get retrieves the message if one exists for the provided key values. - Get(context context.Context, message proto.Message, keyValues ...interface{}) (found bool, err error) -} - -type indexer interface { - onInsert(store kv.Store, message protoreflect.Message) error - onUpdate(store kv.Store, new, existing protoreflect.Message) error - onDelete(store kv.Store, message protoreflect.Message) error -} diff --git a/orm/model/ormtable/index_impl.go b/orm/model/ormtable/index_impl.go deleted file mode 100644 index 7aacd5aebac4..000000000000 --- a/orm/model/ormtable/index_impl.go +++ /dev/null @@ -1,121 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -// indexKeyIndex implements Index for a regular IndexKey. -type indexKeyIndex struct { - *ormkv.IndexKeyCodec - fields fieldnames.FieldNames - primaryKey *primaryKeyIndex - getReadBackend func(context.Context) (ReadBackend, error) -} - -func (i indexKeyIndex) DeleteBy(ctx context.Context, keyValues ...interface{}) error { - it, err := i.List(ctx, keyValues) - if err != nil { - return err - } - - return i.primaryKey.deleteByIterator(ctx, it) -} - -func (i indexKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := i.ListRange(ctx, from, to) - if err != nil { - return err - } - - return i.primaryKey.deleteByIterator(ctx, it) -} - -func (i indexKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := i.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.IndexStoreReader(), backend, i, i.KeyCodec, prefixKey, options) -} - -func (i indexKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := i.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.IndexStoreReader(), backend, i, i.KeyCodec, from, to, options) -} - -var ( - _ indexer = &indexKeyIndex{} - _ Index = &indexKeyIndex{} -) - -func (i indexKeyIndex) doNotImplement() {} - -func (i indexKeyIndex) onInsert(store kv.Store, message protoreflect.Message) error { - k, v, err := i.EncodeKVFromMessage(message) - if err != nil { - return err - } - return store.Set(k, v) -} - -func (i indexKeyIndex) onUpdate(store kv.Store, new, existing protoreflect.Message) error { - newValues := i.GetKeyValues(new) - existingValues := i.GetKeyValues(existing) - if i.CompareKeys(newValues, existingValues) == 0 { - return nil - } - - existingKey, err := i.EncodeKey(existingValues) - if err != nil { - return err - } - err = store.Delete(existingKey) - if err != nil { - return err - } - - newKey, err := i.EncodeKey(newValues) - if err != nil { - return err - } - return store.Set(newKey, []byte{}) -} - -func (i indexKeyIndex) onDelete(store kv.Store, message protoreflect.Message) error { - _, key, err := i.EncodeKeyFromMessage(message) - if err != nil { - return err - } - return store.Delete(key) -} - -func (i indexKeyIndex) readValueFromIndexKey(backend ReadBackend, primaryKey []protoreflect.Value, _ []byte, message proto.Message) error { - found, err := i.primaryKey.get(backend, message, primaryKey) - if err != nil { - return err - } - - if !found { - return ormerrors.UnexpectedError.Wrapf("can't find primary key") - } - - return nil -} - -func (i indexKeyIndex) Fields() string { - return i.fields.String() -} diff --git a/orm/model/ormtable/paginate.go b/orm/model/ormtable/paginate.go deleted file mode 100644 index 276179e46921..000000000000 --- a/orm/model/ormtable/paginate.go +++ /dev/null @@ -1,96 +0,0 @@ -package ormtable - -import ( - "math" - - queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - "cosmossdk.io/orm/internal/listinternal" -) - -func paginate(it Iterator, options *listinternal.Options) Iterator { - offset := int(options.Offset) - limit := int(options.Limit) - if limit == 0 { - limit = int(options.DefaultLimit) - } - - i := 0 - if offset != 0 { - for ; i < offset; i++ { - if !it.Next() { - return &paginationIterator{ - Iterator: it, - pageRes: &queryv1beta1.PageResponse{Total: uint64(i)}, - } - } - } - } - - var done int - if limit != 0 { - done = limit + offset - } else { - done = math.MaxInt - } - - return &paginationIterator{ - Iterator: it, - pageRes: nil, - countTotal: options.CountTotal, - i: i, - done: done, - } -} - -type paginationIterator struct { - Iterator - pageRes *queryv1beta1.PageResponse - countTotal bool - i int - done int -} - -func (it *paginationIterator) Next() bool { - if it.i >= it.done { - it.pageRes = &queryv1beta1.PageResponse{} - cursor := it.Cursor() - next := it.Iterator.Next() - if next { - it.pageRes.NextKey = cursor - it.i++ - } - if it.countTotal { - // once it.Iterator.Next() returns false, another call to it will panic. - // we check next here to ensure we do not call it again. - if next { - for { - if !it.Iterator.Next() { - it.pageRes.Total = uint64(it.i) - return false - } - it.i++ - } - } else { - // when next is false, the iterator can no longer move forward, - // so the index == total entries. - it.pageRes.Total = uint64(it.i) - } - } - return false - } - - ok := it.Iterator.Next() - if ok { - it.i++ - return true - } - - it.pageRes = &queryv1beta1.PageResponse{ - Total: uint64(it.i), - } - return false -} - -func (it paginationIterator) PageResponse() *queryv1beta1.PageResponse { - return it.pageRes -} diff --git a/orm/model/ormtable/primary_key.go b/orm/model/ormtable/primary_key.go deleted file mode 100644 index 1efd1cbbf802..000000000000 --- a/orm/model/ormtable/primary_key.go +++ /dev/null @@ -1,240 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/ormerrors" -) - -// primaryKeyIndex defines an UniqueIndex for the primary key. -type primaryKeyIndex struct { - *ormkv.PrimaryKeyCodec - fields fieldnames.FieldNames - indexers []indexer - getBackend func(context.Context) (ReadBackend, error) -} - -func (p primaryKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.CommitmentStoreReader(), backend, p, p.KeyCodec, prefixKey, options) -} - -func (p primaryKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.CommitmentStoreReader(), backend, p, p.KeyCodec, from, to, options) -} - -func (p primaryKeyIndex) doNotImplement() {} - -func (p primaryKeyIndex) Has(ctx context.Context, key ...interface{}) (found bool, err error) { - backend, err := p.getBackend(ctx) - if err != nil { - return false, err - } - - return p.has(backend, encodeutil.ValuesOf(key...)) -} - -func (p primaryKeyIndex) has(backend ReadBackend, values []protoreflect.Value) (found bool, err error) { - keyBz, err := p.EncodeKey(values) - if err != nil { - return false, err - } - - return backend.CommitmentStoreReader().Has(keyBz) -} - -func (p primaryKeyIndex) Get(ctx context.Context, message proto.Message, values ...interface{}) (found bool, err error) { - backend, err := p.getBackend(ctx) - if err != nil { - return false, err - } - - return p.get(backend, message, encodeutil.ValuesOf(values...)) -} - -func (p primaryKeyIndex) get(backend ReadBackend, message proto.Message, values []protoreflect.Value) (found bool, err error) { - key, err := p.EncodeKey(values) - if err != nil { - return false, err - } - - return p.getByKeyBytes(backend, key, values, message) -} - -func (p primaryKeyIndex) DeleteBy(ctx context.Context, primaryKeyValues ...interface{}) error { - if len(primaryKeyValues) == len(p.GetFieldNames()) { - return p.doDelete(ctx, encodeutil.ValuesOf(primaryKeyValues...)) - } - - it, err := p.List(ctx, primaryKeyValues) - if err != nil { - return err - } - - return p.deleteByIterator(ctx, it) -} - -func (p primaryKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := p.ListRange(ctx, from, to) - if err != nil { - return err - } - - return p.deleteByIterator(ctx, it) -} - -func (p primaryKeyIndex) getWriteBackend(ctx context.Context) (Backend, error) { - backend, err := p.getBackend(ctx) - if err != nil { - return nil, err - } - - if writeBackend, ok := backend.(Backend); ok { - return writeBackend, nil - } - - return nil, ormerrors.ReadOnly -} - -func (p primaryKeyIndex) doDelete(ctx context.Context, primaryKeyValues []protoreflect.Value) error { - backend, err := p.getWriteBackend(ctx) - if err != nil { - return err - } - - // delete object - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - pk, err := p.EncodeKey(primaryKeyValues) - if err != nil { - return err - } - - msg := p.MessageType().New().Interface() - found, err := p.getByKeyBytes(backend, pk, primaryKeyValues, msg) - if err != nil { - return err - } - - if !found { - return nil - } - - err = p.doDeleteWithWriteBatch(ctx, backend, writer, pk, msg) - if err != nil { - return err - } - - return writer.Write() -} - -func (p primaryKeyIndex) doDeleteWithWriteBatch(ctx context.Context, backend Backend, writer *batchIndexCommitmentWriter, primaryKeyBz []byte, message proto.Message) error { - if hooks := backend.ValidateHooks(); hooks != nil { - err := hooks.ValidateDelete(ctx, message) - if err != nil { - return err - } - } - - // delete object - err := writer.CommitmentStore().Delete(primaryKeyBz) - if err != nil { - return err - } - - // clear indexes - mref := message.ProtoReflect() - indexStoreWriter := writer.IndexStore() - for _, idx := range p.indexers { - err := idx.onDelete(indexStoreWriter, mref) - if err != nil { - return err - } - } - - if writeHooks := backend.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnDelete(ctx, message) - }) - } - - return nil -} - -func (p primaryKeyIndex) getByKeyBytes(store ReadBackend, key []byte, keyValues []protoreflect.Value, message proto.Message) (found bool, err error) { - bz, err := store.CommitmentStoreReader().Get(key) - if err != nil { - return false, err - } - - if bz == nil { - return false, nil - } - - return true, p.Unmarshal(keyValues, bz, message) -} - -func (p primaryKeyIndex) readValueFromIndexKey(_ ReadBackend, primaryKey []protoreflect.Value, value []byte, message proto.Message) error { - return p.Unmarshal(primaryKey, value, message) -} - -func (p primaryKeyIndex) Fields() string { - return p.fields.String() -} - -func (p primaryKeyIndex) deleteByIterator(ctx context.Context, it Iterator) error { - backend, err := p.getWriteBackend(ctx) - if err != nil { - return err - } - - // we batch writes while the iterator is still open - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - - for it.Next() { - _, pk, err := it.Keys() - if err != nil { - return err - } - - msg, err := it.GetMessage() - if err != nil { - return err - } - - pkBz, err := p.EncodeKey(pk) - if err != nil { - return err - } - - err = p.doDeleteWithWriteBatch(ctx, backend, writer, pkBz, msg) - if err != nil { - return err - } - } - - // close iterator - it.Close() - // then write batch - return writer.Write() -} - -var _ UniqueIndex = &primaryKeyIndex{} diff --git a/orm/model/ormtable/save_test.go b/orm/model/ormtable/save_test.go deleted file mode 100644 index 40106550e800..000000000000 --- a/orm/model/ormtable/save_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package ormtable_test - -import ( - "context" - "fmt" - "testing" - - "github.com/regen-network/gocuke" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protojson" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" - "cosmossdk.io/orm/testing/ormtest" -) - -func TestSave(t *testing.T) { - gocuke.NewRunner(t, &suite{}).Path("../../features/table/saving.feature").Run() -} - -type suite struct { - gocuke.TestingT - table ormtable.Table - ctx context.Context - err error -} - -func (s *suite) Before() { - var err error - s.table, err = ormtable.Build(ormtable.Options{ - MessageType: (&testpb.SimpleExample{}).ProtoReflect().Type(), - }) - assert.NilError(s, err) - s.ctx = ormtable.WrapContextDefault(ormtest.NewMemoryBackend()) -} - -func (s *suite) AnExistingEntity(docString gocuke.DocString) { - existing := s.simpleExampleFromDocString(docString) - assert.NilError(s, s.table.Insert(s.ctx, existing)) -} - -func (s suite) simpleExampleFromDocString(docString gocuke.DocString) *testpb.SimpleExample { - ex := &testpb.SimpleExample{} - assert.NilError(s, protojson.Unmarshal([]byte(docString.Content), ex)) - return ex -} - -func (s *suite) IInsert(a gocuke.DocString) { - ex := s.simpleExampleFromDocString(a) - s.err = s.table.Insert(s.ctx, ex) -} - -func (s *suite) IUpdate(a gocuke.DocString) { - ex := s.simpleExampleFromDocString(a) - s.err = s.table.Update(s.ctx, ex) -} - -func (s *suite) ExpectAError(a string) { - assert.ErrorContains(s, s.err, a) -} - -func (s *suite) ExpectGrpcErrorCode(a string) { - var code codes.Code - assert.NilError(s, code.UnmarshalJSON([]byte(fmt.Sprintf("%q", a)))) - assert.Equal(s, code, status.Code(s.err)) -} diff --git a/orm/model/ormtable/singleton.go b/orm/model/ormtable/singleton.go deleted file mode 100644 index 13bf37f2afa1..000000000000 --- a/orm/model/ormtable/singleton.go +++ /dev/null @@ -1,101 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "io" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -// singleton implements a Table instance for singletons. -type singleton struct { - *tableImpl -} - -func (t singleton) DefaultJSON() json.RawMessage { - msg := t.MessageType().New().Interface() - bz, err := t.jsonMarshalOptions().Marshal(msg) - if err != nil { - return json.RawMessage("{}") - } - return bz -} - -func (t singleton) ValidateJSON(reader io.Reader) error { - bz, err := io.ReadAll(reader) - if err != nil { - return err - } - - msg := t.MessageType().New().Interface() - err = protojson.Unmarshal(bz, msg) - if err != nil { - return err - } - - if t.customJSONValidator != nil { - return t.customJSONValidator(msg) - } - - return DefaultJSONValidator(msg) -} - -func (t singleton) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - bz, err := io.ReadAll(reader) - if err != nil { - return err - } - - msg := t.MessageType().New().Interface() - err = protojson.Unmarshal(bz, msg) - if err != nil { - return err - } - - return t.save(ctx, backend, msg, saveModeDefault) -} - -func (t singleton) ExportJSON(ctx context.Context, writer io.Writer) error { - msg := t.MessageType().New().Interface() - found, err := t.Get(ctx, msg) - if err != nil { - return err - } - - var bz []byte - if !found { - bz = t.DefaultJSON() - } else { - bz, err = t.jsonMarshalOptions().Marshal(msg) - if err != nil { - return err - } - } - - _, err = writer.Write(bz) - return err -} - -func (t singleton) jsonMarshalOptions() protojson.MarshalOptions { - return protojson.MarshalOptions{ - Multiline: true, - Indent: "", - UseProtoNames: true, - EmitUnpopulated: true, - Resolver: t.typeResolver, - } -} - -func (t *singleton) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} diff --git a/orm/model/ormtable/singleton_test.go b/orm/model/ormtable/singleton_test.go deleted file mode 100644 index 318305966e68..000000000000 --- a/orm/model/ormtable/singleton_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package ormtable_test - -import ( - "bytes" - "testing" - - "google.golang.org/protobuf/testing/protocmp" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestSingleton(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleSingleton{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - ctx := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - - store, err := testpb.NewExampleSingletonTable(table) - assert.NilError(t, err) - - val, err := store.Get(ctx) - assert.NilError(t, err) - assert.Assert(t, val != nil) // singletons are always set - assert.NilError(t, store.Save(ctx, &testpb.ExampleSingleton{})) - - val.Foo = "abc" - val.Bar = 3 - assert.NilError(t, store.Save(ctx, val)) - - val2, err := store.Get(ctx) - assert.NilError(t, err) - assert.DeepEqual(t, val, val2, protocmp.Transform()) - - buf := &bytes.Buffer{} - assert.NilError(t, table.ExportJSON(ctx, buf)) - assert.NilError(t, table.ValidateJSON(bytes.NewReader(buf.Bytes()))) - store2 := ormtable.WrapContextDefault(testkv.NewSplitMemBackend()) - assert.NilError(t, table.ImportJSON(store2, bytes.NewReader(buf.Bytes()))) - - val3, err := store.Get(ctx) - assert.NilError(t, err) - assert.DeepEqual(t, val, val3, protocmp.Transform()) -} diff --git a/orm/model/ormtable/table.go b/orm/model/ormtable/table.go deleted file mode 100644 index 1bbdab7376ed..000000000000 --- a/orm/model/ormtable/table.go +++ /dev/null @@ -1,164 +0,0 @@ -package ormtable - -import ( - "context" - "encoding/json" - "io" - - "google.golang.org/protobuf/proto" - - "cosmossdk.io/orm/encoding/ormkv" -) - -// View defines a read-only table. -// -// It exists as a separate interacted to support future scenarios where -// tables may be "supported" virtually to provide compatibility between -// systems, for instance to enable backwards compatibility when a major -// migration needs to be performed. -type View interface { - Index - - // Has returns true if there is an entity in the table with the same - // primary key as message. Other fields besides the primary key fields will not - // be used for retrieval. - Has(ctx context.Context, message proto.Message) (found bool, err error) - - // Get retrieves the message if one exists for the primary key fields - // set on the message. Other fields besides the primary key fields will not - // be used for retrieval. - Get(ctx context.Context, message proto.Message) (found bool, err error) - - // GetIndex returns the index referenced by the provided fields if - // one exists or nil. Note that some concrete indexes can be retrieved by - // multiple lists of fields. - GetIndex(fields string) Index - - // GetUniqueIndex returns the unique index referenced by the provided fields if - // one exists or nil. Note that some concrete indexes can be retrieved by - // multiple lists of fields. - GetUniqueIndex(fields string) UniqueIndex - - // Indexes returns all the concrete indexes for the table. - Indexes() []Index - - // GetIndexByID returns the index with the provided ID or nil. - GetIndexByID(id uint32) Index - - // PrimaryKey returns the primary key unique index. - PrimaryKey() UniqueIndex -} - -// Table is an abstract interface around a concrete table. Table instances -// are stateless, with all state existing only in the store passed -// to table and index methods. -type Table interface { - View - - ormkv.EntryCodec - - // Save saves the provided entry in the store either inserting it or - // updating it if needed. - // - // If store implement the ValidateHooks interface, the appropriate ValidateInsert or - // ValidateUpdate hook method will be called. - // - // Save attempts to be atomic with respect to the underlying store, - // meaning that either the full save operation is written or the store is - // left unchanged, unless there is an error with the underlying store. - // - // If a unique key constraint is violated, ormerrors.UniqueKeyViolation - // (or an error wrapping it) will be returned. - Save(context context.Context, message proto.Message) error - - // Insert inserts the provided entry in the store and fails if there is - // an unique key violation. See Save for more details on behavior. - // - // If an entity with the same primary key exists, an error wrapping - // ormerrors.AlreadyExists will be returned. - Insert(ctx context.Context, message proto.Message) error - - // Update updates the provided entry in the store and fails if an entry - // with a matching primary key does not exist. See Save for more details - // on behavior. - // - // If an entity with the same primary key does not exist, ormerrors.NotFound - // (or an error wrapping it) will be returned. - Update(ctx context.Context, message proto.Message) error - - // Delete deletes the entry with the with primary key fields set on message - // if one exists. Other fields besides the primary key fields will not - // be used for retrieval. - // - // If store implement the ValidateHooks interface, the ValidateDelete hook method will - // be called. - // - // Delete attempts to be atomic with respect to the underlying store, - // meaning that either the full save operation is written or the store is - // left unchanged, unless there is an error with the underlying store. - Delete(ctx context.Context, message proto.Message) error - - // DefaultJSON returns default JSON that can be used as a template for - // genesis files. - // - // For regular tables this an empty JSON array, but for singletons an - // empty instance of the singleton is marshaled. - DefaultJSON() json.RawMessage - - // ValidateJSON validates JSON streamed from the reader. - ValidateJSON(io.Reader) error - - // ImportJSON imports JSON into the store, streaming one entry at a time. - // Each table should be import from a separate JSON file to enable proper - // streaming. - // - // Regular tables should be stored as an array of objects with each object - // corresponding to a single record in the table. - // - // Auto-incrementing tables - // can optionally have the last sequence value as the first element in the - // array. If the last sequence value is provided, then each value of the - // primary key in the file must be <= this last sequence value or omitted - // entirely. If no last sequence value is provided, no entries should - // contain the primary key as this will be auto-assigned. - // - // Singletons should define a single object and not an array. - // - // ImportJSON is not atomic with respect to the underlying store, meaning - // that in the case of an error, some records may already have been - // imported. It is assumed that ImportJSON is called in the context of some - // larger transaction isolation. - ImportJSON(context.Context, io.Reader) error - - // ExportJSON exports JSON in the format accepted by ImportJSON. - // Auto-incrementing tables will export the last sequence number as the - // first element in the JSON array. - ExportJSON(context.Context, io.Writer) error - - // ID is the ID of this table within the schema of its FileDescriptor. - ID() uint32 - - Schema -} - -// Schema is an interface for things that contain tables and can encode and -// decode kv-store pairs. - -type Schema interface { - ormkv.EntryCodec - - // GetTable returns the table for the provided message type or nil. - GetTable(message proto.Message) Table -} - -type AutoIncrementTable interface { - Table - - // InsertReturningPKey inserts the provided entry in the store and returns the newly - // generated primary key for the message or an error. - InsertReturningPKey(ctx context.Context, message proto.Message) (newPK uint64, err error) - - // LastInsertedSequence retrieves the sequence number of the last entry inserted into the table. - // The LastInsertedSequence is 0 if no entries have been inserted into the table. - LastInsertedSequence(ctx context.Context) (uint64, error) -} diff --git a/orm/model/ormtable/table_impl.go b/orm/model/ormtable/table_impl.go deleted file mode 100644 index 9321ae269664..000000000000 --- a/orm/model/ormtable/table_impl.go +++ /dev/null @@ -1,430 +0,0 @@ -package ormtable - -import ( - "bytes" - "context" - "encoding/binary" - "encoding/json" - "io" - "math" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/types/ormerrors" -) - -// tableImpl implements Table. -type tableImpl struct { - *primaryKeyIndex - indexes []Index - indexesByFields map[fieldnames.FieldNames]concreteIndex - uniqueIndexesByFields map[fieldnames.FieldNames]UniqueIndex - indexesByID map[uint32]Index - entryCodecsByID map[uint32]ormkv.EntryCodec - tablePrefix []byte - tableID uint32 - typeResolver TypeResolver - customJSONValidator func(message proto.Message) error -} - -func (t *tableImpl) GetTable(message proto.Message) Table { - if message.ProtoReflect().Descriptor().FullName() == t.MessageType().Descriptor().FullName() { - return t - } - return nil -} - -func (t tableImpl) PrimaryKey() UniqueIndex { - return t.primaryKeyIndex -} - -func (t tableImpl) GetIndexByID(id uint32) Index { - return t.indexesByID[id] -} - -func (t tableImpl) Save(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeDefault) -} - -func (t tableImpl) Insert(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeInsert) -} - -func (t tableImpl) Update(ctx context.Context, message proto.Message) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.save(ctx, backend, message, saveModeUpdate) -} - -func (t tableImpl) save(ctx context.Context, backend Backend, message proto.Message, mode saveMode) error { - writer := newBatchIndexCommitmentWriter(backend) - defer writer.Close() - return t.doSave(ctx, writer, message, mode) -} - -func (t tableImpl) doSave(ctx context.Context, writer *batchIndexCommitmentWriter, message proto.Message, mode saveMode) error { - mref := message.ProtoReflect() - pkValues, pk, err := t.EncodeKeyFromMessage(mref) - if err != nil { - return err - } - - existing := mref.New().Interface() - haveExisting, err := t.getByKeyBytes(writer, pk, pkValues, existing) - if err != nil { - return err - } - - if haveExisting { - if mode == saveModeInsert { - return ormerrors.AlreadyExists.Wrapf("%q:%+v", mref.Descriptor().FullName(), pkValues) - } - - if validateHooks := writer.ValidateHooks(); validateHooks != nil { - err = validateHooks.ValidateUpdate(ctx, existing, message) - if err != nil { - return err - } - } - } else { - if mode == saveModeUpdate { - return ormerrors.NotFound.Wrapf("%q", mref.Descriptor().FullName()) - } - - if validateHooks := writer.ValidateHooks(); validateHooks != nil { - err = validateHooks.ValidateInsert(ctx, message) - if err != nil { - return err - } - } - } - - // temporarily clear primary key - t.ClearValues(mref) - - // store object - bz, err := proto.MarshalOptions{Deterministic: true}.Marshal(message) - if err != nil { - return err - } - err = writer.CommitmentStore().Set(pk, bz) - if err != nil { - return err - } - - // set primary key again - t.SetKeyValues(mref, pkValues) - - // set indexes - indexStoreWriter := writer.IndexStore() - if !haveExisting { - for _, idx := range t.indexers { - err = idx.onInsert(indexStoreWriter, mref) - if err != nil { - return err - } - - } - if writeHooks := writer.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnInsert(ctx, message) - }) - } - } else { - existingMref := existing.ProtoReflect() - for _, idx := range t.indexers { - err = idx.onUpdate(indexStoreWriter, mref, existingMref) - if err != nil { - return err - } - } - if writeHooks := writer.WriteHooks(); writeHooks != nil { - writer.enqueueHook(func() { - writeHooks.OnUpdate(ctx, existing, message) - }) - } - } - - return writer.Write() -} - -func (t tableImpl) Delete(ctx context.Context, message proto.Message) error { - pk := t.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.doDelete(ctx, pk) -} - -func (t tableImpl) GetIndex(fields string) Index { - return t.indexesByFields[fieldnames.CommaSeparatedFieldNames(fields)] -} - -func (t tableImpl) GetUniqueIndex(fields string) UniqueIndex { - return t.uniqueIndexesByFields[fieldnames.CommaSeparatedFieldNames(fields)] -} - -func (t tableImpl) Indexes() []Index { - return t.indexes -} - -func (t tableImpl) DefaultJSON() json.RawMessage { - return json.RawMessage("[]") -} - -func (t tableImpl) decodeJSON(reader io.Reader, onMsg func(message proto.Message) error) error { - decoder, err := t.startDecodeJSON(reader) - if err != nil { - return err - } - - return t.doDecodeJSON(decoder, nil, onMsg) -} - -func (t tableImpl) startDecodeJSON(reader io.Reader) (*json.Decoder, error) { - decoder := json.NewDecoder(reader) - token, err := decoder.Token() - if err != nil { - return nil, err - } - - if token != json.Delim('[') { - return nil, ormerrors.JSONImportError.Wrapf("expected [ got %s", token) - } - - return decoder, nil -} - -// onFirst is called on the first RawMessage and used for auto-increment tables -// to decode the sequence in which case it should return true. -// onMsg is called on every decoded message -func (t tableImpl) doDecodeJSON(decoder *json.Decoder, onFirst func(message json.RawMessage) bool, onMsg func(message proto.Message) error) error { - unmarshalOptions := protojson.UnmarshalOptions{Resolver: t.typeResolver} - - first := true - for decoder.More() { - var rawJSON json.RawMessage - err := decoder.Decode(&rawJSON) - if err != nil { - return ormerrors.JSONImportError.Wrapf("%s", err) - } - - if first { - first = false - if onFirst != nil { - if onFirst(rawJSON) { - // if onFirst handled this, skip decoding into a proto message - continue - } - } - } - - msg := t.MessageType().New().Interface() - err = unmarshalOptions.Unmarshal(rawJSON, msg) - if err != nil { - return err - } - - err = onMsg(msg) - if err != nil { - return err - } - } - - token, err := decoder.Token() - if err != nil { - return err - } - - if token != json.Delim(']') { - return ormerrors.JSONImportError.Wrapf("expected ] got %s", token) - } - - return nil -} - -// DefaultJSONValidator is the default validator used when calling -// Table.ValidateJSON(). It will call methods with the signature `ValidateBasic() error` -// and/or `Validate() error` to validate the message. -func DefaultJSONValidator(message proto.Message) error { - if v, ok := message.(interface{ ValidateBasic() error }); ok { - err := v.ValidateBasic() - if err != nil { - return err - } - } - - if v, ok := message.(interface{ Validate() error }); ok { - err := v.Validate() - if err != nil { - return err - } - } - - return nil -} - -func (t tableImpl) ValidateJSON(reader io.Reader) error { - return t.decodeJSON(reader, func(message proto.Message) error { - if t.customJSONValidator != nil { - return t.customJSONValidator(message) - } - - return DefaultJSONValidator(message) - }) -} - -func (t tableImpl) ImportJSON(ctx context.Context, reader io.Reader) error { - backend, err := t.getWriteBackend(ctx) - if err != nil { - return err - } - - return t.decodeJSON(reader, func(message proto.Message) error { - return t.save(ctx, backend, message, saveModeDefault) - }) -} - -func (t tableImpl) ExportJSON(context context.Context, writer io.Writer) error { - _, err := writer.Write([]byte("[")) - if err != nil { - return err - } - - return t.doExportJSON(context, writer, true) -} - -func (t tableImpl) doExportJSON(ctx context.Context, writer io.Writer, start bool) error { - marshalOptions := protojson.MarshalOptions{ - UseProtoNames: true, - Resolver: t.typeResolver, - } - - var err error - it, _ := t.List(ctx, nil) - for { - found := it.Next() - - if !found { - _, err = writer.Write([]byte("]")) - return err - } else if !start { - _, err = writer.Write([]byte(",\n")) - if err != nil { - return err - } - } - start = false - - msg := t.MessageType().New().Interface() - err = it.UnmarshalMessage(msg) - if err != nil { - return err - } - - bz, err := marshalOptions.Marshal(msg) - if err != nil { - return err - } - - _, err = writer.Write(bz) - if err != nil { - return err - } - - } -} - -func (t tableImpl) DecodeEntry(k, v []byte) (ormkv.Entry, error) { - r := bytes.NewReader(k) - err := encodeutil.SkipPrefix(r, t.tablePrefix) - if err != nil { - return nil, err - } - - id, err := binary.ReadUvarint(r) - if err != nil { - return nil, err - } - - if id > math.MaxUint32 { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("uint32 varint id out of range %d", id) - } - - idx, ok := t.entryCodecsByID[uint32(id)] - if !ok { - return nil, ormerrors.UnexpectedDecodePrefix.Wrapf("can't find field with id %d", id) - } - - return idx.DecodeEntry(k, v) -} - -func (t tableImpl) EncodeEntry(entry ormkv.Entry) (k, v []byte, err error) { - switch entry := entry.(type) { - case *ormkv.PrimaryKeyEntry: - return t.PrimaryKeyCodec.EncodeEntry(entry) - case *ormkv.IndexKeyEntry: - idx, ok := t.indexesByFields[fieldnames.FieldsFromNames(entry.Fields)] - if !ok { - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("can't find index with fields %s", entry.Fields) - } - - return idx.EncodeEntry(entry) - default: - return nil, nil, ormerrors.BadDecodeEntry.Wrapf("%s", entry) - } -} - -func (t tableImpl) ID() uint32 { - return t.tableID -} - -func (t tableImpl) Has(ctx context.Context, message proto.Message) (found bool, err error) { - backend, err := t.getBackend(ctx) - if err != nil { - return false, err - } - - keyValues := t.primaryKeyIndex.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.primaryKeyIndex.has(backend, keyValues) -} - -// Get retrieves the message if one exists for the primary key fields -// set on the message. Other fields besides the primary key fields will not -// be used for retrieval. -func (t tableImpl) Get(ctx context.Context, message proto.Message) (found bool, err error) { - backend, err := t.getBackend(ctx) - if err != nil { - return false, err - } - - keyValues := t.primaryKeyIndex.PrimaryKeyCodec.GetKeyValues(message.ProtoReflect()) - return t.primaryKeyIndex.get(backend, message, keyValues) -} - -var ( - _ Table = &tableImpl{} - _ Schema = &tableImpl{} -) - -type saveMode int - -const ( - saveModeDefault saveMode = iota - saveModeInsert - saveModeUpdate -) diff --git a/orm/model/ormtable/testdata/bad_auto_inc.json b/orm/model/ormtable/testdata/bad_auto_inc.json deleted file mode 100644 index 48521d55dd0c..000000000000 --- a/orm/model/ormtable/testdata/bad_auto_inc.json +++ /dev/null @@ -1,2 +0,0 @@ -[1, - {"id":"2","x":"foo","y":5}] diff --git a/orm/model/ormtable/testdata/bad_auto_inc2.json b/orm/model/ormtable/testdata/bad_auto_inc2.json deleted file mode 100644 index dbdbbbf91b0a..000000000000 --- a/orm/model/ormtable/testdata/bad_auto_inc2.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"1","x":"foo","y":5}] diff --git a/orm/model/ormtable/testdata/test_auto_inc.golden b/orm/model/ormtable/testdata/test_auto_inc.golden deleted file mode 100644 index 432c3a371c9b..000000000000 --- a/orm/model/ormtable/testdata/test_auto_inc.golden +++ /dev/null @@ -1,80 +0,0 @@ -GET 03000005 - PK testpb.ExampleAutoIncrementTable 5 -> {"id":5} -GET 03808002 - SEQ testpb.ExampleAutoIncrementTable 0 -GET 03000001 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1} -ORM BEFORE INSERT testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -HAS 0301666f6f - ERR:EOF -SET 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} -SET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -SET 0301666f6f 0001 - UNIQ testpb.ExampleAutoIncrementTable x : foo -> 1 -ORM AFTER INSERT testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -GET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -GET 03808002 01 - SEQ testpb.ExampleAutoIncrementTable 1 -GET 03000002 - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2} -ORM BEFORE INSERT testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -HAS 0301626172 - ERR:EOF -SET 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} -SET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -SET 0301626172 0002 - UNIQ testpb.ExampleAutoIncrementTable x : bar -> 2 -ORM AFTER INSERT testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -ITERATOR 0300 -> 0301 - VALID true - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - NEXT - VALID true - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - NEXT - VALID false -ITERATOR 0300 -> 0301 - VALID true - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - KEY 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} - NEXT - VALID true - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - KEY 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} - NEXT - VALID false -GET 03000001 1203666f6f1805 - PK testpb.ExampleAutoIncrementTable 1 -> {"id":1,"x":"foo","y":5} -ORM BEFORE DELETE testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -DEL 03000001 -DEL PK testpb.ExampleAutoIncrementTable 1 -> {"id":1} -DEL 0301666f6f -DEL ERR:EOF -ORM AFTER DELETE testpb.ExampleAutoIncrementTable {"id":1,"x":"foo","y":5} -GET 03000002 1203626172180a - PK testpb.ExampleAutoIncrementTable 2 -> {"id":2,"x":"bar","y":10} -ORM BEFORE DELETE testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -DEL 03000002 -DEL PK testpb.ExampleAutoIncrementTable 2 -> {"id":2} -DEL 0301626172 -DEL ERR:EOF -ORM AFTER DELETE testpb.ExampleAutoIncrementTable {"id":2,"x":"bar","y":10} -GET 03808002 02 - SEQ testpb.ExampleAutoIncrementTable 2 -ITERATOR 0300 -> 0301 - VALID false diff --git a/orm/model/ormtable/testdata/test_scenario.golden b/orm/model/ormtable/testdata/test_scenario.golden deleted file mode 100644 index d6dad07dbe0b..000000000000 --- a/orm/model/ormtable/testdata/test_scenario.golden +++ /dev/null @@ -1,1185 +0,0 @@ -GET 010000047ffffffffffffffe616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"str":"abc","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -HAS 01010007616263 - ERR:EOF -SET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} -SET 01010007616263 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 7/abc -> 4/-2/abc -SET 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -SET 0103006162630000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-2 -> 4/-2/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -GET 010000047ffffffffffffffe616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"str":"abd","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -HAS 01010007616264 - ERR:EOF -SET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -SET 01010007616264 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 7/abd -> 4/-2/abd -SET 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -SET 0103006162640000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/4/-2 -> 4/-2/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID false -GET 010000047fffffffffffffff616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"str":"abc","i64":-1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -HAS 01010008616263 - ERR:EOF -SET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} -SET 01010008616263 00047fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 8/abc -> 4/-1/abc -SET 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -SET 0103006162630000047fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-1 -> 4/-1/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -GET 010000057ffffffffffffffe616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"str":"abd","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -HAS 01010008616264 - ERR:EOF -SET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} -SET 01010008616264 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 8/abd -> 5/-2/abd -SET 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -SET 0103006162640000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/5/-2 -> 5/-2/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -GET 010000057ffffffffffffffe616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"str":"abe","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -HAS 01010009616265 - ERR:EOF -SET 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} -SET 01010009616265 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 9/abe -> 5/-2/abe -SET 01026162650000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -SET 0103006162650000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/5/-2 -> 5/-2/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -GET 010000077ffffffffffffffe616265 - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -ORM BEFORE INSERT testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -HAS 0101000a616265 - ERR:EOF -SET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} -SET 0101000a616265 00077ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 10/abe -> 7/-2/abe -SET 01026162650000077ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -SET 0103006162650000077ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-2 -> 7/-2/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -GET 010000077fffffffffffffff616265 - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"str":"abe","i64":-1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":7,"u64":11,"str":"abe","i64":-1} -HAS 0101000b616265 - ERR:EOF -SET 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} -SET 0101000b616265 00077fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 11/abe -> 7/-1/abe -SET 01026162650000077fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abe/7/-1 -> 7/-1/abe -SET 0103006162650000077fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-1 -> 7/-1/abe -ORM AFTER INSERT testpb.ExampleTable {"u32":7,"u64":11,"str":"abe","i64":-1} -GET 010000087ffffffffffffffc616263 - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"str":"abc","i64":-4} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -HAS 0101000b616263 - ERR:EOF -SET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} -SET 0101000b616263 00087ffffffffffffffc - UNIQ testpb.ExampleTable u64/str : 11/abc -> 8/-4/abc -SET 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -SET 0103006162630000087ffffffffffffffc - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/-4 -> 8/-4/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -GET 010000088000000000000001616263 - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"str":"abc","i64":1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -HAS 0101000c616263 - ERR:EOF -SET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -SET 0101000c616263 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 12/abc -> 8/1/abc -SET 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -SET 0103006162630000088000000000000001 - IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/1 -> 8/1/abc -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -GET 010000088000000000000001616264 - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"str":"abd","i64":1} -ORM BEFORE INSERT testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -HAS 0101000a616264 - ERR:EOF -SET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} -SET 0101000a616264 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 10/abd -> 8/1/abd -SET 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -SET 0103006162640000088000000000000001 - IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/8/1 -> 8/1/abd -ORM AFTER INSERT testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -ITERATOR 01000008 -> 01000009 - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 01000004 <- 01000005 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 010000047fffffffffffffff -> 01000008 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID false -ITERATOR 010000057ffffffffffffffd -> 01000008800000000000000161626300 - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID false -ITERATOR 010261626300 <- 010261626401 - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -GET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 0102616265000007 -> 0102616265000008 - VALID true - KEY 01026162650000077ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -GET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 01026162650000077fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abe/7/-1 -> 7/-1/abe -GET 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID false -ITERATOR 0102616263000004 <- 0102616263000005 - VALID true - KEY 01026162630000047fffffffffffffff - IDX testpb.ExampleTable str/u32/i64 : abc/4/-1 -> 4/-1/abc -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 01026162630000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -ITERATOR 010000047ffffffffffffffe61626400 -> 0101 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -HAS 0101000c616263 - ERR:EOF -GET 0101000c616263 00088000000000000001 - UNIQ testpb.ExampleTable u64/str : 12/abc -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 010000057ffffffffffffffe61626400 -> 0101 - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true -ITERATOR 010000087ffffffffffffffc61626300 -> 0101 - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 0100 <- 0101 - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 <- 010000088000000000000001616263 - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true -ITERATOR 010000047fffffffffffffff616263 -> 010000077ffffffffffffffe61626500 - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 <- 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - KEY 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID true - NEXT - VALID false -GET 010000047ffffffffffffffe616263 1007 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":7,"str":"abc","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -HAS 0101000e616263 - ERR:EOF -SET 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -DEL 01010007616263 -DEL ERR:EOF -SET 0101000e616263 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 14/abc -> 4/-2/abc -DEL 0103006162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-2 -> 4/-2/abc -SET 0103036162636162630000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-2 -> 4/-2/abc -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abc","i64":-2} -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -GET 010000047ffffffffffffffe616264 1007 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":7,"str":"abd","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -HAS 0101000e616264 - ERR:EOF -SET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -DEL 01010007616264 -DEL ERR:EOF -SET 0101000e616264 00047ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 14/abd -> 4/-2/abd -DEL 0103006162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/4/-2 -> 4/-2/abd -SET 0103036162646162640000047ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/4/-2 -> 4/-2/abd -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":7,"str":"abd","i64":-2} -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -GET 010000047fffffffffffffff616263 1008 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":8,"str":"abc","i64":-1} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -HAS 01010010616263 - ERR:EOF -SET 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -DEL 01010008616263 -DEL ERR:EOF -SET 01010010616263 00047fffffffffffffff - UNIQ testpb.ExampleTable u64/str : 16/abc -> 4/-1/abc -DEL 0103006162630000047fffffffffffffff -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/4/-1 -> 4/-1/abc -SET 0103036162636162630000047fffffffffffffff - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-1 -> 4/-1/abc -ORM AFTER UPDATE testpb.ExampleTable {"u32":4,"u64":8,"str":"abc","i64":-1} -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -GET 010000057ffffffffffffffe616264 1008 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":8,"str":"abd","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -HAS 01010010616264 - ERR:EOF -SET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -DEL 01010008616264 -DEL ERR:EOF -SET 01010010616264 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 16/abd -> 5/-2/abd -DEL 0103006162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/5/-2 -> 5/-2/abd -SET 0103036162646162640000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/5/-2 -> 5/-2/abd -ORM AFTER UPDATE testpb.ExampleTable {"u32":5,"u64":8,"str":"abd","i64":-2} -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -GET 010000057ffffffffffffffe616265 1009 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":9,"str":"abe","i64":-2} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -HAS 01010012616265 - ERR:EOF -SET 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -DEL 01010009616265 -DEL ERR:EOF -SET 01010012616265 00057ffffffffffffffe - UNIQ testpb.ExampleTable u64/str : 18/abe -> 5/-2/abe -DEL 0103006162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/5/-2 -> 5/-2/abe -SET 0103036162656162650000057ffffffffffffffe - IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 101]/abe/5/-2 -> 5/-2/abe -ORM AFTER UPDATE testpb.ExampleTable {"u32":5,"u64":9,"str":"abe","i64":-2} -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -ORM BEFORE INSERT testpb.ExampleTable {"u32":9} -HAS 01010000 - ERR:EOF -SET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -SET 01010000 00098000000000000000 - UNIQ testpb.ExampleTable u64/str : 0/ -> 9/0/ -SET 01020000098000000000000000 - IDX testpb.ExampleTable str/u32/i64 : /9/0 -> 9/0/ -SET 0103000000098000000000000000 - IDX testpb.ExampleTable bz/str/u32/i64 : []//9/0 -> 9/0/ -ORM AFTER INSERT testpb.ExampleTable {"u32":9} -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -GET 010000098000000000000000 - PK testpb.ExampleTable 9/0/ -> {"u32":9} -ORM BEFORE UPDATE testpb.ExampleTable {"u32":9} -> {"u32":9,"b":true} -SET 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} -ORM AFTER UPDATE testpb.ExampleTable {"u32":9} -> {"u32":9,"b":true} -GET 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - KEY 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -GET 010000077ffffffffffffffe616265 100a - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"u64":10,"str":"abe","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -DEL 010000077ffffffffffffffe616265 -DEL PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -DEL 0101000a616265 -DEL ERR:EOF -DEL 01026162650000077ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abe/7/-2 -> 7/-2/abe -DEL 0103006162650000077ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abe/7/-2 -> 7/-2/abe -ORM AFTER DELETE testpb.ExampleTable {"u32":7,"u64":10,"str":"abe","i64":-2} -HAS 010000077ffffffffffffffe616265 - PK testpb.ExampleTable 7/-2/abe -> {"u32":7,"str":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 010261626400 -> 010261626401 - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false -ITERATOR 010261626400 -> 010261626401 - VALID true - KEY 01026162640000047ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -GET 010000047ffffffffffffffe616264 100e2203616264 - PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -GET 010000057ffffffffffffffe616264 10102203616264 - PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} - NEXT - VALID true - KEY 01026162640000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -GET 010000088000000000000001616264 100a - PK testpb.ExampleTable 8/1/abd -> {"u32":8,"u64":10,"str":"abd","i64":1} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} - NEXT - VALID false - CLOSE -DEL 010000047ffffffffffffffe616264 -DEL PK testpb.ExampleTable 4/-2/abd -> {"u32":4,"str":"abd","i64":-2} -DEL 010000057ffffffffffffffe616264 -DEL PK testpb.ExampleTable 5/-2/abd -> {"u32":5,"str":"abd","i64":-2} -DEL 010000088000000000000001616264 -DEL PK testpb.ExampleTable 8/1/abd -> {"u32":8,"str":"abd","i64":1} -DEL 0101000e616264 -DEL ERR:EOF -DEL 01026162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abd/4/-2 -> 4/-2/abd -DEL 0103036162646162640000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/4/-2 -> 4/-2/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abd","bz":"abd","i64":-2} -DEL 01010010616264 -DEL ERR:EOF -DEL 01026162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abd/5/-2 -> 5/-2/abd -DEL 0103036162646162640000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 100]/abd/5/-2 -> 5/-2/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":5,"u64":16,"str":"abd","bz":"abd","i64":-2} -DEL 0101000a616264 -DEL ERR:EOF -DEL 01026162640000088000000000000001 -DEL IDX testpb.ExampleTable str/u32/i64 : abd/8/1 -> 8/1/abd -DEL 0103006162640000088000000000000001 -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abd/8/1 -> 8/1/abd -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":10,"str":"abd","i64":1} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -ITERATOR 0102616263000008 -> 0102616265000006 - VALID true - KEY 01026162630000087ffffffffffffffc - IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -GET 010000087ffffffffffffffc616263 100b - PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"u64":11,"str":"abc","i64":-4} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} - NEXT - VALID true - KEY 01026162630000088000000000000001 - IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -GET 010000088000000000000001616263 100c - PK testpb.ExampleTable 8/1/abc -> {"u32":8,"u64":12,"str":"abc","i64":1} -ORM BEFORE DELETE testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} - NEXT - VALID true - KEY 01026162650000057ffffffffffffffe - IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -GET 010000057ffffffffffffffe616265 10122203616265 - PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} - NEXT - VALID false - CLOSE -DEL 010000087ffffffffffffffc616263 -DEL PK testpb.ExampleTable 8/-4/abc -> {"u32":8,"str":"abc","i64":-4} -DEL 010000088000000000000001616263 -DEL PK testpb.ExampleTable 8/1/abc -> {"u32":8,"str":"abc","i64":1} -DEL 010000057ffffffffffffffe616265 -DEL PK testpb.ExampleTable 5/-2/abe -> {"u32":5,"str":"abe","i64":-2} -DEL 0101000b616263 -DEL ERR:EOF -DEL 01026162630000087ffffffffffffffc -DEL IDX testpb.ExampleTable str/u32/i64 : abc/8/-4 -> 8/-4/abc -DEL 0103006162630000087ffffffffffffffc -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/-4 -> 8/-4/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":11,"str":"abc","i64":-4} -DEL 0101000c616263 -DEL ERR:EOF -DEL 01026162630000088000000000000001 -DEL IDX testpb.ExampleTable str/u32/i64 : abc/8/1 -> 8/1/abc -DEL 0103006162630000088000000000000001 -DEL IDX testpb.ExampleTable bz/str/u32/i64 : []/abc/8/1 -> 8/1/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":8,"u64":12,"str":"abc","i64":1} -DEL 01010012616265 -DEL ERR:EOF -DEL 01026162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abe/5/-2 -> 5/-2/abe -DEL 0103036162656162650000057ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 101]/abe/5/-2 -> 5/-2/abe -ORM AFTER DELETE testpb.ExampleTable {"u32":5,"u64":18,"str":"abe","bz":"abe","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} - NEXT - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false -GET 010000047ffffffffffffffe616263 100e2203616263 - PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -ORM BEFORE DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -DEL 010000047ffffffffffffffe616263 -DEL PK testpb.ExampleTable 4/-2/abc -> {"u32":4,"str":"abc","i64":-2} -DEL 0101000e616263 -DEL ERR:EOF -DEL 01026162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable str/u32/i64 : abc/4/-2 -> 4/-2/abc -DEL 0103036162636162630000047ffffffffffffffe -DEL IDX testpb.ExampleTable bz/str/u32/i64 : [97 98 99]/abc/4/-2 -> 4/-2/abc -ORM AFTER DELETE testpb.ExampleTable {"u32":4,"u64":14,"str":"abc","bz":"abc","i64":-2} -ITERATOR 0100 -> 0101 - VALID true - KEY 010000047fffffffffffffff616263 10102203616263 - PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} - NEXT - VALID true - KEY 010000077fffffffffffffff616265 100b - PK testpb.ExampleTable 7/-1/abe -> {"u32":7,"u64":11,"str":"abe","i64":-1} - NEXT - VALID true - KEY 010000098000000000000000 7801 - PK testpb.ExampleTable 9/0/ -> {"u32":9,"b":true} - NEXT - VALID false - CLOSE - CLOSE - CLOSE diff --git a/orm/model/ormtable/testdata/trivial_auto_inc_export.golden b/orm/model/ormtable/testdata/trivial_auto_inc_export.golden deleted file mode 100644 index 5d50c80c0683..000000000000 --- a/orm/model/ormtable/testdata/trivial_auto_inc_export.golden +++ /dev/null @@ -1 +0,0 @@ -[2] \ No newline at end of file diff --git a/orm/model/ormtable/timestamp_test.go b/orm/model/ormtable/timestamp_test.go deleted file mode 100644 index 80bce67cc757..000000000000 --- a/orm/model/ormtable/timestamp_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package ormtable_test - -import ( - "testing" - "time" - - "google.golang.org/protobuf/types/known/timestamppb" - "gotest.tools/v3/assert" - - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/internal/testpb" - "cosmossdk.io/orm/model/ormtable" -) - -func TestTimestampIndex(t *testing.T) { - table, err := ormtable.Build(ormtable.Options{ - MessageType: (&testpb.ExampleTimestamp{}).ProtoReflect().Type(), - }) - assert.NilError(t, err) - backend := testkv.NewDebugBackend(testkv.NewSplitMemBackend(), &testkv.EntryCodecDebugger{ - EntryCodec: table, - }) - ctx := ormtable.WrapContextDefault(backend) - store, err := testpb.NewExampleTimestampTable(table) - assert.NilError(t, err) - - past, err := time.Parse("2006-01-02", "2000-01-01") - assert.NilError(t, err) - middle, err := time.Parse("2006-01-02", "2020-01-01") - assert.NilError(t, err) - future, err := time.Parse("2006-01-02", "2049-01-01") - assert.NilError(t, err) - - pastPb, middlePb, futurePb := timestamppb.New(past), timestamppb.New(middle), timestamppb.New(future) - timeOrder := []*timestamppb.Timestamp{pastPb, middlePb, futurePb} - - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "foo", - Ts: pastPb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "bar", - Ts: middlePb, - })) - assert.NilError(t, store.Insert(ctx, &testpb.ExampleTimestamp{ - Name: "baz", - Ts: futurePb, - })) - - from, to := testpb.ExampleTimestampTsIndexKey{}.WithTs(timestamppb.New(past)), testpb.ExampleTimestampTsIndexKey{}.WithTs(timestamppb.New(future)) - it, err := store.ListRange(ctx, from, to) - assert.NilError(t, err) - - i := 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Equal(t, timeOrder[i].String(), v.Ts.String()) - i++ - } - - // insert a nil entry - id, err := store.InsertReturningId(ctx, &testpb.ExampleTimestamp{ - Name: "nil", - Ts: nil, - }) - assert.NilError(t, err) - - res, err := store.Get(ctx, id) - assert.NilError(t, err) - assert.Assert(t, res.Ts == nil) - - it, err = store.List(ctx, testpb.ExampleTimestampTsIndexKey{}) - assert.NilError(t, err) - - // make sure nils are ordered last - timeOrder = append(timeOrder, nil) - i = 0 - for it.Next() { - v, err := it.Value() - assert.NilError(t, err) - assert.Assert(t, v != nil) - x := timeOrder[i] - if x == nil { - assert.Assert(t, v.Ts == nil) - } else { - assert.Equal(t, x.String(), v.Ts.String()) - } - i++ - } - it.Close() - - // try iterating over just nil timestamps - it, err = store.List(ctx, testpb.ExampleTimestampTsIndexKey{}.WithTs(nil)) - assert.NilError(t, err) - assert.Assert(t, it.Next()) - res, err = it.Value() - assert.NilError(t, err) - assert.Assert(t, res.Ts == nil) - assert.Assert(t, !it.Next()) - it.Close() -} diff --git a/orm/model/ormtable/unique.go b/orm/model/ormtable/unique.go deleted file mode 100644 index d82df89a0805..000000000000 --- a/orm/model/ormtable/unique.go +++ /dev/null @@ -1,210 +0,0 @@ -package ormtable - -import ( - "context" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - - "cosmossdk.io/orm/encoding/encodeutil" - "cosmossdk.io/orm/encoding/ormkv" - "cosmossdk.io/orm/internal/fieldnames" - "cosmossdk.io/orm/model/ormlist" - "cosmossdk.io/orm/types/kv" - "cosmossdk.io/orm/types/ormerrors" -) - -type uniqueKeyIndex struct { - *ormkv.UniqueKeyCodec - fields fieldnames.FieldNames - primaryKey *primaryKeyIndex - getReadBackend func(context.Context) (ReadBackend, error) -} - -func (u uniqueKeyIndex) List(ctx context.Context, prefixKey []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return prefixIterator(backend.IndexStoreReader(), backend, u, u.GetKeyCodec(), prefixKey, options) -} - -func (u uniqueKeyIndex) ListRange(ctx context.Context, from, to []interface{}, options ...ormlist.Option) (Iterator, error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return nil, err - } - - return rangeIterator(backend.IndexStoreReader(), backend, u, u.GetKeyCodec(), from, to, options) -} - -func (u uniqueKeyIndex) doNotImplement() {} - -func (u uniqueKeyIndex) Has(ctx context.Context, values ...interface{}) (found bool, err error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return false, err - } - - key, err := u.GetKeyCodec().EncodeKey(encodeutil.ValuesOf(values...)) - if err != nil { - return false, err - } - - return backend.IndexStoreReader().Has(key) -} - -func (u uniqueKeyIndex) Get(ctx context.Context, message proto.Message, keyValues ...interface{}) (found bool, err error) { - backend, err := u.getReadBackend(ctx) - if err != nil { - return false, err - } - - key, err := u.GetKeyCodec().EncodeKey(encodeutil.ValuesOf(keyValues...)) - if err != nil { - return false, err - } - - value, err := backend.IndexStoreReader().Get(key) - if err != nil { - return false, err - } - - // for unique keys, value can be empty and the entry still exists - if value == nil { - return false, nil - } - - _, pk, err := u.DecodeIndexKey(key, value) - if err != nil { - return true, err - } - - return u.primaryKey.get(backend, message, pk) -} - -func (u uniqueKeyIndex) DeleteBy(ctx context.Context, keyValues ...interface{}) error { - it, err := u.List(ctx, keyValues) - if err != nil { - return err - } - - return u.primaryKey.deleteByIterator(ctx, it) -} - -func (u uniqueKeyIndex) DeleteRange(ctx context.Context, from, to []interface{}) error { - it, err := u.ListRange(ctx, from, to) - if err != nil { - return err - } - - return u.primaryKey.deleteByIterator(ctx, it) -} - -func (u uniqueKeyIndex) onInsert(store kv.Store, message protoreflect.Message) error { - k, v, err := u.EncodeKVFromMessage(message) - if err != nil { - return err - } - - has, err := store.Has(k) - if err != nil { - return err - } - - if has { - return ormerrors.UniqueKeyViolation.Wrapf("%q", u.fields) - } - - return store.Set(k, v) -} - -func (u uniqueKeyIndex) onUpdate(store kv.Store, new, existing protoreflect.Message) error { - keyCodec := u.GetKeyCodec() - newValues := keyCodec.GetKeyValues(new) - existingValues := keyCodec.GetKeyValues(existing) - if keyCodec.CompareKeys(newValues, existingValues) == 0 { - return nil - } - - newKey, err := keyCodec.EncodeKey(newValues) - if err != nil { - return err - } - - has, err := store.Has(newKey) - if err != nil { - return err - } - - if has { - return ormerrors.UniqueKeyViolation.Wrapf("%q", u.fields) - } - - existingKey, err := keyCodec.EncodeKey(existingValues) - if err != nil { - return err - } - - err = store.Delete(existingKey) - if err != nil { - return err - } - - _, value, err := u.GetValueCodec().EncodeKeyFromMessage(new) - if err != nil { - return err - } - - return store.Set(newKey, value) -} - -func (u uniqueKeyIndex) onDelete(store kv.Store, message protoreflect.Message) error { - _, key, err := u.GetKeyCodec().EncodeKeyFromMessage(message) - if err != nil { - return err - } - - return store.Delete(key) -} - -func (u uniqueKeyIndex) readValueFromIndexKey(store ReadBackend, primaryKey []protoreflect.Value, _ []byte, message proto.Message) error { - found, err := u.primaryKey.get(store, message, primaryKey) - if err != nil { - return err - } - - if !found { - return ormerrors.UnexpectedError.Wrapf("can't find primary key") - } - - return nil -} - -func (u uniqueKeyIndex) Fields() string { - return u.fields.String() -} - -var ( - _ indexer = &uniqueKeyIndex{} - _ UniqueIndex = &uniqueKeyIndex{} -) - -// isNonTrivialUniqueKey checks if unique key fields are non-trivial, meaning that they -// don't contain the full primary key. If they contain the full primary key, then -// we can just use a regular index because there is no new unique constraint. -func isNonTrivialUniqueKey(fields, primaryKeyFields []protoreflect.Name) bool { - have := map[protoreflect.Name]bool{} - for _, field := range fields { - have[field] = true - } - - for _, field := range primaryKeyFields { - if !have[field] { - return true - } - } - - return false -} diff --git a/orm/model/ormtable/util.go b/orm/model/ormtable/util.go deleted file mode 100644 index c3098d0eee5f..000000000000 --- a/orm/model/ormtable/util.go +++ /dev/null @@ -1,35 +0,0 @@ -package ormtable - -// prefixEndBytes returns the []byte that would end a -// range query for all []byte with a certain prefix -// Deals with last byte of prefix being FF without overflowing -func prefixEndBytes(prefix []byte) []byte { - if len(prefix) == 0 { - return nil - } - - end := make([]byte, len(prefix)) - copy(end, prefix) - - for { - if end[len(end)-1] != byte(255) { - end[len(end)-1]++ - break - } - - end = end[:len(end)-1] - - if len(end) == 0 { - end = nil - break - } - } - - return end -} - -// inclusiveEndBytes returns the []byte that would end a -// range query such that the input would be included -func inclusiveEndBytes(inclusiveBytes []byte) []byte { - return append(inclusiveBytes, byte(0x00)) -} diff --git a/orm/testing/ormmocks/docs.go b/orm/testing/ormmocks/docs.go deleted file mode 100644 index 7065a2fed8b9..000000000000 --- a/orm/testing/ormmocks/docs.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package ormmocks contains generated mocks for orm types that can be used -// in testing. Right now, this package only contains a mock for ormtable.ValidateHooks -// as this useful way for unit testing using an in-memory database. Rather -// than attempting to mock a whole table or database instance, instead -// a mock Hook instance can be passed in to verify that the expected -// insert/update/delete operations are happening in the database. -// -// The Eq function gomock.Matcher that compares protobuf messages can -// be used in gomock EXPECT functions. -// -// See TestHooks in ormdb/module_test.go for examples of how to use -// mock ValidateHooks in a real-world scenario. -package ormmocks diff --git a/orm/testing/ormtest/membackend.go b/orm/testing/ormtest/membackend.go deleted file mode 100644 index 2fbeda2866d0..000000000000 --- a/orm/testing/ormtest/membackend.go +++ /dev/null @@ -1,19 +0,0 @@ -// Package ormtest contains utilities for testing modules built with the ORM. -package ormtest - -import ( - "cosmossdk.io/orm/internal/testkv" - "cosmossdk.io/orm/model/ormtable" -) - -// NewMemoryBackend returns a new ORM memory backend which can be used for -// testing purposes independent of any storage layer. -// -// Example: -// -// backend := ormtest.NewMemoryBackend() -// ctx := ormtable.WrapContextDefault() -// ... -func NewMemoryBackend() ormtable.Backend { - return testkv.NewSplitMemBackend() -} diff --git a/orm/types/docs.go b/orm/types/docs.go deleted file mode 100644 index 42d7b07b50af..000000000000 --- a/orm/types/docs.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package types contains types used in the ORM implementation that don't -// have another home. -package types diff --git a/proto/cosmos/group/v1/events.proto b/proto/cosmos/group/v1/events.proto index 2b98ec9abc32..754afa5dac3c 100644 --- a/proto/cosmos/group/v1/events.proto +++ b/proto/cosmos/group/v1/events.proto @@ -92,3 +92,13 @@ message EventProposalPruned { // tally_result is the proposal tally result (when applicable). TallyResult tally_result = 3; } + +// EventTallyError is an event emitted when a proposal tally failed with an error. +message EventTallyError { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // error_message is the raw error output + string error_message = 2; +} diff --git a/simapp/go.mod b/simapp/go.mod index 8e185cc6ea31..5d0c3c534a64 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -19,16 +19,16 @@ require ( cosmossdk.io/x/tx v0.13.7 cosmossdk.io/x/upgrade v0.1.4 github.com/cometbft/cometbft v0.38.12 - github.com/cosmos/cosmos-db v1.1.0 + github.com/cosmos/cosmos-db v1.1.1 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.50.8 github.com/cosmos/gogoproto v1.7.0 github.com/golang/mock v1.6.0 - github.com/spf13/cast v1.7.0 + github.com/spf13/cast v1.7.1 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 google.golang.org/protobuf v1.35.1 ) @@ -67,7 +67,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect github.com/danieljoos/wincred v1.1.2 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 41a3588728a3..35da7c5d680e 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -353,8 +353,8 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.1.0 h1:KLHNVQ73h7vawXTpj9UJ7ZR2IXv51tsEHkQJJ9EBDzI= -github.com/cosmos/cosmos-db v1.1.0/go.mod h1:t7c4A6cfGdpUwwVxrQ0gQLeRQqGUBJu0yvE4F/26REg= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -370,8 +370,8 @@ github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5Rtn github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= -github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -973,8 +973,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= -github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -1009,8 +1009,9 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= diff --git a/tests/go.mod b/tests/go.mod index aabadaf3b7e3..778c7a0139e5 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -17,14 +17,14 @@ require ( cosmossdk.io/x/tx v0.13.7 cosmossdk.io/x/upgrade v0.1.4 github.com/cometbft/cometbft v0.38.12 - github.com/cosmos/cosmos-db v1.1.0 + github.com/cosmos/cosmos-db v1.1.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.50.8 github.com/cosmos/gogoproto v1.7.0 github.com/golang/mock v1.6.0 github.com/spf13/cobra v1.8.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.1 gotest.tools/v3 v3.5.1 @@ -67,7 +67,7 @@ require ( github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect @@ -160,7 +160,7 @@ require ( github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.7.0 // indirect + github.com/spf13/cast v1.7.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index 78ed9d9d006a..478b61e96efd 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -351,8 +351,8 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.1.0 h1:KLHNVQ73h7vawXTpj9UJ7ZR2IXv51tsEHkQJJ9EBDzI= -github.com/cosmos/cosmos-db v1.1.0/go.mod h1:t7c4A6cfGdpUwwVxrQ0gQLeRQqGUBJu0yvE4F/26REg= +github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= +github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -368,8 +368,8 @@ github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5Rtn github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= -github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= +github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -974,8 +974,8 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= -github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -1010,8 +1010,9 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index fbb883da63bc..b0087a4cfe14 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -1,11 +1,15 @@ package keeper_test import ( + "encoding/hex" "fmt" "testing" cmtabcitypes "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" @@ -72,6 +76,7 @@ func initFixture(t testing.TB) *fixture { maccPerms := map[string][]string{ distrtypes.ModuleName: {authtypes.Minter}, + minttypes.ModuleName: {authtypes.Minter}, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, } @@ -132,10 +137,18 @@ func initFixture(t testing.TB) *fixture { }) sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) + require.NoError(t, stakingKeeper.SetParams(sdkCtx, stakingtypes.DefaultParams())) + + stakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks( + distrKeeper.Hooks(), // Needed for reward distribution on staking events + ), + ) // Register MsgServer and QueryServer distrtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), distrkeeper.NewMsgServerImpl(distrKeeper)) distrtypes.RegisterQueryServer(integrationApp.QueryHelper(), distrkeeper.NewQuerier(distrKeeper)) + stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingkeeper.NewMsgServerImpl(stakingKeeper)) return &fixture{ app: integrationApp, @@ -982,3 +995,108 @@ func TestMsgDepositValidatorRewardsPool(t *testing.T) { }) } } + +func TestCannotDepositIfRewardPoolFull(t *testing.T) { + f := initFixture(t) + err := f.distrKeeper.FeePool.Set(f.sdkCtx, distrtypes.FeePool{ + CommunityPool: sdk.NewDecCoins(sdk.DecCoin{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDec(10000)}), + }) + assert.NilError(t, err) + assert.NilError(t, f.distrKeeper.Params.Set(f.sdkCtx, distrtypes.DefaultParams())) + _, err = f.distrKeeper.FeePool.Get(f.sdkCtx) + assert.NilError(t, err) + + ctx := f.sdkCtx.WithIsCheckTx(false).WithBlockHeight(1) + populateValidators(t, f) + + valPubKey := newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB53") + operatorAddr := sdk.ValAddress(valPubKey.Address()) + + tstaking := stakingtestutil.NewHelper(t, ctx, f.stakingKeeper) + + assert.NilError(t, f.bankKeeper.MintCoins(f.sdkCtx, minttypes.ModuleName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)))) + assert.NilError(t, f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, minttypes.ModuleName, sdk.AccAddress(operatorAddr), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)))) + + tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()) + selfDelegation := math.OneInt() + tstaking.CreateValidator(operatorAddr, valPubKey, selfDelegation, true) + + _, err = f.stakingKeeper.EndBlocker(f.sdkCtx) + assert.NilError(t, err) + + testDenom := "utesttest" + maxSupply, ok := math.NewIntFromString("115792089237316195423570985008687907853269984665640564039457584007913129639934") + assert.Assert(t, ok) + maxCoins := sdk.NewCoins(sdk.NewCoin(testDenom, maxSupply)) + assert.NilError(t, f.bankKeeper.MintCoins(f.sdkCtx, minttypes.ModuleName, maxCoins)) + assert.NilError(t, f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, minttypes.ModuleName, sdk.AccAddress(operatorAddr), maxCoins)) + + fundValMsg := &distrtypes.MsgDepositValidatorRewardsPool{ + Depositor: sdk.AccAddress(operatorAddr).String(), + ValidatorAddress: operatorAddr.String(), + Amount: maxCoins, + } + + // fund the rewards pool. this will set the current rewards. + _, err = f.app.RunMsg( + fundValMsg, + integration.WithAutomaticFinalizeBlock(), + integration.WithAutomaticCommit(), + ) + assert.NilError(t, err) + + // now we delegate to increment the validator period, setting the current rewards to the previous. + power := int64(1) + delegationAmount := sdk.TokensFromConsensusPower(power, sdk.DefaultPowerReduction) + delMsg := stakingtypes.NewMsgDelegate(sdk.AccAddress(operatorAddr).String(), operatorAddr.String(), sdk.NewCoin(sdk.DefaultBondDenom, delegationAmount)) + _, err = f.app.RunMsg( + delMsg, + integration.WithAutomaticFinalizeBlock(), + integration.WithAutomaticCommit(), + ) + assert.NilError(t, err) + + // this should fail since this amount cannot be added to the previous amount without overflowing. + _, err = f.app.RunMsg( + fundValMsg, + integration.WithAutomaticFinalizeBlock(), + integration.WithAutomaticCommit(), + ) + assert.ErrorContains(t, err, "unable to deposit coins") +} + +var ( + pubkeys = []cryptotypes.PubKey{ + newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB50"), + newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB51"), + newPubKey("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AFB52"), + } + + valAddresses = []sdk.ValAddress{ + sdk.ValAddress(pubkeys[0].Address()), + sdk.ValAddress(pubkeys[1].Address()), + sdk.ValAddress(pubkeys[2].Address()), + } + + initAmt = sdk.TokensFromConsensusPower(1000000, sdk.DefaultPowerReduction) + initCoins = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)) +) + +func populateValidators(t assert.TestingT, f *fixture) { + totalSupplyAmt := initAmt.MulRaw(int64(len(valAddresses))) + totalSupply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, totalSupplyAmt)) + assert.NilError(t, f.bankKeeper.MintCoins(f.sdkCtx, distrtypes.ModuleName, totalSupply)) + + for _, addr := range valAddresses { + assert.NilError(t, f.bankKeeper.SendCoinsFromModuleToAccount(f.sdkCtx, distrtypes.ModuleName, (sdk.AccAddress)(addr), initCoins)) + } +} + +func newPubKey(pk string) (res cryptotypes.PubKey) { + pkBytes, err := hex.DecodeString(pk) + if err != nil { + panic(err) + } + pubkey := &ed25519.PubKey{Key: pkBytes} + return pubkey +} diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 1f4c64e0eb3f..8153466d5412 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" "github.com/hashicorp/go-metrics" @@ -200,6 +201,36 @@ func (k msgServer) DepositValidatorRewardsPool(ctx context.Context, msg *types.M return nil, err } + // make sure the reward pool isn't already full. + if !validator.GetTokens().IsZero() { + rewards, err := k.GetValidatorCurrentRewards(ctx, valAddr) + if err != nil { + return nil, err + } + current := rewards.Rewards + historical, err := k.GetValidatorHistoricalRewards(ctx, valAddr, rewards.Period-1) + if err != nil { + return nil, err + } + if !historical.CumulativeRewardRatio.IsZero() { + rewardRatio := historical.CumulativeRewardRatio + var panicErr error + func() { + defer func() { + if r := recover(); r != nil { + panicErr = fmt.Errorf("deposit is too large: %v", r) + } + }() + rewardRatio.Add(current...) + }() + + // Check if the deferred function caught a panic + if panicErr != nil { + return nil, fmt.Errorf("unable to deposit coins: %w", panicErr) + } + } + } + logger := k.Logger(ctx) logger.Info( "transferred from rewards to validator rewards pool", diff --git a/x/group/events.pb.go b/x/group/events.pb.go index dc869b695c66..4d4c6822569a 100644 --- a/x/group/events.pb.go +++ b/x/group/events.pb.go @@ -528,6 +528,61 @@ func (m *EventProposalPruned) GetTallyResult() *TallyResult { return nil } +// EventTallyError is an event emitted when a proposal tally failed with an error. +type EventTallyError struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // error_message is the raw error output + ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` +} + +func (m *EventTallyError) Reset() { *m = EventTallyError{} } +func (m *EventTallyError) String() string { return proto.CompactTextString(m) } +func (*EventTallyError) ProtoMessage() {} +func (*EventTallyError) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{10} +} +func (m *EventTallyError) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventTallyError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventTallyError.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 *EventTallyError) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventTallyError.Merge(m, src) +} +func (m *EventTallyError) XXX_Size() int { + return m.Size() +} +func (m *EventTallyError) XXX_DiscardUnknown() { + xxx_messageInfo_EventTallyError.DiscardUnknown(m) +} + +var xxx_messageInfo_EventTallyError proto.InternalMessageInfo + +func (m *EventTallyError) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *EventTallyError) GetErrorMessage() string { + if m != nil { + return m.ErrorMessage + } + return "" +} + func init() { proto.RegisterType((*EventCreateGroup)(nil), "cosmos.group.v1.EventCreateGroup") proto.RegisterType((*EventUpdateGroup)(nil), "cosmos.group.v1.EventUpdateGroup") @@ -539,40 +594,43 @@ func init() { proto.RegisterType((*EventExec)(nil), "cosmos.group.v1.EventExec") proto.RegisterType((*EventLeaveGroup)(nil), "cosmos.group.v1.EventLeaveGroup") proto.RegisterType((*EventProposalPruned)(nil), "cosmos.group.v1.EventProposalPruned") + proto.RegisterType((*EventTallyError)(nil), "cosmos.group.v1.EventTallyError") } func init() { proto.RegisterFile("cosmos/group/v1/events.proto", fileDescriptor_e8d753981546f032) } var fileDescriptor_e8d753981546f032 = []byte{ - // 442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0xef, 0xd2, 0x30, - 0x18, 0xc7, 0xe9, 0x4f, 0x02, 0x52, 0x8c, 0x98, 0xfa, 0x27, 0x03, 0xc9, 0x20, 0xc4, 0x44, 0x0e, - 0xb2, 0x05, 0x4c, 0xd4, 0x93, 0x44, 0x0c, 0x31, 0x24, 0x1c, 0xc8, 0xf0, 0x4f, 0xe2, 0x05, 0xc7, - 0xda, 0x8c, 0xc5, 0x41, 0x97, 0xb6, 0x9b, 0x70, 0xf4, 0x1d, 0xf8, 0x52, 0x3c, 0xf8, 0x22, 0x3c, - 0x12, 0x4f, 0x1e, 0x0d, 0xbc, 0x11, 0xb3, 0xae, 0x03, 0x82, 0x31, 0x23, 0xf9, 0x9d, 0x68, 0xfb, - 0xfd, 0x7c, 0xbf, 0x3c, 0x4f, 0x9f, 0x15, 0xd6, 0x1d, 0xca, 0x97, 0x94, 0x9b, 0x2e, 0xa3, 0x61, - 0x60, 0x46, 0x5d, 0x93, 0x44, 0x64, 0x25, 0xb8, 0x11, 0x30, 0x2a, 0x28, 0xaa, 0x24, 0xaa, 0x21, - 0x55, 0x23, 0xea, 0xd6, 0xaa, 0xc9, 0xc1, 0x4c, 0xca, 0xa6, 0x52, 0xe5, 0xa6, 0xf6, 0xf0, 0x3c, - 0x49, 0x6c, 0x02, 0xa2, 0xc4, 0x56, 0x07, 0xde, 0x19, 0xc6, 0xc1, 0xaf, 0x19, 0xb1, 0x05, 0x79, - 0x13, 0x23, 0xa8, 0x0a, 0x6f, 0x4a, 0x76, 0xe6, 0x61, 0x0d, 0x34, 0x41, 0x3b, 0x6f, 0x15, 0xe5, - 0x7e, 0x84, 0x0f, 0xf8, 0xbb, 0x00, 0x5f, 0x82, 0x8f, 0xe1, 0x83, 0xf3, 0xf4, 0x09, 0xf5, 0x3d, - 0x67, 0x83, 0x7a, 0xb0, 0x68, 0x63, 0xcc, 0x08, 0xe7, 0xd2, 0x53, 0x1a, 0x68, 0xbf, 0x7e, 0x74, - 0xee, 0xa9, 0xba, 0x5f, 0x25, 0xca, 0x54, 0x30, 0x6f, 0xe5, 0x5a, 0x29, 0x78, 0x48, 0x3b, 0xf9, - 0xf3, 0x6b, 0xa4, 0x3d, 0x83, 0x77, 0x65, 0xda, 0x34, 0x9c, 0x2f, 0x3d, 0x31, 0x61, 0x34, 0xa0, - 0xdc, 0xf6, 0x51, 0x03, 0x96, 0x03, 0xb5, 0x3e, 0x36, 0x04, 0xd3, 0xa3, 0x11, 0x6e, 0xbd, 0x80, - 0xf7, 0xa5, 0xef, 0x83, 0x27, 0x16, 0x98, 0xd9, 0x5f, 0x2e, 0x77, 0x3e, 0x81, 0x25, 0xe9, 0x7c, - 0x4f, 0x05, 0xc9, 0xa6, 0xbf, 0x02, 0x85, 0x0f, 0xd7, 0xc4, 0xc9, 0xc4, 0x51, 0x1f, 0x16, 0x18, - 0xe1, 0xa1, 0x2f, 0xb4, 0xab, 0x26, 0x68, 0xdf, 0xee, 0x3d, 0x36, 0xce, 0x3e, 0x11, 0x23, 0x2d, - 0x34, 0xce, 0x0b, 0x05, 0x65, 0x96, 0xc4, 0x2d, 0x65, 0x43, 0x08, 0xe6, 0x7d, 0xea, 0x72, 0xed, - 0x46, 0x7c, 0x81, 0x96, 0x5c, 0xb7, 0x3e, 0xc1, 0x8a, 0x2c, 0x61, 0x4c, 0xec, 0x28, 0x73, 0xda, - 0xa7, 0x53, 0xb8, 0xba, 0x74, 0x0a, 0xdf, 0x81, 0x1a, 0x43, 0x5a, 0xdd, 0x84, 0x85, 0x2b, 0x82, - 0xb3, 0xfb, 0x7d, 0x0e, 0x0b, 0x5c, 0xd8, 0x22, 0xe4, 0xaa, 0xdf, 0xc6, 0x7f, 0xfb, 0x9d, 0x4a, - 0xcc, 0x52, 0x38, 0xea, 0xc3, 0x5b, 0xc2, 0xf6, 0xfd, 0xcd, 0x4c, 0x5d, 0x57, 0xdc, 0x6f, 0xb9, - 0x57, 0xff, 0xc7, 0xfe, 0x36, 0x86, 0xd4, 0x1d, 0x95, 0xc5, 0x71, 0x33, 0x78, 0xf9, 0x73, 0xa7, - 0x83, 0xed, 0x4e, 0x07, 0x7f, 0x76, 0x3a, 0xf8, 0xb6, 0xd7, 0x73, 0xdb, 0xbd, 0x9e, 0xfb, 0xbd, - 0xd7, 0x73, 0x1f, 0x1f, 0xb9, 0x9e, 0x58, 0x84, 0x73, 0xc3, 0xa1, 0x4b, 0xf5, 0x04, 0xd5, 0x4f, - 0x87, 0xe3, 0xcf, 0xe6, 0x3a, 0x79, 0x81, 0xf3, 0x82, 0x7c, 0x79, 0x4f, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0xa5, 0x1a, 0x1c, 0xb9, 0xe2, 0x03, 0x00, 0x00, + // 476 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x33, 0xb5, 0xa4, 0xf6, 0x49, 0xb5, 0x32, 0xbe, 0x90, 0xd6, 0xb2, 0x2d, 0x51, 0xb0, + 0x07, 0xb3, 0x4b, 0x23, 0xa8, 0x27, 0x8b, 0x95, 0x20, 0x85, 0x0a, 0x61, 0xa3, 0x16, 0xbc, 0xc4, + 0x49, 0x66, 0xd8, 0x2e, 0xee, 0x66, 0x96, 0x99, 0xd9, 0xb5, 0x39, 0xfa, 0x0d, 0xfc, 0x28, 0x1e, + 0xfc, 0x10, 0x1e, 0x8b, 0x27, 0x8f, 0x92, 0x7c, 0x11, 0xd9, 0x67, 0x67, 0xdb, 0x10, 0x91, 0x0d, + 0x78, 0xca, 0xcc, 0xf3, 0xfc, 0xfe, 0xff, 0x3c, 0x2f, 0x3b, 0xb0, 0x33, 0x92, 0x3a, 0x96, 0xda, + 0x0b, 0x94, 0x4c, 0x13, 0x2f, 0x3b, 0xf0, 0x44, 0x26, 0xc6, 0x46, 0xbb, 0x89, 0x92, 0x46, 0xd2, + 0xcd, 0x22, 0xeb, 0x62, 0xd6, 0xcd, 0x0e, 0xb6, 0xb7, 0x8a, 0xc0, 0x00, 0xd3, 0x9e, 0xcd, 0xe2, + 0x65, 0xfb, 0xfe, 0xa2, 0x93, 0x99, 0x24, 0xc2, 0x26, 0x5b, 0x6d, 0xb8, 0xd5, 0xcd, 0x8d, 0x5f, + 0x29, 0xc1, 0x8c, 0x78, 0x9d, 0x23, 0x74, 0x0b, 0xae, 0x23, 0x3b, 0x08, 0x79, 0x93, 0xec, 0x91, + 0xfd, 0x55, 0x7f, 0x0d, 0xef, 0xc7, 0xfc, 0x12, 0x7f, 0x97, 0xf0, 0x65, 0xf0, 0x13, 0xb8, 0xb7, + 0xe8, 0xde, 0x93, 0x51, 0x38, 0x9a, 0xd0, 0x0e, 0xac, 0x31, 0xce, 0x95, 0xd0, 0x1a, 0x35, 0xeb, + 0x47, 0xcd, 0x9f, 0xdf, 0xdb, 0x77, 0x6c, 0xdd, 0x2f, 0x8b, 0x4c, 0xdf, 0xa8, 0x70, 0x1c, 0xf8, + 0x25, 0x78, 0xe9, 0x36, 0xf7, 0xe7, 0xff, 0xe1, 0xf6, 0x14, 0x6e, 0xa3, 0x5b, 0x3f, 0x1d, 0xc6, + 0xa1, 0xe9, 0x29, 0x99, 0x48, 0xcd, 0x22, 0xba, 0x0b, 0x8d, 0xc4, 0x9e, 0xaf, 0x1a, 0x82, 0x32, + 0x74, 0xcc, 0x5b, 0xcf, 0xe1, 0x2e, 0xea, 0x4e, 0x43, 0x73, 0xc6, 0x15, 0xfb, 0xbc, 0xbc, 0xf2, + 0x31, 0xac, 0xa3, 0xf2, 0xbd, 0x34, 0xa2, 0x9a, 0xfe, 0x42, 0x2c, 0xde, 0x3d, 0x17, 0xa3, 0x4a, + 0x9c, 0x1e, 0x42, 0x5d, 0x09, 0x9d, 0x46, 0xa6, 0xb9, 0xb2, 0x47, 0xf6, 0x6f, 0x76, 0x1e, 0xb9, + 0x0b, 0x9f, 0x88, 0x5b, 0x16, 0x9a, 0xfb, 0xa5, 0x46, 0x2a, 0x1f, 0x71, 0xdf, 0xca, 0x28, 0x85, + 0xd5, 0x48, 0x06, 0xba, 0x79, 0x2d, 0x1f, 0xa0, 0x8f, 0xe7, 0xd6, 0x47, 0xd8, 0xc4, 0x12, 0x4e, + 0x04, 0xcb, 0x2a, 0xb7, 0x3d, 0xbf, 0x85, 0x95, 0x65, 0xb7, 0xf0, 0x8d, 0xd8, 0x35, 0x94, 0xd5, + 0xf5, 0x54, 0x3a, 0x16, 0xbc, 0xba, 0xdf, 0x67, 0x50, 0xd7, 0x86, 0x99, 0x54, 0xdb, 0x7e, 0x77, + 0xff, 0xd9, 0x6f, 0x1f, 0x31, 0xdf, 0xe2, 0xf4, 0x10, 0x36, 0x0c, 0x8b, 0xa2, 0xc9, 0xc0, 0x8e, + 0x2b, 0xef, 0xb7, 0xd1, 0xd9, 0xf9, 0x4b, 0xfe, 0x36, 0x87, 0xec, 0x8c, 0x1a, 0xe6, 0xea, 0xd2, + 0x3a, 0xb5, 0x43, 0x41, 0xa0, 0xab, 0x94, 0x54, 0xd5, 0xd5, 0x3e, 0x80, 0x1b, 0x22, 0x27, 0x07, + 0xb1, 0xd0, 0x9a, 0x05, 0xa2, 0x18, 0x90, 0xbf, 0x81, 0xc1, 0x37, 0x45, 0xec, 0xe8, 0xc5, 0x8f, + 0xa9, 0x43, 0x2e, 0xa6, 0x0e, 0xf9, 0x3d, 0x75, 0xc8, 0xd7, 0x99, 0x53, 0xbb, 0x98, 0x39, 0xb5, + 0x5f, 0x33, 0xa7, 0xf6, 0xe1, 0x61, 0x10, 0x9a, 0xb3, 0x74, 0xe8, 0x8e, 0x64, 0x6c, 0xdf, 0xb6, + 0xfd, 0x69, 0x6b, 0xfe, 0xc9, 0x3b, 0x2f, 0x9e, 0xf6, 0xb0, 0x8e, 0x4f, 0xfa, 0xc9, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x14, 0x0c, 0xb7, 0x93, 0x3b, 0x04, 0x00, 0x00, } func (m *EventCreateGroup) Marshal() (dAtA []byte, err error) { @@ -895,6 +953,41 @@ func (m *EventProposalPruned) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventTallyError) 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 *EventTallyError) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventTallyError) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ErrorMessage) > 0 { + i -= len(m.ErrorMessage) + copy(dAtA[i:], m.ErrorMessage) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ErrorMessage))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1046,6 +1139,22 @@ func (m *EventProposalPruned) Size() (n int) { return n } +func (m *EventTallyError) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + l = len(m.ErrorMessage) + 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 } @@ -1906,6 +2015,107 @@ func (m *EventProposalPruned) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventTallyError) 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: EventTallyError: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventTallyError: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrorMessage", 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.ErrorMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index b36215a75e60..6689cf573931 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -200,6 +200,10 @@ func (k Keeper) UpdateGroupMembers(goCtx context.Context, msg *group.MsgUpdateGr return err } } + // ensure that group has one or more members + if totalWeight.IsZero() { + return errorsmod.Wrap(errors.ErrInvalid, "group must not be empty") + } // Update group in the groupTable. g.TotalWeight = totalWeight.String() g.Version++ @@ -777,33 +781,40 @@ func (k Keeper) Vote(goCtx context.Context, msg *group.MsgVote) (*group.MsgVoteR // doTallyAndUpdate performs a tally, and, if the tally result is final, then: // - updates the proposal's `Status` and `FinalTallyResult` fields, // - prune all the votes. -func (k Keeper) doTallyAndUpdate(ctx sdk.Context, p *group.Proposal, groupInfo group.GroupInfo, policyInfo group.GroupPolicyInfo) error { +func (k Keeper) doTallyAndUpdate(ctx sdk.Context, proposal *group.Proposal, groupInfo group.GroupInfo, policyInfo group.GroupPolicyInfo) error { policy, err := policyInfo.GetDecisionPolicy() if err != nil { return err } - tallyResult, err := k.Tally(ctx, *p, policyInfo.GroupId) - if err != nil { - return err + var result group.DecisionPolicyResult + tallyResult, err := k.Tally(ctx, *proposal, policyInfo.GroupId) + if err == nil { + result, err = policy.Allow(tallyResult, groupInfo.TotalWeight) } - - result, err := policy.Allow(tallyResult, groupInfo.TotalWeight) if err != nil { - return errorsmod.Wrap(err, "policy allow") + if err := k.pruneVotes(ctx, proposal.Id); err != nil { + return err + } + proposal.Status = group.PROPOSAL_STATUS_REJECTED + return ctx.EventManager().EmitTypedEvents( + &group.EventTallyError{ + ProposalId: proposal.Id, + ErrorMessage: err.Error(), + }) } // If the result was final (i.e. enough votes to pass) or if the voting // period ended, then we consider the proposal as final. - if isFinal := result.Final || ctx.BlockTime().After(p.VotingPeriodEnd); isFinal { - if err := k.pruneVotes(ctx, p.Id); err != nil { + if isFinal := result.Final || ctx.BlockTime().After(proposal.VotingPeriodEnd); isFinal { + if err := k.pruneVotes(ctx, proposal.Id); err != nil { return err } - p.FinalTallyResult = tallyResult + proposal.FinalTallyResult = tallyResult if result.Allow { - p.Status = group.PROPOSAL_STATUS_ACCEPTED + proposal.Status = group.PROPOSAL_STATUS_ACCEPTED } else { - p.Status = group.PROPOSAL_STATUS_REJECTED + proposal.Status = group.PROPOSAL_STATUS_REJECTED } } @@ -1145,10 +1156,8 @@ func (k Keeper) validateMembers(members []group.MemberRequest) error { if _, err := math.NewNonNegativeDecFromString(member.Weight); err != nil { return errorsmod.Wrap(err, "weight must be non negative") } - index[member.Address] = struct{}{} } - return nil } diff --git a/x/group/keeper/msg_server_priv_test.go b/x/group/keeper/msg_server_priv_test.go new file mode 100644 index 000000000000..dd5c3e94644c --- /dev/null +++ b/x/group/keeper/msg_server_priv_test.go @@ -0,0 +1,254 @@ +package keeper + +import ( + "bytes" + "context" + "errors" + "fmt" + "testing" + "time" + + "github.com/cosmos/gogoproto/proto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + coreaddress "cosmossdk.io/core/address" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/group" + "github.com/cosmos/cosmos-sdk/x/group/internal/math" +) + +func TestDoTallyAndUpdate(t *testing.T) { + var ( + myAddr = sdk.AccAddress(bytes.Repeat([]byte{0x01}, 20)) + myOtherAddr = sdk.AccAddress(bytes.Repeat([]byte{0x02}, 20)) + ) + encCfg := moduletestutil.MakeTestEncodingConfig() + group.RegisterInterfaces(encCfg.InterfaceRegistry) + + storeKey := storetypes.NewKVStoreKey(group.StoreKey) + testCtx := testutil.DefaultContextWithDB(t, storeKey, storetypes.NewTransientStoreKey("transient_test")) + myAccountKeeper := &mockAccountKeeper{ + AddressCodecFn: func() coreaddress.Codec { + return address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()) + }, + } + groupKeeper := NewKeeper(storeKey, encCfg.Codec, nil, myAccountKeeper, group.DefaultConfig()) + noEventsFn := func(proposalID uint64) sdk.Events { return sdk.Events{} } + type memberVote struct { + address string + weight string + option group.VoteOption + } + specs := map[string]struct { + votes []memberVote + policy group.DecisionPolicy + expStatus group.ProposalStatus + expVotesCleared bool + expEvents func(proposalID uint64) sdk.Events + }{ + "proposal accepted": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "2"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "1"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: true, Final: true}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_ACCEPTED, + expVotesCleared: true, + expEvents: noEventsFn, + }, + "proposal rejected": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "2"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: false, Final: true}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_REJECTED, + expVotesCleared: true, + expEvents: noEventsFn, + }, + "proposal in flight": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "1"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{Allow: false, Final: false}, nil + }, + }, + expStatus: group.PROPOSAL_STATUS_SUBMITTED, + expVotesCleared: false, + expEvents: noEventsFn, + }, + "policy errors": { + votes: []memberVote{ + {address: myAddr.String(), option: group.VOTE_OPTION_YES, weight: "1"}, + {address: myOtherAddr.String(), option: group.VOTE_OPTION_NO, weight: "2"}, + }, + policy: mockDecisionPolicy{ + AllowFn: func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + return group.DecisionPolicyResult{}, errors.New("my test error") + }, + }, + expStatus: group.PROPOSAL_STATUS_REJECTED, + expVotesCleared: true, + expEvents: func(proposalID uint64) sdk.Events { + return sdk.Events{ + sdk.NewEvent("cosmos.group.v1.EventTallyError", + sdk.Attribute{Key: "error_message", Value: `"my test error"`}, + sdk.Attribute{Key: "proposal_id", Value: fmt.Sprintf(`"%d"`, proposalID)}, + ), + } + }, + }, + } + var ( + groupID uint64 + proposalId uint64 + ) + for name, spec := range specs { + groupID++ + proposalId++ + t.Run(name, func(t *testing.T) { + em := sdk.NewEventManager() + ctx := testCtx.Ctx.WithEventManager(em) + totalWeight, err := math.NewDecFromString("0") + require.NoError(t, err) + // given a group, policy and persisted votes + for _, v := range spec.votes { + err := groupKeeper.groupMemberTable.Create(ctx.KVStore(storeKey), &group.GroupMember{ + GroupId: groupID, + Member: &group.Member{Address: v.address, Weight: v.weight}, + }) + require.NoError(t, err) + err = groupKeeper.voteTable.Create(ctx.KVStore(storeKey), &group.Vote{ + ProposalId: proposalId, + Voter: v.address, + Option: v.option, + }) + require.NoError(t, err) + } + myGroupInfo := group.GroupInfo{ + TotalWeight: totalWeight.String(), + } + myPolicy := group.GroupPolicyInfo{GroupId: groupID} + err = myPolicy.SetDecisionPolicy(spec.policy) + require.NoError(t, err) + + myProposal := &group.Proposal{ + Id: proposalId, + Status: group.PROPOSAL_STATUS_SUBMITTED, + VotingPeriodEnd: ctx.BlockTime().Add(time.Hour), + } + + // when + gotErr := groupKeeper.doTallyAndUpdate(ctx, myProposal, myGroupInfo, myPolicy) + // then + require.NoError(t, gotErr) + assert.Equal(t, spec.expStatus, myProposal.Status) + require.Equal(t, spec.expEvents(proposalId), em.Events()) + // and persistent state updated + persistedVotes, err := groupKeeper.votesByProposal(ctx, groupID) + require.NoError(t, err) + if spec.expVotesCleared { + assert.Empty(t, persistedVotes) + } else { + assert.Len(t, persistedVotes, len(spec.votes)) + } + }) + } +} + +var _ group.AccountKeeper = &mockAccountKeeper{} + +// mockAccountKeeper is a mock implementation of the AccountKeeper interface for testing purposes. +type mockAccountKeeper struct { + AddressCodecFn func() coreaddress.Codec +} + +func (m mockAccountKeeper) AddressCodec() coreaddress.Codec { + if m.AddressCodecFn == nil { + panic("not expected to be called") + } + return m.AddressCodecFn() +} + +func (m mockAccountKeeper) NewAccount(ctx context.Context, i sdk.AccountI) sdk.AccountI { + panic("not expected to be called") +} + +func (m mockAccountKeeper) GetAccount(ctx context.Context, address sdk.AccAddress) sdk.AccountI { + panic("not expected to be called") +} + +func (m mockAccountKeeper) SetAccount(ctx context.Context, i sdk.AccountI) { + panic("not expected to be called") +} + +func (m mockAccountKeeper) RemoveAccount(ctx context.Context, acc sdk.AccountI) { + panic("not expected to be called") +} + +// mockDecisionPolicy is a mock implementation of a decision policy for testing purposes. +type mockDecisionPolicy struct { + fakeProtoType + AllowFn func(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) +} + +func (m mockDecisionPolicy) Allow(tallyResult group.TallyResult, totalPower string) (group.DecisionPolicyResult, error) { + if m.AllowFn == nil { + panic("not expected to be called") + } + return m.AllowFn(tallyResult, totalPower) +} + +func (m mockDecisionPolicy) GetVotingPeriod() time.Duration { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) GetMinExecutionPeriod() time.Duration { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) ValidateBasic() error { + panic("not expected to be called") +} + +func (m mockDecisionPolicy) Validate(g group.GroupInfo, config group.Config) error { + panic("not expected to be called") +} + +var ( + _ proto.Marshaler = (*fakeProtoType)(nil) + _ proto.Message = (*fakeProtoType)(nil) +) + +// fakeProtoType is a struct used for mocking and testing purposes. +// Custom types can be converted into Any and back via internal CachedValue only. +type fakeProtoType struct{} + +func (a fakeProtoType) Reset() {} + +func (a fakeProtoType) String() string { + return "testing" +} + +func (a fakeProtoType) Marshal() ([]byte, error) { + return nil, nil +} + +func (a fakeProtoType) ProtoMessage() {} diff --git a/x/group/keeper/msg_server_test.go b/x/group/keeper/msg_server_test.go index 32b058523791..4533202145bc 100644 --- a/x/group/keeper/msg_server_test.go +++ b/x/group/keeper/msg_server_test.go @@ -237,20 +237,13 @@ func (s *TestSuite) TestCreateGroup() { } func (s *TestSuite) TestUpdateGroupMembers() { - addrs := s.addrs - addr3 := addrs[2] - addr4 := addrs[3] - addr5 := addrs[4] - addr6 := addrs[5] - - member1 := addr5.String() - member2 := addr6.String() - members := []group.MemberRequest{{ - Address: member1, - Weight: "1", - }} + unknownAddr, myAdmin := s.addrs[0].String(), s.addrs[1].String() + member1, member2, member3 := s.addrs[2].String(), s.addrs[3].String(), s.addrs[4].String() + members := []group.MemberRequest{ + {Address: member1, Weight: "1"}, + {Address: member2, Weight: "2"}, + } - myAdmin := addr4.String() groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ Admin: myAdmin, Members: members, @@ -270,7 +263,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: 0, Admin: myAdmin, MemberUpdates: []group.MemberRequest{{ - Address: member2, + Address: member3, Weight: "2", }}, }, @@ -303,7 +296,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { Admin: myAdmin, MemberUpdates: []group.MemberRequest{ { - Address: member2, + Address: member3, Weight: "2", Metadata: strings.Repeat("a", 256), }, @@ -314,90 +307,77 @@ func (s *TestSuite) TestUpdateGroupMembers() { }, "add new member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member2, - Weight: "2", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member3, Weight: "3"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "3", + TotalWeight: "6", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { - Member: &group.Member{ - Address: member2, - Weight: "2", - AddedAt: s.sdkCtx.BlockTime(), - }, + Member: &group.Member{Address: member3, Weight: "3", AddedAt: s.blockTime}, GroupId: groupID, }, { - Member: &group.Member{ - Address: member1, - Weight: "1", - AddedAt: s.blockTime, - }, + Member: &group.Member{Address: member1, Weight: "1", AddedAt: s.blockTime}, + GroupId: groupID, + }, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, GroupId: groupID, }, }, }, "update member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "2", + TotalWeight: "4", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { + Member: &group.Member{Address: member1, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "2", - AddedAt: s.blockTime, - }, }, }, }, "update member with same data": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "1", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "1"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{ { GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - AddedAt: s.blockTime, - }, + Member: &group.Member{Address: member1, Weight: "1", AddedAt: s.blockTime}, + }, + { + GroupId: groupID, + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, }, }, }, @@ -406,58 +386,53 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.MemberRequest{ - { - Address: member1, - Weight: "0", - }, - { - Address: member2, - Weight: "1", - }, + {Address: member1, Weight: "0"}, + {Address: member3, Weight: "1"}, }, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 2, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{{ - GroupId: groupID, - Member: &group.Member{ - Address: member2, - Weight: "1", - AddedAt: s.sdkCtx.BlockTime(), + expMembers: []*group.GroupMember{ + { + Member: &group.Member{Address: member3, Weight: "1", AddedAt: s.blockTime}, + GroupId: groupID, }, - }}, + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }, + }, }, "remove existing member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "0", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "0"}}, }, expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "0", + TotalWeight: "2", Version: 2, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{}, + expMembers: []*group.GroupMember{ + { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, + }, + }, }, "remove unknown member": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: addr4.String(), - Weight: "0", - }}, + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: unknownAddr, Weight: "0"}}, }, expErr: true, expGroup: &group.GroupInfo{ @@ -467,66 +442,74 @@ func (s *TestSuite) TestUpdateGroupMembers() { Version: 1, CreatedAt: s.blockTime, }, - expMembers: []*group.GroupMember{{ - GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", + expMembers: []*group.GroupMember{ + { + GroupId: groupID, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, }, - }}, + }, }, "with wrong admin": { req: &group.MsgUpdateGroupMembers{ - GroupId: groupID, - Admin: addr3.String(), - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: groupID, + Admin: unknownAddr, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expErr: true, expErrMsg: "not group admin", expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 1, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - }, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, }}, }, "with unknown groupID": { req: &group.MsgUpdateGroupMembers{ - GroupId: 999, - Admin: myAdmin, - MemberUpdates: []group.MemberRequest{{ - Address: member1, - Weight: "2", - }}, + GroupId: 999, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{{Address: member1, Weight: "2"}}, }, expErr: true, expErrMsg: "not found", expGroup: &group.GroupInfo{ Id: groupID, Admin: myAdmin, - TotalWeight: "1", + TotalWeight: "3", Version: 1, CreatedAt: s.blockTime, }, expMembers: []*group.GroupMember{{ GroupId: groupID, - Member: &group.Member{ - Address: member1, - Weight: "1", - }, + Member: &group.Member{Address: member1, Weight: "1"}, + }, { + Member: &group.Member{Address: member2, Weight: "2", AddedAt: s.blockTime}, + GroupId: groupID, }}, }, + "remove all members": { + req: &group.MsgUpdateGroupMembers{ + GroupId: groupID, + Admin: myAdmin, + MemberUpdates: []group.MemberRequest{ + {Address: member1, Weight: "0"}, + {Address: member2, Weight: "0"}, + }, + }, + expErr: true, + expErrMsg: "group must not be empty", + }, } for msg, spec := range specs { spec := spec diff --git a/x/group/simulation/operations.go b/x/group/simulation/operations.go index 94576d36d615..e7ec1911e56b 100644 --- a/x/group/simulation/operations.go +++ b/x/group/simulation/operations.go @@ -629,7 +629,7 @@ func SimulateMsgUpdateGroupMembers( // set existing random group member weight to zero to remove from the group existigMembers := res.Members - if len(existigMembers) > 0 { + if len(existigMembers) > 1 { memberToRemove := existigMembers[r.Intn(len(existigMembers))] var isDuplicateMember bool for idx, m := range members { diff --git a/x/group/types.go b/x/group/types.go index 529b5be66d24..4c498b1b1b7b 100644 --- a/x/group/types.go +++ b/x/group/types.go @@ -209,7 +209,9 @@ func (p PercentageDecisionPolicy) Allow(tally TallyResult, totalPower string) (D if err != nil { return DecisionPolicyResult{}, errorsmod.Wrap(err, "total power") } - + if totalPowerDec.IsZero() { + return DecisionPolicyResult{Allow: false, Final: true}, nil + } yesPercentage, err := yesCount.Quo(totalPowerDec) if err != nil { return DecisionPolicyResult{}, err diff --git a/x/group/types_test.go b/x/group/types_test.go index afad812a39d5..c69bb2f5ce0a 100644 --- a/x/group/types_test.go +++ b/x/group/types_test.go @@ -239,6 +239,28 @@ func TestPercentageDecisionPolicyAllow(t *testing.T) { }, false, }, + { + "empty total power", + &group.PercentageDecisionPolicy{ + Percentage: "0.5", + Windows: &group.DecisionPolicyWindows{ + VotingPeriod: time.Second * 100, + }, + }, + &group.TallyResult{ + YesCount: "1", + NoCount: "0", + AbstainCount: "0", + NoWithVetoCount: "0", + }, + "0", + time.Second * 50, + group.DecisionPolicyResult{ + Allow: false, + Final: true, + }, + false, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index a28086dc15e2..56933dd0bbef 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -33,9 +33,11 @@ Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos- ## [Unreleased] -## [v0.13.7](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.7) - 2024-12-16 +## [v0.13.8](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.8) - 2025-01-28 -### Bug Fixes +* [#23513](https://github.com/cosmos/cosmos-sdk/pull/23513), [#23539](https://github.com/cosmos/cosmos-sdk/pull/23539) Add map marshalling support (as option) to Amino JSON encoder. + +## [v0.13.7](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.7) - 2024-12-16 * Fix [ABS-0043](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-8wcc-m6j2-qxvm) Limit recursion depth for unknown field detection diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 1e5d1b59af81..338ea9d88a61 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -38,6 +38,8 @@ type EncoderOptions struct { // It is useful when using the Amino JSON encoder for non Amino purposes, // such as JSON RPC. AminoNameAsTypeURL bool + // MarshalMappings when set will use the Amino JSON encoder to marshal maps. + MarshalMappings bool // TypeResolver is used to resolve protobuf message types by TypeURL when marshaling any packed messages. TypeResolver signing.TypeResolver // FileResolver is used to resolve protobuf file descriptors TypeURL when TypeResolver fails. @@ -57,6 +59,7 @@ type Encoder struct { indent string enumsAsString bool aminoNameAsTypeURL bool + marshalMappings bool } // NewEncoder returns a new Encoder capable of serializing protobuf messages to JSON using the Amino JSON encoding @@ -93,6 +96,7 @@ func NewEncoder(options EncoderOptions) Encoder { indent: options.Indent, enumsAsString: options.EnumAsString, aminoNameAsTypeURL: options.AminoNameAsTypeURL, + marshalMappings: options.MarshalMappings, } return enc } @@ -237,6 +241,20 @@ func (enc Encoder) marshal(value protoreflect.Value, fd protoreflect.FieldDescri return err case protoreflect.Map: + if enc.marshalMappings { + if !val.IsValid() { + _, err := io.WriteString(writer, "null") + return err + } + + mapData := make(map[string]interface{}) + val.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { + mapData[k.String()] = v.Interface() + return true + }) + + return jsonMarshal(writer, mapData) + } return errors.New("maps are not supported") case protoreflect.List: diff --git a/x/tx/signing/aminojson/json_marshal_test.go b/x/tx/signing/aminojson/json_marshal_test.go index 29d2f8cf8f59..7dae096f8410 100644 --- a/x/tx/signing/aminojson/json_marshal_test.go +++ b/x/tx/signing/aminojson/json_marshal_test.go @@ -265,7 +265,6 @@ func TestIndent(t *testing.T) { bz, err := encoder.Marshal(msg) require.NoError(t, err) - fmt.Println(string(bz)) require.Equal(t, `{ "type": "ABitOfEverything", "value": { @@ -324,7 +323,6 @@ func TestEnumAsString(t *testing.T) { bz, err := encoder.Marshal(msg) require.NoError(t, err) - fmt.Println(string(bz)) require.Equal(t, `{ "type": "ABitOfEverything", "value": { @@ -383,7 +381,6 @@ func TestAminoNameAsTypeURL(t *testing.T) { bz, err := encoder.Marshal(msg) require.NoError(t, err) - fmt.Println(string(bz)) require.Equal(t, `{ "type": "/testpb.ABitOfEverything", "value": { @@ -414,3 +411,29 @@ func TestAminoNameAsTypeURL(t *testing.T) { } }`, string(bz)) } + +func TestMarshalMappings(t *testing.T) { + // valid + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", MarshalMappings: true}) + + msg := &testpb.WithAMap{ + StrMap: map[string]string{ + "foo": "bar", + "baz": "qux", + }, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{ + "str_map": { + "baz": "qux", + "foo": "bar" + } +}`, string(bz)) + + // invalid + encoder = aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", MarshalMappings: false}) + _, err = encoder.Marshal(msg) + require.Error(t, err) +}