From ceb1459708a64225549dd883fb81736cd6b4f2dd Mon Sep 17 00:00:00 2001 From: Alex | Interchain Labs Date: Wed, 15 Jan 2025 10:37:58 -0500 Subject: [PATCH 1/3] chore: license for slinky (#878) Co-authored-by: Zygimantas <5236121+Zygimantass@users.noreply.github.com> --- LICENSE | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 155c5ca7f..6ca24c75d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,51 @@ -LIMITED ACCESS RIGHTS ONLY; NO USAGE OR OTHER LICENSE GRANTED +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ -Copyright 2024 SKIP PROTOCOL Inc. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Other than the right to read the software code or associated documentation files (the “Software”) provided by the copyright holder listed above, no permission or right of any kind is granted to any person obtaining a copy of this Software. You may obtain a commercial license to use the Software by entering into a separate commercial licensing agreement with Skip Protocol Inc. +1. Definitions. -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS From 0cd5f1b7231fd5bb5baa818628d2e618a25b164c Mon Sep 17 00:00:00 2001 From: Alex | Interchain Labs Date: Thu, 16 Jan 2025 08:01:09 -0500 Subject: [PATCH 2/3] feat: add list query (#888) (backport) (#891) --- api/slinky/marketmap/v1/query.pulsar.go | 1191 +++++++++++++++++++--- api/slinky/marketmap/v1/query_grpc.pb.go | 48 +- cmd/slinky/main.go | 1 + go.mod | 10 +- go.sum | 20 +- proto/slinky/marketmap/v1/query.proto | 20 +- tests/integration/go.mod | 8 +- tests/integration/go.sum | 16 +- tests/integration/slinky_setup.go | 67 +- tests/petri/go.mod | 52 +- tests/petri/go.sum | 110 +- tests/simapp/go.mod | 12 +- tests/simapp/go.sum | 20 +- x/marketmap/keeper/keeper.go | 20 + x/marketmap/keeper/keeper_test.go | 27 +- x/marketmap/keeper/query.go | 17 + x/marketmap/keeper/query_test.go | 41 + x/marketmap/types/client.go | 6 + x/marketmap/types/mocks/QueryClient.go | 248 ++++- x/marketmap/types/query.pb.go | 435 +++++++- x/marketmap/types/query.pb.gw.go | 65 ++ 21 files changed, 2147 insertions(+), 287 deletions(-) create mode 100644 x/marketmap/types/client.go diff --git a/api/slinky/marketmap/v1/query.pulsar.go b/api/slinky/marketmap/v1/query.pulsar.go index 91a34d224..a0297cfde 100644 --- a/api/slinky/marketmap/v1/query.pulsar.go +++ b/api/slinky/marketmap/v1/query.pulsar.go @@ -918,6 +918,856 @@ func (x *fastReflection_MarketMapResponse) ProtoMethods() *protoiface.Methods { } } +var ( + md_MarketsRequest protoreflect.MessageDescriptor +) + +func init() { + file_slinky_marketmap_v1_query_proto_init() + md_MarketsRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketsRequest") +} + +var _ protoreflect.Message = (*fastReflection_MarketsRequest)(nil) + +type fastReflection_MarketsRequest MarketsRequest + +func (x *MarketsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketsRequest)(x) +} + +func (x *MarketsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_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) +} + +var _fastReflection_MarketsRequest_messageType fastReflection_MarketsRequest_messageType +var _ protoreflect.MessageType = fastReflection_MarketsRequest_messageType{} + +type fastReflection_MarketsRequest_messageType struct{} + +func (x fastReflection_MarketsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketsRequest)(nil) +} +func (x fastReflection_MarketsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MarketsRequest) +} +func (x fastReflection_MarketsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MarketsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MarketsRequest +} + +// 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_MarketsRequest) Type() protoreflect.MessageType { + return _fastReflection_MarketsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MarketsRequest) New() protoreflect.Message { + return new(fastReflection_MarketsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MarketsRequest) Interface() protoreflect.ProtoMessage { + return (*MarketsRequest)(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_MarketsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MarketsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsRequest 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_MarketsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketsRequest", 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_MarketsRequest) 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_MarketsRequest) 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_MarketsRequest) 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_MarketsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MarketsRequest) + 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.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().(*MarketsRequest) + 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 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().(*MarketsRequest) + 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: MarketsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MarketsResponse_1_list)(nil) + +type _MarketsResponse_1_list struct { + list *[]*Market +} + +func (x *_MarketsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MarketsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MarketsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + (*x.list)[i] = concreteValue +} + +func (x *_MarketsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MarketsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Market) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MarketsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MarketsResponse_1_list) NewElement() protoreflect.Value { + v := new(Market) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MarketsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MarketsResponse protoreflect.MessageDescriptor + fd_MarketsResponse_markets protoreflect.FieldDescriptor +) + +func init() { + file_slinky_marketmap_v1_query_proto_init() + md_MarketsResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketsResponse") + fd_MarketsResponse_markets = md_MarketsResponse.Fields().ByName("markets") +} + +var _ protoreflect.Message = (*fastReflection_MarketsResponse)(nil) + +type fastReflection_MarketsResponse MarketsResponse + +func (x *MarketsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketsResponse)(x) +} + +func (x *MarketsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_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) +} + +var _fastReflection_MarketsResponse_messageType fastReflection_MarketsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MarketsResponse_messageType{} + +type fastReflection_MarketsResponse_messageType struct{} + +func (x fastReflection_MarketsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketsResponse)(nil) +} +func (x fastReflection_MarketsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MarketsResponse) +} +func (x fastReflection_MarketsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MarketsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MarketsResponse +} + +// 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_MarketsResponse) Type() protoreflect.MessageType { + return _fastReflection_MarketsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MarketsResponse) New() protoreflect.Message { + return new(fastReflection_MarketsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MarketsResponse) Interface() protoreflect.ProtoMessage { + return (*MarketsResponse)(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_MarketsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Markets) != 0 { + value := protoreflect.ValueOfList(&_MarketsResponse_1_list{list: &x.Markets}) + if !f(fd_MarketsResponse_markets, 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_MarketsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + return len(x.Markets) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + x.Markets = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + if len(x.Markets) == 0 { + return protoreflect.ValueOfList(&_MarketsResponse_1_list{}) + } + listValue := &_MarketsResponse_1_list{list: &x.Markets} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + lv := value.List() + clv := lv.(*_MarketsResponse_1_list) + x.Markets = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + if x.Markets == nil { + x.Markets = []*Market{} + } + value := &_MarketsResponse_1_list{list: &x.Markets} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketsResponse.markets": + list := []*Market{} + return protoreflect.ValueOfList(&_MarketsResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketsResponse 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_MarketsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketsResponse", 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_MarketsResponse) 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_MarketsResponse) 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_MarketsResponse) 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_MarketsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MarketsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Markets) > 0 { + for _, e := range x.Markets { + l = options.Size(e) + 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().(*MarketsResponse) + 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.Markets) > 0 { + for iNdEx := len(x.Markets) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Markets[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MarketsResponse) + 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: MarketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Markets = append(x.Markets, &Market{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Markets[len(x.Markets)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_MarketRequest protoreflect.MessageDescriptor fd_MarketRequest_currency_pair protoreflect.FieldDescriptor @@ -938,7 +1788,7 @@ func (x *MarketRequest) ProtoReflect() protoreflect.Message { } func (x *MarketRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[2] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1373,7 +2223,7 @@ func (x *MarketResponse) ProtoReflect() protoreflect.Message { } func (x *MarketResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[3] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1806,7 +2656,7 @@ func (x *ParamsRequest) ProtoReflect() protoreflect.Message { } func (x *ParamsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[4] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2164,7 +3014,7 @@ func (x *ParamsResponse) ProtoReflect() protoreflect.Message { } func (x *ParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[5] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2597,7 +3447,7 @@ func (x *LastUpdatedRequest) ProtoReflect() protoreflect.Message { } func (x *LastUpdatedRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[6] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2955,7 +3805,7 @@ func (x *LastUpdatedResponse) ProtoReflect() protoreflect.Message { } func (x *LastUpdatedResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[7] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3438,6 +4288,70 @@ func (x *MarketMapResponse) GetChainId() string { return "" } +// MarketsRequest is the query request for the Market query. +type MarketsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MarketsRequest) Reset() { + *x = MarketsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarketsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarketsRequest) ProtoMessage() {} + +// Deprecated: Use MarketsRequest.ProtoReflect.Descriptor instead. +func (*MarketsRequest) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{2} +} + +// MarketsResponse is the query response for the Markets query. +type MarketsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Markets is a sorted list of all markets in the module. + Markets []*Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty"` +} + +func (x *MarketsResponse) Reset() { + *x = MarketsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarketsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarketsResponse) ProtoMessage() {} + +// Deprecated: Use MarketsResponse.ProtoReflect.Descriptor instead. +func (*MarketsResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *MarketsResponse) GetMarkets() []*Market { + if x != nil { + return x.Markets + } + return nil +} + // MarketRequest is the query request for the Market query. // It takes the currency pair of the market as an argument. type MarketRequest struct { @@ -3453,7 +4367,7 @@ type MarketRequest struct { func (x *MarketRequest) Reset() { *x = MarketRequest{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[2] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3467,7 +4381,7 @@ func (*MarketRequest) ProtoMessage() {} // Deprecated: Use MarketRequest.ProtoReflect.Descriptor instead. func (*MarketRequest) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{2} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{4} } func (x *MarketRequest) GetCurrencyPair() *v1.CurrencyPair { @@ -3490,7 +4404,7 @@ type MarketResponse struct { func (x *MarketResponse) Reset() { *x = MarketResponse{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[3] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3504,7 +4418,7 @@ func (*MarketResponse) ProtoMessage() {} // Deprecated: Use MarketResponse.ProtoReflect.Descriptor instead. func (*MarketResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{3} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{5} } func (x *MarketResponse) GetMarket() *Market { @@ -3524,7 +4438,7 @@ type ParamsRequest struct { func (x *ParamsRequest) Reset() { *x = ParamsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[4] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3538,7 +4452,7 @@ func (*ParamsRequest) ProtoMessage() {} // Deprecated: Use ParamsRequest.ProtoReflect.Descriptor instead. func (*ParamsRequest) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{4} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{6} } // ParamsResponse is the response type for the Query/Params RPC method. @@ -3553,7 +4467,7 @@ type ParamsResponse struct { func (x *ParamsResponse) Reset() { *x = ParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[5] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3567,7 +4481,7 @@ func (*ParamsResponse) ProtoMessage() {} // Deprecated: Use ParamsResponse.ProtoReflect.Descriptor instead. func (*ParamsResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{5} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{7} } func (x *ParamsResponse) GetParams() *Params { @@ -3588,7 +4502,7 @@ type LastUpdatedRequest struct { func (x *LastUpdatedRequest) Reset() { *x = LastUpdatedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[6] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3602,7 +4516,7 @@ func (*LastUpdatedRequest) ProtoMessage() {} // Deprecated: Use LastUpdatedRequest.ProtoReflect.Descriptor instead. func (*LastUpdatedRequest) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{6} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{8} } // LastUpdatedResponse is the response type for the Query/LastUpdated RPC @@ -3618,7 +4532,7 @@ type LastUpdatedResponse struct { func (x *LastUpdatedResponse) Reset() { *x = LastUpdatedResponse{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[7] + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3632,7 +4546,7 @@ func (*LastUpdatedResponse) ProtoMessage() {} // Deprecated: Use LastUpdatedResponse.ProtoReflect.Descriptor instead. func (*LastUpdatedResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{7} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{9} } func (x *LastUpdatedResponse) GetLastUpdated() uint64 { @@ -3669,74 +4583,88 @@ var file_slinky_marketmap_v1_query_proto_rawDesc = []byte{ 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, - 0x22, 0x59, 0x0a, 0x0d, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x48, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, - 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0c, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x22, 0x4b, 0x0a, 0x0e, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, - 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x22, 0x10, 0x0a, 0x0e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x4e, 0x0a, 0x0f, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x73, 0x22, 0x59, 0x0a, 0x0d, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, + 0x70, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x69, + 0x6e, 0x6b, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x22, 0x4b, 0x0a, + 0x0e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x39, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x0e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x0e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, 0x0a, 0x13, - 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x32, 0x8a, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x82, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x25, - 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, - 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x61, 0x73, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x38, + 0x0a, 0x13, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x73, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x32, 0x86, 0x05, 0x0a, 0x05, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x82, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, + 0x12, 0x25, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x7a, 0x0a, 0x07, 0x4d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x76, 0x0a, 0x06, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, - 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, - 0x12, 0x1b, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x8b, 0x01, - 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x27, 0x2e, + 0x65, 0x74, 0x73, 0x12, 0x76, 0x0a, 0x06, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x73, - 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x76, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x42, - 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x6d, 0x61, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, + 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, + 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x0b, + 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x27, 0x2e, 0x73, 0x6c, + 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x76, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6c, + 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x76, + 0x31, 0x3b, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x13, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x53, 0x6c, 0x69, 0x6e, + 0x6b, 0x79, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, + 0x61, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x15, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -3751,39 +4679,44 @@ func file_slinky_marketmap_v1_query_proto_rawDescGZIP() []byte { return file_slinky_marketmap_v1_query_proto_rawDescData } -var file_slinky_marketmap_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_slinky_marketmap_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_slinky_marketmap_v1_query_proto_goTypes = []interface{}{ (*MarketMapRequest)(nil), // 0: slinky.marketmap.v1.MarketMapRequest (*MarketMapResponse)(nil), // 1: slinky.marketmap.v1.MarketMapResponse - (*MarketRequest)(nil), // 2: slinky.marketmap.v1.MarketRequest - (*MarketResponse)(nil), // 3: slinky.marketmap.v1.MarketResponse - (*ParamsRequest)(nil), // 4: slinky.marketmap.v1.ParamsRequest - (*ParamsResponse)(nil), // 5: slinky.marketmap.v1.ParamsResponse - (*LastUpdatedRequest)(nil), // 6: slinky.marketmap.v1.LastUpdatedRequest - (*LastUpdatedResponse)(nil), // 7: slinky.marketmap.v1.LastUpdatedResponse - (*MarketMap)(nil), // 8: slinky.marketmap.v1.MarketMap - (*v1.CurrencyPair)(nil), // 9: slinky.types.v1.CurrencyPair - (*Market)(nil), // 10: slinky.marketmap.v1.Market - (*Params)(nil), // 11: slinky.marketmap.v1.Params + (*MarketsRequest)(nil), // 2: slinky.marketmap.v1.MarketsRequest + (*MarketsResponse)(nil), // 3: slinky.marketmap.v1.MarketsResponse + (*MarketRequest)(nil), // 4: slinky.marketmap.v1.MarketRequest + (*MarketResponse)(nil), // 5: slinky.marketmap.v1.MarketResponse + (*ParamsRequest)(nil), // 6: slinky.marketmap.v1.ParamsRequest + (*ParamsResponse)(nil), // 7: slinky.marketmap.v1.ParamsResponse + (*LastUpdatedRequest)(nil), // 8: slinky.marketmap.v1.LastUpdatedRequest + (*LastUpdatedResponse)(nil), // 9: slinky.marketmap.v1.LastUpdatedResponse + (*MarketMap)(nil), // 10: slinky.marketmap.v1.MarketMap + (*Market)(nil), // 11: slinky.marketmap.v1.Market + (*v1.CurrencyPair)(nil), // 12: slinky.types.v1.CurrencyPair + (*Params)(nil), // 13: slinky.marketmap.v1.Params } var file_slinky_marketmap_v1_query_proto_depIdxs = []int32{ - 8, // 0: slinky.marketmap.v1.MarketMapResponse.market_map:type_name -> slinky.marketmap.v1.MarketMap - 9, // 1: slinky.marketmap.v1.MarketRequest.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 10, // 2: slinky.marketmap.v1.MarketResponse.market:type_name -> slinky.marketmap.v1.Market - 11, // 3: slinky.marketmap.v1.ParamsResponse.params:type_name -> slinky.marketmap.v1.Params - 0, // 4: slinky.marketmap.v1.Query.MarketMap:input_type -> slinky.marketmap.v1.MarketMapRequest - 2, // 5: slinky.marketmap.v1.Query.Market:input_type -> slinky.marketmap.v1.MarketRequest - 6, // 6: slinky.marketmap.v1.Query.LastUpdated:input_type -> slinky.marketmap.v1.LastUpdatedRequest - 4, // 7: slinky.marketmap.v1.Query.Params:input_type -> slinky.marketmap.v1.ParamsRequest - 1, // 8: slinky.marketmap.v1.Query.MarketMap:output_type -> slinky.marketmap.v1.MarketMapResponse - 3, // 9: slinky.marketmap.v1.Query.Market:output_type -> slinky.marketmap.v1.MarketResponse - 7, // 10: slinky.marketmap.v1.Query.LastUpdated:output_type -> slinky.marketmap.v1.LastUpdatedResponse - 5, // 11: slinky.marketmap.v1.Query.Params:output_type -> slinky.marketmap.v1.ParamsResponse - 8, // [8:12] is the sub-list for method output_type - 4, // [4:8] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 10, // 0: slinky.marketmap.v1.MarketMapResponse.market_map:type_name -> slinky.marketmap.v1.MarketMap + 11, // 1: slinky.marketmap.v1.MarketsResponse.markets:type_name -> slinky.marketmap.v1.Market + 12, // 2: slinky.marketmap.v1.MarketRequest.currency_pair:type_name -> slinky.types.v1.CurrencyPair + 11, // 3: slinky.marketmap.v1.MarketResponse.market:type_name -> slinky.marketmap.v1.Market + 13, // 4: slinky.marketmap.v1.ParamsResponse.params:type_name -> slinky.marketmap.v1.Params + 0, // 5: slinky.marketmap.v1.Query.MarketMap:input_type -> slinky.marketmap.v1.MarketMapRequest + 2, // 6: slinky.marketmap.v1.Query.Markets:input_type -> slinky.marketmap.v1.MarketsRequest + 4, // 7: slinky.marketmap.v1.Query.Market:input_type -> slinky.marketmap.v1.MarketRequest + 8, // 8: slinky.marketmap.v1.Query.LastUpdated:input_type -> slinky.marketmap.v1.LastUpdatedRequest + 6, // 9: slinky.marketmap.v1.Query.Params:input_type -> slinky.marketmap.v1.ParamsRequest + 1, // 10: slinky.marketmap.v1.Query.MarketMap:output_type -> slinky.marketmap.v1.MarketMapResponse + 3, // 11: slinky.marketmap.v1.Query.Markets:output_type -> slinky.marketmap.v1.MarketsResponse + 5, // 12: slinky.marketmap.v1.Query.Market:output_type -> slinky.marketmap.v1.MarketResponse + 9, // 13: slinky.marketmap.v1.Query.LastUpdated:output_type -> slinky.marketmap.v1.LastUpdatedResponse + 7, // 14: slinky.marketmap.v1.Query.Params:output_type -> slinky.marketmap.v1.ParamsResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_slinky_marketmap_v1_query_proto_init() } @@ -3819,7 +4752,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketRequest); i { + switch v := v.(*MarketsRequest); i { case 0: return &v.state case 1: @@ -3831,7 +4764,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketResponse); i { + switch v := v.(*MarketsResponse); i { case 0: return &v.state case 1: @@ -3843,7 +4776,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParamsRequest); i { + switch v := v.(*MarketRequest); i { case 0: return &v.state case 1: @@ -3855,7 +4788,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParamsResponse); i { + switch v := v.(*MarketResponse); i { case 0: return &v.state case 1: @@ -3867,7 +4800,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LastUpdatedRequest); i { + switch v := v.(*ParamsRequest); i { case 0: return &v.state case 1: @@ -3879,6 +4812,30 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_marketmap_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LastUpdatedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_marketmap_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LastUpdatedResponse); i { case 0: return &v.state @@ -3897,7 +4854,7 @@ func file_slinky_marketmap_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_slinky_marketmap_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/slinky/marketmap/v1/query_grpc.pb.go b/api/slinky/marketmap/v1/query_grpc.pb.go index 0ab689036..c94fab303 100644 --- a/api/slinky/marketmap/v1/query_grpc.pb.go +++ b/api/slinky/marketmap/v1/query_grpc.pb.go @@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion9 const ( Query_MarketMap_FullMethodName = "/slinky.marketmap.v1.Query/MarketMap" + Query_Markets_FullMethodName = "/slinky.marketmap.v1.Query/Markets" Query_Market_FullMethodName = "/slinky.marketmap.v1.Query/Market" Query_LastUpdated_FullMethodName = "/slinky.marketmap.v1.Query/LastUpdated" Query_Params_FullMethodName = "/slinky.marketmap.v1.Query/Params" @@ -32,8 +33,12 @@ const ( // Query is the query service for the x/marketmap module. type QueryClient interface { // MarketMap returns the full market map stored in the x/marketmap - // module. + // module. NOTE: the value returned by this query is not safe for on-chain + // code. MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) + // Market returns all stored in the x/marketmap + // module as a sorted list. + Markets(ctx context.Context, in *MarketsRequest, opts ...grpc.CallOption) (*MarketsResponse, error) // Market returns a market stored in the x/marketmap // module. Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) @@ -61,6 +66,16 @@ func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts return out, nil } +func (c *queryClient) Markets(ctx context.Context, in *MarketsRequest, opts ...grpc.CallOption) (*MarketsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MarketsResponse) + err := c.cc.Invoke(ctx, Query_Markets_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MarketResponse) @@ -98,8 +113,12 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp // Query is the query service for the x/marketmap module. type QueryServer interface { // MarketMap returns the full market map stored in the x/marketmap - // module. + // module. NOTE: the value returned by this query is not safe for on-chain + // code. MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) + // Market returns all stored in the x/marketmap + // module as a sorted list. + Markets(context.Context, *MarketsRequest) (*MarketsResponse, error) // Market returns a market stored in the x/marketmap // module. Market(context.Context, *MarketRequest) (*MarketResponse, error) @@ -120,6 +139,9 @@ type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketMap not implemented") } +func (UnimplementedQueryServer) Markets(context.Context, *MarketsRequest) (*MarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Markets not implemented") +} func (UnimplementedQueryServer) Market(context.Context, *MarketRequest) (*MarketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") } @@ -168,6 +190,24 @@ func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_Markets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MarketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Markets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Markets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Markets(ctx, req.(*MarketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Market_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MarketRequest) if err := dec(in); err != nil { @@ -233,6 +273,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "MarketMap", Handler: _Query_MarketMap_Handler, }, + { + MethodName: "Markets", + Handler: _Query_Markets_Handler, + }, { MethodName: "Market", Handler: _Query_Market_Handler, diff --git a/cmd/slinky/main.go b/cmd/slinky/main.go index daa2150c8..f98d0833b 100644 --- a/cmd/slinky/main.go +++ b/cmd/slinky/main.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "net/http" + //nolint: gosec _ "net/http/pprof" "os" diff --git a/go.mod b/go.mod index 73654d80f..5df009a62 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/client9/misspell v0.3.4 github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.50.10 + github.com/cosmos/cosmos-sdk v0.50.11 github.com/cosmos/gogogateway v1.2.0 github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/interchain-security/v5 v5.2.0 @@ -59,7 +59,7 @@ require ( 4d63.com/gochecknoglobals v0.2.1 // indirect cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/x/tx v0.13.5 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect cosmossdk.io/x/upgrade v0.1.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/4meepo/tagalign v1.3.4 // indirect @@ -118,9 +118,9 @@ require ( github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/cosmos/cosmos-db v1.1.0 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect github.com/cosmos/ibc-go/v8 v8.5.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect @@ -140,7 +140,7 @@ require ( github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/emicklei/dot v1.6.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum/c-kzg-4844 v1.0.0 // indirect github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect github.com/ettle/strcase v0.2.0 // indirect diff --git a/go.sum b/go.sum index c63c652fe..f175bec14 100644 --- a/go.sum +++ b/go.sum @@ -215,8 +215,8 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -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.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -430,12 +430,12 @@ 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.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +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-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/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= -github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= +github.com/cosmos/cosmos-sdk v0.50.11 h1:LxR1aAc8kixdrs3itO+3a44sFoc+vjxVAOyPFx22yjk= +github.com/cosmos/cosmos-sdk v0.50.11/go.mod h1:gt14Meok2IDCjbDtjwkbUcgVNEpUBDN/4hg9cCUtLgw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -443,8 +443,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= -github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= @@ -508,8 +508,8 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= -github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= diff --git a/proto/slinky/marketmap/v1/query.proto b/proto/slinky/marketmap/v1/query.proto index ff107a5e6..b08ea295a 100644 --- a/proto/slinky/marketmap/v1/query.proto +++ b/proto/slinky/marketmap/v1/query.proto @@ -12,11 +12,20 @@ option go_package = "github.com/skip-mev/slinky/x/marketmap/types"; // Query is the query service for the x/marketmap module. service Query { // MarketMap returns the full market map stored in the x/marketmap - // module. + // module. NOTE: the value returned by this query is not safe for on-chain + // code. rpc MarketMap(MarketMapRequest) returns (MarketMapResponse) { option (google.api.http).get = "/slinky/marketmap/v1/marketmap"; } + // Market returns all stored in the x/marketmap + // module as a sorted list. + rpc Markets(MarketsRequest) returns (MarketsResponse) { + option (google.api.http) = { + get : "/slinky/marketmap/v1/markets" + }; + } + // Market returns a market stored in the x/marketmap // module. rpc Market(MarketRequest) returns (MarketResponse) { @@ -55,6 +64,15 @@ message MarketMapResponse { string chain_id = 3; } +// MarketsRequest is the query request for the Market query. +message MarketsRequest {} + +// MarketsResponse is the query response for the Markets query. +message MarketsResponse { + // Markets is a sorted list of all markets in the module. + repeated Market markets = 1 [ (gogoproto.nullable) = false ]; +} + // MarketRequest is the query request for the Market query. // It takes the currency pair of the market as an argument. message MarketRequest { diff --git a/tests/integration/go.mod b/tests/integration/go.mod index a8e12c2c3..526a52c30 100644 --- a/tests/integration/go.mod +++ b/tests/integration/go.mod @@ -15,7 +15,7 @@ toolchain go1.23.4 require ( cosmossdk.io/math v1.4.0 github.com/cometbft/cometbft v0.38.15 - github.com/cosmos/cosmos-sdk v0.50.10 + github.com/cosmos/cosmos-sdk v0.50.11 github.com/pelletier/go-toml/v2 v2.2.3 github.com/skip-mev/slinky v1.0.4 github.com/strangelove-ventures/interchaintest/v8 v8.8.1 @@ -40,7 +40,7 @@ require ( cosmossdk.io/store v1.1.1 // indirect cosmossdk.io/x/evidence v0.1.1 // indirect cosmossdk.io/x/feegrant v0.1.1 // indirect - cosmossdk.io/x/tx v0.13.5 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect cosmossdk.io/x/upgrade v0.1.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -77,12 +77,12 @@ require ( github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/cosmos/cosmos-db v1.1.0 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect - github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect github.com/cosmos/ibc-go/v8 v8.5.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect diff --git a/tests/integration/go.sum b/tests/integration/go.sum index e3852140b..7d9ab0aaa 100644 --- a/tests/integration/go.sum +++ b/tests/integration/go.sum @@ -212,8 +212,8 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -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.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -377,12 +377,12 @@ 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.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +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-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/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= -github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= +github.com/cosmos/cosmos-sdk v0.50.11 h1:LxR1aAc8kixdrs3itO+3a44sFoc+vjxVAOyPFx22yjk= +github.com/cosmos/cosmos-sdk v0.50.11/go.mod h1:gt14Meok2IDCjbDtjwkbUcgVNEpUBDN/4hg9cCUtLgw= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -391,8 +391,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= -github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= diff --git a/tests/integration/slinky_setup.go b/tests/integration/slinky_setup.go index 9b80f81ff..267156920 100644 --- a/tests/integration/slinky_setup.go +++ b/tests/integration/slinky_setup.go @@ -332,7 +332,8 @@ func QueryMarket(chain *cosmos.CosmosChain, cp slinkytypes.CurrencyPair) (mmtype return res.Market, nil } -// QueryMarketMap queries the market map. +// QueryMarketMap queries the market map. This query util provides an additional query to the list endpoint +// and ensures that the response data in both queries is equal. func QueryMarketMap(chain *cosmos.CosmosChain) (*mmtypes.MarketMapResponse, error) { grpcAddr := chain.GetHostGRPCAddress() @@ -349,7 +350,59 @@ func QueryMarketMap(chain *cosmos.CosmosChain) (*mmtypes.MarketMapResponse, erro ctx := context.Background() // query the currency pairs - res, err := client.MarketMap(ctx, &mmtypes.MarketMapRequest{}) + mapRes, err := client.MarketMap(ctx, &mmtypes.MarketMapRequest{}) + if err != nil { + return nil, err + } + + if mapRes == nil { + return nil, fmt.Errorf("map response is nil") + } + + // query markets to check that there is 1-1 correspondence to the map query + listRes, err := QueryMarkets(chain) + if err != nil { + return nil, err + } + + if len(listRes.Markets) != len(mapRes.MarketMap.Markets) { + return nil, fmt.Errorf("map and list responses should be the same length: got %d list, %d map", + len(listRes.Markets), + len(mapRes.MarketMap.Markets), + ) + } + for _, market := range listRes.Markets { + mapMarket, found := mapRes.MarketMap.Markets[market.Ticker.String()] + if !found { + return nil, fmt.Errorf("market %s not found", market.Ticker.String()) + } + + if !market.Equal(mapMarket) { + return nil, fmt.Errorf("market %s is not equal to %s", market.Ticker.String(), mapMarket.String()) + } + } + + return mapRes, nil +} + +// QueryMarkets queries all markets . +func QueryMarkets(chain *cosmos.CosmosChain) (*mmtypes.MarketsResponse, error) { + grpcAddr := chain.GetHostGRPCAddress() + + // create the client + cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, err + } + defer cc.Close() + + // create the mm client + client := mmtypes.NewQueryClient(cc) + + ctx := context.Background() + + // query the currency pairs + res, err := client.Markets(ctx, &mmtypes.MarketsRequest{}) if err != nil { return nil, err } @@ -500,6 +553,16 @@ func (s *SlinkyIntegrationSuite) RemoveMarket( return fmt.Errorf(resp.TxResult.Log) } + // check market map and lastUpdated + mmResp, err := QueryMarketMap(chain) + s.Require().NoError(err) + + // ensure that the market no longer exist + for _, market := range markets { + _, found := mmResp.MarketMap.Markets[market.String()] + s.Require().False(found) + } + return nil } diff --git a/tests/petri/go.mod b/tests/petri/go.mod index 361fca0f9..476b79c5c 100644 --- a/tests/petri/go.mod +++ b/tests/petri/go.mod @@ -5,7 +5,7 @@ go 1.22.0 toolchain go1.23.4 require ( - github.com/cosmos/cosmos-sdk v0.50.8 + github.com/cosmos/cosmos-sdk v0.50.11 github.com/skip-mev/petri/chain/v2 v2.0.1 github.com/skip-mev/petri/node/v2 v2.0.1 github.com/skip-mev/petri/provider/v2 v2.0.0 @@ -22,16 +22,16 @@ require ( cloud.google.com/go/compute/metadata v0.5.0 // indirect cloud.google.com/go/iam v1.1.10 // indirect cloud.google.com/go/storage v1.41.0 // indirect - cosmossdk.io/api v0.7.5 // indirect + cosmossdk.io/api v0.7.6 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.1.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.1.0 // indirect + cosmossdk.io/log v1.4.1 // indirect + cosmossdk.io/math v1.4.0 // indirect + cosmossdk.io/store v1.1.1 // indirect cosmossdk.io/x/circuit v0.1.1 // indirect - cosmossdk.io/x/tx v0.13.3 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect cosmossdk.io/x/upgrade v0.1.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -44,29 +44,30 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.10 // indirect - github.com/cometbft/cometbft-db v0.10.0 // indirect + github.com/cometbft/cometbft v0.38.12 // indirect + github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/cosmos/cosmos-db v1.1.0 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.5.0 // indirect - github.com/cosmos/iavl v1.1.2 // indirect + github.com/cosmos/gogoproto v1.7.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.0 // indirect github.com/cosmos/ibc-go/v8 v8.2.0 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/interchain-security/v5 v5.0.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -83,7 +84,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/emicklei/dot v1.6.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.17.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -101,7 +102,7 @@ require ( github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/btree v1.1.2 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -148,6 +149,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect @@ -156,14 +158,14 @@ require ( github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/cors v1.11.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect @@ -171,7 +173,7 @@ require ( github.com/skip-mev/petri/wallet/v2 v2.0.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect @@ -182,7 +184,7 @@ require ( github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect diff --git a/tests/petri/go.sum b/tests/petri/go.sum index e5180eb07..dda74fc71 100644 --- a/tests/petri/go.sum +++ b/tests/petri/go.sum @@ -186,32 +186,32 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= -cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.6 h1:PC20PcXy1xYKH2KU4RMurVoFjjKkCgYRbVAD4PdqUuY= +cosmossdk.io/api v0.7.6/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA1/Q= cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= +cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= -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/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= +cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= +cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= +cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= +cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/x/tx v0.13.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -274,10 +274,10 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= @@ -322,21 +322,23 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= -github.com/cometbft/cometbft-db v0.10.0 h1:VMBQh88zXn64jXVvj39tlu/IgsGR84T7ImjS523DCiU= -github.com/cometbft/cometbft-db v0.10.0/go.mod h1:7RR7NRv99j7keWJ5IkE9iZibUTKYdtepXTp7Ra0FxKk= +github.com/cometbft/cometbft v0.38.12 h1:OWsLZN2KcSSFe8bet9xCn07VwhBnavPea3VyPnNq1bg= +github.com/cometbft/cometbft v0.38.12/go.mod h1:GPHp3/pehPqgX1930HmK1BpBLZPxB75v/dZg8Viwy+o= +github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= +github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -347,27 +349,27 @@ 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.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +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-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/cosmos-sdk v0.50.8 h1:2UJHssUaGHTl4/dFp8xyREKAnfiRU6VVfqtKG9n8w5g= -github.com/cosmos/cosmos-sdk v0.50.8/go.mod h1:Zb+DgHtiByNwgj71IlJBXwOq6dLhtyAq3AgqpXm/jHo= +github.com/cosmos/cosmos-sdk v0.50.11 h1:LxR1aAc8kixdrs3itO+3a44sFoc+vjxVAOyPFx22yjk= +github.com/cosmos/cosmos-sdk v0.50.11/go.mod h1:gt14Meok2IDCjbDtjwkbUcgVNEpUBDN/4hg9cCUtLgw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= -github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= github.com/cosmos/ibc-go/modules/capability v1.0.0/go.mod h1:D81ZxzjZAe0ZO5ambnvn1qedsFQ8lOwtqicG6liLBco= github.com/cosmos/ibc-go/v8 v8.2.0 h1:7oCzyy1sZCcgpeQLnHxC56brsSz3KWwQGKXalXwXFzE= github.com/cosmos/ibc-go/v8 v8.2.0/go.mod h1:wj3qx75iC/XNnsMqbPDCIGs0G6Y3E/lo3bdqCyoCy+8= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= +github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/interchain-security/v5 v5.0.0 h1:iwHu1nFbXuYfa13isEgm6hkHU+2t/t56YjcfyP3PnQA= github.com/cosmos/interchain-security/v5 v5.0.0/go.mod h1:h/RkwOppo5AJj+1pkQyfjqU1MPdpohD/S6oEeAXpGZY= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -418,8 +420,8 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= -github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -562,8 +564,8 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXi github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -768,6 +770,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= @@ -828,6 +832,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -913,8 +919,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -929,16 +935,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -949,11 +955,11 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= -github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1002,8 +1008,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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +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/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= @@ -1072,8 +1078,8 @@ github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWp github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= +go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= diff --git a/tests/simapp/go.mod b/tests/simapp/go.mod index 16ecdc396..0c06aa5de 100644 --- a/tests/simapp/go.mod +++ b/tests/simapp/go.mod @@ -16,9 +16,9 @@ require ( cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/upgrade v0.1.4 github.com/cometbft/cometbft v0.38.15 - github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-sdk v0.50.10 - github.com/skip-mev/slinky v0.0.0-00010101000000-000000000000 + github.com/cosmos/cosmos-db v1.1.0 + github.com/cosmos/cosmos-sdk v0.50.11 + github.com/skip-mev/slinky v1.0.1 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 @@ -35,7 +35,7 @@ require ( cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/x/tx v0.13.5 // indirect + cosmossdk.io/x/tx v0.13.7 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -62,7 +62,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect - github.com/cosmos/iavl v1.2.0 // indirect + github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect github.com/cosmos/ibc-go/v8 v8.5.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect @@ -78,7 +78,7 @@ require ( github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/emicklei/dot v1.6.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect diff --git a/tests/simapp/go.sum b/tests/simapp/go.sum index b2f51fec2..5f8f94f8d 100644 --- a/tests/simapp/go.sum +++ b/tests/simapp/go.sum @@ -214,8 +214,8 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -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.7 h1:8WSk6B/OHJLYjiZeMKhq7DK7lHDMyK0UfDbBMxVmeOI= +cosmossdk.io/x/tx v0.13.7/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -344,12 +344,12 @@ 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.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +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-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/cosmos-sdk v0.50.10 h1:zXfeu/z653tWZARr/jESzAEiCUYjgJwwG4ytnYWMoDM= -github.com/cosmos/cosmos-sdk v0.50.10/go.mod h1:6Eesrx3ZE7vxBZWpK++30H+Uc7Q4ahQWCL7JKU/LEdU= +github.com/cosmos/cosmos-sdk v0.50.11 h1:LxR1aAc8kixdrs3itO+3a44sFoc+vjxVAOyPFx22yjk= +github.com/cosmos/cosmos-sdk v0.50.11/go.mod h1:gt14Meok2IDCjbDtjwkbUcgVNEpUBDN/4hg9cCUtLgw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -357,8 +357,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= -github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= +github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= +github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= @@ -411,8 +411,8 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= -github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= diff --git a/x/marketmap/keeper/keeper.go b/x/marketmap/keeper/keeper.go index 9e63fd374..dcdb297cc 100644 --- a/x/marketmap/keeper/keeper.go +++ b/x/marketmap/keeper/keeper.go @@ -134,6 +134,26 @@ func (k *Keeper) GetAllMarkets(ctx sdk.Context) (map[string]types.Market, error) return m, nil } +// GetAllMarketsList returns the set of Market objects currently stored in state +// as a list. +func (k *Keeper) GetAllMarketsList(ctx sdk.Context) ([]types.Market, error) { + iter, err := k.markets.Iterate(ctx, nil) + if err != nil { + return nil, err + } + + markets := make([]types.Market, 0) + for ; iter.Valid(); iter.Next() { + market, err := iter.Value() + if err != nil { + return nil, err + } + markets = append(markets, market) + } + + return markets, nil +} + // CreateMarket initializes a new Market. // The Ticker.String corresponds to a market, and must be unique. func (k *Keeper) CreateMarket(ctx sdk.Context, market types.Market) error { diff --git a/x/marketmap/keeper/keeper_test.go b/x/marketmap/keeper/keeper_test.go index eaf4c6053..0aff8a763 100644 --- a/x/marketmap/keeper/keeper_test.go +++ b/x/marketmap/keeper/keeper_test.go @@ -168,6 +168,13 @@ var ( ethusdt, } + marketsKeySorted = []types.Market{ + btcusdt, + ethusdt, + usdcusd, + usdtusd, + } + marketsMap = map[string]types.Market{ btcusdt.Ticker.String(): btcusdt, usdcusd.Ticker.String(): usdcusd, @@ -197,13 +204,31 @@ func (s *KeeperTestSuite) TestGets() { s.Require().NoError(s.keeper.ValidateState(s.ctx, markets)) }) - s.Run("get all tickers", func() { + s.Run("get all tickers map", func() { got, err := s.keeper.GetAllMarkets(s.ctx) s.Require().NoError(err) s.Require().Equal(len(markets), len(got)) s.Require().Equal(marketsMap, got) }) + + s.Run("get all tickers list", func() { + got, err := s.keeper.GetAllMarketsList(s.ctx) + s.Require().NoError(err) + + s.Require().Equal(len(marketsKeySorted), len(got)) + s.Require().Equal(marketsKeySorted, got) + }) + + s.Run("get all tickers list - deterministic", func() { + for range 100 { + got, err := s.keeper.GetAllMarketsList(s.ctx) + s.Require().NoError(err) + + s.Require().Equal(len(marketsKeySorted), len(got)) + s.Require().Equal(marketsKeySorted, got) + } + }) } func (s *KeeperTestSuite) TestSetParams() { diff --git a/x/marketmap/keeper/query.go b/x/marketmap/keeper/query.go index 9851b7b9f..f6654c1a8 100644 --- a/x/marketmap/keeper/query.go +++ b/x/marketmap/keeper/query.go @@ -44,6 +44,23 @@ func (q queryServerImpl) MarketMap(goCtx context.Context, req *types.MarketMapRe err } +// Markets returns all markets stored in the x/marketmap module. +func (q queryServerImpl) Markets(goCtx context.Context, req *types.MarketsRequest) (*types.MarketsResponse, error) { + if req == nil { + return nil, fmt.Errorf("request cannot be nil") + } + + // unwrap the context + ctx := sdk.UnwrapSDKContext(goCtx) + + markets, err := q.k.GetAllMarketsList(ctx) + if err != nil { + return nil, err + } + + return &types.MarketsResponse{Markets: markets}, nil +} + // Market returns the requested market stored in the x/marketmap module. func (q queryServerImpl) Market(goCtx context.Context, req *types.MarketRequest) (*types.MarketResponse, error) { if req == nil { diff --git a/x/marketmap/keeper/query_test.go b/x/marketmap/keeper/query_test.go index 6eb68212c..d78823fa9 100644 --- a/x/marketmap/keeper/query_test.go +++ b/x/marketmap/keeper/query_test.go @@ -54,6 +54,47 @@ func (s *KeeperTestSuite) TestMarketMap() { }) } +func (s *KeeperTestSuite) TestMarkets() { + qs := keeper.NewQueryServer(s.keeper) + s.ctx = s.ctx.WithChainID("test-chain") + + s.Run("invalid for nil request", func() { + _, err := qs.Markets(s.ctx, nil) + s.Require().Error(err) + }) + + s.Run("run query with no state", func() { + resp, err := qs.Markets(s.ctx, &types.MarketsRequest{}) + s.Require().NoError(err) + + expected := &types.MarketsResponse{ + Markets: []types.Market{}, + } + + s.Require().Equal(expected, resp) + }) + + s.Run("run query with state", func() { + for _, market := range markets { + s.Require().NoError(s.keeper.CreateMarket(s.ctx, market)) + } + + resp, err := qs.Markets(s.ctx, &types.MarketsRequest{}) + s.Require().NoError(err) + + expected := &types.MarketsResponse{ + Markets: marketsKeySorted, + } + + nonSortedResp := &types.MarketsResponse{ + Markets: markets, + } + + s.Require().Equal(expected, resp) + s.Require().NotEqual(nonSortedResp, resp) + }) +} + func (s *KeeperTestSuite) TestMarket() { qs := keeper.NewQueryServer(s.keeper) s.ctx = s.ctx.WithChainID("test-chain") diff --git a/x/marketmap/types/client.go b/x/marketmap/types/client.go new file mode 100644 index 000000000..1a2fea31f --- /dev/null +++ b/x/marketmap/types/client.go @@ -0,0 +1,6 @@ +package types + +//go:generate mockery --name QueryClient +type ClientWrapper interface { + QueryClient +} diff --git a/x/marketmap/types/mocks/QueryClient.go b/x/marketmap/types/mocks/QueryClient.go index 619a7fac0..c8f243020 100644 --- a/x/marketmap/types/mocks/QueryClient.go +++ b/x/marketmap/types/mocks/QueryClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.1. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -17,6 +17,14 @@ type QueryClient struct { mock.Mock } +type QueryClient_Expecter struct { + mock *mock.Mock +} + +func (_m *QueryClient) EXPECT() *QueryClient_Expecter { + return &QueryClient_Expecter{mock: &_m.Mock} +} + // LastUpdated provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) LastUpdated(ctx context.Context, in *types.LastUpdatedRequest, opts ...grpc.CallOption) (*types.LastUpdatedResponse, error) { _va := make([]interface{}, len(opts)) @@ -28,6 +36,10 @@ func (_m *QueryClient) LastUpdated(ctx context.Context, in *types.LastUpdatedReq _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for LastUpdated") + } + var r0 *types.LastUpdatedResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.LastUpdatedRequest, ...grpc.CallOption) (*types.LastUpdatedResponse, error)); ok { @@ -50,6 +62,43 @@ func (_m *QueryClient) LastUpdated(ctx context.Context, in *types.LastUpdatedReq return r0, r1 } +// QueryClient_LastUpdated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastUpdated' +type QueryClient_LastUpdated_Call struct { + *mock.Call +} + +// LastUpdated is a helper method to define mock.On call +// - ctx context.Context +// - in *types.LastUpdatedRequest +// - opts ...grpc.CallOption +func (_e *QueryClient_Expecter) LastUpdated(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_LastUpdated_Call { + return &QueryClient_LastUpdated_Call{Call: _e.mock.On("LastUpdated", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *QueryClient_LastUpdated_Call) Run(run func(ctx context.Context, in *types.LastUpdatedRequest, opts ...grpc.CallOption)) *QueryClient_LastUpdated_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*types.LastUpdatedRequest), variadicArgs...) + }) + return _c +} + +func (_c *QueryClient_LastUpdated_Call) Return(_a0 *types.LastUpdatedResponse, _a1 error) *QueryClient_LastUpdated_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueryClient_LastUpdated_Call) RunAndReturn(run func(context.Context, *types.LastUpdatedRequest, ...grpc.CallOption) (*types.LastUpdatedResponse, error)) *QueryClient_LastUpdated_Call { + _c.Call.Return(run) + return _c +} + // Market provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) Market(ctx context.Context, in *types.MarketRequest, opts ...grpc.CallOption) (*types.MarketResponse, error) { _va := make([]interface{}, len(opts)) @@ -61,6 +110,10 @@ func (_m *QueryClient) Market(ctx context.Context, in *types.MarketRequest, opts _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Market") + } + var r0 *types.MarketResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.MarketRequest, ...grpc.CallOption) (*types.MarketResponse, error)); ok { @@ -83,6 +136,43 @@ func (_m *QueryClient) Market(ctx context.Context, in *types.MarketRequest, opts return r0, r1 } +// QueryClient_Market_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Market' +type QueryClient_Market_Call struct { + *mock.Call +} + +// Market is a helper method to define mock.On call +// - ctx context.Context +// - in *types.MarketRequest +// - opts ...grpc.CallOption +func (_e *QueryClient_Expecter) Market(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Market_Call { + return &QueryClient_Market_Call{Call: _e.mock.On("Market", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *QueryClient_Market_Call) Run(run func(ctx context.Context, in *types.MarketRequest, opts ...grpc.CallOption)) *QueryClient_Market_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*types.MarketRequest), variadicArgs...) + }) + return _c +} + +func (_c *QueryClient_Market_Call) Return(_a0 *types.MarketResponse, _a1 error) *QueryClient_Market_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueryClient_Market_Call) RunAndReturn(run func(context.Context, *types.MarketRequest, ...grpc.CallOption) (*types.MarketResponse, error)) *QueryClient_Market_Call { + _c.Call.Return(run) + return _c +} + // MarketMap provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) MarketMap(ctx context.Context, in *types.MarketMapRequest, opts ...grpc.CallOption) (*types.MarketMapResponse, error) { _va := make([]interface{}, len(opts)) @@ -94,6 +184,10 @@ func (_m *QueryClient) MarketMap(ctx context.Context, in *types.MarketMapRequest _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for MarketMap") + } + var r0 *types.MarketMapResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.MarketMapRequest, ...grpc.CallOption) (*types.MarketMapResponse, error)); ok { @@ -116,6 +210,117 @@ func (_m *QueryClient) MarketMap(ctx context.Context, in *types.MarketMapRequest return r0, r1 } +// QueryClient_MarketMap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarketMap' +type QueryClient_MarketMap_Call struct { + *mock.Call +} + +// MarketMap is a helper method to define mock.On call +// - ctx context.Context +// - in *types.MarketMapRequest +// - opts ...grpc.CallOption +func (_e *QueryClient_Expecter) MarketMap(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_MarketMap_Call { + return &QueryClient_MarketMap_Call{Call: _e.mock.On("MarketMap", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *QueryClient_MarketMap_Call) Run(run func(ctx context.Context, in *types.MarketMapRequest, opts ...grpc.CallOption)) *QueryClient_MarketMap_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*types.MarketMapRequest), variadicArgs...) + }) + return _c +} + +func (_c *QueryClient_MarketMap_Call) Return(_a0 *types.MarketMapResponse, _a1 error) *QueryClient_MarketMap_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueryClient_MarketMap_Call) RunAndReturn(run func(context.Context, *types.MarketMapRequest, ...grpc.CallOption) (*types.MarketMapResponse, error)) *QueryClient_MarketMap_Call { + _c.Call.Return(run) + return _c +} + +// Markets provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) Markets(ctx context.Context, in *types.MarketsRequest, opts ...grpc.CallOption) (*types.MarketsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Markets") + } + + var r0 *types.MarketsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.MarketsRequest, ...grpc.CallOption) (*types.MarketsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.MarketsRequest, ...grpc.CallOption) *types.MarketsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.MarketsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.MarketsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// QueryClient_Markets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Markets' +type QueryClient_Markets_Call struct { + *mock.Call +} + +// Markets is a helper method to define mock.On call +// - ctx context.Context +// - in *types.MarketsRequest +// - opts ...grpc.CallOption +func (_e *QueryClient_Expecter) Markets(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Markets_Call { + return &QueryClient_Markets_Call{Call: _e.mock.On("Markets", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *QueryClient_Markets_Call) Run(run func(ctx context.Context, in *types.MarketsRequest, opts ...grpc.CallOption)) *QueryClient_Markets_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*types.MarketsRequest), variadicArgs...) + }) + return _c +} + +func (_c *QueryClient_Markets_Call) Return(_a0 *types.MarketsResponse, _a1 error) *QueryClient_Markets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueryClient_Markets_Call) RunAndReturn(run func(context.Context, *types.MarketsRequest, ...grpc.CallOption) (*types.MarketsResponse, error)) *QueryClient_Markets_Call { + _c.Call.Return(run) + return _c +} + // Params provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) Params(ctx context.Context, in *types.ParamsRequest, opts ...grpc.CallOption) (*types.ParamsResponse, error) { _va := make([]interface{}, len(opts)) @@ -127,6 +332,10 @@ func (_m *QueryClient) Params(ctx context.Context, in *types.ParamsRequest, opts _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Params") + } + var r0 *types.ParamsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *types.ParamsRequest, ...grpc.CallOption) (*types.ParamsResponse, error)); ok { @@ -149,6 +358,43 @@ func (_m *QueryClient) Params(ctx context.Context, in *types.ParamsRequest, opts return r0, r1 } +// QueryClient_Params_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Params' +type QueryClient_Params_Call struct { + *mock.Call +} + +// Params is a helper method to define mock.On call +// - ctx context.Context +// - in *types.ParamsRequest +// - opts ...grpc.CallOption +func (_e *QueryClient_Expecter) Params(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Params_Call { + return &QueryClient_Params_Call{Call: _e.mock.On("Params", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *QueryClient_Params_Call) Run(run func(ctx context.Context, in *types.ParamsRequest, opts ...grpc.CallOption)) *QueryClient_Params_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*types.ParamsRequest), variadicArgs...) + }) + return _c +} + +func (_c *QueryClient_Params_Call) Return(_a0 *types.ParamsResponse, _a1 error) *QueryClient_Params_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *QueryClient_Params_Call) RunAndReturn(run func(context.Context, *types.ParamsRequest, ...grpc.CallOption) (*types.ParamsResponse, error)) *QueryClient_Params_Call { + _c.Call.Return(run) + return _c +} + // NewQueryClient creates a new instance of QueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewQueryClient(t interface { diff --git a/x/marketmap/types/query.pb.go b/x/marketmap/types/query.pb.go index fef209bb3..f8d890d97 100644 --- a/x/marketmap/types/query.pb.go +++ b/x/marketmap/types/query.pb.go @@ -135,6 +135,89 @@ func (m *MarketMapResponse) GetChainId() string { return "" } +// MarketsRequest is the query request for the Market query. +type MarketsRequest struct { +} + +func (m *MarketsRequest) Reset() { *m = MarketsRequest{} } +func (m *MarketsRequest) String() string { return proto.CompactTextString(m) } +func (*MarketsRequest) ProtoMessage() {} +func (*MarketsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b5d6ff68f3c474a0, []int{2} +} +func (m *MarketsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarketsRequest.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 *MarketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketsRequest.Merge(m, src) +} +func (m *MarketsRequest) XXX_Size() int { + return m.Size() +} +func (m *MarketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MarketsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MarketsRequest proto.InternalMessageInfo + +// MarketsResponse is the query response for the Markets query. +type MarketsResponse struct { + // Markets is a sorted list of all markets in the module. + Markets []Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets"` +} + +func (m *MarketsResponse) Reset() { *m = MarketsResponse{} } +func (m *MarketsResponse) String() string { return proto.CompactTextString(m) } +func (*MarketsResponse) ProtoMessage() {} +func (*MarketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b5d6ff68f3c474a0, []int{3} +} +func (m *MarketsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarketsResponse.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 *MarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketsResponse.Merge(m, src) +} +func (m *MarketsResponse) XXX_Size() int { + return m.Size() +} +func (m *MarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MarketsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MarketsResponse proto.InternalMessageInfo + +func (m *MarketsResponse) GetMarkets() []Market { + if m != nil { + return m.Markets + } + return nil +} + // MarketRequest is the query request for the Market query. // It takes the currency pair of the market as an argument. type MarketRequest struct { @@ -147,7 +230,7 @@ func (m *MarketRequest) Reset() { *m = MarketRequest{} } func (m *MarketRequest) String() string { return proto.CompactTextString(m) } func (*MarketRequest) ProtoMessage() {} func (*MarketRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{2} + return fileDescriptor_b5d6ff68f3c474a0, []int{4} } func (m *MarketRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -193,7 +276,7 @@ func (m *MarketResponse) Reset() { *m = MarketResponse{} } func (m *MarketResponse) String() string { return proto.CompactTextString(m) } func (*MarketResponse) ProtoMessage() {} func (*MarketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{3} + return fileDescriptor_b5d6ff68f3c474a0, []int{5} } func (m *MarketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -237,7 +320,7 @@ func (m *ParamsRequest) Reset() { *m = ParamsRequest{} } func (m *ParamsRequest) String() string { return proto.CompactTextString(m) } func (*ParamsRequest) ProtoMessage() {} func (*ParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{4} + return fileDescriptor_b5d6ff68f3c474a0, []int{6} } func (m *ParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -275,7 +358,7 @@ func (m *ParamsResponse) Reset() { *m = ParamsResponse{} } func (m *ParamsResponse) String() string { return proto.CompactTextString(m) } func (*ParamsResponse) ProtoMessage() {} func (*ParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{5} + return fileDescriptor_b5d6ff68f3c474a0, []int{7} } func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +403,7 @@ func (m *LastUpdatedRequest) Reset() { *m = LastUpdatedRequest{} } func (m *LastUpdatedRequest) String() string { return proto.CompactTextString(m) } func (*LastUpdatedRequest) ProtoMessage() {} func (*LastUpdatedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{6} + return fileDescriptor_b5d6ff68f3c474a0, []int{8} } func (m *LastUpdatedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,7 +442,7 @@ func (m *LastUpdatedResponse) Reset() { *m = LastUpdatedResponse{} } func (m *LastUpdatedResponse) String() string { return proto.CompactTextString(m) } func (*LastUpdatedResponse) ProtoMessage() {} func (*LastUpdatedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{7} + return fileDescriptor_b5d6ff68f3c474a0, []int{9} } func (m *LastUpdatedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -398,6 +481,8 @@ func (m *LastUpdatedResponse) GetLastUpdated() uint64 { func init() { proto.RegisterType((*MarketMapRequest)(nil), "slinky.marketmap.v1.MarketMapRequest") proto.RegisterType((*MarketMapResponse)(nil), "slinky.marketmap.v1.MarketMapResponse") + proto.RegisterType((*MarketsRequest)(nil), "slinky.marketmap.v1.MarketsRequest") + proto.RegisterType((*MarketsResponse)(nil), "slinky.marketmap.v1.MarketsResponse") proto.RegisterType((*MarketRequest)(nil), "slinky.marketmap.v1.MarketRequest") proto.RegisterType((*MarketResponse)(nil), "slinky.marketmap.v1.MarketResponse") proto.RegisterType((*ParamsRequest)(nil), "slinky.marketmap.v1.ParamsRequest") @@ -409,41 +494,45 @@ func init() { func init() { proto.RegisterFile("slinky/marketmap/v1/query.proto", fileDescriptor_b5d6ff68f3c474a0) } var fileDescriptor_b5d6ff68f3c474a0 = []byte{ - // 543 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0x96, 0x10, 0xc8, 0xa4, 0x29, 0xb0, 0xed, 0x21, 0xa4, 0xd4, 0x75, 0x1d, 0x51, 0x82, - 0x04, 0xb6, 0x5a, 0x2e, 0x70, 0x6d, 0x25, 0x04, 0x2a, 0x95, 0x4a, 0x24, 0x0e, 0x70, 0x89, 0xb6, - 0xce, 0xca, 0xb5, 0x12, 0x7b, 0xb7, 0xfe, 0x88, 0xc8, 0xb5, 0x47, 0xb8, 0x20, 0x21, 0xf1, 0x9b, - 0x7a, 0xac, 0xc4, 0x85, 0x13, 0x42, 0x09, 0x3f, 0x04, 0x79, 0x3f, 0x52, 0x87, 0x26, 0xce, 0x2d, - 0x3b, 0xfb, 0xe6, 0xbd, 0xb7, 0x6f, 0x26, 0x86, 0xed, 0x78, 0xe0, 0x87, 0xfd, 0x91, 0x13, 0x90, - 0xa8, 0x4f, 0x93, 0x80, 0x70, 0x67, 0xb8, 0xe7, 0x9c, 0xa7, 0x34, 0x1a, 0xd9, 0x3c, 0x62, 0x09, - 0xc3, 0xeb, 0x12, 0x60, 0x4f, 0x01, 0xf6, 0x70, 0xaf, 0xb9, 0xe1, 0x31, 0x8f, 0x89, 0x7b, 0x27, - 0xfb, 0x25, 0xa1, 0xcd, 0x47, 0x1e, 0x63, 0xde, 0x80, 0x3a, 0x84, 0xfb, 0x0e, 0x09, 0x43, 0x96, - 0x90, 0xc4, 0x67, 0x61, 0xac, 0x6e, 0x5b, 0x4a, 0x29, 0x19, 0x71, 0x1a, 0x67, 0x2a, 0x6e, 0x1a, - 0x45, 0x34, 0x74, 0x47, 0x5d, 0x4e, 0xfc, 0x48, 0x81, 0xcc, 0x79, 0x76, 0xe4, 0xa1, 0x08, 0xc1, - 0x49, 0x44, 0x02, 0x25, 0x64, 0x61, 0xb8, 0x7f, 0x2c, 0x2e, 0x8f, 0x09, 0xef, 0xd0, 0xf3, 0x94, - 0xc6, 0x89, 0xf5, 0x03, 0xc1, 0x83, 0x5c, 0x31, 0xe6, 0x2c, 0x8c, 0x29, 0x3e, 0x04, 0x90, 0x34, - 0xdd, 0x80, 0xf0, 0x06, 0x32, 0x51, 0xbb, 0xb6, 0x6f, 0xd8, 0x73, 0x1e, 0x6c, 0x4f, 0x7b, 0x0f, - 0xca, 0x97, 0xbf, 0xb7, 0x4b, 0x9d, 0x6a, 0xa0, 0x0b, 0x78, 0x07, 0x56, 0x07, 0x24, 0x4e, 0xba, - 0x29, 0xef, 0x91, 0x84, 0xf6, 0x1a, 0x2b, 0x26, 0x6a, 0x97, 0x3b, 0xb5, 0xac, 0xf6, 0x41, 0x96, - 0xf0, 0x43, 0xb8, 0xeb, 0x9e, 0x11, 0x3f, 0xec, 0xfa, 0xbd, 0xc6, 0x2d, 0x13, 0xb5, 0xab, 0x9d, - 0x3b, 0xe2, 0xfc, 0xb6, 0x67, 0x7d, 0x84, 0xba, 0xe4, 0x56, 0x4e, 0xf1, 0x1b, 0xa8, 0xcf, 0x04, - 0xa3, 0x6c, 0x6d, 0x69, 0x5b, 0x22, 0xbe, 0xcc, 0xd2, 0xa1, 0x42, 0x9d, 0x10, 0x3f, 0x52, 0xae, - 0x56, 0xdd, 0x5c, 0xcd, 0x3a, 0x82, 0x35, 0x4d, 0xad, 0xde, 0xfb, 0x0a, 0x2a, 0xd2, 0xb7, 0x22, - 0xdd, 0x2c, 0x78, 0xab, 0xa2, 0x54, 0x0d, 0xd6, 0x3d, 0xa8, 0x9f, 0x88, 0x90, 0x75, 0xa2, 0x47, - 0xb0, 0xa6, 0x0b, 0xd7, 0xec, 0x72, 0x0e, 0x85, 0xec, 0xb2, 0x49, 0xb3, 0xcb, 0x06, 0x6b, 0x03, - 0xf0, 0xbb, 0xeb, 0xbc, 0xb4, 0xc4, 0x4b, 0x58, 0x9f, 0xa9, 0x2a, 0x9d, 0xff, 0x03, 0x47, 0x37, - 0x02, 0xdf, 0xff, 0x52, 0x86, 0xdb, 0xef, 0xb3, 0x25, 0xc6, 0x17, 0x08, 0xaa, 0xd3, 0xe1, 0xe1, - 0xc7, 0xc5, 0xc3, 0x55, 0xc2, 0xcd, 0xdd, 0x65, 0x30, 0xe9, 0xc4, 0xda, 0xbd, 0xf8, 0xf9, 0xf7, - 0xfb, 0x8a, 0x89, 0x0d, 0x67, 0xf1, 0xda, 0x06, 0x84, 0xe3, 0x21, 0x54, 0x64, 0x33, 0xb6, 0x0a, - 0x98, 0xb5, 0x7a, 0xab, 0x10, 0xa3, 0xa4, 0x5b, 0x42, 0x7a, 0x0b, 0x6f, 0x16, 0x48, 0xe3, 0xaf, - 0x08, 0x6a, 0xb9, 0x04, 0xf1, 0x93, 0xb9, 0xcc, 0x37, 0x93, 0x6f, 0xb6, 0x97, 0x03, 0x95, 0x8f, - 0xa7, 0xc2, 0x47, 0x0b, 0xef, 0xcc, 0xf5, 0x91, 0x9f, 0x53, 0x96, 0x82, 0x1c, 0xfe, 0x82, 0x14, - 0x66, 0xf6, 0x6b, 0x41, 0x0a, 0xb3, 0x2b, 0xb7, 0x24, 0x05, 0xb9, 0x5c, 0x07, 0xaf, 0x2f, 0xc7, - 0x06, 0xba, 0x1a, 0x1b, 0xe8, 0xcf, 0xd8, 0x40, 0xdf, 0x26, 0x46, 0xe9, 0x6a, 0x62, 0x94, 0x7e, - 0x4d, 0x8c, 0xd2, 0xa7, 0x67, 0x9e, 0x9f, 0x9c, 0xa5, 0xa7, 0xb6, 0xcb, 0x02, 0x27, 0xee, 0xfb, - 0xfc, 0x79, 0x40, 0x87, 0x9a, 0xe9, 0x73, 0x8e, 0x4b, 0xfc, 0xe7, 0x4e, 0x2b, 0xe2, 0xf3, 0xf2, - 0xe2, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x7b, 0x92, 0x92, 0x33, 0x05, 0x00, 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6f, 0x12, 0x41, + 0x14, 0x66, 0xfa, 0x0b, 0x79, 0x94, 0xb6, 0x4e, 0x7b, 0x40, 0xda, 0x6e, 0xb7, 0x4b, 0xad, 0x98, + 0xe8, 0x6e, 0x8a, 0x17, 0x8d, 0xb7, 0x36, 0x31, 0x9a, 0x5a, 0x53, 0x49, 0x3c, 0xe8, 0x85, 0x4c, + 0x61, 0x43, 0x37, 0xb0, 0xbb, 0xd3, 0x9d, 0x85, 0x88, 0xc7, 0x1e, 0xbc, 0x78, 0x31, 0x31, 0xf1, + 0x6f, 0xea, 0xb1, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x7f, 0x88, 0xd9, 0xf9, 0x41, 0x17, 0x0b, 0x83, + 0x37, 0xf6, 0xcd, 0xf7, 0xbe, 0xef, 0x9b, 0xf7, 0xbe, 0x01, 0x76, 0x58, 0xc7, 0x0b, 0xda, 0x7d, + 0xc7, 0x27, 0x51, 0xdb, 0x8d, 0x7d, 0x42, 0x9d, 0xde, 0x81, 0x73, 0xd1, 0x75, 0xa3, 0xbe, 0x4d, + 0xa3, 0x30, 0x0e, 0xf1, 0xba, 0x00, 0xd8, 0x23, 0x80, 0xdd, 0x3b, 0x28, 0x6d, 0xb4, 0xc2, 0x56, + 0xc8, 0xcf, 0x9d, 0xe4, 0x97, 0x80, 0x96, 0xb6, 0x5a, 0x61, 0xd8, 0xea, 0xb8, 0x0e, 0xa1, 0x9e, + 0x43, 0x82, 0x20, 0x8c, 0x49, 0xec, 0x85, 0x01, 0x93, 0xa7, 0x65, 0xa9, 0x14, 0xf7, 0xa9, 0xcb, + 0x12, 0x95, 0x46, 0x37, 0x8a, 0xdc, 0xa0, 0xd1, 0xaf, 0x53, 0xe2, 0x45, 0x12, 0x64, 0x4e, 0xb2, + 0x23, 0x3e, 0x74, 0x08, 0x4a, 0x22, 0xe2, 0x4b, 0x21, 0x0b, 0xc3, 0xda, 0x09, 0x3f, 0x3c, 0x21, + 0xb4, 0xe6, 0x5e, 0x74, 0x5d, 0x16, 0x5b, 0xdf, 0x11, 0xdc, 0x4d, 0x15, 0x19, 0x0d, 0x03, 0xe6, + 0xe2, 0x23, 0x00, 0x41, 0x53, 0xf7, 0x09, 0x2d, 0x22, 0x13, 0x55, 0xf2, 0x55, 0xc3, 0x9e, 0x70, + 0x61, 0x7b, 0xd4, 0x7b, 0xb8, 0x70, 0xf5, 0x6b, 0x27, 0x53, 0xcb, 0xf9, 0xaa, 0x80, 0x77, 0x61, + 0xb9, 0x43, 0x58, 0x5c, 0xef, 0xd2, 0x26, 0x89, 0xdd, 0x66, 0x71, 0xce, 0x44, 0x95, 0x85, 0x5a, + 0x3e, 0xa9, 0xbd, 0x13, 0x25, 0x7c, 0x0f, 0xee, 0x34, 0xce, 0x89, 0x17, 0xd4, 0xbd, 0x66, 0x71, + 0xde, 0x44, 0x95, 0x5c, 0x2d, 0xcb, 0xbf, 0x5f, 0x35, 0xad, 0x35, 0x58, 0x11, 0xdc, 0x4c, 0x59, + 0x7d, 0x03, 0xab, 0xa3, 0x8a, 0xf4, 0xf9, 0x1c, 0xb2, 0x42, 0x8f, 0x15, 0x91, 0x39, 0x5f, 0xc9, + 0x57, 0x37, 0x35, 0x26, 0xa5, 0x43, 0xd5, 0x61, 0xbd, 0x87, 0x82, 0x38, 0x90, 0x02, 0xf8, 0x25, + 0x14, 0xc6, 0x46, 0x2f, 0x2f, 0xbe, 0xad, 0x38, 0xf9, 0x82, 0x12, 0xbe, 0x23, 0x89, 0x3a, 0x25, + 0x5e, 0x24, 0x59, 0x97, 0x1b, 0xa9, 0x9a, 0x75, 0xac, 0xcc, 0x8f, 0x9c, 0x3e, 0x83, 0x25, 0xa1, + 0x2b, 0x49, 0xff, 0xc3, 0xa8, 0x6c, 0xb0, 0x56, 0xa1, 0x70, 0xca, 0xd7, 0xa8, 0x06, 0x71, 0x0c, + 0x2b, 0xaa, 0x70, 0xc3, 0x2e, 0x36, 0xad, 0x65, 0x17, 0x4d, 0x8a, 0x5d, 0x34, 0x58, 0x1b, 0x80, + 0x5f, 0xdf, 0x6c, 0x44, 0x49, 0x3c, 0x85, 0xf5, 0xb1, 0xaa, 0xd4, 0xf9, 0x77, 0xa5, 0xe8, 0xd6, + 0x4a, 0xab, 0x9f, 0x17, 0x61, 0xf1, 0x6d, 0xf2, 0x4c, 0xf0, 0x25, 0x82, 0xdc, 0x28, 0x1e, 0xf8, + 0xbe, 0x3e, 0x3e, 0x52, 0xb8, 0xb4, 0x3f, 0x0b, 0x26, 0x9c, 0x58, 0xfb, 0x97, 0x3f, 0xfe, 0x7c, + 0x9b, 0x33, 0xb1, 0xe1, 0x4c, 0x7f, 0x18, 0x3e, 0xa1, 0xf8, 0x13, 0x64, 0x65, 0x68, 0x70, 0x59, + 0x43, 0xad, 0x66, 0x5b, 0xda, 0xd3, 0x83, 0xa4, 0xfa, 0x1e, 0x57, 0x37, 0xf0, 0x96, 0x46, 0x9d, + 0xe1, 0x1e, 0x2c, 0x89, 0x46, 0x6c, 0x69, 0x58, 0x95, 0x72, 0x59, 0x8b, 0x91, 0xc2, 0x65, 0x2e, + 0xbc, 0x8d, 0x37, 0x35, 0xc2, 0xf8, 0x0b, 0x82, 0x7c, 0x6a, 0x7b, 0xf8, 0xc1, 0x44, 0xe6, 0xdb, + 0x5b, 0x2f, 0x55, 0x66, 0x03, 0xa5, 0x8f, 0x87, 0xdc, 0x47, 0x19, 0xef, 0x4e, 0xf4, 0x91, 0xce, + 0x48, 0x32, 0x05, 0x11, 0xbc, 0x29, 0x53, 0x18, 0xcb, 0xf6, 0x94, 0x29, 0x8c, 0xc7, 0x7d, 0xc6, + 0x14, 0x44, 0xb0, 0x0f, 0x5f, 0x5c, 0x0d, 0x0c, 0x74, 0x3d, 0x30, 0xd0, 0xef, 0x81, 0x81, 0xbe, + 0x0e, 0x8d, 0xcc, 0xf5, 0xd0, 0xc8, 0xfc, 0x1c, 0x1a, 0x99, 0x0f, 0x8f, 0x5a, 0x5e, 0x7c, 0xde, + 0x3d, 0xb3, 0x1b, 0xa1, 0xef, 0xb0, 0xb6, 0x47, 0x1f, 0xfb, 0x6e, 0x4f, 0x31, 0x7d, 0x4c, 0x71, + 0xf1, 0xf7, 0x7e, 0xb6, 0xc4, 0xff, 0x3c, 0x9f, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x14, 0x89, + 0x9c, 0x2a, 0x11, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -459,8 +548,12 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { // MarketMap returns the full market map stored in the x/marketmap - // module. + // module. NOTE: the value returned by this query is not safe for on-chain + // code. MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) + // Market returns all stored in the x/marketmap + // module as a sorted list. + Markets(ctx context.Context, in *MarketsRequest, opts ...grpc.CallOption) (*MarketsResponse, error) // Market returns a market stored in the x/marketmap // module. Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) @@ -487,6 +580,15 @@ func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts return out, nil } +func (c *queryClient) Markets(ctx context.Context, in *MarketsRequest, opts ...grpc.CallOption) (*MarketsResponse, error) { + out := new(MarketsResponse) + err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Query/Markets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) { out := new(MarketResponse) err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Query/Market", in, out, opts...) @@ -517,8 +619,12 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp // QueryServer is the server API for Query service. type QueryServer interface { // MarketMap returns the full market map stored in the x/marketmap - // module. + // module. NOTE: the value returned by this query is not safe for on-chain + // code. MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) + // Market returns all stored in the x/marketmap + // module as a sorted list. + Markets(context.Context, *MarketsRequest) (*MarketsResponse, error) // Market returns a market stored in the x/marketmap // module. Market(context.Context, *MarketRequest) (*MarketResponse, error) @@ -535,6 +641,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) MarketMap(ctx context.Context, req *MarketMapRequest) (*MarketMapResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketMap not implemented") } +func (*UnimplementedQueryServer) Markets(ctx context.Context, req *MarketsRequest) (*MarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Markets not implemented") +} func (*UnimplementedQueryServer) Market(ctx context.Context, req *MarketRequest) (*MarketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") } @@ -567,6 +676,24 @@ func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_Markets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MarketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Markets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slinky.marketmap.v1.Query/Markets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Markets(ctx, req.(*MarketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Market_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MarketRequest) if err := dec(in); err != nil { @@ -629,6 +756,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "MarketMap", Handler: _Query_MarketMap_Handler, }, + { + MethodName: "Markets", + Handler: _Query_Markets_Handler, + }, { MethodName: "Market", Handler: _Query_Market_Handler, @@ -714,6 +845,66 @@ func (m *MarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MarketsRequest) 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 *MarketsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MarketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MarketsResponse) 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 *MarketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Markets) > 0 { + for iNdEx := len(m.Markets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Markets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *MarketRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -925,6 +1116,30 @@ func (m *MarketMapResponse) Size() (n int) { return n } +func (m *MarketsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MarketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Markets) > 0 { + for _, e := range m.Markets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *MarketRequest) Size() (n int) { if m == nil { return 0 @@ -1178,6 +1393,140 @@ func (m *MarketMapResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MarketsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MarketsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MarketsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MarketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Markets = append(m.Markets, Market{}) + if err := m.Markets[len(m.Markets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MarketRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/marketmap/types/query.pb.gw.go b/x/marketmap/types/query.pb.gw.go index 94675c023..a8dc74ede 100644 --- a/x/marketmap/types/query.pb.gw.go +++ b/x/marketmap/types/query.pb.gw.go @@ -51,6 +51,24 @@ func local_request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_Markets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MarketsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Markets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Markets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MarketsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Markets(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_Market_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -152,6 +170,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Markets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Markets_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Markets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Market_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -282,6 +323,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Markets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Markets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Markets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Market_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -348,6 +409,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_MarketMap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"slinky", "marketmap", "v1"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Markets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "marketmap", "v1", "markets"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Market_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "marketmap", "v1", "market"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LastUpdated_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "marketmap", "v1", "last_updated"}, "", runtime.AssumeColonVerbOpt(false))) @@ -358,6 +421,8 @@ var ( var ( forward_Query_MarketMap_0 = runtime.ForwardResponseMessage + forward_Query_Markets_0 = runtime.ForwardResponseMessage + forward_Query_Market_0 = runtime.ForwardResponseMessage forward_Query_LastUpdated_0 = runtime.ForwardResponseMessage From b31522e2c43611a0494fe73a21ea05820ef408cb Mon Sep 17 00:00:00 2001 From: Alex | Interchain Labs Date: Thu, 16 Jan 2025 15:45:14 -0500 Subject: [PATCH 3/3] feat: deterministic query oracle (#893) (backport (#894) --- api/slinky/oracle/v1/query.pulsar.go | 1670 +++++++++++++++++++++++-- api/slinky/oracle/v1/query_grpc.pb.go | 52 +- proto/slinky/oracle/v1/query.proto | 29 + tests/integration/slinky_setup.go | 76 +- x/marketmap/keeper/query.go | 2 + x/oracle/keeper/grpc_query.go | 13 + x/oracle/keeper/grpc_query_test.go | 40 + x/oracle/keeper/keeper.go | 18 + x/oracle/keeper/keeper_test.go | 87 ++ x/oracle/types/query.pb.go | 645 +++++++++- x/oracle/types/query.pb.gw.go | 65 + 11 files changed, 2572 insertions(+), 125 deletions(-) diff --git a/api/slinky/oracle/v1/query.pulsar.go b/api/slinky/oracle/v1/query.pulsar.go index 8749524e4..279a2493d 100644 --- a/api/slinky/oracle/v1/query.pulsar.go +++ b/api/slinky/oracle/v1/query.pulsar.go @@ -3878,6 +3878,1339 @@ func (x *fastReflection_GetCurrencyPairMappingResponse) ProtoMethods() *protoifa } } +var ( + md_GetCurrencyPairMappingListRequest protoreflect.MessageDescriptor +) + +func init() { + file_slinky_oracle_v1_query_proto_init() + md_GetCurrencyPairMappingListRequest = File_slinky_oracle_v1_query_proto.Messages().ByName("GetCurrencyPairMappingListRequest") +} + +var _ protoreflect.Message = (*fastReflection_GetCurrencyPairMappingListRequest)(nil) + +type fastReflection_GetCurrencyPairMappingListRequest GetCurrencyPairMappingListRequest + +func (x *GetCurrencyPairMappingListRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_GetCurrencyPairMappingListRequest)(x) +} + +func (x *GetCurrencyPairMappingListRequest) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_oracle_v1_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) +} + +var _fastReflection_GetCurrencyPairMappingListRequest_messageType fastReflection_GetCurrencyPairMappingListRequest_messageType +var _ protoreflect.MessageType = fastReflection_GetCurrencyPairMappingListRequest_messageType{} + +type fastReflection_GetCurrencyPairMappingListRequest_messageType struct{} + +func (x fastReflection_GetCurrencyPairMappingListRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_GetCurrencyPairMappingListRequest)(nil) +} +func (x fastReflection_GetCurrencyPairMappingListRequest_messageType) New() protoreflect.Message { + return new(fastReflection_GetCurrencyPairMappingListRequest) +} +func (x fastReflection_GetCurrencyPairMappingListRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GetCurrencyPairMappingListRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GetCurrencyPairMappingListRequest) Descriptor() protoreflect.MessageDescriptor { + return md_GetCurrencyPairMappingListRequest +} + +// 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_GetCurrencyPairMappingListRequest) Type() protoreflect.MessageType { + return _fastReflection_GetCurrencyPairMappingListRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GetCurrencyPairMappingListRequest) New() protoreflect.Message { + return new(fastReflection_GetCurrencyPairMappingListRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GetCurrencyPairMappingListRequest) Interface() protoreflect.ProtoMessage { + return (*GetCurrencyPairMappingListRequest)(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_GetCurrencyPairMappingListRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_GetCurrencyPairMappingListRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListRequest")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListRequest 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_GetCurrencyPairMappingListRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.oracle.v1.GetCurrencyPairMappingListRequest", 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_GetCurrencyPairMappingListRequest) 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_GetCurrencyPairMappingListRequest) 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_GetCurrencyPairMappingListRequest) 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_GetCurrencyPairMappingListRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GetCurrencyPairMappingListRequest) + 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.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().(*GetCurrencyPairMappingListRequest) + 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 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().(*GetCurrencyPairMappingListRequest) + 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: GetCurrencyPairMappingListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetCurrencyPairMappingListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_CurrencyPairMapping protoreflect.MessageDescriptor + fd_CurrencyPairMapping_id protoreflect.FieldDescriptor + fd_CurrencyPairMapping_currency_pair protoreflect.FieldDescriptor +) + +func init() { + file_slinky_oracle_v1_query_proto_init() + md_CurrencyPairMapping = File_slinky_oracle_v1_query_proto.Messages().ByName("CurrencyPairMapping") + fd_CurrencyPairMapping_id = md_CurrencyPairMapping.Fields().ByName("id") + fd_CurrencyPairMapping_currency_pair = md_CurrencyPairMapping.Fields().ByName("currency_pair") +} + +var _ protoreflect.Message = (*fastReflection_CurrencyPairMapping)(nil) + +type fastReflection_CurrencyPairMapping CurrencyPairMapping + +func (x *CurrencyPairMapping) ProtoReflect() protoreflect.Message { + return (*fastReflection_CurrencyPairMapping)(x) +} + +func (x *CurrencyPairMapping) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_oracle_v1_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) +} + +var _fastReflection_CurrencyPairMapping_messageType fastReflection_CurrencyPairMapping_messageType +var _ protoreflect.MessageType = fastReflection_CurrencyPairMapping_messageType{} + +type fastReflection_CurrencyPairMapping_messageType struct{} + +func (x fastReflection_CurrencyPairMapping_messageType) Zero() protoreflect.Message { + return (*fastReflection_CurrencyPairMapping)(nil) +} +func (x fastReflection_CurrencyPairMapping_messageType) New() protoreflect.Message { + return new(fastReflection_CurrencyPairMapping) +} +func (x fastReflection_CurrencyPairMapping_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_CurrencyPairMapping +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_CurrencyPairMapping) Descriptor() protoreflect.MessageDescriptor { + return md_CurrencyPairMapping +} + +// 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_CurrencyPairMapping) Type() protoreflect.MessageType { + return _fastReflection_CurrencyPairMapping_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_CurrencyPairMapping) New() protoreflect.Message { + return new(fastReflection_CurrencyPairMapping) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_CurrencyPairMapping) Interface() protoreflect.ProtoMessage { + return (*CurrencyPairMapping)(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_CurrencyPairMapping) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_CurrencyPairMapping_id, value) { + return + } + } + if x.CurrencyPair != nil { + value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + if !f(fd_CurrencyPairMapping_currency_pair, 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_CurrencyPairMapping) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.id": + return x.Id != uint64(0) + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + return x.CurrencyPair != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.id": + x.Id = uint64(0) + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + x.CurrencyPair = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + value := x.CurrencyPair + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.id": + x.Id = value.Uint() + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + if x.CurrencyPair == nil { + x.CurrencyPair = new(v1.CurrencyPair) + } + return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + case "slinky.oracle.v1.CurrencyPairMapping.id": + panic(fmt.Errorf("field id of message slinky.oracle.v1.CurrencyPairMapping is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.oracle.v1.CurrencyPairMapping.id": + return protoreflect.ValueOfUint64(uint64(0)) + case "slinky.oracle.v1.CurrencyPairMapping.currency_pair": + m := new(v1.CurrencyPair) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.CurrencyPairMapping")) + } + panic(fmt.Errorf("message slinky.oracle.v1.CurrencyPairMapping 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_CurrencyPairMapping) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.oracle.v1.CurrencyPairMapping", 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_CurrencyPairMapping) 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_CurrencyPairMapping) 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_CurrencyPairMapping) 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_CurrencyPairMapping) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*CurrencyPairMapping) + 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.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + if x.CurrencyPair != nil { + l = options.Size(x.CurrencyPair) + 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().(*CurrencyPairMapping) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.CurrencyPair != nil { + encoded, err := options.Marshal(x.CurrencyPair) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + 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().(*CurrencyPairMapping) + 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: CurrencyPairMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CurrencyPairMapping: 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 Id", wireType) + } + x.Id = 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.Id |= 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 CurrencyPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.CurrencyPair == nil { + x.CurrencyPair = &v1.CurrencyPair{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CurrencyPair); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_GetCurrencyPairMappingListResponse_1_list)(nil) + +type _GetCurrencyPairMappingListResponse_1_list struct { + list *[]*CurrencyPairMapping +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*CurrencyPairMapping) + (*x.list)[i] = concreteValue +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*CurrencyPairMapping) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) AppendMutable() protoreflect.Value { + v := new(CurrencyPairMapping) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) NewElement() protoreflect.Value { + v := new(CurrencyPairMapping) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GetCurrencyPairMappingListResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GetCurrencyPairMappingListResponse protoreflect.MessageDescriptor + fd_GetCurrencyPairMappingListResponse_mappings protoreflect.FieldDescriptor +) + +func init() { + file_slinky_oracle_v1_query_proto_init() + md_GetCurrencyPairMappingListResponse = File_slinky_oracle_v1_query_proto.Messages().ByName("GetCurrencyPairMappingListResponse") + fd_GetCurrencyPairMappingListResponse_mappings = md_GetCurrencyPairMappingListResponse.Fields().ByName("mappings") +} + +var _ protoreflect.Message = (*fastReflection_GetCurrencyPairMappingListResponse)(nil) + +type fastReflection_GetCurrencyPairMappingListResponse GetCurrencyPairMappingListResponse + +func (x *GetCurrencyPairMappingListResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_GetCurrencyPairMappingListResponse)(x) +} + +func (x *GetCurrencyPairMappingListResponse) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_oracle_v1_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) +} + +var _fastReflection_GetCurrencyPairMappingListResponse_messageType fastReflection_GetCurrencyPairMappingListResponse_messageType +var _ protoreflect.MessageType = fastReflection_GetCurrencyPairMappingListResponse_messageType{} + +type fastReflection_GetCurrencyPairMappingListResponse_messageType struct{} + +func (x fastReflection_GetCurrencyPairMappingListResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_GetCurrencyPairMappingListResponse)(nil) +} +func (x fastReflection_GetCurrencyPairMappingListResponse_messageType) New() protoreflect.Message { + return new(fastReflection_GetCurrencyPairMappingListResponse) +} +func (x fastReflection_GetCurrencyPairMappingListResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GetCurrencyPairMappingListResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GetCurrencyPairMappingListResponse) Descriptor() protoreflect.MessageDescriptor { + return md_GetCurrencyPairMappingListResponse +} + +// 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_GetCurrencyPairMappingListResponse) Type() protoreflect.MessageType { + return _fastReflection_GetCurrencyPairMappingListResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GetCurrencyPairMappingListResponse) New() protoreflect.Message { + return new(fastReflection_GetCurrencyPairMappingListResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GetCurrencyPairMappingListResponse) Interface() protoreflect.ProtoMessage { + return (*GetCurrencyPairMappingListResponse)(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_GetCurrencyPairMappingListResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Mappings) != 0 { + value := protoreflect.ValueOfList(&_GetCurrencyPairMappingListResponse_1_list{list: &x.Mappings}) + if !f(fd_GetCurrencyPairMappingListResponse_mappings, 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_GetCurrencyPairMappingListResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + return len(x.Mappings) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + x.Mappings = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + if len(x.Mappings) == 0 { + return protoreflect.ValueOfList(&_GetCurrencyPairMappingListResponse_1_list{}) + } + listValue := &_GetCurrencyPairMappingListResponse_1_list{list: &x.Mappings} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + lv := value.List() + clv := lv.(*_GetCurrencyPairMappingListResponse_1_list) + x.Mappings = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + if x.Mappings == nil { + x.Mappings = []*CurrencyPairMapping{} + } + value := &_GetCurrencyPairMappingListResponse_1_list{list: &x.Mappings} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings": + list := []*CurrencyPairMapping{} + return protoreflect.ValueOfList(&_GetCurrencyPairMappingListResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.oracle.v1.GetCurrencyPairMappingListResponse")) + } + panic(fmt.Errorf("message slinky.oracle.v1.GetCurrencyPairMappingListResponse 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_GetCurrencyPairMappingListResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.oracle.v1.GetCurrencyPairMappingListResponse", 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_GetCurrencyPairMappingListResponse) 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_GetCurrencyPairMappingListResponse) 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_GetCurrencyPairMappingListResponse) 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_GetCurrencyPairMappingListResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GetCurrencyPairMappingListResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Mappings) > 0 { + for _, e := range x.Mappings { + l = options.Size(e) + 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().(*GetCurrencyPairMappingListResponse) + 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.Mappings) > 0 { + for iNdEx := len(x.Mappings) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Mappings[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GetCurrencyPairMappingListResponse) + 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: GetCurrencyPairMappingListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetCurrencyPairMappingListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Mappings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Mappings = append(x.Mappings, &CurrencyPairMapping{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Mappings[len(x.Mappings)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -4199,6 +5532,116 @@ func (x *GetCurrencyPairMappingResponse) GetCurrencyPairMapping() map[uint64]*v1 return nil } +// GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. +type GetCurrencyPairMappingListRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetCurrencyPairMappingListRequest) Reset() { + *x = GetCurrencyPairMappingListRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_oracle_v1_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCurrencyPairMappingListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCurrencyPairMappingListRequest) ProtoMessage() {} + +// Deprecated: Use GetCurrencyPairMappingListRequest.ProtoReflect.Descriptor instead. +func (*GetCurrencyPairMappingListRequest) Descriptor() ([]byte, []int) { + return file_slinky_oracle_v1_query_proto_rawDescGZIP(), []int{8} +} + +type CurrencyPairMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // ID is the unique identifier for this currency pair string. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // CurrencyPair is the human-readable representation of the currency pair. + CurrencyPair *v1.CurrencyPair `protobuf:"bytes,2,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair,omitempty"` +} + +func (x *CurrencyPairMapping) Reset() { + *x = CurrencyPairMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_oracle_v1_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CurrencyPairMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CurrencyPairMapping) ProtoMessage() {} + +// Deprecated: Use CurrencyPairMapping.ProtoReflect.Descriptor instead. +func (*CurrencyPairMapping) Descriptor() ([]byte, []int) { + return file_slinky_oracle_v1_query_proto_rawDescGZIP(), []int{9} +} + +func (x *CurrencyPairMapping) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CurrencyPairMapping) GetCurrencyPair() *v1.CurrencyPair { + if x != nil { + return x.CurrencyPair + } + return nil +} + +// GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. +type GetCurrencyPairMappingListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // mappings is a list of the id representing the currency pair + // to the currency pair itself. + Mappings []*CurrencyPairMapping `protobuf:"bytes,1,rep,name=mappings,proto3" json:"mappings,omitempty"` +} + +func (x *GetCurrencyPairMappingListResponse) Reset() { + *x = GetCurrencyPairMappingListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_oracle_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCurrencyPairMappingListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCurrencyPairMappingListResponse) ProtoMessage() {} + +// Deprecated: Use GetCurrencyPairMappingListResponse.ProtoReflect.Descriptor instead. +func (*GetCurrencyPairMappingListResponse) Descriptor() ([]byte, []int) { + return file_slinky_oracle_v1_query_proto_rawDescGZIP(), []int{10} +} + +func (x *GetCurrencyPairMappingListResponse) GetMappings() []*CurrencyPairMapping { + if x != nil { + return x.Mappings + } + return nil +} + var File_slinky_oracle_v1_query_proto protoreflect.FileDescriptor var file_slinky_oracle_v1_query_proto_rawDesc = []byte{ @@ -4264,56 +5707,84 @@ var file_slinky_oracle_v1_query_proto_rawDesc = []byte{ 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0xce, 0x04, 0x0a, 0x05, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x9d, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x73, 0x6c, 0x69, - 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, - 0x6c, 0x6c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, - 0x21, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, - 0x72, 0x73, 0x12, 0x76, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x21, - 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x23, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x43, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6f, 0x0a, + 0x13, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, + 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, + 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x22, 0x6d, + 0x0a, 0x22, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, + 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x73, 0x32, 0x93, 0x06, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x9d, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, + 0x6c, 0x6c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, + 0x2c, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, + 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, + 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x76, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, + 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, + 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, + 0x7a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x73, + 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x09, 0x47, 0x65, - 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0xb0, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x43, 0x75, + 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x12, 0xb0, 0x01, 0x0a, 0x16, + 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, + 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, + 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x12, 0x2f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, - 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2d, 0x12, 0x2b, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0xc2, + 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, + 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x33, 0x2e, + 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x61, 0x69, 0x72, + 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, - 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x67, 0x65, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x69, - 0x72, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0xb0, 0x01, 0x0a, 0x14, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, - 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, - 0x4f, 0x58, 0xaa, 0x02, 0x10, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4f, 0x72, 0x61, 0x63, - 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4f, - 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x53, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x50, 0x61, 0x69, 0x72, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, + 0x12, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, + 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x42, 0xb0, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, + 0x6b, 0x79, 0x2e, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6c, 0x69, + 0x6e, 0x6b, 0x79, 0x2f, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x72, + 0x61, 0x63, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4f, 0x58, 0xaa, 0x02, 0x10, 0x53, + 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x10, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x12, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4f, 0x72, 0x61, 0x63, + 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4328,40 +5799,47 @@ func file_slinky_oracle_v1_query_proto_rawDescGZIP() []byte { return file_slinky_oracle_v1_query_proto_rawDescData } -var file_slinky_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_slinky_oracle_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_slinky_oracle_v1_query_proto_goTypes = []interface{}{ - (*GetAllCurrencyPairsRequest)(nil), // 0: slinky.oracle.v1.GetAllCurrencyPairsRequest - (*GetAllCurrencyPairsResponse)(nil), // 1: slinky.oracle.v1.GetAllCurrencyPairsResponse - (*GetPriceRequest)(nil), // 2: slinky.oracle.v1.GetPriceRequest - (*GetPriceResponse)(nil), // 3: slinky.oracle.v1.GetPriceResponse - (*GetPricesRequest)(nil), // 4: slinky.oracle.v1.GetPricesRequest - (*GetPricesResponse)(nil), // 5: slinky.oracle.v1.GetPricesResponse - (*GetCurrencyPairMappingRequest)(nil), // 6: slinky.oracle.v1.GetCurrencyPairMappingRequest - (*GetCurrencyPairMappingResponse)(nil), // 7: slinky.oracle.v1.GetCurrencyPairMappingResponse - nil, // 8: slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry - (*v1.CurrencyPair)(nil), // 9: slinky.types.v1.CurrencyPair - (*QuotePrice)(nil), // 10: slinky.oracle.v1.QuotePrice + (*GetAllCurrencyPairsRequest)(nil), // 0: slinky.oracle.v1.GetAllCurrencyPairsRequest + (*GetAllCurrencyPairsResponse)(nil), // 1: slinky.oracle.v1.GetAllCurrencyPairsResponse + (*GetPriceRequest)(nil), // 2: slinky.oracle.v1.GetPriceRequest + (*GetPriceResponse)(nil), // 3: slinky.oracle.v1.GetPriceResponse + (*GetPricesRequest)(nil), // 4: slinky.oracle.v1.GetPricesRequest + (*GetPricesResponse)(nil), // 5: slinky.oracle.v1.GetPricesResponse + (*GetCurrencyPairMappingRequest)(nil), // 6: slinky.oracle.v1.GetCurrencyPairMappingRequest + (*GetCurrencyPairMappingResponse)(nil), // 7: slinky.oracle.v1.GetCurrencyPairMappingResponse + (*GetCurrencyPairMappingListRequest)(nil), // 8: slinky.oracle.v1.GetCurrencyPairMappingListRequest + (*CurrencyPairMapping)(nil), // 9: slinky.oracle.v1.CurrencyPairMapping + (*GetCurrencyPairMappingListResponse)(nil), // 10: slinky.oracle.v1.GetCurrencyPairMappingListResponse + nil, // 11: slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry + (*v1.CurrencyPair)(nil), // 12: slinky.types.v1.CurrencyPair + (*QuotePrice)(nil), // 13: slinky.oracle.v1.QuotePrice } var file_slinky_oracle_v1_query_proto_depIdxs = []int32{ - 9, // 0: slinky.oracle.v1.GetAllCurrencyPairsResponse.currency_pairs:type_name -> slinky.types.v1.CurrencyPair - 9, // 1: slinky.oracle.v1.GetPriceRequest.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 10, // 2: slinky.oracle.v1.GetPriceResponse.price:type_name -> slinky.oracle.v1.QuotePrice + 12, // 0: slinky.oracle.v1.GetAllCurrencyPairsResponse.currency_pairs:type_name -> slinky.types.v1.CurrencyPair + 12, // 1: slinky.oracle.v1.GetPriceRequest.currency_pair:type_name -> slinky.types.v1.CurrencyPair + 13, // 2: slinky.oracle.v1.GetPriceResponse.price:type_name -> slinky.oracle.v1.QuotePrice 3, // 3: slinky.oracle.v1.GetPricesResponse.prices:type_name -> slinky.oracle.v1.GetPriceResponse - 8, // 4: slinky.oracle.v1.GetCurrencyPairMappingResponse.currency_pair_mapping:type_name -> slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry - 9, // 5: slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry.value:type_name -> slinky.types.v1.CurrencyPair - 0, // 6: slinky.oracle.v1.Query.GetAllCurrencyPairs:input_type -> slinky.oracle.v1.GetAllCurrencyPairsRequest - 2, // 7: slinky.oracle.v1.Query.GetPrice:input_type -> slinky.oracle.v1.GetPriceRequest - 4, // 8: slinky.oracle.v1.Query.GetPrices:input_type -> slinky.oracle.v1.GetPricesRequest - 6, // 9: slinky.oracle.v1.Query.GetCurrencyPairMapping:input_type -> slinky.oracle.v1.GetCurrencyPairMappingRequest - 1, // 10: slinky.oracle.v1.Query.GetAllCurrencyPairs:output_type -> slinky.oracle.v1.GetAllCurrencyPairsResponse - 3, // 11: slinky.oracle.v1.Query.GetPrice:output_type -> slinky.oracle.v1.GetPriceResponse - 5, // 12: slinky.oracle.v1.Query.GetPrices:output_type -> slinky.oracle.v1.GetPricesResponse - 7, // 13: slinky.oracle.v1.Query.GetCurrencyPairMapping:output_type -> slinky.oracle.v1.GetCurrencyPairMappingResponse - 10, // [10:14] is the sub-list for method output_type - 6, // [6:10] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 11, // 4: slinky.oracle.v1.GetCurrencyPairMappingResponse.currency_pair_mapping:type_name -> slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry + 12, // 5: slinky.oracle.v1.CurrencyPairMapping.currency_pair:type_name -> slinky.types.v1.CurrencyPair + 9, // 6: slinky.oracle.v1.GetCurrencyPairMappingListResponse.mappings:type_name -> slinky.oracle.v1.CurrencyPairMapping + 12, // 7: slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry.value:type_name -> slinky.types.v1.CurrencyPair + 0, // 8: slinky.oracle.v1.Query.GetAllCurrencyPairs:input_type -> slinky.oracle.v1.GetAllCurrencyPairsRequest + 2, // 9: slinky.oracle.v1.Query.GetPrice:input_type -> slinky.oracle.v1.GetPriceRequest + 4, // 10: slinky.oracle.v1.Query.GetPrices:input_type -> slinky.oracle.v1.GetPricesRequest + 6, // 11: slinky.oracle.v1.Query.GetCurrencyPairMapping:input_type -> slinky.oracle.v1.GetCurrencyPairMappingRequest + 8, // 12: slinky.oracle.v1.Query.GetCurrencyPairMappingList:input_type -> slinky.oracle.v1.GetCurrencyPairMappingListRequest + 1, // 13: slinky.oracle.v1.Query.GetAllCurrencyPairs:output_type -> slinky.oracle.v1.GetAllCurrencyPairsResponse + 3, // 14: slinky.oracle.v1.Query.GetPrice:output_type -> slinky.oracle.v1.GetPriceResponse + 5, // 15: slinky.oracle.v1.Query.GetPrices:output_type -> slinky.oracle.v1.GetPricesResponse + 7, // 16: slinky.oracle.v1.Query.GetCurrencyPairMapping:output_type -> slinky.oracle.v1.GetCurrencyPairMappingResponse + 10, // 17: slinky.oracle.v1.Query.GetCurrencyPairMappingList:output_type -> slinky.oracle.v1.GetCurrencyPairMappingListResponse + 13, // [13:18] is the sub-list for method output_type + 8, // [8:13] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_slinky_oracle_v1_query_proto_init() } @@ -4467,6 +5945,42 @@ func file_slinky_oracle_v1_query_proto_init() { return nil } } + file_slinky_oracle_v1_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCurrencyPairMappingListRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_oracle_v1_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CurrencyPairMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_oracle_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCurrencyPairMappingListResponse); 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{ @@ -4474,7 +5988,7 @@ func file_slinky_oracle_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_slinky_oracle_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/api/slinky/oracle/v1/query_grpc.pb.go b/api/slinky/oracle/v1/query_grpc.pb.go index 8c84ec260..fb4ec25f3 100644 --- a/api/slinky/oracle/v1/query_grpc.pb.go +++ b/api/slinky/oracle/v1/query_grpc.pb.go @@ -19,10 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Query_GetAllCurrencyPairs_FullMethodName = "/slinky.oracle.v1.Query/GetAllCurrencyPairs" - Query_GetPrice_FullMethodName = "/slinky.oracle.v1.Query/GetPrice" - Query_GetPrices_FullMethodName = "/slinky.oracle.v1.Query/GetPrices" - Query_GetCurrencyPairMapping_FullMethodName = "/slinky.oracle.v1.Query/GetCurrencyPairMapping" + Query_GetAllCurrencyPairs_FullMethodName = "/slinky.oracle.v1.Query/GetAllCurrencyPairs" + Query_GetPrice_FullMethodName = "/slinky.oracle.v1.Query/GetPrice" + Query_GetPrices_FullMethodName = "/slinky.oracle.v1.Query/GetPrices" + Query_GetCurrencyPairMapping_FullMethodName = "/slinky.oracle.v1.Query/GetCurrencyPairMapping" + Query_GetCurrencyPairMappingList_FullMethodName = "/slinky.oracle.v1.Query/GetCurrencyPairMappingList" ) // QueryClient is the client API for Query service. @@ -41,6 +42,10 @@ type QueryClient interface { // indexers that have access to the ID of a currency pair, but no way to get // the underlying currency pair from it. GetCurrencyPairMapping(ctx context.Context, in *GetCurrencyPairMappingRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingResponse, error) + // Get the mapping of currency pair ID <-> currency pair as a list. This is + // useful for indexers that have access to the ID of a currency pair, but no + // way to get the underlying currency pair from it. + GetCurrencyPairMappingList(ctx context.Context, in *GetCurrencyPairMappingListRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingListResponse, error) } type queryClient struct { @@ -91,6 +96,16 @@ func (c *queryClient) GetCurrencyPairMapping(ctx context.Context, in *GetCurrenc return out, nil } +func (c *queryClient) GetCurrencyPairMappingList(ctx context.Context, in *GetCurrencyPairMappingListRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetCurrencyPairMappingListResponse) + err := c.cc.Invoke(ctx, Query_GetCurrencyPairMappingList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility. @@ -107,6 +122,10 @@ type QueryServer interface { // indexers that have access to the ID of a currency pair, but no way to get // the underlying currency pair from it. GetCurrencyPairMapping(context.Context, *GetCurrencyPairMappingRequest) (*GetCurrencyPairMappingResponse, error) + // Get the mapping of currency pair ID <-> currency pair as a list. This is + // useful for indexers that have access to the ID of a currency pair, but no + // way to get the underlying currency pair from it. + GetCurrencyPairMappingList(context.Context, *GetCurrencyPairMappingListRequest) (*GetCurrencyPairMappingListResponse, error) mustEmbedUnimplementedQueryServer() } @@ -129,6 +148,9 @@ func (UnimplementedQueryServer) GetPrices(context.Context, *GetPricesRequest) (* func (UnimplementedQueryServer) GetCurrencyPairMapping(context.Context, *GetCurrencyPairMappingRequest) (*GetCurrencyPairMappingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCurrencyPairMapping not implemented") } +func (UnimplementedQueryServer) GetCurrencyPairMappingList(context.Context, *GetCurrencyPairMappingListRequest) (*GetCurrencyPairMappingListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCurrencyPairMappingList not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) testEmbeddedByValue() {} @@ -222,6 +244,24 @@ func _Query_GetCurrencyPairMapping_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_GetCurrencyPairMappingList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCurrencyPairMappingListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetCurrencyPairMappingList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_GetCurrencyPairMappingList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetCurrencyPairMappingList(ctx, req.(*GetCurrencyPairMappingListRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -245,6 +285,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCurrencyPairMapping", Handler: _Query_GetCurrencyPairMapping_Handler, }, + { + MethodName: "GetCurrencyPairMappingList", + Handler: _Query_GetCurrencyPairMappingList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "slinky/oracle/v1/query.proto", diff --git a/proto/slinky/oracle/v1/query.proto b/proto/slinky/oracle/v1/query.proto index 7e1b1599c..af649998b 100644 --- a/proto/slinky/oracle/v1/query.proto +++ b/proto/slinky/oracle/v1/query.proto @@ -33,6 +33,17 @@ service Query { option (google.api.http).get = "/slinky/oracle/v1/get_currency_pair_mapping"; } + + // Get the mapping of currency pair ID <-> currency pair as a list. This is + // useful for indexers that have access to the ID of a currency pair, but no + // way to get the underlying currency pair from it. + rpc GetCurrencyPairMappingList(GetCurrencyPairMappingListRequest) + returns (GetCurrencyPairMappingListResponse) { + option (google.api.http) = { + get : "/connect/oracle/v2/get_currency_pair_mapping_list" + additional_bindings : [] + }; + } } message GetAllCurrencyPairsRequest {} @@ -88,3 +99,21 @@ message GetCurrencyPairMappingResponse { map currency_pair_mapping = 1 [ (gogoproto.nullable) = false ]; } + +// GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. +message GetCurrencyPairMappingListRequest {} + +message CurrencyPairMapping { + // ID is the unique identifier for this currency pair string. + uint64 id = 1; + // CurrencyPair is the human-readable representation of the currency pair. + slinky.types.v1.CurrencyPair currency_pair = 2 + [ (gogoproto.nullable) = false ]; +} + +// GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. +message GetCurrencyPairMappingListResponse { + // mappings is a list of the id representing the currency pair + // to the currency pair itself. + repeated CurrencyPairMapping mappings = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/tests/integration/slinky_setup.go b/tests/integration/slinky_setup.go index 267156920..b7fc29994 100644 --- a/tests/integration/slinky_setup.go +++ b/tests/integration/slinky_setup.go @@ -269,7 +269,81 @@ func QueryCurrencyPairs(chain *cosmos.CosmosChain) (*oracletypes.GetAllCurrencyP client := oracletypes.NewQueryClient(cc) // query the currency pairs - return client.GetAllCurrencyPairs(context.Background(), &oracletypes.GetAllCurrencyPairsRequest{}) + resp, err := client.GetAllCurrencyPairs(context.Background(), &oracletypes.GetAllCurrencyPairsRequest{}) + + // check that there is a correspondence between mappings and the raw response + mappingResp, err := QueryCurrencyPairMappings(chain) + if err != nil { + return nil, err + } + + if len(resp.CurrencyPairs) != len(mappingResp.CurrencyPairMapping) { + return nil, fmt.Errorf("list and map responses should be the same length: got %d list, %d map", + len(resp.CurrencyPairs), + len(mappingResp.CurrencyPairMapping), + ) + } + for _, v := range mappingResp.CurrencyPairMapping { + found := false + for _, cp := range resp.CurrencyPairs { + if v.Equal(cp) { + found = true + } + } + + if !found { + return nil, fmt.Errorf("currency pair %v was found in mapping response but not in currency pair list", v) + } + } + + return resp, err +} + +// QueryCurrencyPairMappings queries the chain for the given currency pair mappings +func QueryCurrencyPairMappings(chain *cosmos.CosmosChain) (*oracletypes.GetCurrencyPairMappingResponse, error) { + // get grpc address + grpcAddr := chain.GetHostGRPCAddress() + + // create the client + cc, err := grpc.Dial(grpcAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + return nil, err + } + defer cc.Close() + + // create the oracle client + client := oracletypes.NewQueryClient(cc) + + // query the currency pairs map + mapRes, err := client.GetCurrencyPairMapping(context.Background(), &oracletypes.GetCurrencyPairMappingRequest{}) + if err != nil { + return nil, err + } + + // query the currency pairs list + listRes, err := client.GetCurrencyPairMappingList(context.Background(), &oracletypes.GetCurrencyPairMappingListRequest{}) + if err != nil { + return nil, err + } + + if len(listRes.Mappings) != len(mapRes.CurrencyPairMapping) { + return nil, fmt.Errorf("map and list responses should be the same length: got %d list, %d map", + len(listRes.Mappings), + len(mapRes.CurrencyPairMapping), + ) + } + for _, m := range listRes.Mappings { + cp, found := mapRes.CurrencyPairMapping[m.Id] + if !found { + return nil, fmt.Errorf("mapping for %d not found", m.Id) + } + + if !m.CurrencyPair.Equal(cp) { + return nil, fmt.Errorf("market %s is not equal to %s", m.CurrencyPair.String(), cp.String()) + } + } + + return mapRes, nil } // QueryCurrencyPair queries the price for the given currency-pair given a desired height to query from diff --git a/x/marketmap/keeper/query.go b/x/marketmap/keeper/query.go index f6654c1a8..e24acd158 100644 --- a/x/marketmap/keeper/query.go +++ b/x/marketmap/keeper/query.go @@ -19,6 +19,8 @@ func NewQueryServer(k *Keeper) types.QueryServer { } // MarketMap returns the full MarketMap and associated information stored in the x/marketmap module. +// +// NOTE: the map type returned by this query is NOT SAFE. Use Markets instead for a safe value. func (q queryServerImpl) MarketMap(goCtx context.Context, req *types.MarketMapRequest) (*types.MarketMapResponse, error) { if req == nil { return nil, fmt.Errorf("request cannot be nil") diff --git a/x/oracle/keeper/grpc_query.go b/x/oracle/keeper/grpc_query.go index 9db062359..fcca10345 100644 --- a/x/oracle/keeper/grpc_query.go +++ b/x/oracle/keeper/grpc_query.go @@ -124,6 +124,9 @@ func (q queryServer) GetPrices(goCtx context.Context, req *types.GetPricesReques }, nil } +// GetCurrencyPairMapping returns a map of ID -> CurrencyPair. +// +// NOTE: the map type returned by this query is NOT SAFE. Use GetCurrencyPairMappingList instead for a safe value. func (q queryServer) GetCurrencyPairMapping(ctx context.Context, _ *types.GetCurrencyPairMappingRequest) (*types.GetCurrencyPairMappingResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) pairs, err := q.k.GetCurrencyPairMapping(sdkCtx) @@ -132,3 +135,13 @@ func (q queryServer) GetCurrencyPairMapping(ctx context.Context, _ *types.GetCur } return &types.GetCurrencyPairMappingResponse{CurrencyPairMapping: pairs}, nil } + +func (q queryServer) GetCurrencyPairMappingList(ctx context.Context, _ *types.GetCurrencyPairMappingListRequest) (*types.GetCurrencyPairMappingListResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + pairs, err := q.k.GetCurrencyPairMappingList(sdkCtx) + if err != nil { + return nil, err + } + + return &types.GetCurrencyPairMappingListResponse{Mappings: pairs}, nil +} diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index 9065326e3..6f094debf 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -233,3 +233,43 @@ func (s *KeeperTestSuite) TestGetCurrencyPairMappingGRPC() { } }) } + +func (s *KeeperTestSuite) TestGetCurrencyPairMappingListGRPC() { + cp1 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN1"} + cp2 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN2"} + cp3 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN3"} + + qs := keeper.NewQueryServer(s.oracleKeeper) + // test that after CurrencyPairs are registered, all of them are returned from the query + s.Run("after CurrencyPairs are registered, all of them are returned from the query", func() { + currencyPairs := []slinkytypes.CurrencyPair{ + cp1, + cp2, + cp3, + } + for _, cp := range currencyPairs { + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp)) + } + + // manually insert a new CurrencyPair as well + s.Require().NoError(s.oracleKeeper.SetPriceForCurrencyPair(s.ctx, cp1, types.QuotePrice{Price: sdkmath.NewInt(100)})) + + // query for pairs + res, err := qs.GetCurrencyPairMappingList(s.ctx, nil) + s.Require().Nil(err) + s.Require().Equal([]types.CurrencyPairMapping{ + { + Id: 0, + CurrencyPair: cp1, + }, + { + Id: 1, + CurrencyPair: cp2, + }, + { + Id: 2, + CurrencyPair: cp3, + }, + }, res.Mappings) + }) +} diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index b840572eb..89794dc76 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -287,6 +287,7 @@ func (k *Keeper) GetAllCurrencyPairs(ctx sdk.Context) []slinkytypes.CurrencyPair } // GetCurrencyPairMapping returns a CurrencyPair mapping by ID that have currently been stored to state. +// NOTE: this map[] type should not be used by on-chain code. func (k *Keeper) GetCurrencyPairMapping(ctx sdk.Context) (map[uint64]slinkytypes.CurrencyPair, error) { numPairs, err := k.numCPs.Get(ctx) if err != nil { @@ -301,6 +302,23 @@ func (k *Keeper) GetCurrencyPairMapping(ctx sdk.Context) (map[uint64]slinkytypes return pairs, nil } +// GetCurrencyPairMappingList returns a CurrencyPair mapping by ID that have currently been stored to state as a list. +func (k *Keeper) GetCurrencyPairMappingList(ctx sdk.Context) ([]types.CurrencyPairMapping, error) { + pairs := make([]types.CurrencyPairMapping, 0) + // aggregate CurrencyPairs stored under KeyPrefixNonce + err := k.IterateCurrencyPairs(ctx, func(cp slinkytypes.CurrencyPair, cps types.CurrencyPairState) { + pairs = append(pairs, types.CurrencyPairMapping{ + Id: cps.GetId(), + CurrencyPair: cp, + }) + }) + if err != nil { + return nil, err + } + + return pairs, nil +} + // IterateCurrencyPairs iterates over all CurrencyPairs in the store, and executes a callback for each CurrencyPair. func (k *Keeper) IterateCurrencyPairs(ctx sdk.Context, cb func(cp slinkytypes.CurrencyPair, cps types.CurrencyPairState)) error { it, err := k.currencyPairs.Iterate(ctx, nil) diff --git a/x/oracle/keeper/keeper_test.go b/x/oracle/keeper/keeper_test.go index fe6f77a63..4a64ff87f 100644 --- a/x/oracle/keeper/keeper_test.go +++ b/x/oracle/keeper/keeper_test.go @@ -364,3 +364,90 @@ func (s *KeeperTestSuite) TestGetNumCurrencyPairs() { s.Require().Equal(cps, uint64(2)) }) } + +func (s *KeeperTestSuite) TestGetCurrencyPairMapping() { + cp1 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN1"} + cp2 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN2"} + + s.Run("get 0 with no state", func() { + s.SetupTest() + + mapping, err := s.oracleKeeper.GetCurrencyPairMapping(s.ctx) + s.Require().NoError(err) + s.Require().Empty(mapping) + }) + + s.Run("get 1 with 1 cp", func() { + s.SetupTest() + + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp1)) + + mapping, err := s.oracleKeeper.GetCurrencyPairMapping(s.ctx) + s.Require().NoError(err) + s.Require().Equal(map[uint64]slinkytypes.CurrencyPair{ + 0: cp1, + }, mapping) + }) + + s.Run("get 2 with 2 cp", func() { + s.SetupTest() + + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp1)) + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp2)) + + mapping, err := s.oracleKeeper.GetCurrencyPairMapping(s.ctx) + s.Require().NoError(err) + s.Require().Equal(map[uint64]slinkytypes.CurrencyPair{ + 0: cp1, + 1: cp2, + }, mapping) + }) +} + +func (s *KeeperTestSuite) TestGetCurrencyPairMappingList() { + cp1 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN1"} + cp2 := slinkytypes.CurrencyPair{Base: "TEST", Quote: "COIN2"} + + s.Run("get 0 with no state", func() { + s.SetupTest() + + mapping, err := s.oracleKeeper.GetCurrencyPairMappingList(s.ctx) + s.Require().NoError(err) + s.Require().Empty(mapping) + }) + + s.Run("get 1 with 1 cp", func() { + s.SetupTest() + + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp1)) + + mapping, err := s.oracleKeeper.GetCurrencyPairMappingList(s.ctx) + s.Require().NoError(err) + s.Require().Equal([]types.CurrencyPairMapping{ + { + Id: 0, + CurrencyPair: cp1, + }, + }, mapping) + }) + + s.Run("get 2 with 2 cp", func() { + s.SetupTest() + + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp1)) + s.Require().NoError(s.oracleKeeper.CreateCurrencyPair(s.ctx, cp2)) + + mapping, err := s.oracleKeeper.GetCurrencyPairMappingList(s.ctx) + s.Require().NoError(err) + s.Require().Equal([]types.CurrencyPairMapping{ + { + Id: 0, + CurrencyPair: cp1, + }, + { + Id: 1, + CurrencyPair: cp2, + }, + }, mapping) + }) +} diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index 38accc7b2..e7f4c4e8e 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -412,6 +412,144 @@ func (m *GetCurrencyPairMappingResponse) GetCurrencyPairMapping() map[uint64]typ return nil } +// GetCurrencyPairMappingRequest is the GetCurrencyPairMapping request type. +type GetCurrencyPairMappingListRequest struct { +} + +func (m *GetCurrencyPairMappingListRequest) Reset() { *m = GetCurrencyPairMappingListRequest{} } +func (m *GetCurrencyPairMappingListRequest) String() string { return proto.CompactTextString(m) } +func (*GetCurrencyPairMappingListRequest) ProtoMessage() {} +func (*GetCurrencyPairMappingListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ba8e832073f3a7b0, []int{8} +} +func (m *GetCurrencyPairMappingListRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCurrencyPairMappingListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCurrencyPairMappingListRequest.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 *GetCurrencyPairMappingListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCurrencyPairMappingListRequest.Merge(m, src) +} +func (m *GetCurrencyPairMappingListRequest) XXX_Size() int { + return m.Size() +} +func (m *GetCurrencyPairMappingListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCurrencyPairMappingListRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCurrencyPairMappingListRequest proto.InternalMessageInfo + +type CurrencyPairMapping struct { + // ID is the unique identifier for this currency pair string. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // CurrencyPair is the human-readable representation of the currency pair. + CurrencyPair types.CurrencyPair `protobuf:"bytes,2,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` +} + +func (m *CurrencyPairMapping) Reset() { *m = CurrencyPairMapping{} } +func (m *CurrencyPairMapping) String() string { return proto.CompactTextString(m) } +func (*CurrencyPairMapping) ProtoMessage() {} +func (*CurrencyPairMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_ba8e832073f3a7b0, []int{9} +} +func (m *CurrencyPairMapping) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CurrencyPairMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CurrencyPairMapping.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 *CurrencyPairMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_CurrencyPairMapping.Merge(m, src) +} +func (m *CurrencyPairMapping) XXX_Size() int { + return m.Size() +} +func (m *CurrencyPairMapping) XXX_DiscardUnknown() { + xxx_messageInfo_CurrencyPairMapping.DiscardUnknown(m) +} + +var xxx_messageInfo_CurrencyPairMapping proto.InternalMessageInfo + +func (m *CurrencyPairMapping) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *CurrencyPairMapping) GetCurrencyPair() types.CurrencyPair { + if m != nil { + return m.CurrencyPair + } + return types.CurrencyPair{} +} + +// GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response type. +type GetCurrencyPairMappingListResponse struct { + // mappings is a list of the id representing the currency pair + // to the currency pair itself. + Mappings []CurrencyPairMapping `protobuf:"bytes,1,rep,name=mappings,proto3" json:"mappings"` +} + +func (m *GetCurrencyPairMappingListResponse) Reset() { *m = GetCurrencyPairMappingListResponse{} } +func (m *GetCurrencyPairMappingListResponse) String() string { return proto.CompactTextString(m) } +func (*GetCurrencyPairMappingListResponse) ProtoMessage() {} +func (*GetCurrencyPairMappingListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ba8e832073f3a7b0, []int{10} +} +func (m *GetCurrencyPairMappingListResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCurrencyPairMappingListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCurrencyPairMappingListResponse.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 *GetCurrencyPairMappingListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCurrencyPairMappingListResponse.Merge(m, src) +} +func (m *GetCurrencyPairMappingListResponse) XXX_Size() int { + return m.Size() +} +func (m *GetCurrencyPairMappingListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetCurrencyPairMappingListResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCurrencyPairMappingListResponse proto.InternalMessageInfo + +func (m *GetCurrencyPairMappingListResponse) GetMappings() []CurrencyPairMapping { + if m != nil { + return m.Mappings + } + return nil +} + func init() { proto.RegisterType((*GetAllCurrencyPairsRequest)(nil), "slinky.oracle.v1.GetAllCurrencyPairsRequest") proto.RegisterType((*GetAllCurrencyPairsResponse)(nil), "slinky.oracle.v1.GetAllCurrencyPairsResponse") @@ -422,53 +560,62 @@ func init() { proto.RegisterType((*GetCurrencyPairMappingRequest)(nil), "slinky.oracle.v1.GetCurrencyPairMappingRequest") proto.RegisterType((*GetCurrencyPairMappingResponse)(nil), "slinky.oracle.v1.GetCurrencyPairMappingResponse") proto.RegisterMapType((map[uint64]types.CurrencyPair)(nil), "slinky.oracle.v1.GetCurrencyPairMappingResponse.CurrencyPairMappingEntry") + proto.RegisterType((*GetCurrencyPairMappingListRequest)(nil), "slinky.oracle.v1.GetCurrencyPairMappingListRequest") + proto.RegisterType((*CurrencyPairMapping)(nil), "slinky.oracle.v1.CurrencyPairMapping") + proto.RegisterType((*GetCurrencyPairMappingListResponse)(nil), "slinky.oracle.v1.GetCurrencyPairMappingListResponse") } func init() { proto.RegisterFile("slinky/oracle/v1/query.proto", fileDescriptor_ba8e832073f3a7b0) } var fileDescriptor_ba8e832073f3a7b0 = []byte{ - // 651 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x4f, 0xd4, 0x40, - 0x14, 0xde, 0x59, 0x76, 0x09, 0x3c, 0xe5, 0xd7, 0x80, 0x66, 0xb3, 0x2c, 0x05, 0xba, 0x1e, 0x40, - 0xa5, 0x15, 0xb8, 0x10, 0x0f, 0x46, 0x21, 0x06, 0x31, 0x31, 0x81, 0x26, 0x5e, 0xf4, 0xb0, 0x29, - 0xdd, 0x49, 0x9d, 0x6c, 0xb7, 0x53, 0x3a, 0xb3, 0x1b, 0xeb, 0x51, 0xcf, 0x1a, 0x13, 0xcf, 0xfe, - 0x0f, 0xfe, 0x19, 0x9c, 0x0c, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x7f, 0x88, 0xd9, 0x99, 0x29, 0x74, - 0xa1, 0xac, 0xeb, 0xad, 0xed, 0xf7, 0xde, 0xf7, 0xbe, 0xf7, 0xde, 0xf7, 0x0a, 0x35, 0x1e, 0xd0, - 0xb0, 0x95, 0xd8, 0x2c, 0x76, 0xbd, 0x80, 0xd8, 0xdd, 0x75, 0xfb, 0xa8, 0x43, 0xe2, 0xc4, 0x8a, - 0x62, 0x26, 0x18, 0x9e, 0x56, 0xa8, 0xa5, 0x50, 0xab, 0xbb, 0x5e, 0x9d, 0xf3, 0x99, 0xcf, 0x24, - 0x68, 0xf7, 0x9e, 0x54, 0x5c, 0xb5, 0xe6, 0x33, 0xe6, 0x07, 0xc4, 0x76, 0x23, 0x6a, 0xbb, 0x61, - 0xc8, 0x84, 0x2b, 0x28, 0x0b, 0xb9, 0x46, 0x8d, 0x2b, 0x35, 0x7c, 0x12, 0x12, 0x4e, 0x53, 0xbc, - 0xae, 0x71, 0x91, 0x44, 0x84, 0xf7, 0x60, 0xaf, 0x13, 0xc7, 0x24, 0xf4, 0x92, 0x46, 0xe4, 0xd2, - 0x58, 0x05, 0x99, 0x35, 0xa8, 0xee, 0x12, 0xf1, 0x24, 0x08, 0x76, 0x34, 0xb8, 0xef, 0xd2, 0x98, - 0x3b, 0xe4, 0xa8, 0x43, 0xb8, 0x30, 0x29, 0xcc, 0xe7, 0xa2, 0x3c, 0x62, 0x21, 0x27, 0xf8, 0x39, - 0x4c, 0xf6, 0x71, 0xf2, 0x0a, 0x5a, 0x1a, 0x59, 0xb9, 0xb1, 0xb1, 0x60, 0xe9, 0x06, 0x65, 0x69, - 0xab, 0xbb, 0x6e, 0x65, 0xf3, 0xb7, 0x4b, 0xc7, 0xbf, 0x16, 0x0b, 0xce, 0x84, 0x97, 0xe5, 0x34, - 0x5f, 0xc3, 0xd4, 0x2e, 0x11, 0xfb, 0x31, 0xf5, 0x88, 0xae, 0x8e, 0x9f, 0xc1, 0x44, 0x1f, 0x7d, - 0x05, 0x2d, 0xa1, 0x61, 0xd9, 0x6f, 0x66, 0xd9, 0xcd, 0x4f, 0x08, 0xa6, 0x2f, 0xd8, 0xb5, 0xfa, - 0x2d, 0x28, 0x47, 0xbd, 0x0f, 0x9a, 0xb6, 0x66, 0x5d, 0xde, 0x8a, 0x75, 0xd0, 0x61, 0x82, 0xc8, - 0x24, 0xc9, 0x8a, 0x1c, 0x95, 0x80, 0xe7, 0xa0, 0x1c, 0xb2, 0xd0, 0x23, 0x95, 0xe2, 0x12, 0x5a, - 0x29, 0x39, 0xea, 0x05, 0x57, 0x61, 0xac, 0x49, 0x3c, 0xda, 0x76, 0x03, 0x5e, 0x19, 0x91, 0xc0, - 0xf9, 0x3b, 0x9e, 0x84, 0x22, 0x6d, 0x56, 0x4a, 0xf2, 0x6b, 0x91, 0x36, 0xcd, 0x47, 0x17, 0x7a, - 0xd2, 0x61, 0xe3, 0xbb, 0x30, 0xd3, 0xd7, 0x6e, 0x83, 0x36, 0xd5, 0x40, 0xc7, 0x9d, 0xa9, 0x6c, - 0x37, 0x7b, 0x4d, 0x6e, 0xbe, 0x84, 0x99, 0x4c, 0xbe, 0x6e, 0xe8, 0x31, 0x8c, 0x4a, 0x7d, 0xe9, - 0x1a, 0xcc, 0xab, 0x1d, 0x5d, 0x1e, 0x82, 0x9e, 0x96, 0xce, 0x33, 0x17, 0x61, 0x61, 0x97, 0x88, - 0xec, 0x38, 0x5f, 0xb8, 0x51, 0x44, 0x43, 0x3f, 0x35, 0xc4, 0xc7, 0x22, 0x18, 0xd7, 0x45, 0x68, - 0x15, 0x1f, 0x10, 0xdc, 0xea, 0xef, 0xa3, 0xad, 0x22, 0xb4, 0xaa, 0xbd, 0x5c, 0x55, 0x03, 0x18, - 0xad, 0x1c, 0xec, 0x69, 0x28, 0xe2, 0x44, 0x8b, 0x9f, 0xf5, 0xae, 0xe2, 0x55, 0x02, 0x95, 0xeb, - 0xd2, 0xf0, 0x34, 0x8c, 0xb4, 0x48, 0x22, 0xd7, 0x5e, 0x72, 0x7a, 0x8f, 0x78, 0x13, 0xca, 0x5d, - 0x37, 0xe8, 0xa8, 0x85, 0xfe, 0xcb, 0x61, 0x8e, 0x8a, 0x7d, 0x58, 0xdc, 0x42, 0x1b, 0xdf, 0x4b, - 0x50, 0x3e, 0xe8, 0x5d, 0x36, 0xfe, 0x8a, 0x60, 0x36, 0xe7, 0x56, 0xf0, 0xfd, 0xdc, 0x76, 0xaf, - 0x39, 0xb8, 0xea, 0xda, 0x90, 0xd1, 0x6a, 0x32, 0xe6, 0xea, 0xfb, 0x1f, 0x7f, 0xbe, 0x14, 0xeb, - 0x78, 0xd9, 0xce, 0xf9, 0x17, 0x88, 0x86, 0x1b, 0x04, 0x0d, 0x41, 0xbd, 0x16, 0x89, 0x39, 0xee, - 0xc2, 0x58, 0xba, 0x7c, 0xbc, 0x3c, 0xc8, 0x18, 0x4a, 0xc8, 0x10, 0xde, 0x31, 0xeb, 0xb2, 0xfa, - 0x02, 0x9e, 0xcf, 0xaf, 0xae, 0x6e, 0xe5, 0x1d, 0x8c, 0x9f, 0x3b, 0x15, 0x0f, 0x60, 0x3d, 0x1f, - 0x41, 0x7d, 0x60, 0x8c, 0x2e, 0x7d, 0x47, 0x96, 0x36, 0x70, 0x6d, 0x40, 0x69, 0x8e, 0xbf, 0x21, - 0xb8, 0x9d, 0xef, 0x2d, 0x6c, 0x0f, 0xef, 0x42, 0x25, 0xeb, 0xc1, 0xff, 0xda, 0xd6, 0xdc, 0x94, - 0x1a, 0xd7, 0xf0, 0xbd, 0x7c, 0x8d, 0xb9, 0x37, 0xb2, 0xbd, 0x73, 0x7c, 0x6a, 0xa0, 0x93, 0x53, - 0x03, 0xfd, 0x3e, 0x35, 0xd0, 0xe7, 0x33, 0xa3, 0x70, 0x72, 0x66, 0x14, 0x7e, 0x9e, 0x19, 0x85, - 0x57, 0xab, 0x3e, 0x15, 0x6f, 0x3a, 0x87, 0x96, 0xc7, 0xda, 0x36, 0x6f, 0xd1, 0x68, 0xad, 0x4d, - 0xba, 0x29, 0xf3, 0xdb, 0x94, 0x5b, 0x1a, 0xf6, 0x70, 0x54, 0xfe, 0xdb, 0x37, 0xff, 0x06, 0x00, - 0x00, 0xff, 0xff, 0x47, 0x86, 0x2b, 0x85, 0x86, 0x06, 0x00, 0x00, + // 745 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xd3, 0x4a, + 0x14, 0xce, 0xa4, 0x49, 0xd5, 0x9e, 0x7b, 0xfb, 0x37, 0xed, 0xbd, 0x8a, 0xd2, 0xd4, 0x6d, 0x9d, + 0x7b, 0xa5, 0x16, 0xa8, 0x4d, 0x1a, 0x16, 0x85, 0x05, 0x82, 0x56, 0x28, 0x14, 0x81, 0xd4, 0x46, + 0x62, 0x03, 0x8b, 0xc8, 0x75, 0x46, 0x61, 0x14, 0xc7, 0xe3, 0x7a, 0x26, 0x11, 0x61, 0x09, 0x6b, + 0x10, 0x52, 0xd7, 0xbc, 0x03, 0xcf, 0xc0, 0xaa, 0xcb, 0x4a, 0x6c, 0x58, 0x21, 0xd4, 0xf2, 0x20, + 0x28, 0x33, 0xe3, 0x34, 0x69, 0x9c, 0x90, 0xb2, 0xb3, 0xfd, 0x9d, 0xf3, 0x9d, 0xef, 0xfc, 0x1a, + 0x72, 0xdc, 0xa3, 0x7e, 0xbd, 0x6d, 0xb3, 0xd0, 0x71, 0x3d, 0x62, 0xb7, 0x0a, 0xf6, 0x71, 0x93, + 0x84, 0x6d, 0x2b, 0x08, 0x99, 0x60, 0x78, 0x5e, 0xa1, 0x96, 0x42, 0xad, 0x56, 0x21, 0xbb, 0x54, + 0x63, 0x35, 0x26, 0x41, 0xbb, 0xf3, 0xa4, 0xec, 0xb2, 0xb9, 0x1a, 0x63, 0x35, 0x8f, 0xd8, 0x4e, + 0x40, 0x6d, 0xc7, 0xf7, 0x99, 0x70, 0x04, 0x65, 0x3e, 0xd7, 0xa8, 0x31, 0x10, 0xa3, 0x46, 0x7c, + 0xc2, 0x69, 0x84, 0xe7, 0x35, 0x2e, 0xda, 0x01, 0xe1, 0x1d, 0xd8, 0x6d, 0x86, 0x21, 0xf1, 0xdd, + 0x76, 0x25, 0x70, 0x68, 0xa8, 0x8c, 0xcc, 0x1c, 0x64, 0x4b, 0x44, 0x3c, 0xf4, 0xbc, 0x3d, 0x0d, + 0x1e, 0x38, 0x34, 0xe4, 0x65, 0x72, 0xdc, 0x24, 0x5c, 0x98, 0x14, 0x96, 0x63, 0x51, 0x1e, 0x30, + 0x9f, 0x13, 0xfc, 0x04, 0x66, 0xfb, 0x38, 0x79, 0x06, 0xad, 0x4d, 0x6c, 0xfc, 0xb5, 0xbd, 0x62, + 0xe9, 0x04, 0x65, 0x68, 0xab, 0x55, 0xb0, 0x7a, 0xfd, 0x77, 0x53, 0xa7, 0xdf, 0x57, 0x13, 0xe5, + 0x19, 0xb7, 0x97, 0xd3, 0x7c, 0x09, 0x73, 0x25, 0x22, 0x0e, 0x42, 0xea, 0x12, 0x1d, 0x1d, 0x3f, + 0x86, 0x99, 0x3e, 0xfa, 0x0c, 0x5a, 0x43, 0xe3, 0xb2, 0xff, 0xdd, 0xcb, 0x6e, 0x7e, 0x40, 0x30, + 0x7f, 0xc9, 0xae, 0xd5, 0xef, 0x40, 0x3a, 0xe8, 0x7c, 0xd0, 0xb4, 0x39, 0xeb, 0x6a, 0x57, 0xac, + 0xc3, 0x26, 0x13, 0x44, 0x3a, 0x49, 0x56, 0x54, 0x56, 0x0e, 0x78, 0x09, 0xd2, 0x3e, 0xf3, 0x5d, + 0x92, 0x49, 0xae, 0xa1, 0x8d, 0x54, 0x59, 0xbd, 0xe0, 0x2c, 0x4c, 0x55, 0x89, 0x4b, 0x1b, 0x8e, + 0xc7, 0x33, 0x13, 0x12, 0xe8, 0xbe, 0xe3, 0x59, 0x48, 0xd2, 0x6a, 0x26, 0x25, 0xbf, 0x26, 0x69, + 0xd5, 0xbc, 0x7f, 0xa9, 0x27, 0x2a, 0x36, 0xbe, 0x01, 0x0b, 0x7d, 0xe9, 0x56, 0x68, 0x55, 0x15, + 0x74, 0xba, 0x3c, 0xd7, 0x9b, 0xcd, 0x7e, 0x95, 0x9b, 0xcf, 0x61, 0xa1, 0xc7, 0x5f, 0x27, 0xf4, + 0x00, 0x26, 0xa5, 0xbe, 0xa8, 0x0d, 0xe6, 0x60, 0x46, 0x57, 0x8b, 0xa0, 0xab, 0xa5, 0xfd, 0xcc, + 0x55, 0x58, 0x29, 0x11, 0xd1, 0x5b, 0xce, 0x67, 0x4e, 0x10, 0x50, 0xbf, 0x16, 0x0d, 0xc4, 0xfb, + 0x24, 0x18, 0xc3, 0x2c, 0xb4, 0x8a, 0x77, 0x08, 0xfe, 0xe9, 0xcf, 0xa3, 0xa1, 0x2c, 0xb4, 0xaa, + 0xfd, 0x58, 0x55, 0x23, 0x18, 0xad, 0x18, 0xec, 0x91, 0x2f, 0xc2, 0xb6, 0x16, 0xbf, 0xe8, 0x0e, + 0xe2, 0x59, 0x02, 0x99, 0x61, 0x6e, 0x78, 0x1e, 0x26, 0xea, 0xa4, 0x2d, 0xdb, 0x9e, 0x2a, 0x77, + 0x1e, 0x71, 0x11, 0xd2, 0x2d, 0xc7, 0x6b, 0xaa, 0x86, 0xfe, 0x6e, 0xc2, 0xca, 0xca, 0xf6, 0x5e, + 0x72, 0x07, 0x99, 0x79, 0x58, 0x8f, 0x17, 0xff, 0x94, 0x72, 0x11, 0x15, 0x8d, 0xc1, 0x62, 0x8c, + 0x85, 0x9e, 0x09, 0x14, 0xcd, 0xc4, 0xe0, 0xb8, 0x27, 0xff, 0x74, 0xdc, 0x1b, 0x60, 0x8e, 0x52, + 0xa5, 0x1b, 0x55, 0x82, 0x29, 0xdd, 0x99, 0x68, 0x60, 0xfe, 0x1f, 0x6c, 0x4d, 0x0c, 0x89, 0x0e, + 0xd9, 0x75, 0xde, 0x3e, 0x99, 0x84, 0xf4, 0x61, 0xe7, 0xbc, 0xe1, 0x4f, 0x08, 0x16, 0x63, 0x0e, + 0x06, 0xbe, 0x15, 0xdb, 0xf3, 0x21, 0x57, 0x27, 0xbb, 0x35, 0xa6, 0xb5, 0xca, 0xc3, 0xdc, 0x7c, + 0xfb, 0xf5, 0xe7, 0x49, 0x32, 0x8f, 0xd7, 0xed, 0x98, 0x83, 0x28, 0x2a, 0x8e, 0xe7, 0x55, 0x04, + 0x75, 0xeb, 0x24, 0xe4, 0xb8, 0x05, 0x53, 0xd1, 0x06, 0xe0, 0xf5, 0x51, 0xdb, 0xa1, 0x84, 0x8c, + 0xb1, 0x40, 0x66, 0x5e, 0x46, 0x5f, 0xc1, 0xcb, 0xf1, 0xd1, 0xd5, 0xc1, 0x78, 0x03, 0xd3, 0xdd, + 0x75, 0xc5, 0x23, 0x58, 0xbb, 0x25, 0xc8, 0x8f, 0xb4, 0xd1, 0xa1, 0xff, 0x93, 0xa1, 0x0d, 0x9c, + 0x1b, 0x11, 0x9a, 0xe3, 0xcf, 0x08, 0xfe, 0x8d, 0x9f, 0x06, 0x6c, 0x8f, 0xbf, 0x8a, 0x4a, 0xd6, + 0xed, 0xeb, 0xee, 0xae, 0x59, 0x94, 0x1a, 0xb7, 0xf0, 0xcd, 0x78, 0x8d, 0xb1, 0x87, 0x02, 0x7f, + 0x41, 0xf2, 0xaf, 0x34, 0x64, 0x80, 0x71, 0x71, 0x5c, 0x15, 0x3d, 0x4b, 0x98, 0xbd, 0x73, 0x3d, + 0x27, 0x2d, 0xff, 0xae, 0x94, 0x5f, 0xc4, 0x05, 0xdb, 0x65, 0xbe, 0x4f, 0x5c, 0xd1, 0xd5, 0xbf, + 0x3d, 0x5c, 0x7f, 0xc5, 0xa3, 0x5c, 0xec, 0xee, 0x9d, 0x9e, 0x1b, 0xe8, 0xec, 0xdc, 0x40, 0x3f, + 0xce, 0x0d, 0xf4, 0xf1, 0xc2, 0x48, 0x9c, 0x5d, 0x18, 0x89, 0x6f, 0x17, 0x46, 0xe2, 0xc5, 0x66, + 0x8d, 0x8a, 0x57, 0xcd, 0x23, 0xcb, 0x65, 0x0d, 0x9b, 0xd7, 0x69, 0xb0, 0xd5, 0x20, 0xad, 0xa8, + 0x3c, 0xaf, 0xa3, 0x00, 0x72, 0xdb, 0x8f, 0x26, 0xe5, 0x5f, 0xba, 0xf8, 0x2b, 0x00, 0x00, 0xff, + 0xff, 0x31, 0xda, 0x50, 0xf3, 0x50, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -493,6 +640,10 @@ type QueryClient interface { // indexers that have access to the ID of a currency pair, but no way to get // the underlying currency pair from it. GetCurrencyPairMapping(ctx context.Context, in *GetCurrencyPairMappingRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingResponse, error) + // Get the mapping of currency pair ID <-> currency pair as a list. This is + // useful for indexers that have access to the ID of a currency pair, but no + // way to get the underlying currency pair from it. + GetCurrencyPairMappingList(ctx context.Context, in *GetCurrencyPairMappingListRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingListResponse, error) } type queryClient struct { @@ -539,6 +690,15 @@ func (c *queryClient) GetCurrencyPairMapping(ctx context.Context, in *GetCurrenc return out, nil } +func (c *queryClient) GetCurrencyPairMappingList(ctx context.Context, in *GetCurrencyPairMappingListRequest, opts ...grpc.CallOption) (*GetCurrencyPairMappingListResponse, error) { + out := new(GetCurrencyPairMappingListResponse) + err := c.cc.Invoke(ctx, "/slinky.oracle.v1.Query/GetCurrencyPairMappingList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Get all the currency pairs the x/oracle module is tracking price-data for. @@ -551,6 +711,10 @@ type QueryServer interface { // indexers that have access to the ID of a currency pair, but no way to get // the underlying currency pair from it. GetCurrencyPairMapping(context.Context, *GetCurrencyPairMappingRequest) (*GetCurrencyPairMappingResponse, error) + // Get the mapping of currency pair ID <-> currency pair as a list. This is + // useful for indexers that have access to the ID of a currency pair, but no + // way to get the underlying currency pair from it. + GetCurrencyPairMappingList(context.Context, *GetCurrencyPairMappingListRequest) (*GetCurrencyPairMappingListResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -569,6 +733,9 @@ func (*UnimplementedQueryServer) GetPrices(ctx context.Context, req *GetPricesRe func (*UnimplementedQueryServer) GetCurrencyPairMapping(ctx context.Context, req *GetCurrencyPairMappingRequest) (*GetCurrencyPairMappingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCurrencyPairMapping not implemented") } +func (*UnimplementedQueryServer) GetCurrencyPairMappingList(ctx context.Context, req *GetCurrencyPairMappingListRequest) (*GetCurrencyPairMappingListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCurrencyPairMappingList not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -646,6 +813,24 @@ func _Query_GetCurrencyPairMapping_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_GetCurrencyPairMappingList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCurrencyPairMappingListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetCurrencyPairMappingList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slinky.oracle.v1.Query/GetCurrencyPairMappingList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetCurrencyPairMappingList(ctx, req.(*GetCurrencyPairMappingListRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "slinky.oracle.v1.Query", HandlerType: (*QueryServer)(nil), @@ -666,6 +851,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetCurrencyPairMapping", Handler: _Query_GetCurrencyPairMapping_Handler, }, + { + MethodName: "GetCurrencyPairMappingList", + Handler: _Query_GetCurrencyPairMappingList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "slinky/oracle/v1/query.proto", @@ -951,6 +1140,104 @@ func (m *GetCurrencyPairMappingResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *GetCurrencyPairMappingListRequest) 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 *GetCurrencyPairMappingListRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCurrencyPairMappingListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CurrencyPairMapping) 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 *CurrencyPairMapping) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CurrencyPairMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.CurrencyPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetCurrencyPairMappingListResponse) 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 *GetCurrencyPairMappingListResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCurrencyPairMappingListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Mappings) > 0 { + for iNdEx := len(m.Mappings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mappings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1076,6 +1363,44 @@ func (m *GetCurrencyPairMappingResponse) Size() (n int) { return n } +func (m *GetCurrencyPairMappingListRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CurrencyPairMapping) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + l = m.CurrencyPair.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *GetCurrencyPairMappingListResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Mappings) > 0 { + for _, e := range m.Mappings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1823,6 +2148,242 @@ func (m *GetCurrencyPairMappingResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *GetCurrencyPairMappingListRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCurrencyPairMappingListRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCurrencyPairMappingListRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CurrencyPairMapping) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CurrencyPairMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CurrencyPairMapping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyPair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CurrencyPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCurrencyPairMappingListResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCurrencyPairMappingListResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCurrencyPairMappingListResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mappings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mappings = append(m.Mappings, CurrencyPairMapping{}) + if err := m.Mappings[len(m.Mappings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index fbbeca1da..2048460a0 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -141,6 +141,24 @@ func local_request_Query_GetCurrencyPairMapping_0(ctx context.Context, marshaler } +func request_Query_GetCurrencyPairMappingList_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCurrencyPairMappingListRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetCurrencyPairMappingList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetCurrencyPairMappingList_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCurrencyPairMappingListRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetCurrencyPairMappingList(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -239,6 +257,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_GetCurrencyPairMappingList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetCurrencyPairMappingList_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetCurrencyPairMappingList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -360,6 +401,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_GetCurrencyPairMappingList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetCurrencyPairMappingList_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetCurrencyPairMappingList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -371,6 +432,8 @@ var ( pattern_Query_GetPrices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "oracle", "v1", "get_prices"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GetCurrencyPairMapping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "oracle", "v1", "get_currency_pair_mapping"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetCurrencyPairMappingList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"connect", "oracle", "v2", "get_currency_pair_mapping_list"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -381,4 +444,6 @@ var ( forward_Query_GetPrices_0 = runtime.ForwardResponseMessage forward_Query_GetCurrencyPairMapping_0 = runtime.ForwardResponseMessage + + forward_Query_GetCurrencyPairMappingList_0 = runtime.ForwardResponseMessage )