diff --git a/api/slinky/marketmap/v1/market.pulsar.go b/api/slinky/marketmap/v1/market.pulsar.go index 912db7654..c9768213c 100644 --- a/api/slinky/marketmap/v1/market.pulsar.go +++ b/api/slinky/marketmap/v1/market.pulsar.go @@ -15,34 +15,79 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Market_2_list)(nil) + +type _Market_2_list struct { + list *[]*ProviderConfig +} + +func (x *_Market_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Market_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Market_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ProviderConfig) + (*x.list)[i] = concreteValue +} + +func (x *_Market_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*ProviderConfig) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Market_2_list) AppendMutable() protoreflect.Value { + v := new(ProviderConfig) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Market_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Market_2_list) NewElement() protoreflect.Value { + v := new(ProviderConfig) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Market_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_Ticker protoreflect.MessageDescriptor - fd_Ticker_currency_pair protoreflect.FieldDescriptor - fd_Ticker_decimals protoreflect.FieldDescriptor - fd_Ticker_min_provider_count protoreflect.FieldDescriptor - fd_Ticker_enabled protoreflect.FieldDescriptor - fd_Ticker_metadata_JSON protoreflect.FieldDescriptor + md_Market protoreflect.MessageDescriptor + fd_Market_ticker protoreflect.FieldDescriptor + fd_Market_provider_configs protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_market_proto_init() - md_Ticker = File_slinky_marketmap_v1_market_proto.Messages().ByName("Ticker") - fd_Ticker_currency_pair = md_Ticker.Fields().ByName("currency_pair") - fd_Ticker_decimals = md_Ticker.Fields().ByName("decimals") - fd_Ticker_min_provider_count = md_Ticker.Fields().ByName("min_provider_count") - fd_Ticker_enabled = md_Ticker.Fields().ByName("enabled") - fd_Ticker_metadata_JSON = md_Ticker.Fields().ByName("metadata_JSON") + md_Market = File_slinky_marketmap_v1_market_proto.Messages().ByName("Market") + fd_Market_ticker = md_Market.Fields().ByName("ticker") + fd_Market_provider_configs = md_Market.Fields().ByName("provider_configs") } -var _ protoreflect.Message = (*fastReflection_Ticker)(nil) +var _ protoreflect.Message = (*fastReflection_Market)(nil) -type fastReflection_Ticker Ticker +type fastReflection_Market Market -func (x *Ticker) ProtoReflect() protoreflect.Message { - return (*fastReflection_Ticker)(x) +func (x *Market) ProtoReflect() protoreflect.Message { + return (*fastReflection_Market)(x) } -func (x *Ticker) slowProtoReflect() protoreflect.Message { +func (x *Market) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_market_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -54,43 +99,43 @@ func (x *Ticker) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Ticker_messageType fastReflection_Ticker_messageType -var _ protoreflect.MessageType = fastReflection_Ticker_messageType{} +var _fastReflection_Market_messageType fastReflection_Market_messageType +var _ protoreflect.MessageType = fastReflection_Market_messageType{} -type fastReflection_Ticker_messageType struct{} +type fastReflection_Market_messageType struct{} -func (x fastReflection_Ticker_messageType) Zero() protoreflect.Message { - return (*fastReflection_Ticker)(nil) +func (x fastReflection_Market_messageType) Zero() protoreflect.Message { + return (*fastReflection_Market)(nil) } -func (x fastReflection_Ticker_messageType) New() protoreflect.Message { - return new(fastReflection_Ticker) +func (x fastReflection_Market_messageType) New() protoreflect.Message { + return new(fastReflection_Market) } -func (x fastReflection_Ticker_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Ticker +func (x fastReflection_Market_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Market } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Ticker) Descriptor() protoreflect.MessageDescriptor { - return md_Ticker +func (x *fastReflection_Market) Descriptor() protoreflect.MessageDescriptor { + return md_Market } // 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_Ticker) Type() protoreflect.MessageType { - return _fastReflection_Ticker_messageType +func (x *fastReflection_Market) Type() protoreflect.MessageType { + return _fastReflection_Market_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Ticker) New() protoreflect.Message { - return new(fastReflection_Ticker) +func (x *fastReflection_Market) New() protoreflect.Message { + return new(fastReflection_Market) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Ticker) Interface() protoreflect.ProtoMessage { - return (*Ticker)(x) +func (x *fastReflection_Market) Interface() protoreflect.ProtoMessage { + return (*Market)(x) } // Range iterates over every populated field in an undefined order, @@ -98,34 +143,16 @@ func (x *fastReflection_Ticker) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Ticker) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CurrencyPair != nil { - value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - if !f(fd_Ticker_currency_pair, value) { - return - } - } - if x.Decimals != uint64(0) { - value := protoreflect.ValueOfUint64(x.Decimals) - if !f(fd_Ticker_decimals, value) { - return - } - } - if x.MinProviderCount != uint64(0) { - value := protoreflect.ValueOfUint64(x.MinProviderCount) - if !f(fd_Ticker_min_provider_count, value) { - return - } - } - if x.Enabled != false { - value := protoreflect.ValueOfBool(x.Enabled) - if !f(fd_Ticker_enabled, value) { +func (x *fastReflection_Market) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Ticker != nil { + value := protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) + if !f(fd_Market_ticker, value) { return } } - if x.Metadata_JSON != "" { - value := protoreflect.ValueOfString(x.Metadata_JSON) - if !f(fd_Ticker_metadata_JSON, value) { + if len(x.ProviderConfigs) != 0 { + value := protoreflect.ValueOfList(&_Market_2_list{list: &x.ProviderConfigs}) + if !f(fd_Market_provider_configs, value) { return } } @@ -142,23 +169,17 @@ func (x *fastReflection_Ticker) Range(f func(protoreflect.FieldDescriptor, proto // 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_Ticker) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Market) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - return x.CurrencyPair != nil - case "slinky.marketmap.v1.Ticker.decimals": - return x.Decimals != uint64(0) - case "slinky.marketmap.v1.Ticker.min_provider_count": - return x.MinProviderCount != uint64(0) - case "slinky.marketmap.v1.Ticker.enabled": - return x.Enabled != false - case "slinky.marketmap.v1.Ticker.metadata_JSON": - return x.Metadata_JSON != "" + case "slinky.marketmap.v1.Market.ticker": + return x.Ticker != nil + case "slinky.marketmap.v1.Market.provider_configs": + return len(x.ProviderConfigs) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market does not contain field %s", fd.FullName())) } } @@ -168,23 +189,17 @@ func (x *fastReflection_Ticker) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Ticker) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Market) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - x.CurrencyPair = nil - case "slinky.marketmap.v1.Ticker.decimals": - x.Decimals = uint64(0) - case "slinky.marketmap.v1.Ticker.min_provider_count": - x.MinProviderCount = uint64(0) - case "slinky.marketmap.v1.Ticker.enabled": - x.Enabled = false - case "slinky.marketmap.v1.Ticker.metadata_JSON": - x.Metadata_JSON = "" + case "slinky.marketmap.v1.Market.ticker": + x.Ticker = nil + case "slinky.marketmap.v1.Market.provider_configs": + x.ProviderConfigs = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market does not contain field %s", fd.FullName())) } } @@ -194,28 +209,22 @@ func (x *fastReflection_Ticker) Clear(fd protoreflect.FieldDescriptor) { // 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_Ticker) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Market) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - value := x.CurrencyPair + case "slinky.marketmap.v1.Market.ticker": + value := x.Ticker return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.Ticker.decimals": - value := x.Decimals - return protoreflect.ValueOfUint64(value) - case "slinky.marketmap.v1.Ticker.min_provider_count": - value := x.MinProviderCount - return protoreflect.ValueOfUint64(value) - case "slinky.marketmap.v1.Ticker.enabled": - value := x.Enabled - return protoreflect.ValueOfBool(value) - case "slinky.marketmap.v1.Ticker.metadata_JSON": - value := x.Metadata_JSON - return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.Market.provider_configs": + if len(x.ProviderConfigs) == 0 { + return protoreflect.ValueOfList(&_Market_2_list{}) + } + listValue := &_Market_2_list{list: &x.ProviderConfigs} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market does not contain field %s", descriptor.FullName())) } } @@ -229,23 +238,19 @@ func (x *fastReflection_Ticker) Get(descriptor protoreflect.FieldDescriptor) pro // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Ticker) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Market) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) - case "slinky.marketmap.v1.Ticker.decimals": - x.Decimals = value.Uint() - case "slinky.marketmap.v1.Ticker.min_provider_count": - x.MinProviderCount = value.Uint() - case "slinky.marketmap.v1.Ticker.enabled": - x.Enabled = value.Bool() - case "slinky.marketmap.v1.Ticker.metadata_JSON": - x.Metadata_JSON = value.Interface().(string) + case "slinky.marketmap.v1.Market.ticker": + x.Ticker = value.Message().Interface().(*Ticker) + case "slinky.marketmap.v1.Market.provider_configs": + lv := value.List() + clv := lv.(*_Market_2_list) + x.ProviderConfigs = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market does not contain field %s", fd.FullName())) } } @@ -259,60 +264,53 @@ func (x *fastReflection_Ticker) Set(fd protoreflect.FieldDescriptor, value proto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Ticker) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Market) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - if x.CurrencyPair == nil { - x.CurrencyPair = new(v1.CurrencyPair) + case "slinky.marketmap.v1.Market.ticker": + if x.Ticker == nil { + x.Ticker = new(Ticker) } - return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - case "slinky.marketmap.v1.Ticker.decimals": - panic(fmt.Errorf("field decimals of message slinky.marketmap.v1.Ticker is not mutable")) - case "slinky.marketmap.v1.Ticker.min_provider_count": - panic(fmt.Errorf("field min_provider_count of message slinky.marketmap.v1.Ticker is not mutable")) - case "slinky.marketmap.v1.Ticker.enabled": - panic(fmt.Errorf("field enabled of message slinky.marketmap.v1.Ticker is not mutable")) - case "slinky.marketmap.v1.Ticker.metadata_JSON": - panic(fmt.Errorf("field metadata_JSON of message slinky.marketmap.v1.Ticker is not mutable")) + return protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) + case "slinky.marketmap.v1.Market.provider_configs": + if x.ProviderConfigs == nil { + x.ProviderConfigs = []*ProviderConfig{} + } + value := &_Market_2_list{list: &x.ProviderConfigs} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market 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_Ticker) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Market) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Ticker.currency_pair": - m := new(v1.CurrencyPair) + case "slinky.marketmap.v1.Market.ticker": + m := new(Ticker) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.Ticker.decimals": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.marketmap.v1.Ticker.min_provider_count": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.marketmap.v1.Ticker.enabled": - return protoreflect.ValueOfBool(false) - case "slinky.marketmap.v1.Ticker.metadata_JSON": - return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.Market.provider_configs": + list := []*ProviderConfig{} + return protoreflect.ValueOfList(&_Market_2_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Market")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Market 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_Ticker) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Market) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Ticker", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Market", d.FullName())) } panic("unreachable") } @@ -320,7 +318,7 @@ func (x *fastReflection_Ticker) WhichOneof(d protoreflect.OneofDescriptor) proto // 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_Ticker) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Market) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -331,7 +329,7 @@ func (x *fastReflection_Ticker) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Ticker) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Market) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -343,7 +341,7 @@ func (x *fastReflection_Ticker) SetUnknown(fields protoreflect.RawFields) { // 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_Ticker) IsValid() bool { +func (x *fastReflection_Market) IsValid() bool { return x != nil } @@ -353,9 +351,9 @@ func (x *fastReflection_Ticker) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Market) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Ticker) + x := input.Message.Interface().(*Market) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -367,22 +365,15 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.CurrencyPair != nil { - l = options.Size(x.CurrencyPair) + if x.Ticker != nil { + l = options.Size(x.Ticker) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Decimals != 0 { - n += 1 + runtime.Sov(uint64(x.Decimals)) - } - if x.MinProviderCount != 0 { - n += 1 + runtime.Sov(uint64(x.MinProviderCount)) - } - if x.Enabled { - n += 2 - } - l = len(x.Metadata_JSON) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.ProviderConfigs) > 0 { + for _, e := range x.ProviderConfigs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -394,7 +385,7 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Ticker) + x := input.Message.Interface().(*Market) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -413,35 +404,24 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Metadata_JSON) > 0 { - i -= len(x.Metadata_JSON) - copy(dAtA[i:], x.Metadata_JSON) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata_JSON))) - i-- - dAtA[i] = 0x7a - } - if x.Enabled { - i-- - if x.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(x.ProviderConfigs) > 0 { + for iNdEx := len(x.ProviderConfigs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ProviderConfigs[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] = 0x12 } - i-- - dAtA[i] = 0x70 - } - if x.MinProviderCount != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MinProviderCount)) - i-- - dAtA[i] = 0x18 - } - if x.Decimals != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Decimals)) - i-- - dAtA[i] = 0x10 } - if x.CurrencyPair != nil { - encoded, err := options.Marshal(x.CurrencyPair) + if x.Ticker != nil { + encoded, err := options.Marshal(x.Ticker) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -465,7 +445,7 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Ticker) + x := input.Message.Interface().(*Market) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -497,15 +477,15 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Ticker: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Market: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Ticker: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Market: 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 CurrencyPair", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -532,76 +512,18 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.CurrencyPair == nil { - x.CurrencyPair = &v1.CurrencyPair{} + if x.Ticker == nil { + x.Ticker = &Ticker{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CurrencyPair); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Ticker); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - x.Decimals = 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.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) - } - x.MinProviderCount = 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.MinProviderCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Enabled = bool(v != 0) - case 15: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProviderConfigs", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -611,23 +533,25 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.Metadata_JSON = string(dAtA[iNdEx:postIndex]) + x.ProviderConfigs = append(x.ProviderConfigs, &ProviderConfig{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ProviderConfigs[len(x.ProviderConfigs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex default: iNdEx = preIndex @@ -665,27 +589,33 @@ func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { } var ( - md_ProviderConfig protoreflect.MessageDescriptor - fd_ProviderConfig_name protoreflect.FieldDescriptor - fd_ProviderConfig_off_chain_ticker protoreflect.FieldDescriptor + md_Ticker protoreflect.MessageDescriptor + fd_Ticker_currency_pair protoreflect.FieldDescriptor + fd_Ticker_decimals protoreflect.FieldDescriptor + fd_Ticker_min_provider_count protoreflect.FieldDescriptor + fd_Ticker_enabled protoreflect.FieldDescriptor + fd_Ticker_metadata_JSON protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_market_proto_init() - md_ProviderConfig = File_slinky_marketmap_v1_market_proto.Messages().ByName("ProviderConfig") - fd_ProviderConfig_name = md_ProviderConfig.Fields().ByName("name") - fd_ProviderConfig_off_chain_ticker = md_ProviderConfig.Fields().ByName("off_chain_ticker") + md_Ticker = File_slinky_marketmap_v1_market_proto.Messages().ByName("Ticker") + fd_Ticker_currency_pair = md_Ticker.Fields().ByName("currency_pair") + fd_Ticker_decimals = md_Ticker.Fields().ByName("decimals") + fd_Ticker_min_provider_count = md_Ticker.Fields().ByName("min_provider_count") + fd_Ticker_enabled = md_Ticker.Fields().ByName("enabled") + fd_Ticker_metadata_JSON = md_Ticker.Fields().ByName("metadata_JSON") } -var _ protoreflect.Message = (*fastReflection_ProviderConfig)(nil) +var _ protoreflect.Message = (*fastReflection_Ticker)(nil) -type fastReflection_ProviderConfig ProviderConfig +type fastReflection_Ticker Ticker -func (x *ProviderConfig) ProtoReflect() protoreflect.Message { - return (*fastReflection_ProviderConfig)(x) +func (x *Ticker) ProtoReflect() protoreflect.Message { + return (*fastReflection_Ticker)(x) } -func (x *ProviderConfig) slowProtoReflect() protoreflect.Message { +func (x *Ticker) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_market_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -697,43 +627,43 @@ func (x *ProviderConfig) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ProviderConfig_messageType fastReflection_ProviderConfig_messageType -var _ protoreflect.MessageType = fastReflection_ProviderConfig_messageType{} +var _fastReflection_Ticker_messageType fastReflection_Ticker_messageType +var _ protoreflect.MessageType = fastReflection_Ticker_messageType{} -type fastReflection_ProviderConfig_messageType struct{} +type fastReflection_Ticker_messageType struct{} -func (x fastReflection_ProviderConfig_messageType) Zero() protoreflect.Message { - return (*fastReflection_ProviderConfig)(nil) +func (x fastReflection_Ticker_messageType) Zero() protoreflect.Message { + return (*fastReflection_Ticker)(nil) } -func (x fastReflection_ProviderConfig_messageType) New() protoreflect.Message { - return new(fastReflection_ProviderConfig) +func (x fastReflection_Ticker_messageType) New() protoreflect.Message { + return new(fastReflection_Ticker) } -func (x fastReflection_ProviderConfig_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ProviderConfig +func (x fastReflection_Ticker_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Ticker } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ProviderConfig) Descriptor() protoreflect.MessageDescriptor { - return md_ProviderConfig +func (x *fastReflection_Ticker) Descriptor() protoreflect.MessageDescriptor { + return md_Ticker } // 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_ProviderConfig) Type() protoreflect.MessageType { - return _fastReflection_ProviderConfig_messageType +func (x *fastReflection_Ticker) Type() protoreflect.MessageType { + return _fastReflection_Ticker_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ProviderConfig) New() protoreflect.Message { - return new(fastReflection_ProviderConfig) +func (x *fastReflection_Ticker) New() protoreflect.Message { + return new(fastReflection_Ticker) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ProviderConfig) Interface() protoreflect.ProtoMessage { - return (*ProviderConfig)(x) +func (x *fastReflection_Ticker) Interface() protoreflect.ProtoMessage { + return (*Ticker)(x) } // Range iterates over every populated field in an undefined order, @@ -741,16 +671,34 @@ func (x *fastReflection_ProviderConfig) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ProviderConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_ProviderConfig_name, value) { +func (x *fastReflection_Ticker) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CurrencyPair != nil { + value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + if !f(fd_Ticker_currency_pair, value) { return } } - if x.OffChainTicker != "" { - value := protoreflect.ValueOfString(x.OffChainTicker) - if !f(fd_ProviderConfig_off_chain_ticker, value) { + if x.Decimals != uint64(0) { + value := protoreflect.ValueOfUint64(x.Decimals) + if !f(fd_Ticker_decimals, value) { + return + } + } + if x.MinProviderCount != uint64(0) { + value := protoreflect.ValueOfUint64(x.MinProviderCount) + if !f(fd_Ticker_min_provider_count, value) { + return + } + } + if x.Enabled != false { + value := protoreflect.ValueOfBool(x.Enabled) + if !f(fd_Ticker_enabled, value) { + return + } + } + if x.Metadata_JSON != "" { + value := protoreflect.ValueOfString(x.Metadata_JSON) + if !f(fd_Ticker_metadata_JSON, value) { return } } @@ -767,17 +715,23 @@ func (x *fastReflection_ProviderConfig) Range(f func(protoreflect.FieldDescripto // 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_ProviderConfig) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Ticker) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - return x.Name != "" - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": - return x.OffChainTicker != "" + case "slinky.marketmap.v1.Ticker.currency_pair": + return x.CurrencyPair != nil + case "slinky.marketmap.v1.Ticker.decimals": + return x.Decimals != uint64(0) + case "slinky.marketmap.v1.Ticker.min_provider_count": + return x.MinProviderCount != uint64(0) + case "slinky.marketmap.v1.Ticker.enabled": + return x.Enabled != false + case "slinky.marketmap.v1.Ticker.metadata_JSON": + return x.Metadata_JSON != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) } } @@ -787,17 +741,23 @@ func (x *fastReflection_ProviderConfig) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ProviderConfig) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Ticker) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - x.Name = "" - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": - x.OffChainTicker = "" + case "slinky.marketmap.v1.Ticker.currency_pair": + x.CurrencyPair = nil + case "slinky.marketmap.v1.Ticker.decimals": + x.Decimals = uint64(0) + case "slinky.marketmap.v1.Ticker.min_provider_count": + x.MinProviderCount = uint64(0) + case "slinky.marketmap.v1.Ticker.enabled": + x.Enabled = false + case "slinky.marketmap.v1.Ticker.metadata_JSON": + x.Metadata_JSON = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) } } @@ -807,19 +767,28 @@ func (x *fastReflection_ProviderConfig) Clear(fd protoreflect.FieldDescriptor) { // 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_ProviderConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Ticker) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": - value := x.OffChainTicker + case "slinky.marketmap.v1.Ticker.currency_pair": + value := x.CurrencyPair + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "slinky.marketmap.v1.Ticker.decimals": + value := x.Decimals + return protoreflect.ValueOfUint64(value) + case "slinky.marketmap.v1.Ticker.min_provider_count": + value := x.MinProviderCount + return protoreflect.ValueOfUint64(value) + case "slinky.marketmap.v1.Ticker.enabled": + value := x.Enabled + return protoreflect.ValueOfBool(value) + case "slinky.marketmap.v1.Ticker.metadata_JSON": + value := x.Metadata_JSON return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", descriptor.FullName())) } } @@ -833,17 +802,23 @@ func (x *fastReflection_ProviderConfig) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ProviderConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Ticker) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - x.Name = value.Interface().(string) - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": - x.OffChainTicker = value.Interface().(string) + case "slinky.marketmap.v1.Ticker.currency_pair": + x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) + case "slinky.marketmap.v1.Ticker.decimals": + x.Decimals = value.Uint() + case "slinky.marketmap.v1.Ticker.min_provider_count": + x.MinProviderCount = value.Uint() + case "slinky.marketmap.v1.Ticker.enabled": + x.Enabled = value.Bool() + case "slinky.marketmap.v1.Ticker.metadata_JSON": + x.Metadata_JSON = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker does not contain field %s", fd.FullName())) } } @@ -857,44 +832,60 @@ func (x *fastReflection_ProviderConfig) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ProviderConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Ticker) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - panic(fmt.Errorf("field name of message slinky.marketmap.v1.ProviderConfig is not mutable")) - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": - panic(fmt.Errorf("field off_chain_ticker of message slinky.marketmap.v1.ProviderConfig is not mutable")) + case "slinky.marketmap.v1.Ticker.currency_pair": + if x.CurrencyPair == nil { + x.CurrencyPair = new(v1.CurrencyPair) + } + return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + case "slinky.marketmap.v1.Ticker.decimals": + panic(fmt.Errorf("field decimals of message slinky.marketmap.v1.Ticker is not mutable")) + case "slinky.marketmap.v1.Ticker.min_provider_count": + panic(fmt.Errorf("field min_provider_count of message slinky.marketmap.v1.Ticker is not mutable")) + case "slinky.marketmap.v1.Ticker.enabled": + panic(fmt.Errorf("field enabled of message slinky.marketmap.v1.Ticker is not mutable")) + case "slinky.marketmap.v1.Ticker.metadata_JSON": + panic(fmt.Errorf("field metadata_JSON of message slinky.marketmap.v1.Ticker is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker 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_ProviderConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Ticker) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.ProviderConfig.name": - return protoreflect.ValueOfString("") - case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + case "slinky.marketmap.v1.Ticker.currency_pair": + m := new(v1.CurrencyPair) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "slinky.marketmap.v1.Ticker.decimals": + return protoreflect.ValueOfUint64(uint64(0)) + case "slinky.marketmap.v1.Ticker.min_provider_count": + return protoreflect.ValueOfUint64(uint64(0)) + case "slinky.marketmap.v1.Ticker.enabled": + return protoreflect.ValueOfBool(false) + case "slinky.marketmap.v1.Ticker.metadata_JSON": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Ticker")) } - panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.Ticker 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_ProviderConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Ticker) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.ProviderConfig", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Ticker", d.FullName())) } panic("unreachable") } @@ -902,7 +893,7 @@ func (x *fastReflection_ProviderConfig) WhichOneof(d protoreflect.OneofDescripto // 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_ProviderConfig) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Ticker) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -913,7 +904,7 @@ func (x *fastReflection_ProviderConfig) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ProviderConfig) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Ticker) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -925,7 +916,7 @@ func (x *fastReflection_ProviderConfig) SetUnknown(fields protoreflect.RawFields // 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_ProviderConfig) IsValid() bool { +func (x *fastReflection_Ticker) IsValid() bool { return x != nil } @@ -935,9 +926,9 @@ func (x *fastReflection_ProviderConfig) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Ticker) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ProviderConfig) + x := input.Message.Interface().(*Ticker) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -949,11 +940,20 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Name) - if l > 0 { + if x.CurrencyPair != nil { + l = options.Size(x.CurrencyPair) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.OffChainTicker) + if x.Decimals != 0 { + n += 1 + runtime.Sov(uint64(x.Decimals)) + } + if x.MinProviderCount != 0 { + n += 1 + runtime.Sov(uint64(x.MinProviderCount)) + } + if x.Enabled { + n += 2 + } + l = len(x.Metadata_JSON) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -967,7 +967,7 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ProviderConfig) + x := input.Message.Interface().(*Ticker) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -986,17 +986,44 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.OffChainTicker) > 0 { - i -= len(x.OffChainTicker) - copy(dAtA[i:], x.OffChainTicker) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OffChainTicker))) + if len(x.Metadata_JSON) > 0 { + i -= len(x.Metadata_JSON) + copy(dAtA[i:], x.Metadata_JSON) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata_JSON))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x7a } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + if x.Enabled { + i-- + if x.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if x.MinProviderCount != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MinProviderCount)) + i-- + dAtA[i] = 0x18 + } + if x.Decimals != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Decimals)) + i-- + dAtA[i] = 0x10 + } + 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] = 0xa } @@ -1011,7 +1038,7 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ProviderConfig) + x := input.Message.Interface().(*Ticker) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1043,17 +1070,17 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProviderConfig: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Ticker: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProviderConfig: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Ticker: 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 Name", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrencyPair", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1063,27 +1090,89 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.Name = string(dAtA[iNdEx:postIndex]) + 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 case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + x.Decimals = 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.Decimals |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) + } + x.MinProviderCount = 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.MinProviderCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Enabled = bool(v != 0) + case 15: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1111,7 +1200,7 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.OffChainTicker = string(dAtA[iNdEx:postIndex]) + x.Metadata_JSON = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1148,77 +1237,34 @@ func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_Path_1_list)(nil) - -type _Path_1_list struct { - list *[]*Operation -} - -func (x *_Path_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Path_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Path_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Operation) - (*x.list)[i] = concreteValue -} - -func (x *_Path_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Operation) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Path_1_list) AppendMutable() protoreflect.Value { - v := new(Operation) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Path_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Path_1_list) NewElement() protoreflect.Value { - v := new(Operation) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Path_1_list) IsValid() bool { - return x.list != nil -} - var ( - md_Path protoreflect.MessageDescriptor - fd_Path_operations protoreflect.FieldDescriptor + md_ProviderConfig protoreflect.MessageDescriptor + fd_ProviderConfig_name protoreflect.FieldDescriptor + fd_ProviderConfig_off_chain_ticker protoreflect.FieldDescriptor + fd_ProviderConfig_normalize_by_pair protoreflect.FieldDescriptor + fd_ProviderConfig_invert protoreflect.FieldDescriptor + fd_ProviderConfig_metadata_JSON protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_market_proto_init() - md_Path = File_slinky_marketmap_v1_market_proto.Messages().ByName("Path") - fd_Path_operations = md_Path.Fields().ByName("operations") + md_ProviderConfig = File_slinky_marketmap_v1_market_proto.Messages().ByName("ProviderConfig") + fd_ProviderConfig_name = md_ProviderConfig.Fields().ByName("name") + fd_ProviderConfig_off_chain_ticker = md_ProviderConfig.Fields().ByName("off_chain_ticker") + fd_ProviderConfig_normalize_by_pair = md_ProviderConfig.Fields().ByName("normalize_by_pair") + fd_ProviderConfig_invert = md_ProviderConfig.Fields().ByName("invert") + fd_ProviderConfig_metadata_JSON = md_ProviderConfig.Fields().ByName("metadata_JSON") } -var _ protoreflect.Message = (*fastReflection_Path)(nil) +var _ protoreflect.Message = (*fastReflection_ProviderConfig)(nil) -type fastReflection_Path Path +type fastReflection_ProviderConfig ProviderConfig -func (x *Path) ProtoReflect() protoreflect.Message { - return (*fastReflection_Path)(x) +func (x *ProviderConfig) ProtoReflect() protoreflect.Message { + return (*fastReflection_ProviderConfig)(x) } -func (x *Path) slowProtoReflect() protoreflect.Message { +func (x *ProviderConfig) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_market_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1230,43 +1276,43 @@ func (x *Path) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Path_messageType fastReflection_Path_messageType -var _ protoreflect.MessageType = fastReflection_Path_messageType{} +var _fastReflection_ProviderConfig_messageType fastReflection_ProviderConfig_messageType +var _ protoreflect.MessageType = fastReflection_ProviderConfig_messageType{} -type fastReflection_Path_messageType struct{} +type fastReflection_ProviderConfig_messageType struct{} -func (x fastReflection_Path_messageType) Zero() protoreflect.Message { - return (*fastReflection_Path)(nil) +func (x fastReflection_ProviderConfig_messageType) Zero() protoreflect.Message { + return (*fastReflection_ProviderConfig)(nil) } -func (x fastReflection_Path_messageType) New() protoreflect.Message { - return new(fastReflection_Path) +func (x fastReflection_ProviderConfig_messageType) New() protoreflect.Message { + return new(fastReflection_ProviderConfig) } -func (x fastReflection_Path_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Path +func (x fastReflection_ProviderConfig_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ProviderConfig } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Path) Descriptor() protoreflect.MessageDescriptor { - return md_Path +func (x *fastReflection_ProviderConfig) Descriptor() protoreflect.MessageDescriptor { + return md_ProviderConfig } // 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_Path) Type() protoreflect.MessageType { - return _fastReflection_Path_messageType +func (x *fastReflection_ProviderConfig) Type() protoreflect.MessageType { + return _fastReflection_ProviderConfig_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Path) New() protoreflect.Message { - return new(fastReflection_Path) +func (x *fastReflection_ProviderConfig) New() protoreflect.Message { + return new(fastReflection_ProviderConfig) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Path) Interface() protoreflect.ProtoMessage { - return (*Path)(x) +func (x *fastReflection_ProviderConfig) Interface() protoreflect.ProtoMessage { + return (*ProviderConfig)(x) } // Range iterates over every populated field in an undefined order, @@ -1274,10 +1320,34 @@ func (x *fastReflection_Path) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Path) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Operations) != 0 { - value := protoreflect.ValueOfList(&_Path_1_list{list: &x.Operations}) - if !f(fd_Path_operations, value) { +func (x *fastReflection_ProviderConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_ProviderConfig_name, value) { + return + } + } + if x.OffChainTicker != "" { + value := protoreflect.ValueOfString(x.OffChainTicker) + if !f(fd_ProviderConfig_off_chain_ticker, value) { + return + } + } + if x.NormalizeByPair != nil { + value := protoreflect.ValueOfMessage(x.NormalizeByPair.ProtoReflect()) + if !f(fd_ProviderConfig_normalize_by_pair, value) { + return + } + } + if x.Invert != false { + value := protoreflect.ValueOfBool(x.Invert) + if !f(fd_ProviderConfig_invert, value) { + return + } + } + if x.Metadata_JSON != "" { + value := protoreflect.ValueOfString(x.Metadata_JSON) + if !f(fd_ProviderConfig_metadata_JSON, value) { return } } @@ -1294,15 +1364,23 @@ func (x *fastReflection_Path) Range(f func(protoreflect.FieldDescriptor, protore // 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_Path) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ProviderConfig) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.Path.operations": - return len(x.Operations) != 0 + case "slinky.marketmap.v1.ProviderConfig.name": + return x.Name != "" + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + return x.OffChainTicker != "" + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + return x.NormalizeByPair != nil + case "slinky.marketmap.v1.ProviderConfig.invert": + return x.Invert != false + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + return x.Metadata_JSON != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) } } @@ -1312,15 +1390,23 @@ func (x *fastReflection_Path) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Path) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ProviderConfig) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.Path.operations": - x.Operations = nil + case "slinky.marketmap.v1.ProviderConfig.name": + x.Name = "" + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + x.OffChainTicker = "" + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + x.NormalizeByPair = nil + case "slinky.marketmap.v1.ProviderConfig.invert": + x.Invert = false + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + x.Metadata_JSON = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) } } @@ -1330,19 +1416,28 @@ func (x *fastReflection_Path) Clear(fd protoreflect.FieldDescriptor) { // 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_Path) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ProviderConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.Path.operations": - if len(x.Operations) == 0 { - return protoreflect.ValueOfList(&_Path_1_list{}) - } - listValue := &_Path_1_list{list: &x.Operations} - return protoreflect.ValueOfList(listValue) + case "slinky.marketmap.v1.ProviderConfig.name": + value := x.Name + return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + value := x.OffChainTicker + return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + value := x.NormalizeByPair + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "slinky.marketmap.v1.ProviderConfig.invert": + value := x.Invert + return protoreflect.ValueOfBool(value) + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + value := x.Metadata_JSON + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", descriptor.FullName())) } } @@ -1356,17 +1451,23 @@ func (x *fastReflection_Path) Get(descriptor protoreflect.FieldDescriptor) proto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Path) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ProviderConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.Path.operations": - lv := value.List() - clv := lv.(*_Path_1_list) - x.Operations = *clv.list + case "slinky.marketmap.v1.ProviderConfig.name": + x.Name = value.Interface().(string) + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + x.OffChainTicker = value.Interface().(string) + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + x.NormalizeByPair = value.Message().Interface().(*v1.CurrencyPair) + case "slinky.marketmap.v1.ProviderConfig.invert": + x.Invert = value.Bool() + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + x.Metadata_JSON = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig does not contain field %s", fd.FullName())) } } @@ -1380,45 +1481,60 @@ func (x *fastReflection_Path) Set(fd protoreflect.FieldDescriptor, value protore // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Path) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ProviderConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Path.operations": - if x.Operations == nil { - x.Operations = []*Operation{} + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + if x.NormalizeByPair == nil { + x.NormalizeByPair = new(v1.CurrencyPair) } - value := &_Path_1_list{list: &x.Operations} - return protoreflect.ValueOfList(value) + return protoreflect.ValueOfMessage(x.NormalizeByPair.ProtoReflect()) + case "slinky.marketmap.v1.ProviderConfig.name": + panic(fmt.Errorf("field name of message slinky.marketmap.v1.ProviderConfig is not mutable")) + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + panic(fmt.Errorf("field off_chain_ticker of message slinky.marketmap.v1.ProviderConfig is not mutable")) + case "slinky.marketmap.v1.ProviderConfig.invert": + panic(fmt.Errorf("field invert of message slinky.marketmap.v1.ProviderConfig is not mutable")) + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + panic(fmt.Errorf("field metadata_JSON of message slinky.marketmap.v1.ProviderConfig is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig 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_Path) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ProviderConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Path.operations": - list := []*Operation{} - return protoreflect.ValueOfList(&_Path_1_list{list: &list}) + case "slinky.marketmap.v1.ProviderConfig.name": + return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.ProviderConfig.off_chain_ticker": + return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.ProviderConfig.normalize_by_pair": + m := new(v1.CurrencyPair) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "slinky.marketmap.v1.ProviderConfig.invert": + return protoreflect.ValueOfBool(false) + case "slinky.marketmap.v1.ProviderConfig.metadata_JSON": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Path")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.ProviderConfig")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Path does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.ProviderConfig 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_Path) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ProviderConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Path", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.ProviderConfig", d.FullName())) } panic("unreachable") } @@ -1426,7 +1542,7 @@ func (x *fastReflection_Path) WhichOneof(d protoreflect.OneofDescriptor) protore // 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_Path) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ProviderConfig) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1437,7 +1553,7 @@ func (x *fastReflection_Path) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Path) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ProviderConfig) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1449,7 +1565,7 @@ func (x *fastReflection_Path) SetUnknown(fields protoreflect.RawFields) { // 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_Path) IsValid() bool { +func (x *fastReflection_ProviderConfig) IsValid() bool { return x != nil } @@ -1459,9 +1575,9 @@ func (x *fastReflection_Path) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ProviderConfig) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Path) + x := input.Message.Interface().(*ProviderConfig) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1473,11 +1589,24 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Operations) > 0 { - for _, e := range x.Operations { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } + l = len(x.Name) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OffChainTicker) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NormalizeByPair != nil { + l = options.Size(x.NormalizeByPair) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Invert { + n += 2 + } + l = len(x.Metadata_JSON) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1489,7 +1618,7 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Path) + x := input.Message.Interface().(*ProviderConfig) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1508,21 +1637,50 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Operations) > 0 { - for iNdEx := len(x.Operations) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Operations[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 len(x.Metadata_JSON) > 0 { + i -= len(x.Metadata_JSON) + copy(dAtA[i:], x.Metadata_JSON) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata_JSON))) + i-- + dAtA[i] = 0x7a + } + if x.Invert { + i-- + if x.Invert { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if x.NormalizeByPair != nil { + encoded, err := options.Marshal(x.NormalizeByPair) + 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] = 0x1a + } + if len(x.OffChainTicker) > 0 { + i -= len(x.OffChainTicker) + copy(dAtA[i:], x.OffChainTicker) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OffChainTicker))) + i-- + dAtA[i] = 0x12 + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1535,7 +1693,7 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Path) + x := input.Message.Interface().(*ProviderConfig) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1567,17 +1725,17 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Path: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProviderConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Path: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProviderConfig: 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 Operations", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1587,50 +1745,168 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Operations = append(x.Operations, &Operation{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Operations[len(x.Operations)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + x.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } + x.OffChainTicker = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NormalizeByPair", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + 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 } - if (iNdEx + skippy) > l { + 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 !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + if x.NormalizeByPair == nil { + x.NormalizeByPair = &v1.CurrencyPair{} } - 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 - } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NormalizeByPair); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Invert = bool(v != 0) + case 15: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Metadata_JSON = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } return &protoiface.Methods{ NoUnkeyedLiterals: struct{}{}, Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, @@ -1642,30 +1918,116 @@ func (x *fastReflection_Path) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.Map = (*_MarketMap_1_map)(nil) + +type _MarketMap_1_map struct { + m *map[string]*Market +} + +func (x *_MarketMap_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_MarketMap_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_MarketMap_1_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_MarketMap_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_MarketMap_1_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MarketMap_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + (*x.m)[concreteKey] = concreteValue +} + +func (x *_MarketMap_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if ok { + return protoreflect.ValueOfMessage(v.ProtoReflect()) + } + newValue := new(Market) + (*x.m)[concreteKey] = newValue + return protoreflect.ValueOfMessage(newValue.ProtoReflect()) +} + +func (x *_MarketMap_1_map) NewValue() protoreflect.Value { + v := new(Market) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MarketMap_1_map) IsValid() bool { + return x.m != nil +} + var ( - md_Operation protoreflect.MessageDescriptor - fd_Operation_currency_pair protoreflect.FieldDescriptor - fd_Operation_invert protoreflect.FieldDescriptor - fd_Operation_provider protoreflect.FieldDescriptor + md_MarketMap protoreflect.MessageDescriptor + fd_MarketMap_markets protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_market_proto_init() - md_Operation = File_slinky_marketmap_v1_market_proto.Messages().ByName("Operation") - fd_Operation_currency_pair = md_Operation.Fields().ByName("currency_pair") - fd_Operation_invert = md_Operation.Fields().ByName("invert") - fd_Operation_provider = md_Operation.Fields().ByName("provider") + md_MarketMap = File_slinky_marketmap_v1_market_proto.Messages().ByName("MarketMap") + fd_MarketMap_markets = md_MarketMap.Fields().ByName("markets") } -var _ protoreflect.Message = (*fastReflection_Operation)(nil) +var _ protoreflect.Message = (*fastReflection_MarketMap)(nil) -type fastReflection_Operation Operation +type fastReflection_MarketMap MarketMap -func (x *Operation) ProtoReflect() protoreflect.Message { - return (*fastReflection_Operation)(x) +func (x *MarketMap) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketMap)(x) } -func (x *Operation) slowProtoReflect() protoreflect.Message { +func (x *MarketMap) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_market_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1677,43 +2039,43 @@ func (x *Operation) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_Operation_messageType fastReflection_Operation_messageType -var _ protoreflect.MessageType = fastReflection_Operation_messageType{} +var _fastReflection_MarketMap_messageType fastReflection_MarketMap_messageType +var _ protoreflect.MessageType = fastReflection_MarketMap_messageType{} -type fastReflection_Operation_messageType struct{} +type fastReflection_MarketMap_messageType struct{} -func (x fastReflection_Operation_messageType) Zero() protoreflect.Message { - return (*fastReflection_Operation)(nil) +func (x fastReflection_MarketMap_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketMap)(nil) } -func (x fastReflection_Operation_messageType) New() protoreflect.Message { - return new(fastReflection_Operation) +func (x fastReflection_MarketMap_messageType) New() protoreflect.Message { + return new(fastReflection_MarketMap) } -func (x fastReflection_Operation_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Operation +func (x fastReflection_MarketMap_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMap } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_Operation) Descriptor() protoreflect.MessageDescriptor { - return md_Operation +func (x *fastReflection_MarketMap) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMap } // 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_Operation) Type() protoreflect.MessageType { - return _fastReflection_Operation_messageType +func (x *fastReflection_MarketMap) Type() protoreflect.MessageType { + return _fastReflection_MarketMap_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_Operation) New() protoreflect.Message { - return new(fastReflection_Operation) +func (x *fastReflection_MarketMap) New() protoreflect.Message { + return new(fastReflection_MarketMap) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_Operation) Interface() protoreflect.ProtoMessage { - return (*Operation)(x) +func (x *fastReflection_MarketMap) Interface() protoreflect.ProtoMessage { + return (*MarketMap)(x) } // Range iterates over every populated field in an undefined order, @@ -1721,22 +2083,10 @@ func (x *fastReflection_Operation) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_Operation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CurrencyPair != nil { - value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - if !f(fd_Operation_currency_pair, value) { - return - } - } - if x.Invert != false { - value := protoreflect.ValueOfBool(x.Invert) - if !f(fd_Operation_invert, value) { - return - } - } - if x.Provider != "" { - value := protoreflect.ValueOfString(x.Provider) - if !f(fd_Operation_provider, value) { +func (x *fastReflection_MarketMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Markets) != 0 { + value := protoreflect.ValueOfMap(&_MarketMap_1_map{m: &x.Markets}) + if !f(fd_MarketMap_markets, value) { return } } @@ -1753,19 +2103,15 @@ func (x *fastReflection_Operation) Range(f func(protoreflect.FieldDescriptor, pr // 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_Operation) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MarketMap) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - return x.CurrencyPair != nil - case "slinky.marketmap.v1.Operation.invert": - return x.Invert != false - case "slinky.marketmap.v1.Operation.provider": - return x.Provider != "" + case "slinky.marketmap.v1.MarketMap.markets": + return len(x.Markets) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap does not contain field %s", fd.FullName())) } } @@ -1775,19 +2121,15 @@ func (x *fastReflection_Operation) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Operation) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MarketMap) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - x.CurrencyPair = nil - case "slinky.marketmap.v1.Operation.invert": - x.Invert = false - case "slinky.marketmap.v1.Operation.provider": - x.Provider = "" + case "slinky.marketmap.v1.MarketMap.markets": + x.Markets = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap does not contain field %s", fd.FullName())) } } @@ -1797,22 +2139,19 @@ func (x *fastReflection_Operation) Clear(fd protoreflect.FieldDescriptor) { // 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_Operation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMap) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - value := x.CurrencyPair - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.Operation.invert": - value := x.Invert - return protoreflect.ValueOfBool(value) - case "slinky.marketmap.v1.Operation.provider": - value := x.Provider - return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.MarketMap.markets": + if len(x.Markets) == 0 { + return protoreflect.ValueOfMap(&_MarketMap_1_map{}) + } + mapValue := &_MarketMap_1_map{m: &x.Markets} + return protoreflect.ValueOfMap(mapValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap does not contain field %s", descriptor.FullName())) } } @@ -1826,19 +2165,17 @@ func (x *fastReflection_Operation) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Operation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MarketMap) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) - case "slinky.marketmap.v1.Operation.invert": - x.Invert = value.Bool() - case "slinky.marketmap.v1.Operation.provider": - x.Provider = value.Interface().(string) + case "slinky.marketmap.v1.MarketMap.markets": + mv := value.Map() + cmv := mv.(*_MarketMap_1_map) + x.Markets = *cmv.m default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap does not contain field %s", fd.FullName())) } } @@ -1852,52 +2189,45 @@ func (x *fastReflection_Operation) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Operation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMap) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - if x.CurrencyPair == nil { - x.CurrencyPair = new(v1.CurrencyPair) + case "slinky.marketmap.v1.MarketMap.markets": + if x.Markets == nil { + x.Markets = make(map[string]*Market) } - return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - case "slinky.marketmap.v1.Operation.invert": - panic(fmt.Errorf("field invert of message slinky.marketmap.v1.Operation is not mutable")) - case "slinky.marketmap.v1.Operation.provider": - panic(fmt.Errorf("field provider of message slinky.marketmap.v1.Operation is not mutable")) + value := &_MarketMap_1_map{m: &x.Markets} + return protoreflect.ValueOfMap(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_Operation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMap) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Operation.currency_pair": - m := new(v1.CurrencyPair) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.Operation.invert": - return protoreflect.ValueOfBool(false) - case "slinky.marketmap.v1.Operation.provider": - return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.MarketMap.markets": + m := make(map[string]*Market) + return protoreflect.ValueOfMap(&_MarketMap_1_map{m: &m}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Operation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) } - panic(fmt.Errorf("message slinky.marketmap.v1.Operation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_Operation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MarketMap) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Operation", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketMap", d.FullName())) } panic("unreachable") } @@ -1905,7 +2235,7 @@ func (x *fastReflection_Operation) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_Operation) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MarketMap) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1916,7 +2246,7 @@ func (x *fastReflection_Operation) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Operation) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MarketMap) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1928,7 +2258,7 @@ func (x *fastReflection_Operation) SetUnknown(fields protoreflect.RawFields) { // 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_Operation) IsValid() bool { +func (x *fastReflection_MarketMap) IsValid() bool { return x != nil } @@ -1938,9 +2268,9 @@ func (x *fastReflection_Operation) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_Operation) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MarketMap) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Operation) + x := input.Message.Interface().(*MarketMap) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1952,16 +2282,31 @@ func (x *fastReflection_Operation) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.CurrencyPair != nil { - l = options.Size(x.CurrencyPair) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Invert { - n += 2 - } - l = len(x.Provider) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Markets) > 0 { + SiZeMaP := func(k string, v *Market) { + l := 0 + if v != nil { + l = options.Size(v) + } + l += 1 + runtime.Sov(uint64(l)) + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.Markets)) + for k := range x.Markets { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.Markets[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.Markets { + SiZeMaP(k, v) + } + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1973,7 +2318,7 @@ func (x *fastReflection_Operation) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Operation) + x := input.Message.Interface().(*MarketMap) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1992,2399 +2337,108 @@ func (x *fastReflection_Operation) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Provider) > 0 { - i -= len(x.Provider) - copy(dAtA[i:], x.Provider) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Provider))) - i-- - dAtA[i] = 0x1a - } - if x.Invert { - i-- - if x.Invert { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - 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] = 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().(*Operation) - 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: Operation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Operation: 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 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 - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Invert = bool(v != 0) - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) + if len(x.Markets) > 0 { + MaRsHaLmAp := func(k string, v *Market) (protoiface.MarshalOutput, error) { + baseI := i + encoded, err := options.Marshal(v) 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]...) + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err } - iNdEx += skippy + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + return protoiface.MarshalOutput{}, nil } - } - - 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 = (*_Paths_1_list)(nil) - -type _Paths_1_list struct { - list *[]*Path -} - -func (x *_Paths_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Paths_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Paths_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Path) - (*x.list)[i] = concreteValue -} - -func (x *_Paths_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Path) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Paths_1_list) AppendMutable() protoreflect.Value { - v := new(Path) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Paths_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Paths_1_list) NewElement() protoreflect.Value { - v := new(Path) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Paths_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Paths protoreflect.MessageDescriptor - fd_Paths_paths protoreflect.FieldDescriptor -) - -func init() { - file_slinky_marketmap_v1_market_proto_init() - md_Paths = File_slinky_marketmap_v1_market_proto.Messages().ByName("Paths") - fd_Paths_paths = md_Paths.Fields().ByName("paths") -} - -var _ protoreflect.Message = (*fastReflection_Paths)(nil) - -type fastReflection_Paths Paths - -func (x *Paths) ProtoReflect() protoreflect.Message { - return (*fastReflection_Paths)(x) -} - -func (x *Paths) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Paths_messageType fastReflection_Paths_messageType -var _ protoreflect.MessageType = fastReflection_Paths_messageType{} - -type fastReflection_Paths_messageType struct{} - -func (x fastReflection_Paths_messageType) Zero() protoreflect.Message { - return (*fastReflection_Paths)(nil) -} -func (x fastReflection_Paths_messageType) New() protoreflect.Message { - return new(fastReflection_Paths) -} -func (x fastReflection_Paths_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Paths -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Paths) Descriptor() protoreflect.MessageDescriptor { - return md_Paths -} - -// 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_Paths) Type() protoreflect.MessageType { - return _fastReflection_Paths_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Paths) New() protoreflect.Message { - return new(fastReflection_Paths) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Paths) Interface() protoreflect.ProtoMessage { - return (*Paths)(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_Paths) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Paths) != 0 { - value := protoreflect.ValueOfList(&_Paths_1_list{list: &x.Paths}) - if !f(fd_Paths_paths, 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_Paths) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.marketmap.v1.Paths.paths": - return len(x.Paths) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.marketmap.v1.Paths.paths": - x.Paths = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.marketmap.v1.Paths.paths": - if len(x.Paths) == 0 { - return protoreflect.ValueOfList(&_Paths_1_list{}) - } - listValue := &_Paths_1_list{list: &x.Paths} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.marketmap.v1.Paths.paths": - lv := value.List() - clv := lv.(*_Paths_1_list) - x.Paths = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.Paths.paths": - if x.Paths == nil { - x.Paths = []*Path{} - } - value := &_Paths_1_list{list: &x.Paths} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.Paths.paths": - list := []*Path{} - return protoreflect.ValueOfList(&_Paths_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Paths")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Paths 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_Paths) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Paths", 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_Paths) 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_Paths) 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_Paths) 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_Paths) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Paths) - 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.Paths) > 0 { - for _, e := range x.Paths { - 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().(*Paths) - 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.Paths) > 0 { - for iNdEx := len(x.Paths) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Paths[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().(*Paths) - 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: Paths: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Paths: 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 Paths", 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.Paths = append(x.Paths, &Path{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Paths[len(x.Paths)-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 _ protoreflect.List = (*_Providers_1_list)(nil) - -type _Providers_1_list struct { - list *[]*ProviderConfig -} - -func (x *_Providers_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Providers_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Providers_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ProviderConfig) - (*x.list)[i] = concreteValue -} - -func (x *_Providers_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ProviderConfig) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Providers_1_list) AppendMutable() protoreflect.Value { - v := new(ProviderConfig) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Providers_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Providers_1_list) NewElement() protoreflect.Value { - v := new(ProviderConfig) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Providers_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Providers protoreflect.MessageDescriptor - fd_Providers_providers protoreflect.FieldDescriptor -) - -func init() { - file_slinky_marketmap_v1_market_proto_init() - md_Providers = File_slinky_marketmap_v1_market_proto.Messages().ByName("Providers") - fd_Providers_providers = md_Providers.Fields().ByName("providers") -} - -var _ protoreflect.Message = (*fastReflection_Providers)(nil) - -type fastReflection_Providers Providers - -func (x *Providers) ProtoReflect() protoreflect.Message { - return (*fastReflection_Providers)(x) -} - -func (x *Providers) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Providers_messageType fastReflection_Providers_messageType -var _ protoreflect.MessageType = fastReflection_Providers_messageType{} - -type fastReflection_Providers_messageType struct{} - -func (x fastReflection_Providers_messageType) Zero() protoreflect.Message { - return (*fastReflection_Providers)(nil) -} -func (x fastReflection_Providers_messageType) New() protoreflect.Message { - return new(fastReflection_Providers) -} -func (x fastReflection_Providers_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Providers -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Providers) Descriptor() protoreflect.MessageDescriptor { - return md_Providers -} - -// 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_Providers) Type() protoreflect.MessageType { - return _fastReflection_Providers_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Providers) New() protoreflect.Message { - return new(fastReflection_Providers) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Providers) Interface() protoreflect.ProtoMessage { - return (*Providers)(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_Providers) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Providers) != 0 { - value := protoreflect.ValueOfList(&_Providers_1_list{list: &x.Providers}) - if !f(fd_Providers_providers, 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_Providers) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.marketmap.v1.Providers.providers": - return len(x.Providers) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.marketmap.v1.Providers.providers": - x.Providers = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.marketmap.v1.Providers.providers": - if len(x.Providers) == 0 { - return protoreflect.ValueOfList(&_Providers_1_list{}) - } - listValue := &_Providers_1_list{list: &x.Providers} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.marketmap.v1.Providers.providers": - lv := value.List() - clv := lv.(*_Providers_1_list) - x.Providers = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.Providers.providers": - if x.Providers == nil { - x.Providers = []*ProviderConfig{} - } - value := &_Providers_1_list{list: &x.Providers} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.Providers.providers": - list := []*ProviderConfig{} - return protoreflect.ValueOfList(&_Providers_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Providers")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.Providers 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_Providers) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.Providers", 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_Providers) 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_Providers) 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_Providers) 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_Providers) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Providers) - 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.Providers) > 0 { - for _, e := range x.Providers { - 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().(*Providers) - 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.Providers) > 0 { - for iNdEx := len(x.Providers) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Providers[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().(*Providers) - 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: Providers: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Providers: 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 Providers", 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.Providers = append(x.Providers, &ProviderConfig{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Providers[len(x.Providers)-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 _ protoreflect.Map = (*_MarketMap_1_map)(nil) - -type _MarketMap_1_map struct { - m *map[string]*Ticker -} - -func (x *_MarketMap_1_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_MarketMap_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_MarketMap_1_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_MarketMap_1_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_MarketMap_1_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Ticker) - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MarketMap_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if ok { - return protoreflect.ValueOfMessage(v.ProtoReflect()) - } - newValue := new(Ticker) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) -} - -func (x *_MarketMap_1_map) NewValue() protoreflect.Value { - v := new(Ticker) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_1_map) IsValid() bool { - return x.m != nil -} - -var _ protoreflect.Map = (*_MarketMap_2_map)(nil) - -type _MarketMap_2_map struct { - m *map[string]*Paths -} - -func (x *_MarketMap_2_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_MarketMap_2_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_MarketMap_2_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_MarketMap_2_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_MarketMap_2_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_2_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Paths) - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MarketMap_2_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if ok { - return protoreflect.ValueOfMessage(v.ProtoReflect()) - } - newValue := new(Paths) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) -} - -func (x *_MarketMap_2_map) NewValue() protoreflect.Value { - v := new(Paths) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_2_map) IsValid() bool { - return x.m != nil -} - -var _ protoreflect.Map = (*_MarketMap_3_map)(nil) - -type _MarketMap_3_map struct { - m *map[string]*Providers -} - -func (x *_MarketMap_3_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_MarketMap_3_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_MarketMap_3_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_MarketMap_3_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_MarketMap_3_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_3_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Providers) - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MarketMap_3_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if ok { - return protoreflect.ValueOfMessage(v.ProtoReflect()) - } - newValue := new(Providers) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) -} - -func (x *_MarketMap_3_map) NewValue() protoreflect.Value { - v := new(Providers) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_3_map) IsValid() bool { - return x.m != nil -} - -var ( - md_MarketMap protoreflect.MessageDescriptor - fd_MarketMap_tickers protoreflect.FieldDescriptor - fd_MarketMap_paths protoreflect.FieldDescriptor - fd_MarketMap_providers protoreflect.FieldDescriptor - fd_MarketMap_aggregation_type protoreflect.FieldDescriptor -) - -func init() { - file_slinky_marketmap_v1_market_proto_init() - md_MarketMap = File_slinky_marketmap_v1_market_proto.Messages().ByName("MarketMap") - fd_MarketMap_tickers = md_MarketMap.Fields().ByName("tickers") - fd_MarketMap_paths = md_MarketMap.Fields().ByName("paths") - fd_MarketMap_providers = md_MarketMap.Fields().ByName("providers") - fd_MarketMap_aggregation_type = md_MarketMap.Fields().ByName("aggregation_type") -} - -var _ protoreflect.Message = (*fastReflection_MarketMap)(nil) - -type fastReflection_MarketMap MarketMap - -func (x *MarketMap) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketMap)(x) -} - -func (x *MarketMap) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MarketMap_messageType fastReflection_MarketMap_messageType -var _ protoreflect.MessageType = fastReflection_MarketMap_messageType{} - -type fastReflection_MarketMap_messageType struct{} - -func (x fastReflection_MarketMap_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketMap)(nil) -} -func (x fastReflection_MarketMap_messageType) New() protoreflect.Message { - return new(fastReflection_MarketMap) -} -func (x fastReflection_MarketMap_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMap -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketMap) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMap -} - -// 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_MarketMap) Type() protoreflect.MessageType { - return _fastReflection_MarketMap_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketMap) New() protoreflect.Message { - return new(fastReflection_MarketMap) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketMap) Interface() protoreflect.ProtoMessage { - return (*MarketMap)(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_MarketMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Tickers) != 0 { - value := protoreflect.ValueOfMap(&_MarketMap_1_map{m: &x.Tickers}) - if !f(fd_MarketMap_tickers, value) { - return - } - } - if len(x.Paths) != 0 { - value := protoreflect.ValueOfMap(&_MarketMap_2_map{m: &x.Paths}) - if !f(fd_MarketMap_paths, value) { - return - } - } - if len(x.Providers) != 0 { - value := protoreflect.ValueOfMap(&_MarketMap_3_map{m: &x.Providers}) - if !f(fd_MarketMap_providers, value) { - return - } - } - if x.AggregationType != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.AggregationType)) - if !f(fd_MarketMap_aggregation_type, 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_MarketMap) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - return len(x.Tickers) != 0 - case "slinky.marketmap.v1.MarketMap.paths": - return len(x.Paths) != 0 - case "slinky.marketmap.v1.MarketMap.providers": - return len(x.Providers) != 0 - case "slinky.marketmap.v1.MarketMap.aggregation_type": - return x.AggregationType != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - x.Tickers = nil - case "slinky.marketmap.v1.MarketMap.paths": - x.Paths = nil - case "slinky.marketmap.v1.MarketMap.providers": - x.Providers = nil - case "slinky.marketmap.v1.MarketMap.aggregation_type": - x.AggregationType = 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - if len(x.Tickers) == 0 { - return protoreflect.ValueOfMap(&_MarketMap_1_map{}) - } - mapValue := &_MarketMap_1_map{m: &x.Tickers} - return protoreflect.ValueOfMap(mapValue) - case "slinky.marketmap.v1.MarketMap.paths": - if len(x.Paths) == 0 { - return protoreflect.ValueOfMap(&_MarketMap_2_map{}) - } - mapValue := &_MarketMap_2_map{m: &x.Paths} - return protoreflect.ValueOfMap(mapValue) - case "slinky.marketmap.v1.MarketMap.providers": - if len(x.Providers) == 0 { - return protoreflect.ValueOfMap(&_MarketMap_3_map{}) - } - mapValue := &_MarketMap_3_map{m: &x.Providers} - return protoreflect.ValueOfMap(mapValue) - case "slinky.marketmap.v1.MarketMap.aggregation_type": - value := x.AggregationType - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - mv := value.Map() - cmv := mv.(*_MarketMap_1_map) - x.Tickers = *cmv.m - case "slinky.marketmap.v1.MarketMap.paths": - mv := value.Map() - cmv := mv.(*_MarketMap_2_map) - x.Paths = *cmv.m - case "slinky.marketmap.v1.MarketMap.providers": - mv := value.Map() - cmv := mv.(*_MarketMap_3_map) - x.Providers = *cmv.m - case "slinky.marketmap.v1.MarketMap.aggregation_type": - x.AggregationType = (AggregationType)(value.Enum()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - if x.Tickers == nil { - x.Tickers = make(map[string]*Ticker) - } - value := &_MarketMap_1_map{m: &x.Tickers} - return protoreflect.ValueOfMap(value) - case "slinky.marketmap.v1.MarketMap.paths": - if x.Paths == nil { - x.Paths = make(map[string]*Paths) - } - value := &_MarketMap_2_map{m: &x.Paths} - return protoreflect.ValueOfMap(value) - case "slinky.marketmap.v1.MarketMap.providers": - if x.Providers == nil { - x.Providers = make(map[string]*Providers) - } - value := &_MarketMap_3_map{m: &x.Providers} - return protoreflect.ValueOfMap(value) - case "slinky.marketmap.v1.MarketMap.aggregation_type": - panic(fmt.Errorf("field aggregation_type of message slinky.marketmap.v1.MarketMap is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.marketmap.v1.MarketMap.tickers": - m := make(map[string]*Ticker) - return protoreflect.ValueOfMap(&_MarketMap_1_map{m: &m}) - case "slinky.marketmap.v1.MarketMap.paths": - m := make(map[string]*Paths) - return protoreflect.ValueOfMap(&_MarketMap_2_map{m: &m}) - case "slinky.marketmap.v1.MarketMap.providers": - m := make(map[string]*Providers) - return protoreflect.ValueOfMap(&_MarketMap_3_map{m: &m}) - case "slinky.marketmap.v1.MarketMap.aggregation_type": - return protoreflect.ValueOfEnum(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.marketmap.v1.MarketMap 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_MarketMap) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketMap", 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_MarketMap) 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_MarketMap) 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_MarketMap) 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_MarketMap) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketMap) - 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.Tickers) > 0 { - SiZeMaP := func(k string, v *Ticker) { - l := 0 - if v != nil { - l = options.Size(v) - } - l += 1 + runtime.Sov(uint64(l)) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Tickers)) - for k := range x.Tickers { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Tickers[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Tickers { - SiZeMaP(k, v) - } - } - } - if len(x.Paths) > 0 { - SiZeMaP := func(k string, v *Paths) { - l := 0 - if v != nil { - l = options.Size(v) - } - l += 1 + runtime.Sov(uint64(l)) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Paths)) - for k := range x.Paths { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Paths[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Paths { - SiZeMaP(k, v) - } - } - } - if len(x.Providers) > 0 { - SiZeMaP := func(k string, v *Providers) { - l := 0 - if v != nil { - l = options.Size(v) - } - l += 1 + runtime.Sov(uint64(l)) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Providers)) - for k := range x.Providers { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Providers[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Providers { - SiZeMaP(k, v) - } - } - } - if x.AggregationType != 0 { - n += 1 + runtime.Sov(uint64(x.AggregationType)) - } - 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().(*MarketMap) - 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.AggregationType != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.AggregationType)) - i-- - dAtA[i] = 0x20 - } - if len(x.Providers) > 0 { - MaRsHaLmAp := func(k string, v *Providers) (protoiface.MarshalOutput, error) { - baseI := i - encoded, err := options.Marshal(v) - 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 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForProviders := make([]string, 0, len(x.Providers)) - for k := range x.Providers { - keysForProviders = append(keysForProviders, string(k)) - } - sort.Slice(keysForProviders, func(i, j int) bool { - return keysForProviders[i] < keysForProviders[j] - }) - for iNdEx := len(keysForProviders) - 1; iNdEx >= 0; iNdEx-- { - v := x.Providers[string(keysForProviders[iNdEx])] - out, err := MaRsHaLmAp(keysForProviders[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Providers { - v := x.Providers[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Paths) > 0 { - MaRsHaLmAp := func(k string, v *Paths) (protoiface.MarshalOutput, error) { - baseI := i - encoded, err := options.Marshal(v) - 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 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForPaths := make([]string, 0, len(x.Paths)) - for k := range x.Paths { - keysForPaths = append(keysForPaths, string(k)) - } - sort.Slice(keysForPaths, func(i, j int) bool { - return keysForPaths[i] < keysForPaths[j] - }) - for iNdEx := len(keysForPaths) - 1; iNdEx >= 0; iNdEx-- { - v := x.Paths[string(keysForPaths[iNdEx])] - out, err := MaRsHaLmAp(keysForPaths[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Paths { - v := x.Paths[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - if len(x.Tickers) > 0 { - MaRsHaLmAp := func(k string, v *Ticker) (protoiface.MarshalOutput, error) { - baseI := i - encoded, err := options.Marshal(v) - 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 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForTickers := make([]string, 0, len(x.Tickers)) - for k := range x.Tickers { - keysForTickers = append(keysForTickers, string(k)) - } - sort.Slice(keysForTickers, func(i, j int) bool { - return keysForTickers[i] < keysForTickers[j] - }) - for iNdEx := len(keysForTickers) - 1; iNdEx >= 0; iNdEx-- { - v := x.Tickers[string(keysForTickers[iNdEx])] - out, err := MaRsHaLmAp(keysForTickers[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Tickers { - v := x.Tickers[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - 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().(*MarketMap) - 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: MarketMap: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMap: 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 Tickers", 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.Tickers == nil { - x.Tickers = make(map[string]*Ticker) - } - var mapkey string - var mapvalue *Ticker - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey 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++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen 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++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postmsgIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = &Ticker{} - if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - 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) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Tickers[mapkey] = mapvalue - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paths", 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.Paths == nil { - x.Paths = make(map[string]*Paths) + if options.Deterministic { + keysForMarkets := make([]string, 0, len(x.Markets)) + for k := range x.Markets { + keysForMarkets = append(keysForMarkets, string(k)) } - var mapkey string - var mapvalue *Paths - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey 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++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen 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++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postmsgIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = &Paths{} - if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - 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) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy + sort.Slice(keysForMarkets, func(i, j int) bool { + return keysForMarkets[i] < keysForMarkets[j] + }) + for iNdEx := len(keysForMarkets) - 1; iNdEx >= 0; iNdEx-- { + v := x.Markets[string(keysForMarkets[iNdEx])] + out, err := MaRsHaLmAp(keysForMarkets[iNdEx], v) + if err != nil { + return out, err } } - x.Paths[mapkey] = mapvalue - iNdEx = postIndex - case 3: + } else { + for k := range x.Markets { + v := x.Markets[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + 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().(*MarketMap) + 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: MarketMap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMap: 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 Providers", wireType) + 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 { @@ -4411,11 +2465,11 @@ func (x *fastReflection_MarketMap) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Providers == nil { - x.Providers = make(map[string]*Providers) + if x.Markets == nil { + x.Markets = make(map[string]*Market) } var mapkey string - var mapvalue *Providers + var mapvalue *Market for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -4489,7 +2543,7 @@ func (x *fastReflection_MarketMap) ProtoMethods() *protoiface.Methods { if postmsgIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - mapvalue = &Providers{} + mapvalue = &Market{} if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } @@ -4509,27 +2563,8 @@ func (x *fastReflection_MarketMap) ProtoMethods() *protoiface.Methods { iNdEx += skippy } } - x.Providers[mapkey] = mapvalue + x.Markets[mapkey] = mapvalue iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AggregationType", wireType) - } - x.AggregationType = 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.AggregationType |= AggregationType(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4578,63 +2613,52 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// AggregationType is the type of aggregation that will be used to aggregate the -// prices of the tickers. -type AggregationType int32 +// Market encapsulates a Ticker and its provider-specific configuration. +type Market struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -const ( - // UNKOWN_AGGREGATION_TYPE is the default value for the aggregation type. - AggregationType_UNKNOWN_AGGREGATION_TYPE AggregationType = 0 - // IndexPriceAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // either directly or using the index price to a common currency pair. - AggregationType_INDEX_PRICE_AGGREGATION AggregationType = 1 - // StandardMedianAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // to a common currency pair and then takes the median of the prices. No - // conversions are done if the prices are already in the common currency pair. - AggregationType_STANDARD_MEDIAN_AGGREGATION AggregationType = 2 -) + // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + // price feed is scaled to a number of decimal places and has a minimum number + // of providers required to consider the ticker valid. + Ticker *Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` + // ProviderConfigs is the list of provider-specific configs for this Market. + ProviderConfigs []*ProviderConfig `protobuf:"bytes,2,rep,name=provider_configs,json=providerConfigs,proto3" json:"provider_configs,omitempty"` +} -// Enum value maps for AggregationType. -var ( - AggregationType_name = map[int32]string{ - 0: "UNKNOWN_AGGREGATION_TYPE", - 1: "INDEX_PRICE_AGGREGATION", - 2: "STANDARD_MEDIAN_AGGREGATION", - } - AggregationType_value = map[string]int32{ - "UNKNOWN_AGGREGATION_TYPE": 0, - "INDEX_PRICE_AGGREGATION": 1, - "STANDARD_MEDIAN_AGGREGATION": 2, +func (x *Market) Reset() { + *x = Market{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_market_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -) - -func (x AggregationType) Enum() *AggregationType { - p := new(AggregationType) - *p = x - return p } -func (x AggregationType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +func (x *Market) String() string { + return protoimpl.X.MessageStringOf(x) } -func (AggregationType) Descriptor() protoreflect.EnumDescriptor { - return file_slinky_marketmap_v1_market_proto_enumTypes[0].Descriptor() -} +func (*Market) ProtoMessage() {} -func (AggregationType) Type() protoreflect.EnumType { - return &file_slinky_marketmap_v1_market_proto_enumTypes[0] +// Deprecated: Use Market.ProtoReflect.Descriptor instead. +func (*Market) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{0} } -func (x AggregationType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) +func (x *Market) GetTicker() *Ticker { + if x != nil { + return x.Ticker + } + return nil } -// Deprecated: Use AggregationType.Descriptor instead. -func (AggregationType) EnumDescriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{0} +func (x *Market) GetProviderConfigs() []*ProviderConfig { + if x != nil { + return x.ProviderConfigs + } + return nil } // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price @@ -4664,7 +2688,7 @@ type Ticker struct { func (x *Ticker) Reset() { *x = Ticker{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[0] + mi := &file_slinky_marketmap_v1_market_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4678,7 +2702,7 @@ func (*Ticker) ProtoMessage() {} // Deprecated: Use Ticker.ProtoReflect.Descriptor instead. func (*Ticker) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{0} + return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{1} } func (x *Ticker) GetCurrencyPair() *v1.CurrencyPair { @@ -4728,12 +2752,23 @@ type ProviderConfig struct { // The off-chain ticker is unique to a given provider and is used to fetch the // price of the ticker from the provider. OffChainTicker string `protobuf:"bytes,2,opt,name=off_chain_ticker,json=offChainTicker,proto3" json:"off_chain_ticker,omitempty"` + // NormalizeByPair is the currency pair for this ticker to be normalized by. + // For example, if the desired Ticker is BTD/USD, this market could be reached + // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + // optional and nullable. + NormalizeByPair *v1.CurrencyPair `protobuf:"bytes,3,opt,name=normalize_by_pair,json=normalizeByPair,proto3" json:"normalize_by_pair,omitempty"` + // Invert is a boolean indicating if the BASE and QUOTE of the market should + // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + Invert bool `protobuf:"varint,4,opt,name=invert,proto3" json:"invert,omitempty"` + // MetadataJSON is a string of JSON that encodes any extra configuration + // for the given provider config. + Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` } func (x *ProviderConfig) Reset() { *x = ProviderConfig{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[1] + mi := &file_slinky_marketmap_v1_market_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4747,7 +2782,7 @@ func (*ProviderConfig) ProtoMessage() {} // Deprecated: Use ProviderConfig.ProtoReflect.Descriptor instead. func (*ProviderConfig) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{1} + return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{2} } func (x *ProviderConfig) GetName() string { @@ -4764,197 +2799,42 @@ func (x *ProviderConfig) GetOffChainTicker() string { return "" } -// Path is the list of convertable markets that will be used to convert the -// prices of a set of tickers to a common ticker. -type Path struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Operations is an ordered list of operations that will be taken. These must - // be topologically sorted to ensure that the conversion is possible i.e. DAG. - Operations []*Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` -} - -func (x *Path) Reset() { - *x = Path{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Path) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Path) ProtoMessage() {} - -// Deprecated: Use Path.ProtoReflect.Descriptor instead. -func (*Path) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{2} -} - -func (x *Path) GetOperations() []*Operation { - if x != nil { - return x.Operations - } - return nil -} - -// Operation represents the operation configuration for a given ticker. -type Operation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CurrencyPair is the on-chain currency pair for this ticker. - CurrencyPair *v1.CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair,omitempty"` - // Invert is a boolean that indicates whether the price of the ticker should - // be inverted. - Invert bool `protobuf:"varint,2,opt,name=invert,proto3" json:"invert,omitempty"` - // Provider is the name of the provider that will be used to fetch the price - // of the ticker. - Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` -} - -func (x *Operation) Reset() { - *x = Operation{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{3} -} - -func (x *Operation) GetCurrencyPair() *v1.CurrencyPair { +func (x *ProviderConfig) GetNormalizeByPair() *v1.CurrencyPair { if x != nil { - return x.CurrencyPair + return x.NormalizeByPair } return nil } -func (x *Operation) GetInvert() bool { +func (x *ProviderConfig) GetInvert() bool { if x != nil { return x.Invert } return false } -func (x *Operation) GetProvider() string { +func (x *ProviderConfig) GetMetadata_JSON() string { if x != nil { - return x.Provider + return x.Metadata_JSON } return "" } -type Paths struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - Paths []*Path `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` -} - -func (x *Paths) Reset() { - *x = Paths{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Paths) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Paths) ProtoMessage() {} - -// Deprecated: Use Paths.ProtoReflect.Descriptor instead. -func (*Paths) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{4} -} - -func (x *Paths) GetPaths() []*Path { - if x != nil { - return x.Paths - } - return nil -} - -type Providers struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Providers is the list of provider configurations for the given ticker. - Providers []*ProviderConfig `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers,omitempty"` -} - -func (x *Providers) Reset() { - *x = Providers{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Providers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Providers) ProtoMessage() {} - -// Deprecated: Use Providers.ProtoReflect.Descriptor instead. -func (*Providers) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{5} -} - -func (x *Providers) GetProviders() []*ProviderConfig { - if x != nil { - return x.Providers - } - return nil -} - +// MarketMap maps ticker strings to their Markets. type MarketMap struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Tickers is the full list of tickers and their associated configurations + // Markets is the full list of tickers and their associated configurations // to be stored on-chain. - Tickers map[string]*Ticker `protobuf:"bytes,1,rep,name=tickers,proto3" json:"tickers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Paths is a map from CurrencyPair to all paths that resolve to that pair - Paths map[string]*Paths `protobuf:"bytes,2,rep,name=paths,proto3" json:"paths,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Providers is a map from CurrencyPair to each of to provider-specific - // configs associated with it. - Providers map[string]*Providers `protobuf:"bytes,3,rep,name=providers,proto3" json:"providers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // AggregationType is the type of aggregation that will be used to aggregate - // the prices of the tickers. - AggregationType AggregationType `protobuf:"varint,4,opt,name=aggregation_type,json=aggregationType,proto3,enum=slinky.marketmap.v1.AggregationType" json:"aggregation_type,omitempty"` + Markets map[string]*Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *MarketMap) Reset() { *x = MarketMap{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_market_proto_msgTypes[6] + mi := &file_slinky_marketmap_v1_market_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4968,37 +2848,16 @@ func (*MarketMap) ProtoMessage() {} // Deprecated: Use MarketMap.ProtoReflect.Descriptor instead. func (*MarketMap) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{6} -} - -func (x *MarketMap) GetTickers() map[string]*Ticker { - if x != nil { - return x.Tickers - } - return nil -} - -func (x *MarketMap) GetPaths() map[string]*Paths { - if x != nil { - return x.Paths - } - return nil + return file_slinky_marketmap_v1_market_proto_rawDescGZIP(), []int{3} } -func (x *MarketMap) GetProviders() map[string]*Providers { +func (x *MarketMap) GetMarkets() map[string]*Market { if x != nil { - return x.Providers + return x.Markets } return nil } -func (x *MarketMap) GetAggregationType() AggregationType { - if x != nil { - return x.AggregationType - } - return AggregationType_UNKNOWN_AGGREGATION_TYPE -} - var File_slinky_marketmap_v1_market_proto protoreflect.FileDescriptor var file_slinky_marketmap_v1_market_proto_rawDesc = []byte{ @@ -5009,107 +2868,70 @@ var file_slinky_marketmap_v1_market_proto_rawDesc = []byte{ 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xe5, 0x01, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 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, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, - 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, - 0x61, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x10, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x53, 0x4f, 0x4e, - 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, 0x22, 0x4e, 0x0a, 0x0e, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x69, - 0x63, 0x6b, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x66, 0x66, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x22, 0x4c, 0x0a, 0x04, 0x50, 0x61, - 0x74, 0x68, 0x12, 0x44, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0a, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, - 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x22, 0x3e, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x35, 0x0a, - 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, - 0x61, 0x74, 0x68, 0x73, 0x22, 0x54, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x12, 0x47, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0xda, 0x04, 0x0a, 0x09, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x4b, 0x0a, 0x07, 0x74, 0x69, 0x63, 0x6b, - 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 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, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x74, 0x69, - 0x63, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 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, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x51, 0x0a, 0x09, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2d, 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, 0x2e, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, - 0x4f, 0x0a, 0x10, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x1a, 0x57, 0x0a, 0x0c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 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, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x54, 0x0a, 0x0a, 0x50, 0x61, 0x74, - 0x68, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x61, 0x74, 0x68, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x5c, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, + 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, 0x06, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x39, 0x0a, + 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 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, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x54, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x08, 0x98, - 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, 0x2a, 0x6d, 0x0a, 0x0f, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x44, 0x45, - 0x58, 0x5f, 0x50, 0x52, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, - 0x44, 0x5f, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x4e, 0x5f, 0x41, 0x47, 0x47, 0x52, 0x45, 0x47, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x42, 0xc6, 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, 0x0b, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 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, + 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x3a, 0x08, + 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, 0x22, 0xe5, 0x01, 0x0a, 0x06, 0x54, 0x69, 0x63, + 0x6b, 0x65, 0x72, 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, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6e, + 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x4a, 0x53, + 0x4f, 0x4e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x4a, 0x53, 0x4f, 0x4e, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, + 0x22, 0xd6, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x5f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x6f, 0x66, 0x66, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, + 0x72, 0x12, 0x49, 0x0a, 0x11, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x62, + 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x03, 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, 0x0f, 0x6e, 0x6f, 0x72, + 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x50, 0x61, 0x69, 0x72, 0x12, 0x16, 0x0a, 0x06, + 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x6e, + 0x76, 0x65, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0xbb, 0x01, 0x0a, 0x09, 0x4d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x4b, 0x0a, 0x07, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 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, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x73, 0x1a, 0x57, 0x0a, 0x0c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 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, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x08, 0x98, + 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, 0x42, 0xc6, 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, 0x0b, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 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 ( @@ -5124,40 +2946,27 @@ func file_slinky_marketmap_v1_market_proto_rawDescGZIP() []byte { return file_slinky_marketmap_v1_market_proto_rawDescData } -var file_slinky_marketmap_v1_market_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_slinky_marketmap_v1_market_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_slinky_marketmap_v1_market_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_slinky_marketmap_v1_market_proto_goTypes = []interface{}{ - (AggregationType)(0), // 0: slinky.marketmap.v1.AggregationType + (*Market)(nil), // 0: slinky.marketmap.v1.Market (*Ticker)(nil), // 1: slinky.marketmap.v1.Ticker (*ProviderConfig)(nil), // 2: slinky.marketmap.v1.ProviderConfig - (*Path)(nil), // 3: slinky.marketmap.v1.Path - (*Operation)(nil), // 4: slinky.marketmap.v1.Operation - (*Paths)(nil), // 5: slinky.marketmap.v1.Paths - (*Providers)(nil), // 6: slinky.marketmap.v1.Providers - (*MarketMap)(nil), // 7: slinky.marketmap.v1.MarketMap - nil, // 8: slinky.marketmap.v1.MarketMap.TickersEntry - nil, // 9: slinky.marketmap.v1.MarketMap.PathsEntry - nil, // 10: slinky.marketmap.v1.MarketMap.ProvidersEntry - (*v1.CurrencyPair)(nil), // 11: slinky.types.v1.CurrencyPair + (*MarketMap)(nil), // 3: slinky.marketmap.v1.MarketMap + nil, // 4: slinky.marketmap.v1.MarketMap.MarketsEntry + (*v1.CurrencyPair)(nil), // 5: slinky.types.v1.CurrencyPair } var file_slinky_marketmap_v1_market_proto_depIdxs = []int32{ - 11, // 0: slinky.marketmap.v1.Ticker.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 4, // 1: slinky.marketmap.v1.Path.operations:type_name -> slinky.marketmap.v1.Operation - 11, // 2: slinky.marketmap.v1.Operation.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 3, // 3: slinky.marketmap.v1.Paths.paths:type_name -> slinky.marketmap.v1.Path - 2, // 4: slinky.marketmap.v1.Providers.providers:type_name -> slinky.marketmap.v1.ProviderConfig - 8, // 5: slinky.marketmap.v1.MarketMap.tickers:type_name -> slinky.marketmap.v1.MarketMap.TickersEntry - 9, // 6: slinky.marketmap.v1.MarketMap.paths:type_name -> slinky.marketmap.v1.MarketMap.PathsEntry - 10, // 7: slinky.marketmap.v1.MarketMap.providers:type_name -> slinky.marketmap.v1.MarketMap.ProvidersEntry - 0, // 8: slinky.marketmap.v1.MarketMap.aggregation_type:type_name -> slinky.marketmap.v1.AggregationType - 1, // 9: slinky.marketmap.v1.MarketMap.TickersEntry.value:type_name -> slinky.marketmap.v1.Ticker - 5, // 10: slinky.marketmap.v1.MarketMap.PathsEntry.value:type_name -> slinky.marketmap.v1.Paths - 6, // 11: slinky.marketmap.v1.MarketMap.ProvidersEntry.value:type_name -> slinky.marketmap.v1.Providers - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 1, // 0: slinky.marketmap.v1.Market.ticker:type_name -> slinky.marketmap.v1.Ticker + 2, // 1: slinky.marketmap.v1.Market.provider_configs:type_name -> slinky.marketmap.v1.ProviderConfig + 5, // 2: slinky.marketmap.v1.Ticker.currency_pair:type_name -> slinky.types.v1.CurrencyPair + 5, // 3: slinky.marketmap.v1.ProviderConfig.normalize_by_pair:type_name -> slinky.types.v1.CurrencyPair + 4, // 4: slinky.marketmap.v1.MarketMap.markets:type_name -> slinky.marketmap.v1.MarketMap.MarketsEntry + 0, // 5: slinky.marketmap.v1.MarketMap.MarketsEntry.value:type_name -> slinky.marketmap.v1.Market + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] 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 } func init() { file_slinky_marketmap_v1_market_proto_init() } @@ -5167,7 +2976,7 @@ func file_slinky_marketmap_v1_market_proto_init() { } if !protoimpl.UnsafeEnabled { file_slinky_marketmap_v1_market_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ticker); i { + switch v := v.(*Market); i { case 0: return &v.state case 1: @@ -5179,7 +2988,7 @@ func file_slinky_marketmap_v1_market_proto_init() { } } file_slinky_marketmap_v1_market_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProviderConfig); i { + switch v := v.(*Ticker); i { case 0: return &v.state case 1: @@ -5191,7 +3000,7 @@ func file_slinky_marketmap_v1_market_proto_init() { } } file_slinky_marketmap_v1_market_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Path); i { + switch v := v.(*ProviderConfig); i { case 0: return &v.state case 1: @@ -5203,42 +3012,6 @@ func file_slinky_marketmap_v1_market_proto_init() { } } file_slinky_marketmap_v1_market_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_marketmap_v1_market_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Paths); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_marketmap_v1_market_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Providers); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_marketmap_v1_market_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MarketMap); i { case 0: return &v.state @@ -5256,14 +3029,13 @@ func file_slinky_marketmap_v1_market_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_slinky_marketmap_v1_market_proto_rawDesc, - NumEnums: 1, - NumMessages: 10, + NumEnums: 0, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, GoTypes: file_slinky_marketmap_v1_market_proto_goTypes, DependencyIndexes: file_slinky_marketmap_v1_market_proto_depIdxs, - EnumInfos: file_slinky_marketmap_v1_market_proto_enumTypes, MessageInfos: file_slinky_marketmap_v1_market_proto_msgTypes, }.Build() File_slinky_marketmap_v1_market_proto = out.File diff --git a/api/slinky/marketmap/v1/params.pulsar.go b/api/slinky/marketmap/v1/params.pulsar.go index bd12a81f4..021040d1b 100644 --- a/api/slinky/marketmap/v1/params.pulsar.go +++ b/api/slinky/marketmap/v1/params.pulsar.go @@ -12,17 +12,63 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_Params_1_list)(nil) + +type _Params_1_list struct { + list *[]string +} + +func (x *_Params_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Params_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Params_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Params at list field MarketAuthorities as it is not of Message kind")) +} + +func (x *_Params_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Params_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Params_1_list) IsValid() bool { + return x.list != nil +} + var ( - md_Params protoreflect.MessageDescriptor - fd_Params_market_authority protoreflect.FieldDescriptor - fd_Params_version protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_market_authorities protoreflect.FieldDescriptor + fd_Params_admin protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_params_proto_init() md_Params = File_slinky_marketmap_v1_params_proto.Messages().ByName("Params") - fd_Params_market_authority = md_Params.Fields().ByName("market_authority") - fd_Params_version = md_Params.Fields().ByName("version") + fd_Params_market_authorities = md_Params.Fields().ByName("market_authorities") + fd_Params_admin = md_Params.Fields().ByName("admin") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -90,15 +136,15 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MarketAuthority != "" { - value := protoreflect.ValueOfString(x.MarketAuthority) - if !f(fd_Params_market_authority, value) { + if len(x.MarketAuthorities) != 0 { + value := protoreflect.ValueOfList(&_Params_1_list{list: &x.MarketAuthorities}) + if !f(fd_Params_market_authorities, value) { return } } - if x.Version != uint64(0) { - value := protoreflect.ValueOfUint64(x.Version) - if !f(fd_Params_version, value) { + if x.Admin != "" { + value := protoreflect.ValueOfString(x.Admin) + if !f(fd_Params_admin, value) { return } } @@ -117,10 +163,10 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.Params.market_authority": - return x.MarketAuthority != "" - case "slinky.marketmap.v1.Params.version": - return x.Version != uint64(0) + case "slinky.marketmap.v1.Params.market_authorities": + return len(x.MarketAuthorities) != 0 + case "slinky.marketmap.v1.Params.admin": + return x.Admin != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -137,10 +183,10 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.Params.market_authority": - x.MarketAuthority = "" - case "slinky.marketmap.v1.Params.version": - x.Version = uint64(0) + case "slinky.marketmap.v1.Params.market_authorities": + x.MarketAuthorities = nil + case "slinky.marketmap.v1.Params.admin": + x.Admin = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -157,12 +203,15 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.Params.market_authority": - value := x.MarketAuthority + case "slinky.marketmap.v1.Params.market_authorities": + if len(x.MarketAuthorities) == 0 { + return protoreflect.ValueOfList(&_Params_1_list{}) + } + listValue := &_Params_1_list{list: &x.MarketAuthorities} + return protoreflect.ValueOfList(listValue) + case "slinky.marketmap.v1.Params.admin": + value := x.Admin return protoreflect.ValueOfString(value) - case "slinky.marketmap.v1.Params.version": - value := x.Version - return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -183,10 +232,12 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.Params.market_authority": - x.MarketAuthority = value.Interface().(string) - case "slinky.marketmap.v1.Params.version": - x.Version = value.Uint() + case "slinky.marketmap.v1.Params.market_authorities": + lv := value.List() + clv := lv.(*_Params_1_list) + x.MarketAuthorities = *clv.list + case "slinky.marketmap.v1.Params.admin": + x.Admin = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -207,10 +258,14 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Params.market_authority": - panic(fmt.Errorf("field market_authority of message slinky.marketmap.v1.Params is not mutable")) - case "slinky.marketmap.v1.Params.version": - panic(fmt.Errorf("field version of message slinky.marketmap.v1.Params is not mutable")) + case "slinky.marketmap.v1.Params.market_authorities": + if x.MarketAuthorities == nil { + x.MarketAuthorities = []string{} + } + value := &_Params_1_list{list: &x.MarketAuthorities} + return protoreflect.ValueOfList(value) + case "slinky.marketmap.v1.Params.admin": + panic(fmt.Errorf("field admin of message slinky.marketmap.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -224,10 +279,11 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.Params.market_authority": + case "slinky.marketmap.v1.Params.market_authorities": + list := []string{} + return protoreflect.ValueOfList(&_Params_1_list{list: &list}) + case "slinky.marketmap.v1.Params.admin": return protoreflect.ValueOfString("") - case "slinky.marketmap.v1.Params.version": - return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.Params")) @@ -297,13 +353,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.MarketAuthority) + if len(x.MarketAuthorities) > 0 { + for _, s := range x.MarketAuthorities { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Admin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Version != 0 { - n += 1 + runtime.Sov(uint64(x.Version)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -333,17 +392,21 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Version != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) + if len(x.Admin) > 0 { + i -= len(x.Admin) + copy(dAtA[i:], x.Admin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(x.MarketAuthority) > 0 { - i -= len(x.MarketAuthority) - copy(dAtA[i:], x.MarketAuthority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MarketAuthority))) - i-- - dAtA[i] = 0xa + if len(x.MarketAuthorities) > 0 { + for iNdEx := len(x.MarketAuthorities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.MarketAuthorities[iNdEx]) + copy(dAtA[i:], x.MarketAuthorities[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MarketAuthorities[iNdEx]))) + i-- + dAtA[i] = 0xa + } } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -396,7 +459,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MarketAuthority", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MarketAuthorities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -424,13 +487,13 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.MarketAuthority = string(dAtA[iNdEx:postIndex]) + x.MarketAuthorities = append(x.MarketAuthorities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } - x.Version = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -440,11 +503,24 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Version |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -499,12 +575,12 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // MarketAuthority is the authority account that is able to control updating - // the marketmap. - MarketAuthority string `protobuf:"bytes,1,opt,name=market_authority,json=marketAuthority,proto3" json:"market_authority,omitempty"` - // Version is the schema version for the MarketMap data structure and query - // response. - Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // MarketAuthorities is the list of authority accounts that are able to + // control updating the marketmap. + MarketAuthorities []string `protobuf:"bytes,1,rep,name=market_authorities,json=marketAuthorities,proto3" json:"market_authorities,omitempty"` + // Admin is an address that can remove addresses from the MarketAuthorities + // list. Only governance can add to the MarketAuthorities or change the Admin. + Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` } func (x *Params) Reset() { @@ -527,18 +603,18 @@ func (*Params) Descriptor() ([]byte, []int) { return file_slinky_marketmap_v1_params_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetMarketAuthority() string { +func (x *Params) GetMarketAuthorities() []string { if x != nil { - return x.MarketAuthority + return x.MarketAuthorities } - return "" + return nil } -func (x *Params) GetVersion() uint64 { +func (x *Params) GetAdmin() string { if x != nil { - return x.Version + return x.Admin } - return 0 + return "" } var File_slinky_marketmap_v1_params_proto protoreflect.FileDescriptor @@ -548,11 +624,11 @@ var file_slinky_marketmap_v1_params_proto_rawDesc = []byte{ 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x22, 0x4d, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xc6, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x42, 0xc6, 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, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, diff --git a/api/slinky/marketmap/v1/query.pulsar.go b/api/slinky/marketmap/v1/query.pulsar.go index af193c970..cd5b6e33e 100644 --- a/api/slinky/marketmap/v1/query.pulsar.go +++ b/api/slinky/marketmap/v1/query.pulsar.go @@ -5,6 +5,7 @@ import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + v1 "github.com/skip-mev/slinky/api/slinky/types/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -15,23 +16,23 @@ import ( ) var ( - md_GetMarketMapRequest protoreflect.MessageDescriptor + md_MarketMapRequest protoreflect.MessageDescriptor ) func init() { file_slinky_marketmap_v1_query_proto_init() - md_GetMarketMapRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("GetMarketMapRequest") + md_MarketMapRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketMapRequest") } -var _ protoreflect.Message = (*fastReflection_GetMarketMapRequest)(nil) +var _ protoreflect.Message = (*fastReflection_MarketMapRequest)(nil) -type fastReflection_GetMarketMapRequest GetMarketMapRequest +type fastReflection_MarketMapRequest MarketMapRequest -func (x *GetMarketMapRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetMarketMapRequest)(x) +func (x *MarketMapRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketMapRequest)(x) } -func (x *GetMarketMapRequest) slowProtoReflect() protoreflect.Message { +func (x *MarketMapRequest) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_query_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -43,43 +44,43 @@ func (x *GetMarketMapRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_GetMarketMapRequest_messageType fastReflection_GetMarketMapRequest_messageType -var _ protoreflect.MessageType = fastReflection_GetMarketMapRequest_messageType{} +var _fastReflection_MarketMapRequest_messageType fastReflection_MarketMapRequest_messageType +var _ protoreflect.MessageType = fastReflection_MarketMapRequest_messageType{} -type fastReflection_GetMarketMapRequest_messageType struct{} +type fastReflection_MarketMapRequest_messageType struct{} -func (x fastReflection_GetMarketMapRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetMarketMapRequest)(nil) +func (x fastReflection_MarketMapRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketMapRequest)(nil) } -func (x fastReflection_GetMarketMapRequest_messageType) New() protoreflect.Message { - return new(fastReflection_GetMarketMapRequest) +func (x fastReflection_MarketMapRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MarketMapRequest) } -func (x fastReflection_GetMarketMapRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetMarketMapRequest +func (x fastReflection_MarketMapRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMapRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_GetMarketMapRequest) Descriptor() protoreflect.MessageDescriptor { - return md_GetMarketMapRequest +func (x *fastReflection_MarketMapRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMapRequest } // 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_GetMarketMapRequest) Type() protoreflect.MessageType { - return _fastReflection_GetMarketMapRequest_messageType +func (x *fastReflection_MarketMapRequest) Type() protoreflect.MessageType { + return _fastReflection_MarketMapRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetMarketMapRequest) New() protoreflect.Message { - return new(fastReflection_GetMarketMapRequest) +func (x *fastReflection_MarketMapRequest) New() protoreflect.Message { + return new(fastReflection_MarketMapRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_GetMarketMapRequest) Interface() protoreflect.ProtoMessage { - return (*GetMarketMapRequest)(x) +func (x *fastReflection_MarketMapRequest) Interface() protoreflect.ProtoMessage { + return (*MarketMapRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -87,7 +88,7 @@ func (x *fastReflection_GetMarketMapRequest) Interface() protoreflect.ProtoMessa // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_GetMarketMapRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MarketMapRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -101,13 +102,13 @@ func (x *fastReflection_GetMarketMapRequest) Range(f func(protoreflect.FieldDesc // 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_GetMarketMapRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MarketMapRequest) 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.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest does not contain field %s", fd.FullName())) } } @@ -117,13 +118,13 @@ func (x *fastReflection_GetMarketMapRequest) Has(fd protoreflect.FieldDescriptor // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MarketMapRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest does not contain field %s", fd.FullName())) } } @@ -133,13 +134,13 @@ func (x *fastReflection_GetMarketMapRequest) Clear(fd protoreflect.FieldDescript // 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_GetMarketMapRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMapRequest) 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.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest does not contain field %s", descriptor.FullName())) } } @@ -153,13 +154,13 @@ func (x *fastReflection_GetMarketMapRequest) Get(descriptor protoreflect.FieldDe // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MarketMapRequest) 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.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest does not contain field %s", fd.FullName())) } } @@ -173,36 +174,36 @@ func (x *fastReflection_GetMarketMapRequest) Set(fd protoreflect.FieldDescriptor // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMapRequest) 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.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest 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_GetMarketMapRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketMapRequest) 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.GetMarketMapRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapRequest 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_GetMarketMapRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MarketMapRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.GetMarketMapRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketMapRequest", d.FullName())) } panic("unreachable") } @@ -210,7 +211,7 @@ func (x *fastReflection_GetMarketMapRequest) WhichOneof(d protoreflect.OneofDesc // 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_GetMarketMapRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MarketMapRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -221,7 +222,7 @@ func (x *fastReflection_GetMarketMapRequest) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MarketMapRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -233,7 +234,7 @@ func (x *fastReflection_GetMarketMapRequest) SetUnknown(fields protoreflect.RawF // 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_GetMarketMapRequest) IsValid() bool { +func (x *fastReflection_MarketMapRequest) IsValid() bool { return x != nil } @@ -243,9 +244,9 @@ func (x *fastReflection_GetMarketMapRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_GetMarketMapRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MarketMapRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetMarketMapRequest) + x := input.Message.Interface().(*MarketMapRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -267,7 +268,7 @@ func (x *fastReflection_GetMarketMapRequest) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GetMarketMapRequest) + x := input.Message.Interface().(*MarketMapRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -297,7 +298,7 @@ func (x *fastReflection_GetMarketMapRequest) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GetMarketMapRequest) + x := input.Message.Interface().(*MarketMapRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -329,10 +330,10 @@ func (x *fastReflection_GetMarketMapRequest) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetMarketMapRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMapRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetMarketMapRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMapRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -371,31 +372,29 @@ func (x *fastReflection_GetMarketMapRequest) ProtoMethods() *protoiface.Methods } var ( - md_GetMarketMapResponse protoreflect.MessageDescriptor - fd_GetMarketMapResponse_market_map protoreflect.FieldDescriptor - fd_GetMarketMapResponse_last_updated protoreflect.FieldDescriptor - fd_GetMarketMapResponse_version protoreflect.FieldDescriptor - fd_GetMarketMapResponse_chain_id protoreflect.FieldDescriptor + md_MarketMapResponse protoreflect.MessageDescriptor + fd_MarketMapResponse_market_map protoreflect.FieldDescriptor + fd_MarketMapResponse_last_updated protoreflect.FieldDescriptor + fd_MarketMapResponse_chain_id protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_query_proto_init() - md_GetMarketMapResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("GetMarketMapResponse") - fd_GetMarketMapResponse_market_map = md_GetMarketMapResponse.Fields().ByName("market_map") - fd_GetMarketMapResponse_last_updated = md_GetMarketMapResponse.Fields().ByName("last_updated") - fd_GetMarketMapResponse_version = md_GetMarketMapResponse.Fields().ByName("version") - fd_GetMarketMapResponse_chain_id = md_GetMarketMapResponse.Fields().ByName("chain_id") + md_MarketMapResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketMapResponse") + fd_MarketMapResponse_market_map = md_MarketMapResponse.Fields().ByName("market_map") + fd_MarketMapResponse_last_updated = md_MarketMapResponse.Fields().ByName("last_updated") + fd_MarketMapResponse_chain_id = md_MarketMapResponse.Fields().ByName("chain_id") } -var _ protoreflect.Message = (*fastReflection_GetMarketMapResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MarketMapResponse)(nil) -type fastReflection_GetMarketMapResponse GetMarketMapResponse +type fastReflection_MarketMapResponse MarketMapResponse -func (x *GetMarketMapResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetMarketMapResponse)(x) +func (x *MarketMapResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketMapResponse)(x) } -func (x *GetMarketMapResponse) slowProtoReflect() protoreflect.Message { +func (x *MarketMapResponse) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_query_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -407,43 +406,43 @@ func (x *GetMarketMapResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_GetMarketMapResponse_messageType fastReflection_GetMarketMapResponse_messageType -var _ protoreflect.MessageType = fastReflection_GetMarketMapResponse_messageType{} +var _fastReflection_MarketMapResponse_messageType fastReflection_MarketMapResponse_messageType +var _ protoreflect.MessageType = fastReflection_MarketMapResponse_messageType{} -type fastReflection_GetMarketMapResponse_messageType struct{} +type fastReflection_MarketMapResponse_messageType struct{} -func (x fastReflection_GetMarketMapResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetMarketMapResponse)(nil) +func (x fastReflection_MarketMapResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketMapResponse)(nil) } -func (x fastReflection_GetMarketMapResponse_messageType) New() protoreflect.Message { - return new(fastReflection_GetMarketMapResponse) +func (x fastReflection_MarketMapResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MarketMapResponse) } -func (x fastReflection_GetMarketMapResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetMarketMapResponse +func (x fastReflection_MarketMapResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMapResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_GetMarketMapResponse) Descriptor() protoreflect.MessageDescriptor { - return md_GetMarketMapResponse +func (x *fastReflection_MarketMapResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MarketMapResponse } // 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_GetMarketMapResponse) Type() protoreflect.MessageType { - return _fastReflection_GetMarketMapResponse_messageType +func (x *fastReflection_MarketMapResponse) Type() protoreflect.MessageType { + return _fastReflection_MarketMapResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetMarketMapResponse) New() protoreflect.Message { - return new(fastReflection_GetMarketMapResponse) +func (x *fastReflection_MarketMapResponse) New() protoreflect.Message { + return new(fastReflection_MarketMapResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_GetMarketMapResponse) Interface() protoreflect.ProtoMessage { - return (*GetMarketMapResponse)(x) +func (x *fastReflection_MarketMapResponse) Interface() protoreflect.ProtoMessage { + return (*MarketMapResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -451,28 +450,988 @@ func (x *fastReflection_GetMarketMapResponse) Interface() protoreflect.ProtoMess // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_GetMarketMapResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MarketMapResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.MarketMap != nil { value := protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - if !f(fd_GetMarketMapResponse_market_map, value) { + if !f(fd_MarketMapResponse_market_map, value) { return } } if x.LastUpdated != uint64(0) { value := protoreflect.ValueOfUint64(x.LastUpdated) - if !f(fd_GetMarketMapResponse_last_updated, value) { + if !f(fd_MarketMapResponse_last_updated, value) { return } } - if x.Version != uint64(0) { - value := protoreflect.ValueOfUint64(x.Version) - if !f(fd_GetMarketMapResponse_version, value) { + if x.ChainId != "" { + value := protoreflect.ValueOfString(x.ChainId) + if !f(fd_MarketMapResponse_chain_id, value) { return } } - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_GetMarketMapResponse_chain_id, value) { +} + +// 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_MarketMapResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + return x.MarketMap != nil + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + return x.LastUpdated != uint64(0) + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + return x.ChainId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + x.MarketMap = nil + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + x.LastUpdated = uint64(0) + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + x.ChainId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + value := x.MarketMap + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + value := x.LastUpdated + return protoreflect.ValueOfUint64(value) + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + value := x.ChainId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + x.MarketMap = value.Message().Interface().(*MarketMap) + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + x.LastUpdated = value.Uint() + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + x.ChainId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + if x.MarketMap == nil { + x.MarketMap = new(MarketMap) + } + return protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + panic(fmt.Errorf("field last_updated of message slinky.marketmap.v1.MarketMapResponse is not mutable")) + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + panic(fmt.Errorf("field chain_id of message slinky.marketmap.v1.MarketMapResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketMapResponse.market_map": + m := new(MarketMap) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "slinky.marketmap.v1.MarketMapResponse.last_updated": + return protoreflect.ValueOfUint64(uint64(0)) + case "slinky.marketmap.v1.MarketMapResponse.chain_id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketMapResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketMapResponse 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_MarketMapResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketMapResponse", 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_MarketMapResponse) 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_MarketMapResponse) 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_MarketMapResponse) 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_MarketMapResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MarketMapResponse) + 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.MarketMap != nil { + l = options.Size(x.MarketMap) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.LastUpdated != 0 { + n += 1 + runtime.Sov(uint64(x.LastUpdated)) + } + l = len(x.ChainId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MarketMapResponse) + 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.ChainId) > 0 { + i -= len(x.ChainId) + copy(dAtA[i:], x.ChainId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) + i-- + dAtA[i] = 0x1a + } + if x.LastUpdated != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdated)) + i-- + dAtA[i] = 0x10 + } + if x.MarketMap != nil { + encoded, err := options.Marshal(x.MarketMap) + 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().(*MarketMapResponse) + 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: MarketMapResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMapResponse: 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 MarketMap", 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.MarketMap == nil { + x.MarketMap = &MarketMap{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MarketMap); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) + } + x.LastUpdated = 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.LastUpdated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MarketRequest protoreflect.MessageDescriptor + fd_MarketRequest_currency_pair protoreflect.FieldDescriptor +) + +func init() { + file_slinky_marketmap_v1_query_proto_init() + md_MarketRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketRequest") + fd_MarketRequest_currency_pair = md_MarketRequest.Fields().ByName("currency_pair") +} + +var _ protoreflect.Message = (*fastReflection_MarketRequest)(nil) + +type fastReflection_MarketRequest MarketRequest + +func (x *MarketRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketRequest)(x) +} + +func (x *MarketRequest) 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_MarketRequest_messageType fastReflection_MarketRequest_messageType +var _ protoreflect.MessageType = fastReflection_MarketRequest_messageType{} + +type fastReflection_MarketRequest_messageType struct{} + +func (x fastReflection_MarketRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketRequest)(nil) +} +func (x fastReflection_MarketRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MarketRequest) +} +func (x fastReflection_MarketRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MarketRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MarketRequest +} + +// 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_MarketRequest) Type() protoreflect.MessageType { + return _fastReflection_MarketRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MarketRequest) New() protoreflect.Message { + return new(fastReflection_MarketRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MarketRequest) Interface() protoreflect.ProtoMessage { + return (*MarketRequest)(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_MarketRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CurrencyPair != nil { + value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + if !f(fd_MarketRequest_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_MarketRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketRequest.currency_pair": + return x.CurrencyPair != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketRequest.currency_pair": + x.CurrencyPair = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.marketmap.v1.MarketRequest.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.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketRequest.currency_pair": + x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketRequest.currency_pair": + if x.CurrencyPair == nil { + x.CurrencyPair = new(v1.CurrencyPair) + } + return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MarketRequest.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.marketmap.v1.MarketRequest")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MarketRequest 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_MarketRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketRequest", 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_MarketRequest) 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_MarketRequest) 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_MarketRequest) 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_MarketRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MarketRequest) + 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.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().(*MarketRequest) + 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] = 0x1a + } + 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().(*MarketRequest) + 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: MarketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + 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 ( + md_MarketResponse protoreflect.MessageDescriptor + fd_MarketResponse_market protoreflect.FieldDescriptor +) + +func init() { + file_slinky_marketmap_v1_query_proto_init() + md_MarketResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("MarketResponse") + fd_MarketResponse_market = md_MarketResponse.Fields().ByName("market") +} + +var _ protoreflect.Message = (*fastReflection_MarketResponse)(nil) + +type fastReflection_MarketResponse MarketResponse + +func (x *MarketResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MarketResponse)(x) +} + +func (x *MarketResponse) 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_MarketResponse_messageType fastReflection_MarketResponse_messageType +var _ protoreflect.MessageType = fastReflection_MarketResponse_messageType{} + +type fastReflection_MarketResponse_messageType struct{} + +func (x fastReflection_MarketResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MarketResponse)(nil) +} +func (x fastReflection_MarketResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MarketResponse) +} +func (x fastReflection_MarketResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MarketResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MarketResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MarketResponse +} + +// 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_MarketResponse) Type() protoreflect.MessageType { + return _fastReflection_MarketResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MarketResponse) New() protoreflect.Message { + return new(fastReflection_MarketResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MarketResponse) Interface() protoreflect.ProtoMessage { + return (*MarketResponse)(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_MarketResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Market != nil { + value := protoreflect.ValueOfMessage(x.Market.ProtoReflect()) + if !f(fd_MarketResponse_market, value) { return } } @@ -489,21 +1448,15 @@ func (x *fastReflection_GetMarketMapResponse) Range(f func(protoreflect.FieldDes // 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_GetMarketMapResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MarketResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - return x.MarketMap != nil - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - return x.LastUpdated != uint64(0) - case "slinky.marketmap.v1.GetMarketMapResponse.version": - return x.Version != uint64(0) - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - return x.ChainId != "" + case "slinky.marketmap.v1.MarketResponse.market": + return x.Market != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse does not contain field %s", fd.FullName())) } } @@ -513,21 +1466,15 @@ func (x *fastReflection_GetMarketMapResponse) Has(fd protoreflect.FieldDescripto // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MarketResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - x.MarketMap = nil - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - x.LastUpdated = uint64(0) - case "slinky.marketmap.v1.GetMarketMapResponse.version": - x.Version = uint64(0) - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - x.ChainId = "" + case "slinky.marketmap.v1.MarketResponse.market": + x.Market = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse does not contain field %s", fd.FullName())) } } @@ -537,25 +1484,16 @@ func (x *fastReflection_GetMarketMapResponse) Clear(fd protoreflect.FieldDescrip // 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_GetMarketMapResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - value := x.MarketMap + case "slinky.marketmap.v1.MarketResponse.market": + value := x.Market return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - value := x.LastUpdated - return protoreflect.ValueOfUint64(value) - case "slinky.marketmap.v1.GetMarketMapResponse.version": - value := x.Version - return protoreflect.ValueOfUint64(value) - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse does not contain field %s", descriptor.FullName())) } } @@ -569,21 +1507,15 @@ func (x *fastReflection_GetMarketMapResponse) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MarketResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - x.MarketMap = value.Message().Interface().(*MarketMap) - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - x.LastUpdated = value.Uint() - case "slinky.marketmap.v1.GetMarketMapResponse.version": - x.Version = value.Uint() - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - x.ChainId = value.Interface().(string) + case "slinky.marketmap.v1.MarketResponse.market": + x.Market = value.Message().Interface().(*Market) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse does not contain field %s", fd.FullName())) } } @@ -597,56 +1529,44 @@ func (x *fastReflection_GetMarketMapResponse) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - if x.MarketMap == nil { - x.MarketMap = new(MarketMap) + case "slinky.marketmap.v1.MarketResponse.market": + if x.Market == nil { + x.Market = new(Market) } - return protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - panic(fmt.Errorf("field last_updated of message slinky.marketmap.v1.GetMarketMapResponse is not mutable")) - case "slinky.marketmap.v1.GetMarketMapResponse.version": - panic(fmt.Errorf("field version of message slinky.marketmap.v1.GetMarketMapResponse is not mutable")) - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - panic(fmt.Errorf("field chain_id of message slinky.marketmap.v1.GetMarketMapResponse is not mutable")) + return protoreflect.ValueOfMessage(x.Market.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse 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_GetMarketMapResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MarketResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.GetMarketMapResponse.market_map": - m := new(MarketMap) + case "slinky.marketmap.v1.MarketResponse.market": + m := new(Market) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.GetMarketMapResponse.last_updated": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.marketmap.v1.GetMarketMapResponse.version": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.marketmap.v1.GetMarketMapResponse.chain_id": - return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MarketResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MarketResponse 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_GetMarketMapResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MarketResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.GetMarketMapResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MarketResponse", d.FullName())) } panic("unreachable") } @@ -654,7 +1574,7 @@ func (x *fastReflection_GetMarketMapResponse) WhichOneof(d protoreflect.OneofDes // 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_GetMarketMapResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MarketResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -665,7 +1585,7 @@ func (x *fastReflection_GetMarketMapResponse) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetMarketMapResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MarketResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -677,7 +1597,7 @@ func (x *fastReflection_GetMarketMapResponse) SetUnknown(fields protoreflect.Raw // 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_GetMarketMapResponse) IsValid() bool { +func (x *fastReflection_MarketResponse) IsValid() bool { return x != nil } @@ -687,9 +1607,9 @@ func (x *fastReflection_GetMarketMapResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MarketResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetMarketMapResponse) + x := input.Message.Interface().(*MarketResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -701,18 +1621,8 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods var n int var l int _ = l - if x.MarketMap != nil { - l = options.Size(x.MarketMap) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastUpdated != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdated)) - } - if x.Version != 0 { - n += 1 + runtime.Sov(uint64(x.Version)) - } - l = len(x.ChainId) - if l > 0 { + if x.Market != nil { + l = options.Size(x.Market) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -725,7 +1635,7 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GetMarketMapResponse) + x := input.Message.Interface().(*MarketResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -744,25 +1654,8 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) - i-- - dAtA[i] = 0x22 - } - if x.Version != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Version)) - i-- - dAtA[i] = 0x18 - } - if x.LastUpdated != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdated)) - i-- - dAtA[i] = 0x10 - } - if x.MarketMap != nil { - encoded, err := options.Marshal(x.MarketMap) + if x.Market != nil { + encoded, err := options.Marshal(x.Market) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -786,7 +1679,7 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GetMarketMapResponse) + x := input.Message.Interface().(*MarketResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -818,15 +1711,15 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetMarketMapResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetMarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketResponse: 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 MarketMap", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Market", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -853,83 +1746,13 @@ func (x *fastReflection_GetMarketMapResponse) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.MarketMap == nil { - x.MarketMap = &MarketMap{} + if x.Market == nil { + x.Market = &Market{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MarketMap); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Market); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - x.LastUpdated = 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.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - x.Version = 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.Version |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -983,7 +1806,7 @@ func (x *ParamsRequest) ProtoReflect() protoreflect.Message { } func (x *ParamsRequest) 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 { @@ -1341,7 +2164,7 @@ func (x *ParamsResponse) ProtoReflect() protoreflect.Message { } func (x *ParamsResponse) 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 { @@ -1757,24 +2580,24 @@ func (x *fastReflection_ParamsResponse) ProtoMethods() *protoiface.Methods { } var ( - md_GetLastUpdatedRequest protoreflect.MessageDescriptor + md_LastUpdatedRequest protoreflect.MessageDescriptor ) func init() { file_slinky_marketmap_v1_query_proto_init() - md_GetLastUpdatedRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("GetLastUpdatedRequest") + md_LastUpdatedRequest = File_slinky_marketmap_v1_query_proto.Messages().ByName("LastUpdatedRequest") } -var _ protoreflect.Message = (*fastReflection_GetLastUpdatedRequest)(nil) +var _ protoreflect.Message = (*fastReflection_LastUpdatedRequest)(nil) -type fastReflection_GetLastUpdatedRequest GetLastUpdatedRequest +type fastReflection_LastUpdatedRequest LastUpdatedRequest -func (x *GetLastUpdatedRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetLastUpdatedRequest)(x) +func (x *LastUpdatedRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_LastUpdatedRequest)(x) } -func (x *GetLastUpdatedRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[4] +func (x *LastUpdatedRequest) slowProtoReflect() protoreflect.Message { + 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 { @@ -1785,43 +2608,43 @@ func (x *GetLastUpdatedRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_GetLastUpdatedRequest_messageType fastReflection_GetLastUpdatedRequest_messageType -var _ protoreflect.MessageType = fastReflection_GetLastUpdatedRequest_messageType{} +var _fastReflection_LastUpdatedRequest_messageType fastReflection_LastUpdatedRequest_messageType +var _ protoreflect.MessageType = fastReflection_LastUpdatedRequest_messageType{} -type fastReflection_GetLastUpdatedRequest_messageType struct{} +type fastReflection_LastUpdatedRequest_messageType struct{} -func (x fastReflection_GetLastUpdatedRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetLastUpdatedRequest)(nil) +func (x fastReflection_LastUpdatedRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_LastUpdatedRequest)(nil) } -func (x fastReflection_GetLastUpdatedRequest_messageType) New() protoreflect.Message { - return new(fastReflection_GetLastUpdatedRequest) +func (x fastReflection_LastUpdatedRequest_messageType) New() protoreflect.Message { + return new(fastReflection_LastUpdatedRequest) } -func (x fastReflection_GetLastUpdatedRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetLastUpdatedRequest +func (x fastReflection_LastUpdatedRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_LastUpdatedRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_GetLastUpdatedRequest) Descriptor() protoreflect.MessageDescriptor { - return md_GetLastUpdatedRequest +func (x *fastReflection_LastUpdatedRequest) Descriptor() protoreflect.MessageDescriptor { + return md_LastUpdatedRequest } // 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_GetLastUpdatedRequest) Type() protoreflect.MessageType { - return _fastReflection_GetLastUpdatedRequest_messageType +func (x *fastReflection_LastUpdatedRequest) Type() protoreflect.MessageType { + return _fastReflection_LastUpdatedRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetLastUpdatedRequest) New() protoreflect.Message { - return new(fastReflection_GetLastUpdatedRequest) +func (x *fastReflection_LastUpdatedRequest) New() protoreflect.Message { + return new(fastReflection_LastUpdatedRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_GetLastUpdatedRequest) Interface() protoreflect.ProtoMessage { - return (*GetLastUpdatedRequest)(x) +func (x *fastReflection_LastUpdatedRequest) Interface() protoreflect.ProtoMessage { + return (*LastUpdatedRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -1829,7 +2652,7 @@ func (x *fastReflection_GetLastUpdatedRequest) Interface() protoreflect.ProtoMes // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_GetLastUpdatedRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_LastUpdatedRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -1843,13 +2666,13 @@ func (x *fastReflection_GetLastUpdatedRequest) Range(f func(protoreflect.FieldDe // 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_GetLastUpdatedRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_LastUpdatedRequest) 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.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest does not contain field %s", fd.FullName())) } } @@ -1859,13 +2682,13 @@ func (x *fastReflection_GetLastUpdatedRequest) Has(fd protoreflect.FieldDescript // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_LastUpdatedRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest does not contain field %s", fd.FullName())) } } @@ -1875,13 +2698,13 @@ func (x *fastReflection_GetLastUpdatedRequest) Clear(fd protoreflect.FieldDescri // 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_GetLastUpdatedRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedRequest) 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.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest does not contain field %s", descriptor.FullName())) } } @@ -1895,13 +2718,13 @@ func (x *fastReflection_GetLastUpdatedRequest) Get(descriptor protoreflect.Field // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_LastUpdatedRequest) 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.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest does not contain field %s", fd.FullName())) } } @@ -1915,36 +2738,36 @@ func (x *fastReflection_GetLastUpdatedRequest) Set(fd protoreflect.FieldDescript // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedRequest) 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.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest 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_GetLastUpdatedRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedRequest) 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.GetLastUpdatedRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedRequest")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedRequest 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_GetLastUpdatedRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_LastUpdatedRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.GetLastUpdatedRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.LastUpdatedRequest", d.FullName())) } panic("unreachable") } @@ -1952,7 +2775,7 @@ func (x *fastReflection_GetLastUpdatedRequest) WhichOneof(d protoreflect.OneofDe // 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_GetLastUpdatedRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_LastUpdatedRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1963,7 +2786,7 @@ func (x *fastReflection_GetLastUpdatedRequest) GetUnknown() protoreflect.RawFiel // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_LastUpdatedRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1975,7 +2798,7 @@ func (x *fastReflection_GetLastUpdatedRequest) SetUnknown(fields protoreflect.Ra // 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_GetLastUpdatedRequest) IsValid() bool { +func (x *fastReflection_LastUpdatedRequest) IsValid() bool { return x != nil } @@ -1985,9 +2808,9 @@ func (x *fastReflection_GetLastUpdatedRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_GetLastUpdatedRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_LastUpdatedRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetLastUpdatedRequest) + x := input.Message.Interface().(*LastUpdatedRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2009,7 +2832,7 @@ func (x *fastReflection_GetLastUpdatedRequest) ProtoMethods() *protoiface.Method } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GetLastUpdatedRequest) + x := input.Message.Interface().(*LastUpdatedRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2039,7 +2862,7 @@ func (x *fastReflection_GetLastUpdatedRequest) ProtoMethods() *protoiface.Method }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GetLastUpdatedRequest) + x := input.Message.Interface().(*LastUpdatedRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2071,10 +2894,10 @@ func (x *fastReflection_GetLastUpdatedRequest) ProtoMethods() *protoiface.Method fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetLastUpdatedRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetLastUpdatedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2113,26 +2936,26 @@ func (x *fastReflection_GetLastUpdatedRequest) ProtoMethods() *protoiface.Method } var ( - md_GetLastUpdatedResponse protoreflect.MessageDescriptor - fd_GetLastUpdatedResponse_last_updated protoreflect.FieldDescriptor + md_LastUpdatedResponse protoreflect.MessageDescriptor + fd_LastUpdatedResponse_last_updated protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_query_proto_init() - md_GetLastUpdatedResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("GetLastUpdatedResponse") - fd_GetLastUpdatedResponse_last_updated = md_GetLastUpdatedResponse.Fields().ByName("last_updated") + md_LastUpdatedResponse = File_slinky_marketmap_v1_query_proto.Messages().ByName("LastUpdatedResponse") + fd_LastUpdatedResponse_last_updated = md_LastUpdatedResponse.Fields().ByName("last_updated") } -var _ protoreflect.Message = (*fastReflection_GetLastUpdatedResponse)(nil) +var _ protoreflect.Message = (*fastReflection_LastUpdatedResponse)(nil) -type fastReflection_GetLastUpdatedResponse GetLastUpdatedResponse +type fastReflection_LastUpdatedResponse LastUpdatedResponse -func (x *GetLastUpdatedResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_GetLastUpdatedResponse)(x) +func (x *LastUpdatedResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_LastUpdatedResponse)(x) } -func (x *GetLastUpdatedResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_query_proto_msgTypes[5] +func (x *LastUpdatedResponse) slowProtoReflect() protoreflect.Message { + 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 { @@ -2143,43 +2966,43 @@ func (x *GetLastUpdatedResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_GetLastUpdatedResponse_messageType fastReflection_GetLastUpdatedResponse_messageType -var _ protoreflect.MessageType = fastReflection_GetLastUpdatedResponse_messageType{} +var _fastReflection_LastUpdatedResponse_messageType fastReflection_LastUpdatedResponse_messageType +var _ protoreflect.MessageType = fastReflection_LastUpdatedResponse_messageType{} -type fastReflection_GetLastUpdatedResponse_messageType struct{} +type fastReflection_LastUpdatedResponse_messageType struct{} -func (x fastReflection_GetLastUpdatedResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_GetLastUpdatedResponse)(nil) +func (x fastReflection_LastUpdatedResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_LastUpdatedResponse)(nil) } -func (x fastReflection_GetLastUpdatedResponse_messageType) New() protoreflect.Message { - return new(fastReflection_GetLastUpdatedResponse) +func (x fastReflection_LastUpdatedResponse_messageType) New() protoreflect.Message { + return new(fastReflection_LastUpdatedResponse) } -func (x fastReflection_GetLastUpdatedResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GetLastUpdatedResponse +func (x fastReflection_LastUpdatedResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_LastUpdatedResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_GetLastUpdatedResponse) Descriptor() protoreflect.MessageDescriptor { - return md_GetLastUpdatedResponse +func (x *fastReflection_LastUpdatedResponse) Descriptor() protoreflect.MessageDescriptor { + return md_LastUpdatedResponse } // 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_GetLastUpdatedResponse) Type() protoreflect.MessageType { - return _fastReflection_GetLastUpdatedResponse_messageType +func (x *fastReflection_LastUpdatedResponse) Type() protoreflect.MessageType { + return _fastReflection_LastUpdatedResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_GetLastUpdatedResponse) New() protoreflect.Message { - return new(fastReflection_GetLastUpdatedResponse) +func (x *fastReflection_LastUpdatedResponse) New() protoreflect.Message { + return new(fastReflection_LastUpdatedResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_GetLastUpdatedResponse) Interface() protoreflect.ProtoMessage { - return (*GetLastUpdatedResponse)(x) +func (x *fastReflection_LastUpdatedResponse) Interface() protoreflect.ProtoMessage { + return (*LastUpdatedResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2187,10 +3010,10 @@ func (x *fastReflection_GetLastUpdatedResponse) Interface() protoreflect.ProtoMe // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_GetLastUpdatedResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_LastUpdatedResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.LastUpdated != uint64(0) { value := protoreflect.ValueOfUint64(x.LastUpdated) - if !f(fd_GetLastUpdatedResponse_last_updated, value) { + if !f(fd_LastUpdatedResponse_last_updated, value) { return } } @@ -2207,15 +3030,15 @@ func (x *fastReflection_GetLastUpdatedResponse) Range(f func(protoreflect.FieldD // 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_GetLastUpdatedResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_LastUpdatedResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": return x.LastUpdated != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse does not contain field %s", fd.FullName())) } } @@ -2225,15 +3048,15 @@ func (x *fastReflection_GetLastUpdatedResponse) Has(fd protoreflect.FieldDescrip // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_LastUpdatedResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": x.LastUpdated = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse does not contain field %s", fd.FullName())) } } @@ -2243,16 +3066,16 @@ func (x *fastReflection_GetLastUpdatedResponse) Clear(fd protoreflect.FieldDescr // 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_GetLastUpdatedResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": value := x.LastUpdated return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse does not contain field %s", descriptor.FullName())) } } @@ -2266,15 +3089,15 @@ func (x *fastReflection_GetLastUpdatedResponse) Get(descriptor protoreflect.Fiel // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_LastUpdatedResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": x.LastUpdated = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse does not contain field %s", fd.FullName())) } } @@ -2288,40 +3111,40 @@ func (x *fastReflection_GetLastUpdatedResponse) Set(fd protoreflect.FieldDescrip // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": - panic(fmt.Errorf("field last_updated of message slinky.marketmap.v1.GetLastUpdatedResponse is not mutable")) + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": + panic(fmt.Errorf("field last_updated of message slinky.marketmap.v1.LastUpdatedResponse is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse 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_GetLastUpdatedResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_LastUpdatedResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.GetLastUpdatedResponse.last_updated": + case "slinky.marketmap.v1.LastUpdatedResponse.last_updated": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.GetLastUpdatedResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.LastUpdatedResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.GetLastUpdatedResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.LastUpdatedResponse 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_GetLastUpdatedResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_LastUpdatedResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.GetLastUpdatedResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.LastUpdatedResponse", d.FullName())) } panic("unreachable") } @@ -2329,7 +3152,7 @@ func (x *fastReflection_GetLastUpdatedResponse) WhichOneof(d protoreflect.OneofD // 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_GetLastUpdatedResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_LastUpdatedResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2340,7 +3163,7 @@ func (x *fastReflection_GetLastUpdatedResponse) GetUnknown() protoreflect.RawFie // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GetLastUpdatedResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_LastUpdatedResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2352,7 +3175,7 @@ func (x *fastReflection_GetLastUpdatedResponse) SetUnknown(fields protoreflect.R // 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_GetLastUpdatedResponse) IsValid() bool { +func (x *fastReflection_LastUpdatedResponse) IsValid() bool { return x != nil } @@ -2362,9 +3185,9 @@ func (x *fastReflection_GetLastUpdatedResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_GetLastUpdatedResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_LastUpdatedResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GetLastUpdatedResponse) + x := input.Message.Interface().(*LastUpdatedResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2389,7 +3212,7 @@ func (x *fastReflection_GetLastUpdatedResponse) ProtoMethods() *protoiface.Metho } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GetLastUpdatedResponse) + x := input.Message.Interface().(*LastUpdatedResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2424,7 +3247,7 @@ func (x *fastReflection_GetLastUpdatedResponse) ProtoMethods() *protoiface.Metho }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GetLastUpdatedResponse) + x := input.Message.Interface().(*LastUpdatedResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2456,10 +3279,10 @@ func (x *fastReflection_GetLastUpdatedResponse) ProtoMethods() *protoiface.Metho fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetLastUpdatedResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GetLastUpdatedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2529,16 +3352,16 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// GetMarketMapRequest is the query request for the GetMarketMap query. +// MarketMapRequest is the query request for the MarketMap query. // It takes no arguments. -type GetMarketMapRequest struct { +type MarketMapRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *GetMarketMapRequest) Reset() { - *x = GetMarketMapRequest{} +func (x *MarketMapRequest) Reset() { + *x = MarketMapRequest{} if protoimpl.UnsafeEnabled { mi := &file_slinky_marketmap_v1_query_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2546,19 +3369,19 @@ func (x *GetMarketMapRequest) Reset() { } } -func (x *GetMarketMapRequest) String() string { +func (x *MarketMapRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMarketMapRequest) ProtoMessage() {} +func (*MarketMapRequest) ProtoMessage() {} -// Deprecated: Use GetMarketMapRequest.ProtoReflect.Descriptor instead. -func (*GetMarketMapRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use MarketMapRequest.ProtoReflect.Descriptor instead. +func (*MarketMapRequest) Descriptor() ([]byte, []int) { return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{0} } -// GetMarketMapResponse is the query response for the GetMarketMap query. -type GetMarketMapResponse struct { +// MarketMapResponse is the query response for the MarketMap query. +type MarketMapResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2570,15 +3393,12 @@ type GetMarketMapResponse struct { // This field can be used as an optimization for clients checking if there // is a new update to the map. LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // Version is the schema version for the MarketMap data structure and query - // response. - Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` // ChainId is the chain identifier for the market map. - ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (x *GetMarketMapResponse) Reset() { - *x = GetMarketMapResponse{} +func (x *MarketMapResponse) Reset() { + *x = MarketMapResponse{} if protoimpl.UnsafeEnabled { mi := &file_slinky_marketmap_v1_query_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2586,43 +3406,112 @@ func (x *GetMarketMapResponse) Reset() { } } -func (x *GetMarketMapResponse) String() string { +func (x *MarketMapResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMarketMapResponse) ProtoMessage() {} +func (*MarketMapResponse) ProtoMessage() {} -// Deprecated: Use GetMarketMapResponse.ProtoReflect.Descriptor instead. -func (*GetMarketMapResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use MarketMapResponse.ProtoReflect.Descriptor instead. +func (*MarketMapResponse) Descriptor() ([]byte, []int) { return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{1} } -func (x *GetMarketMapResponse) GetMarketMap() *MarketMap { +func (x *MarketMapResponse) GetMarketMap() *MarketMap { if x != nil { return x.MarketMap } return nil } -func (x *GetMarketMapResponse) GetLastUpdated() uint64 { +func (x *MarketMapResponse) GetLastUpdated() uint64 { if x != nil { return x.LastUpdated } return 0 } -func (x *GetMarketMapResponse) GetVersion() uint64 { +func (x *MarketMapResponse) GetChainId() string { if x != nil { - return x.Version + return x.ChainId } - return 0 + return "" +} + +// MarketRequest is the query request for the Market query. +// It takes the currency pair of the market as an argument. +type MarketRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CurrencyPair is the currency pair associated with the market being + // requested. + CurrencyPair *v1.CurrencyPair `protobuf:"bytes,3,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair,omitempty"` +} + +func (x *MarketRequest) Reset() { + *x = MarketRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarketRequest) ProtoMessage() {} + +// Deprecated: Use MarketRequest.ProtoReflect.Descriptor instead. +func (*MarketRequest) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{2} } -func (x *GetMarketMapResponse) GetChainId() string { +func (x *MarketRequest) GetCurrencyPair() *v1.CurrencyPair { if x != nil { - return x.ChainId + return x.CurrencyPair + } + return nil +} + +// MarketResponse is the query response for the Market query. +type MarketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Market is the configuration of a single market to be price-fetched for. + Market *Market `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` +} + +func (x *MarketResponse) Reset() { + *x = MarketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" +} + +func (x *MarketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarketResponse) ProtoMessage() {} + +// Deprecated: Use MarketResponse.ProtoReflect.Descriptor instead. +func (*MarketResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *MarketResponse) GetMarket() *Market { + if x != nil { + return x.Market + } + return nil } // ParamsRequest is the request type for the Query/Params RPC method. @@ -2635,7 +3524,7 @@ type ParamsRequest struct { func (x *ParamsRequest) Reset() { *x = ParamsRequest{} 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) } @@ -2649,7 +3538,7 @@ func (*ParamsRequest) ProtoMessage() {} // Deprecated: Use ParamsRequest.ProtoReflect.Descriptor instead. func (*ParamsRequest) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{2} + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{4} } // ParamsResponse is the response type for the Query/Params RPC method. @@ -2664,7 +3553,7 @@ type ParamsResponse struct { func (x *ParamsResponse) Reset() { *x = ParamsResponse{} 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) } @@ -2678,7 +3567,7 @@ func (*ParamsResponse) ProtoMessage() {} // Deprecated: Use ParamsResponse.ProtoReflect.Descriptor instead. func (*ParamsResponse) 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 *ParamsResponse) GetParams() *Params { @@ -2688,37 +3577,37 @@ func (x *ParamsResponse) GetParams() *Params { return nil } -// GetLastUpdatedRequest is the request type for the Query/LastUpdated RPC +// LastUpdatedRequest is the request type for the Query/LastUpdated RPC // method. -type GetLastUpdatedRequest struct { +type LastUpdatedRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *GetLastUpdatedRequest) Reset() { - *x = GetLastUpdatedRequest{} +func (x *LastUpdatedRequest) Reset() { + *x = LastUpdatedRequest{} 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) } } -func (x *GetLastUpdatedRequest) String() string { +func (x *LastUpdatedRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLastUpdatedRequest) ProtoMessage() {} +func (*LastUpdatedRequest) ProtoMessage() {} -// Deprecated: Use GetLastUpdatedRequest.ProtoReflect.Descriptor instead. -func (*GetLastUpdatedRequest) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{4} +// Deprecated: Use LastUpdatedRequest.ProtoReflect.Descriptor instead. +func (*LastUpdatedRequest) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{6} } -// GetLastUpdatedResponse is the response type for the Query/LastUpdated RPC +// LastUpdatedResponse is the response type for the Query/LastUpdated RPC // method. -type GetLastUpdatedResponse struct { +type LastUpdatedResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2726,27 +3615,27 @@ type GetLastUpdatedResponse struct { LastUpdated uint64 `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` } -func (x *GetLastUpdatedResponse) Reset() { - *x = GetLastUpdatedResponse{} +func (x *LastUpdatedResponse) Reset() { + *x = LastUpdatedResponse{} 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) } } -func (x *GetLastUpdatedResponse) String() string { +func (x *LastUpdatedResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLastUpdatedResponse) ProtoMessage() {} +func (*LastUpdatedResponse) ProtoMessage() {} -// Deprecated: Use GetLastUpdatedResponse.ProtoReflect.Descriptor instead. -func (*GetLastUpdatedResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{5} +// Deprecated: Use LastUpdatedResponse.ProtoReflect.Descriptor instead. +func (*LastUpdatedResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_query_proto_rawDescGZIP(), []int{7} } -func (x *GetLastUpdatedResponse) GetLastUpdated() uint64 { +func (x *LastUpdatedResponse) GetLastUpdated() uint64 { if x != nil { return x.LastUpdated } @@ -2762,74 +3651,92 @@ var file_slinky_marketmap_v1_query_proto_rawDesc = []byte{ 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 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, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 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, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x15, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb3, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 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, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x4d, 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 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, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x73, 0x6c, 0x69, 0x6e, + 0x6b, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x20, 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, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 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, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, + 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 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, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, + 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, + 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, 0x03, 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, 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, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, 0x47, 0x65, 0x74, 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, - 0x9e, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x88, 0x01, 0x0a, 0x09, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x28, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 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, 0x91, 0x01, 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 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, + 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, 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, + 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 ( @@ -2844,31 +3751,39 @@ 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, 6) +var file_slinky_marketmap_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_slinky_marketmap_v1_query_proto_goTypes = []interface{}{ - (*GetMarketMapRequest)(nil), // 0: slinky.marketmap.v1.GetMarketMapRequest - (*GetMarketMapResponse)(nil), // 1: slinky.marketmap.v1.GetMarketMapResponse - (*ParamsRequest)(nil), // 2: slinky.marketmap.v1.ParamsRequest - (*ParamsResponse)(nil), // 3: slinky.marketmap.v1.ParamsResponse - (*GetLastUpdatedRequest)(nil), // 4: slinky.marketmap.v1.GetLastUpdatedRequest - (*GetLastUpdatedResponse)(nil), // 5: slinky.marketmap.v1.GetLastUpdatedResponse - (*MarketMap)(nil), // 6: slinky.marketmap.v1.MarketMap - (*Params)(nil), // 7: slinky.marketmap.v1.Params + (*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 } var file_slinky_marketmap_v1_query_proto_depIdxs = []int32{ - 6, // 0: slinky.marketmap.v1.GetMarketMapResponse.market_map:type_name -> slinky.marketmap.v1.MarketMap - 7, // 1: slinky.marketmap.v1.ParamsResponse.params:type_name -> slinky.marketmap.v1.Params - 0, // 2: slinky.marketmap.v1.Query.MarketMap:input_type -> slinky.marketmap.v1.GetMarketMapRequest - 4, // 3: slinky.marketmap.v1.Query.LastUpdated:input_type -> slinky.marketmap.v1.GetLastUpdatedRequest - 2, // 4: slinky.marketmap.v1.Query.Params:input_type -> slinky.marketmap.v1.ParamsRequest - 1, // 5: slinky.marketmap.v1.Query.MarketMap:output_type -> slinky.marketmap.v1.GetMarketMapResponse - 5, // 6: slinky.marketmap.v1.Query.LastUpdated:output_type -> slinky.marketmap.v1.GetLastUpdatedResponse - 3, // 7: slinky.marketmap.v1.Query.Params:output_type -> slinky.marketmap.v1.ParamsResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 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 } func init() { file_slinky_marketmap_v1_query_proto_init() } @@ -2880,7 +3795,7 @@ func file_slinky_marketmap_v1_query_proto_init() { file_slinky_marketmap_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_slinky_marketmap_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMarketMapRequest); i { + switch v := v.(*MarketMapRequest); i { case 0: return &v.state case 1: @@ -2892,7 +3807,7 @@ func file_slinky_marketmap_v1_query_proto_init() { } } file_slinky_marketmap_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMarketMapResponse); i { + switch v := v.(*MarketMapResponse); i { case 0: return &v.state case 1: @@ -2904,7 +3819,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.(*ParamsRequest); i { + switch v := v.(*MarketRequest); i { case 0: return &v.state case 1: @@ -2916,7 +3831,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.(*ParamsResponse); i { + switch v := v.(*MarketResponse); i { case 0: return &v.state case 1: @@ -2928,7 +3843,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.(*GetLastUpdatedRequest); i { + switch v := v.(*ParamsRequest); i { case 0: return &v.state case 1: @@ -2940,7 +3855,31 @@ 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.(*GetLastUpdatedResponse); i { + 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[6].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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LastUpdatedResponse); i { case 0: return &v.state case 1: @@ -2958,7 +3897,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: 6, + NumMessages: 8, 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 c6342ed55..ecdb03a21 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.SupportPackageIsVersion7 const ( Query_MarketMap_FullMethodName = "/slinky.marketmap.v1.Query/MarketMap" + Query_Market_FullMethodName = "/slinky.marketmap.v1.Query/Market" Query_LastUpdated_FullMethodName = "/slinky.marketmap.v1.Query/LastUpdated" Query_Params_FullMethodName = "/slinky.marketmap.v1.Query/Params" ) @@ -30,9 +31,12 @@ const ( type QueryClient interface { // MarketMap returns the full market map stored in the x/marketmap // module. - MarketMap(ctx context.Context, in *GetMarketMapRequest, opts ...grpc.CallOption) (*GetMarketMapResponse, error) + MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) + // Market returns a market stored in the x/marketmap + // module. + Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) // LastUpdated returns the last height the market map was updated at. - LastUpdated(ctx context.Context, in *GetLastUpdatedRequest, opts ...grpc.CallOption) (*GetLastUpdatedResponse, error) + LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) // Params returns the current x/marketmap module parameters. Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) } @@ -45,8 +49,8 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } -func (c *queryClient) MarketMap(ctx context.Context, in *GetMarketMapRequest, opts ...grpc.CallOption) (*GetMarketMapResponse, error) { - out := new(GetMarketMapResponse) +func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) { + out := new(MarketMapResponse) err := c.cc.Invoke(ctx, Query_MarketMap_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -54,8 +58,17 @@ func (c *queryClient) MarketMap(ctx context.Context, in *GetMarketMapRequest, op return out, nil } -func (c *queryClient) LastUpdated(ctx context.Context, in *GetLastUpdatedRequest, opts ...grpc.CallOption) (*GetLastUpdatedResponse, error) { - out := new(GetLastUpdatedResponse) +func (c *queryClient) Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) { + out := new(MarketResponse) + err := c.cc.Invoke(ctx, Query_Market_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) { + out := new(LastUpdatedResponse) err := c.cc.Invoke(ctx, Query_LastUpdated_FullMethodName, in, out, opts...) if err != nil { return nil, err @@ -78,9 +91,12 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp type QueryServer interface { // MarketMap returns the full market map stored in the x/marketmap // module. - MarketMap(context.Context, *GetMarketMapRequest) (*GetMarketMapResponse, error) + MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) + // Market returns a market stored in the x/marketmap + // module. + Market(context.Context, *MarketRequest) (*MarketResponse, error) // LastUpdated returns the last height the market map was updated at. - LastUpdated(context.Context, *GetLastUpdatedRequest) (*GetLastUpdatedResponse, error) + LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) // Params returns the current x/marketmap module parameters. Params(context.Context, *ParamsRequest) (*ParamsResponse, error) mustEmbedUnimplementedQueryServer() @@ -90,10 +106,13 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (UnimplementedQueryServer) MarketMap(context.Context, *GetMarketMapRequest) (*GetMarketMapResponse, error) { +func (UnimplementedQueryServer) MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketMap not implemented") } -func (UnimplementedQueryServer) LastUpdated(context.Context, *GetLastUpdatedRequest) (*GetLastUpdatedResponse, error) { +func (UnimplementedQueryServer) Market(context.Context, *MarketRequest) (*MarketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") +} +func (UnimplementedQueryServer) LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastUpdated not implemented") } func (UnimplementedQueryServer) Params(context.Context, *ParamsRequest) (*ParamsResponse, error) { @@ -113,7 +132,7 @@ func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { } func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMarketMapRequest) + in := new(MarketMapRequest) if err := dec(in); err != nil { return nil, err } @@ -125,13 +144,31 @@ func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(int FullMethod: Query_MarketMap_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MarketMap(ctx, req.(*GetMarketMapRequest)) + return srv.(QueryServer).MarketMap(ctx, req.(*MarketMapRequest)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Market(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Market_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Market(ctx, req.(*MarketRequest)) } return interceptor(ctx, in, info, handler) } func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLastUpdatedRequest) + in := new(LastUpdatedRequest) if err := dec(in); err != nil { return nil, err } @@ -143,7 +180,7 @@ func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(i FullMethod: Query_LastUpdated_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LastUpdated(ctx, req.(*GetLastUpdatedRequest)) + return srv.(QueryServer).LastUpdated(ctx, req.(*LastUpdatedRequest)) } return interceptor(ctx, in, info, handler) } @@ -177,6 +214,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "MarketMap", Handler: _Query_MarketMap_Handler, }, + { + MethodName: "Market", + Handler: _Query_Market_Handler, + }, { MethodName: "LastUpdated", Handler: _Query_LastUpdated_Handler, diff --git a/api/slinky/marketmap/v1/tx.pulsar.go b/api/slinky/marketmap/v1/tx.pulsar.go index 605b74fe8..726df568f 100644 --- a/api/slinky/marketmap/v1/tx.pulsar.go +++ b/api/slinky/marketmap/v1/tx.pulsar.go @@ -16,30 +16,79 @@ import ( sync "sync" ) +var _ protoreflect.List = (*_MsgCreateMarkets_2_list)(nil) + +type _MsgCreateMarkets_2_list struct { + list *[]*Market +} + +func (x *_MsgCreateMarkets_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateMarkets_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateMarkets_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateMarkets_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateMarkets_2_list) AppendMutable() protoreflect.Value { + v := new(Market) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateMarkets_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateMarkets_2_list) NewElement() protoreflect.Value { + v := new(Market) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateMarkets_2_list) IsValid() bool { + return x.list != nil +} + var ( - md_CreateMarket protoreflect.MessageDescriptor - fd_CreateMarket_ticker protoreflect.FieldDescriptor - fd_CreateMarket_providers protoreflect.FieldDescriptor - fd_CreateMarket_paths protoreflect.FieldDescriptor + md_MsgCreateMarkets protoreflect.MessageDescriptor + fd_MsgCreateMarkets_authority protoreflect.FieldDescriptor + fd_MsgCreateMarkets_create_markets protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_tx_proto_init() - md_CreateMarket = File_slinky_marketmap_v1_tx_proto.Messages().ByName("CreateMarket") - fd_CreateMarket_ticker = md_CreateMarket.Fields().ByName("ticker") - fd_CreateMarket_providers = md_CreateMarket.Fields().ByName("providers") - fd_CreateMarket_paths = md_CreateMarket.Fields().ByName("paths") + md_MsgCreateMarkets = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgCreateMarkets") + fd_MsgCreateMarkets_authority = md_MsgCreateMarkets.Fields().ByName("authority") + fd_MsgCreateMarkets_create_markets = md_MsgCreateMarkets.Fields().ByName("create_markets") } -var _ protoreflect.Message = (*fastReflection_CreateMarket)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateMarkets)(nil) -type fastReflection_CreateMarket CreateMarket +type fastReflection_MsgCreateMarkets MsgCreateMarkets -func (x *CreateMarket) ProtoReflect() protoreflect.Message { - return (*fastReflection_CreateMarket)(x) +func (x *MsgCreateMarkets) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateMarkets)(x) } -func (x *CreateMarket) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateMarkets) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -51,43 +100,43 @@ func (x *CreateMarket) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_CreateMarket_messageType fastReflection_CreateMarket_messageType -var _ protoreflect.MessageType = fastReflection_CreateMarket_messageType{} +var _fastReflection_MsgCreateMarkets_messageType fastReflection_MsgCreateMarkets_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateMarkets_messageType{} -type fastReflection_CreateMarket_messageType struct{} +type fastReflection_MsgCreateMarkets_messageType struct{} -func (x fastReflection_CreateMarket_messageType) Zero() protoreflect.Message { - return (*fastReflection_CreateMarket)(nil) +func (x fastReflection_MsgCreateMarkets_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateMarkets)(nil) } -func (x fastReflection_CreateMarket_messageType) New() protoreflect.Message { - return new(fastReflection_CreateMarket) +func (x fastReflection_MsgCreateMarkets_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateMarkets) } -func (x fastReflection_CreateMarket_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_CreateMarket +func (x fastReflection_MsgCreateMarkets_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateMarkets } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_CreateMarket) Descriptor() protoreflect.MessageDescriptor { - return md_CreateMarket +func (x *fastReflection_MsgCreateMarkets) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateMarkets } // 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_CreateMarket) Type() protoreflect.MessageType { - return _fastReflection_CreateMarket_messageType +func (x *fastReflection_MsgCreateMarkets) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateMarkets_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_CreateMarket) New() protoreflect.Message { - return new(fastReflection_CreateMarket) +func (x *fastReflection_MsgCreateMarkets) New() protoreflect.Message { + return new(fastReflection_MsgCreateMarkets) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_CreateMarket) Interface() protoreflect.ProtoMessage { - return (*CreateMarket)(x) +func (x *fastReflection_MsgCreateMarkets) Interface() protoreflect.ProtoMessage { + return (*MsgCreateMarkets)(x) } // Range iterates over every populated field in an undefined order, @@ -95,22 +144,16 @@ func (x *fastReflection_CreateMarket) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_CreateMarket) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Ticker != nil { - value := protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) - if !f(fd_CreateMarket_ticker, value) { - return - } - } - if x.Providers != nil { - value := protoreflect.ValueOfMessage(x.Providers.ProtoReflect()) - if !f(fd_CreateMarket_providers, value) { +func (x *fastReflection_MsgCreateMarkets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgCreateMarkets_authority, value) { return } } - if x.Paths != nil { - value := protoreflect.ValueOfMessage(x.Paths.ProtoReflect()) - if !f(fd_CreateMarket_paths, value) { + if len(x.CreateMarkets) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{list: &x.CreateMarkets}) + if !f(fd_MsgCreateMarkets_create_markets, value) { return } } @@ -127,19 +170,17 @@ func (x *fastReflection_CreateMarket) Range(f func(protoreflect.FieldDescriptor, // 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_CreateMarket) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateMarkets) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - return x.Ticker != nil - case "slinky.marketmap.v1.CreateMarket.providers": - return x.Providers != nil - case "slinky.marketmap.v1.CreateMarket.paths": - return x.Paths != nil + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + return x.Authority != "" + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + return len(x.CreateMarkets) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets does not contain field %s", fd.FullName())) } } @@ -149,19 +190,17 @@ func (x *fastReflection_CreateMarket) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CreateMarket) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateMarkets) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - x.Ticker = nil - case "slinky.marketmap.v1.CreateMarket.providers": - x.Providers = nil - case "slinky.marketmap.v1.CreateMarket.paths": - x.Paths = nil + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + x.Authority = "" + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + x.CreateMarkets = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets does not contain field %s", fd.FullName())) } } @@ -171,22 +210,22 @@ func (x *fastReflection_CreateMarket) Clear(fd protoreflect.FieldDescriptor) { // 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_CreateMarket) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateMarkets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - value := x.Ticker - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.providers": - value := x.Providers - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.paths": - value := x.Paths - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + if len(x.CreateMarkets) == 0 { + return protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{}) + } + listValue := &_MsgCreateMarkets_2_list{list: &x.CreateMarkets} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets does not contain field %s", descriptor.FullName())) } } @@ -200,19 +239,19 @@ func (x *fastReflection_CreateMarket) Get(descriptor protoreflect.FieldDescripto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CreateMarket) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgCreateMarkets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - x.Ticker = value.Message().Interface().(*Ticker) - case "slinky.marketmap.v1.CreateMarket.providers": - x.Providers = value.Message().Interface().(*Providers) - case "slinky.marketmap.v1.CreateMarket.paths": - x.Paths = value.Message().Interface().(*Paths) + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + x.Authority = value.Interface().(string) + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + lv := value.List() + clv := lv.(*_MsgCreateMarkets_2_list) + x.CreateMarkets = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets does not contain field %s", fd.FullName())) } } @@ -226,60 +265,49 @@ func (x *fastReflection_CreateMarket) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CreateMarket) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateMarkets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - if x.Ticker == nil { - x.Ticker = new(Ticker) - } - return protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.providers": - if x.Providers == nil { - x.Providers = new(Providers) - } - return protoreflect.ValueOfMessage(x.Providers.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.paths": - if x.Paths == nil { - x.Paths = new(Paths) + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + if x.CreateMarkets == nil { + x.CreateMarkets = []*Market{} } - return protoreflect.ValueOfMessage(x.Paths.ProtoReflect()) + value := &_MsgCreateMarkets_2_list{list: &x.CreateMarkets} + return protoreflect.ValueOfList(value) + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + panic(fmt.Errorf("field authority of message slinky.marketmap.v1.MsgCreateMarkets is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets 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_CreateMarket) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateMarkets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.CreateMarket.ticker": - m := new(Ticker) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.providers": - m := new(Providers) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.CreateMarket.paths": - m := new(Paths) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "slinky.marketmap.v1.MsgCreateMarkets.authority": + return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.MsgCreateMarkets.create_markets": + list := []*Market{} + return protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.CreateMarket")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarkets")) } - panic(fmt.Errorf("message slinky.marketmap.v1.CreateMarket does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarkets 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_CreateMarket) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgCreateMarkets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.CreateMarket", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgCreateMarkets", d.FullName())) } panic("unreachable") } @@ -287,7 +315,7 @@ func (x *fastReflection_CreateMarket) WhichOneof(d protoreflect.OneofDescriptor) // 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_CreateMarket) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgCreateMarkets) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -298,7 +326,7 @@ func (x *fastReflection_CreateMarket) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CreateMarket) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgCreateMarkets) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -310,7 +338,7 @@ func (x *fastReflection_CreateMarket) SetUnknown(fields protoreflect.RawFields) // 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_CreateMarket) IsValid() bool { +func (x *fastReflection_MsgCreateMarkets) IsValid() bool { return x != nil } @@ -320,9 +348,9 @@ func (x *fastReflection_CreateMarket) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgCreateMarkets) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*CreateMarket) + x := input.Message.Interface().(*MsgCreateMarkets) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -334,17 +362,15 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Ticker != nil { - l = options.Size(x.Ticker) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Providers != nil { - l = options.Size(x.Providers) + l = len(x.Authority) + if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.Paths != nil { - l = options.Size(x.Paths) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.CreateMarkets) > 0 { + for _, e := range x.CreateMarkets { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -356,7 +382,7 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*CreateMarket) + x := input.Message.Interface().(*MsgCreateMarkets) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -375,45 +401,26 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Paths != nil { - encoded, err := options.Marshal(x.Paths) - 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] = 0x1a - } - if x.Providers != nil { - encoded, err := options.Marshal(x.Providers) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.CreateMarkets) > 0 { + for iNdEx := len(x.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.CreateMarkets[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] = 0x12 } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 } - if x.Ticker != nil { - encoded, err := options.Marshal(x.Ticker) - 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))) + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) i-- dAtA[i] = 0xa } @@ -428,7 +435,7 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*CreateMarket) + x := input.Message.Interface().(*MsgCreateMarkets) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -460,17 +467,17 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CreateMarket: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateMarkets: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CreateMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateMarkets: 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 Ticker", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -480,67 +487,27 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Ticker == nil { - x.Ticker = &Ticker{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Ticker); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Providers", 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.Providers == nil { - x.Providers = &Providers{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Providers); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -567,10 +534,8 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Paths == nil { - x.Paths = &Paths{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Paths); err != nil { + x.CreateMarkets = append(x.CreateMarkets, &Market{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreateMarkets[len(x.CreateMarkets)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -609,79 +574,24 @@ func (x *fastReflection_CreateMarket) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_MsgUpdateMarketMap_2_list)(nil) - -type _MsgUpdateMarketMap_2_list struct { - list *[]*CreateMarket -} - -func (x *_MsgUpdateMarketMap_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgUpdateMarketMap_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgUpdateMarketMap_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*CreateMarket) - (*x.list)[i] = concreteValue -} - -func (x *_MsgUpdateMarketMap_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*CreateMarket) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgUpdateMarketMap_2_list) AppendMutable() protoreflect.Value { - v := new(CreateMarket) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgUpdateMarketMap_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgUpdateMarketMap_2_list) NewElement() protoreflect.Value { - v := new(CreateMarket) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgUpdateMarketMap_2_list) IsValid() bool { - return x.list != nil -} - var ( - md_MsgUpdateMarketMap protoreflect.MessageDescriptor - fd_MsgUpdateMarketMap_signer protoreflect.FieldDescriptor - fd_MsgUpdateMarketMap_create_markets protoreflect.FieldDescriptor + md_MsgCreateMarketsResponse protoreflect.MessageDescriptor ) func init() { file_slinky_marketmap_v1_tx_proto_init() - md_MsgUpdateMarketMap = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgUpdateMarketMap") - fd_MsgUpdateMarketMap_signer = md_MsgUpdateMarketMap.Fields().ByName("signer") - fd_MsgUpdateMarketMap_create_markets = md_MsgUpdateMarketMap.Fields().ByName("create_markets") + md_MsgCreateMarketsResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgCreateMarketsResponse") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateMarketMap)(nil) +var _ protoreflect.Message = (*fastReflection_MsgCreateMarketsResponse)(nil) -type fastReflection_MsgUpdateMarketMap MsgUpdateMarketMap +type fastReflection_MsgCreateMarketsResponse MsgCreateMarketsResponse -func (x *MsgUpdateMarketMap) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketMap)(x) +func (x *MsgCreateMarketsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateMarketsResponse)(x) } -func (x *MsgUpdateMarketMap) slowProtoReflect() protoreflect.Message { +func (x *MsgCreateMarketsResponse) slowProtoReflect() protoreflect.Message { mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -693,43 +603,43 @@ func (x *MsgUpdateMarketMap) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateMarketMap_messageType fastReflection_MsgUpdateMarketMap_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateMarketMap_messageType{} +var _fastReflection_MsgCreateMarketsResponse_messageType fastReflection_MsgCreateMarketsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateMarketsResponse_messageType{} -type fastReflection_MsgUpdateMarketMap_messageType struct{} +type fastReflection_MsgCreateMarketsResponse_messageType struct{} -func (x fastReflection_MsgUpdateMarketMap_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketMap)(nil) +func (x fastReflection_MsgCreateMarketsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateMarketsResponse)(nil) } -func (x fastReflection_MsgUpdateMarketMap_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketMap) +func (x fastReflection_MsgCreateMarketsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateMarketsResponse) } -func (x fastReflection_MsgUpdateMarketMap_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketMap +func (x fastReflection_MsgCreateMarketsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateMarketsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateMarketMap) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketMap +func (x *fastReflection_MsgCreateMarketsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateMarketsResponse } // 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_MsgUpdateMarketMap) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateMarketMap_messageType +func (x *fastReflection_MsgCreateMarketsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateMarketsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateMarketMap) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketMap) +func (x *fastReflection_MsgCreateMarketsResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateMarketsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateMarketMap) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateMarketMap)(x) +func (x *fastReflection_MsgCreateMarketsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateMarketsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -737,19 +647,7 @@ func (x *fastReflection_MsgUpdateMarketMap) Interface() protoreflect.ProtoMessag // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgUpdateMarketMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Signer != "" { - value := protoreflect.ValueOfString(x.Signer) - if !f(fd_MsgUpdateMarketMap_signer, value) { - return - } - } - if len(x.CreateMarkets) != 0 { - value := protoreflect.ValueOfList(&_MsgUpdateMarketMap_2_list{list: &x.CreateMarkets}) - if !f(fd_MsgUpdateMarketMap_create_markets, value) { - return - } - } +func (x *fastReflection_MsgCreateMarketsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -763,17 +661,13 @@ func (x *fastReflection_MsgUpdateMarketMap) Range(f func(protoreflect.FieldDescr // 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_MsgUpdateMarketMap) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgCreateMarketsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": - return x.Signer != "" - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - return len(x.CreateMarkets) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarketsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse does not contain field %s", fd.FullName())) } } @@ -783,17 +677,13 @@ func (x *fastReflection_MsgUpdateMarketMap) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMap) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgCreateMarketsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": - x.Signer = "" - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - x.CreateMarkets = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarketsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse does not contain field %s", fd.FullName())) } } @@ -803,22 +693,1313 @@ func (x *fastReflection_MsgUpdateMarketMap) Clear(fd protoreflect.FieldDescripto // 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_MsgUpdateMarketMap) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgCreateMarketsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": - value := x.Signer + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgCreateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) 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.MsgCreateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) 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.MsgCreateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) 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.MsgCreateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgCreateMarketsResponse", 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateMarketsResponse) + 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().(*MsgCreateMarketsResponse) + 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().(*MsgCreateMarketsResponse) + 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: MsgCreateMarketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateMarketsResponse: 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 = (*_MsgUpdateMarkets_2_list)(nil) + +type _MsgUpdateMarkets_2_list struct { + list *[]*Market +} + +func (x *_MsgUpdateMarkets_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgUpdateMarkets_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgUpdateMarkets_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + (*x.list)[i] = concreteValue +} + +func (x *_MsgUpdateMarkets_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Market) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgUpdateMarkets_2_list) AppendMutable() protoreflect.Value { + v := new(Market) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateMarkets_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgUpdateMarkets_2_list) NewElement() protoreflect.Value { + v := new(Market) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgUpdateMarkets_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgUpdateMarkets protoreflect.MessageDescriptor + fd_MsgUpdateMarkets_authority protoreflect.FieldDescriptor + fd_MsgUpdateMarkets_update_markets protoreflect.FieldDescriptor +) + +func init() { + file_slinky_marketmap_v1_tx_proto_init() + md_MsgUpdateMarkets = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgUpdateMarkets") + fd_MsgUpdateMarkets_authority = md_MsgUpdateMarkets.Fields().ByName("authority") + fd_MsgUpdateMarkets_update_markets = md_MsgUpdateMarkets.Fields().ByName("update_markets") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateMarkets)(nil) + +type fastReflection_MsgUpdateMarkets MsgUpdateMarkets + +func (x *MsgUpdateMarkets) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateMarkets)(x) +} + +func (x *MsgUpdateMarkets) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_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_MsgUpdateMarkets_messageType fastReflection_MsgUpdateMarkets_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateMarkets_messageType{} + +type fastReflection_MsgUpdateMarkets_messageType struct{} + +func (x fastReflection_MsgUpdateMarkets_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateMarkets)(nil) +} +func (x fastReflection_MsgUpdateMarkets_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateMarkets) +} +func (x fastReflection_MsgUpdateMarkets_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateMarkets +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateMarkets) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateMarkets +} + +// 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_MsgUpdateMarkets) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateMarkets_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateMarkets) New() protoreflect.Message { + return new(fastReflection_MsgUpdateMarkets) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateMarkets) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateMarkets)(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_MsgUpdateMarkets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateMarkets_authority, value) { + return + } + } + if len(x.UpdateMarkets) != 0 { + value := protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets}) + if !f(fd_MsgUpdateMarkets_update_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_MsgUpdateMarkets) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + return x.Authority != "" + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + return len(x.UpdateMarkets) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + x.Authority = "" + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + x.UpdateMarkets = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + if len(x.UpdateMarkets) == 0 { + return protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{}) + } + listValue := &_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + x.Authority = value.Interface().(string) + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + lv := value.List() + clv := lv.(*_MsgUpdateMarkets_2_list) + x.UpdateMarkets = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + if x.UpdateMarkets == nil { + x.UpdateMarkets = []*Market{} + } + value := &_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets} + return protoreflect.ValueOfList(value) + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + panic(fmt.Errorf("field authority of message slinky.marketmap.v1.MsgUpdateMarkets is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgUpdateMarkets.authority": + return protoreflect.ValueOfString("") + case "slinky.marketmap.v1.MsgUpdateMarkets.update_markets": + list := []*Market{} + return protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarkets")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgUpdateMarkets", 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateMarkets) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.UpdateMarkets) > 0 { + for _, e := range x.UpdateMarkets { + 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().(*MsgUpdateMarkets) + 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.UpdateMarkets) > 0 { + for iNdEx := len(x.UpdateMarkets) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.UpdateMarkets[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] = 0x12 + } + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + 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().(*MsgUpdateMarkets) + 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: MsgUpdateMarkets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarkets: 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 Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateMarkets", 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.UpdateMarkets = append(x.UpdateMarkets, &Market{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UpdateMarkets[len(x.UpdateMarkets)-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_MsgUpdateMarketsResponse protoreflect.MessageDescriptor +) + +func init() { + file_slinky_marketmap_v1_tx_proto_init() + md_MsgUpdateMarketsResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgUpdateMarketsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateMarketsResponse)(nil) + +type fastReflection_MsgUpdateMarketsResponse MsgUpdateMarketsResponse + +func (x *MsgUpdateMarketsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateMarketsResponse)(x) +} + +func (x *MsgUpdateMarketsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_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_MsgUpdateMarketsResponse_messageType fastReflection_MsgUpdateMarketsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateMarketsResponse_messageType{} + +type fastReflection_MsgUpdateMarketsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateMarketsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateMarketsResponse)(nil) +} +func (x fastReflection_MsgUpdateMarketsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateMarketsResponse) +} +func (x fastReflection_MsgUpdateMarketsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateMarketsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateMarketsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateMarketsResponse +} + +// 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_MsgUpdateMarketsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateMarketsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateMarketsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateMarketsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateMarketsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateMarketsResponse)(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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) 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.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) 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.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) 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.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) 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.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) 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.MsgUpdateMarketsResponse")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgUpdateMarketsResponse", 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateMarketsResponse) + 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().(*MsgUpdateMarketsResponse) + 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().(*MsgUpdateMarketsResponse) + 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: MsgUpdateMarketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketsResponse: 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_MsgParams protoreflect.MessageDescriptor + fd_MsgParams_params protoreflect.FieldDescriptor + fd_MsgParams_authority protoreflect.FieldDescriptor +) + +func init() { + file_slinky_marketmap_v1_tx_proto_init() + md_MsgParams = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgParams") + fd_MsgParams_params = md_MsgParams.Fields().ByName("params") + fd_MsgParams_authority = md_MsgParams.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_MsgParams)(nil) + +type fastReflection_MsgParams MsgParams + +func (x *MsgParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgParams)(x) +} + +func (x *MsgParams) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgParams_messageType fastReflection_MsgParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgParams_messageType{} + +type fastReflection_MsgParams_messageType struct{} + +func (x fastReflection_MsgParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgParams)(nil) +} +func (x fastReflection_MsgParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgParams) +} +func (x fastReflection_MsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParams +} + +// 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_MsgParams) Type() protoreflect.MessageType { + return _fastReflection_MsgParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgParams) New() protoreflect.Message { + return new(fastReflection_MsgParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { + return (*MsgParams)(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_MsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgParams_params, value) { + return + } + } + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgParams_authority, 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_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgParams.params": + return x.Params != nil + case "slinky.marketmap.v1.MsgParams.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams 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_MsgParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "slinky.marketmap.v1.MsgParams.params": + x.Params = nil + case "slinky.marketmap.v1.MsgParams.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + } + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams 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_MsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "slinky.marketmap.v1.MsgParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "slinky.marketmap.v1.MsgParams.authority": + value := x.Authority return protoreflect.ValueOfString(value) - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - if len(x.CreateMarkets) == 0 { - return protoreflect.ValueOfList(&_MsgUpdateMarketMap_2_list{}) - } - listValue := &_MsgUpdateMarketMap_2_list{list: &x.CreateMarkets} - return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", descriptor.FullName())) } } @@ -832,19 +2013,17 @@ func (x *fastReflection_MsgUpdateMarketMap) Get(descriptor protoreflect.FieldDes // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMap) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": - x.Signer = value.Interface().(string) - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - lv := value.List() - clv := lv.(*_MsgUpdateMarketMap_2_list) - x.CreateMarkets = *clv.list + case "slinky.marketmap.v1.MsgParams.params": + x.Params = value.Message().Interface().(*Params) + case "slinky.marketmap.v1.MsgParams.authority": + x.Authority = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) } } @@ -858,49 +2037,48 @@ func (x *fastReflection_MsgUpdateMarketMap) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMap) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - if x.CreateMarkets == nil { - x.CreateMarkets = []*CreateMarket{} + case "slinky.marketmap.v1.MsgParams.params": + if x.Params == nil { + x.Params = new(Params) } - value := &_MsgUpdateMarketMap_2_list{list: &x.CreateMarkets} - return protoreflect.ValueOfList(value) - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": - panic(fmt.Errorf("field signer of message slinky.marketmap.v1.MsgUpdateMarketMap is not mutable")) + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "slinky.marketmap.v1.MsgParams.authority": + panic(fmt.Errorf("field authority of message slinky.marketmap.v1.MsgParams is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams 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_MsgUpdateMarketMap) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.MsgUpdateMarketMap.signer": + case "slinky.marketmap.v1.MsgParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "slinky.marketmap.v1.MsgParams.authority": return protoreflect.ValueOfString("") - case "slinky.marketmap.v1.MsgUpdateMarketMap.create_markets": - list := []*CreateMarket{} - return protoreflect.ValueOfList(&_MsgUpdateMarketMap_2_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMap")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMap does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams 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_MsgUpdateMarketMap) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgUpdateMarketMap", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgParams", d.FullName())) } panic("unreachable") } @@ -908,7 +2086,7 @@ func (x *fastReflection_MsgUpdateMarketMap) WhichOneof(d protoreflect.OneofDescr // 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_MsgUpdateMarketMap) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgParams) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -919,7 +2097,7 @@ func (x *fastReflection_MsgUpdateMarketMap) GetUnknown() protoreflect.RawFields // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMap) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgParams) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -931,7 +2109,7 @@ func (x *fastReflection_MsgUpdateMarketMap) SetUnknown(fields protoreflect.RawFi // 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_MsgUpdateMarketMap) IsValid() bool { +func (x *fastReflection_MsgParams) IsValid() bool { return x != nil } @@ -941,9 +2119,9 @@ func (x *fastReflection_MsgUpdateMarketMap) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateMarketMap) + x := input.Message.Interface().(*MsgParams) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -955,15 +2133,13 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.Params != nil { + l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.CreateMarkets) > 0 { - for _, e := range x.CreateMarkets { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -975,7 +2151,7 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateMarketMap) + x := input.Message.Interface().(*MsgParams) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -994,26 +2170,24 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.CreateMarkets) > 0 { - for iNdEx := len(x.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.CreateMarkets[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] = 0x12 - } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0x12 } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + 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 } @@ -1028,7 +2202,7 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateMarketMap) + x := input.Message.Interface().(*MsgParams) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1060,17 +2234,17 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketMap: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketMap: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: 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 Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1080,29 +2254,33 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.Signer = string(dAtA[iNdEx:postIndex]) + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1112,25 +2290,23 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.CreateMarkets = append(x.CreateMarkets, &CreateMarket{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreateMarkets[len(x.CreateMarkets)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1168,24 +2344,24 @@ func (x *fastReflection_MsgUpdateMarketMap) ProtoMethods() *protoiface.Methods { } var ( - md_MsgUpdateMarketMapResponse protoreflect.MessageDescriptor + md_MsgParamsResponse protoreflect.MessageDescriptor ) func init() { file_slinky_marketmap_v1_tx_proto_init() - md_MsgUpdateMarketMapResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgUpdateMarketMapResponse") + md_MsgParamsResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgParamsResponse") } -var _ protoreflect.Message = (*fastReflection_MsgUpdateMarketMapResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgParamsResponse)(nil) -type fastReflection_MsgUpdateMarketMapResponse MsgUpdateMarketMapResponse +type fastReflection_MsgParamsResponse MsgParamsResponse -func (x *MsgUpdateMarketMapResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketMapResponse)(x) +func (x *MsgParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgParamsResponse)(x) } -func (x *MsgUpdateMarketMapResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[2] +func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1196,43 +2372,43 @@ func (x *MsgUpdateMarketMapResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgUpdateMarketMapResponse_messageType fastReflection_MsgUpdateMarketMapResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateMarketMapResponse_messageType{} +var _fastReflection_MsgParamsResponse_messageType fastReflection_MsgParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgParamsResponse_messageType{} -type fastReflection_MsgUpdateMarketMapResponse_messageType struct{} +type fastReflection_MsgParamsResponse_messageType struct{} -func (x fastReflection_MsgUpdateMarketMapResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketMapResponse)(nil) +func (x fastReflection_MsgParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgParamsResponse)(nil) } -func (x fastReflection_MsgUpdateMarketMapResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketMapResponse) +func (x fastReflection_MsgParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgParamsResponse) } -func (x fastReflection_MsgUpdateMarketMapResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketMapResponse +func (x fastReflection_MsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParamsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgUpdateMarketMapResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketMapResponse +func (x *fastReflection_MsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParamsResponse } // 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_MsgUpdateMarketMapResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateMarketMapResponse_messageType +func (x *fastReflection_MsgParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgParamsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateMarketMapResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketMapResponse) +func (x *fastReflection_MsgParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgParamsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateMarketMapResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateMarketMapResponse)(x) +func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgParamsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1240,7 +2416,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Interface() protoreflect.Pro // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgUpdateMarketMapResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -1254,13 +2430,13 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Range(f func(protoreflect.Fi // 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_MsgUpdateMarketMapResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgParamsResponse) 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.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -1270,13 +2446,13 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Has(fd protoreflect.FieldDes // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMapResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -1286,13 +2462,13 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Clear(fd protoreflect.FieldD // 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_MsgUpdateMarketMapResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgParamsResponse) 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.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -1306,13 +2482,13 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Get(descriptor protoreflect. // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMapResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgParamsResponse) 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.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -1326,36 +2502,36 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) Set(fd protoreflect.FieldDes // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMapResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgParamsResponse) 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.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse 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_MsgUpdateMarketMapResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgParamsResponse) 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.MsgUpdateMarketMapResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgUpdateMarketMapResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse 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_MsgUpdateMarketMapResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgUpdateMarketMapResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgParamsResponse", d.FullName())) } panic("unreachable") } @@ -1363,7 +2539,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) WhichOneof(d protoreflect.On // 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_MsgUpdateMarketMapResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgParamsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1374,7 +2550,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) GetUnknown() protoreflect.Ra // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateMarketMapResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1386,7 +2562,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) SetUnknown(fields protorefle // 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_MsgUpdateMarketMapResponse) IsValid() bool { +func (x *fastReflection_MsgParamsResponse) IsValid() bool { return x != nil } @@ -1396,9 +2572,9 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateMarketMapResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateMarketMapResponse) + x := input.Message.Interface().(*MsgParamsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1420,7 +2596,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) ProtoMethods() *protoiface.M } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateMarketMapResponse) + x := input.Message.Interface().(*MsgParamsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1450,7 +2626,7 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) ProtoMethods() *protoiface.M }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateMarketMapResponse) + x := input.Message.Interface().(*MsgParamsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1482,10 +2658,10 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) ProtoMethods() *protoiface.M fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketMapResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1523,29 +2699,75 @@ func (x *fastReflection_MsgUpdateMarketMapResponse) ProtoMethods() *protoiface.M } } +var _ protoreflect.List = (*_MsgRemoveMarketAuthorities_1_list)(nil) + +type _MsgRemoveMarketAuthorities_1_list struct { + list *[]string +} + +func (x *_MsgRemoveMarketAuthorities_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgRemoveMarketAuthorities_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_MsgRemoveMarketAuthorities_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_MsgRemoveMarketAuthorities_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgRemoveMarketAuthorities_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message MsgRemoveMarketAuthorities at list field RemoveAddresses as it is not of Message kind")) +} + +func (x *_MsgRemoveMarketAuthorities_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_MsgRemoveMarketAuthorities_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_MsgRemoveMarketAuthorities_1_list) IsValid() bool { + return x.list != nil +} + var ( - md_MsgParams protoreflect.MessageDescriptor - fd_MsgParams_params protoreflect.FieldDescriptor - fd_MsgParams_authority protoreflect.FieldDescriptor + md_MsgRemoveMarketAuthorities protoreflect.MessageDescriptor + fd_MsgRemoveMarketAuthorities_remove_addresses protoreflect.FieldDescriptor + fd_MsgRemoveMarketAuthorities_admin protoreflect.FieldDescriptor ) func init() { file_slinky_marketmap_v1_tx_proto_init() - md_MsgParams = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgParams") - fd_MsgParams_params = md_MsgParams.Fields().ByName("params") - fd_MsgParams_authority = md_MsgParams.Fields().ByName("authority") + md_MsgRemoveMarketAuthorities = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgRemoveMarketAuthorities") + fd_MsgRemoveMarketAuthorities_remove_addresses = md_MsgRemoveMarketAuthorities.Fields().ByName("remove_addresses") + fd_MsgRemoveMarketAuthorities_admin = md_MsgRemoveMarketAuthorities.Fields().ByName("admin") } -var _ protoreflect.Message = (*fastReflection_MsgParams)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRemoveMarketAuthorities)(nil) -type fastReflection_MsgParams MsgParams +type fastReflection_MsgRemoveMarketAuthorities MsgRemoveMarketAuthorities -func (x *MsgParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParams)(x) +func (x *MsgRemoveMarketAuthorities) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveMarketAuthorities)(x) } -func (x *MsgParams) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[3] +func (x *MsgRemoveMarketAuthorities) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1556,43 +2778,43 @@ func (x *MsgParams) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgParams_messageType fastReflection_MsgParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgParams_messageType{} +var _fastReflection_MsgRemoveMarketAuthorities_messageType fastReflection_MsgRemoveMarketAuthorities_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveMarketAuthorities_messageType{} -type fastReflection_MsgParams_messageType struct{} +type fastReflection_MsgRemoveMarketAuthorities_messageType struct{} -func (x fastReflection_MsgParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParams)(nil) +func (x fastReflection_MsgRemoveMarketAuthorities_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveMarketAuthorities)(nil) } -func (x fastReflection_MsgParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParams) +func (x fastReflection_MsgRemoveMarketAuthorities_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveMarketAuthorities) } -func (x fastReflection_MsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams +func (x fastReflection_MsgRemoveMarketAuthorities_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveMarketAuthorities } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams +func (x *fastReflection_MsgRemoveMarketAuthorities) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveMarketAuthorities } // 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_MsgParams) Type() protoreflect.MessageType { - return _fastReflection_MsgParams_messageType +func (x *fastReflection_MsgRemoveMarketAuthorities) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveMarketAuthorities_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParams) New() protoreflect.Message { - return new(fastReflection_MsgParams) +func (x *fastReflection_MsgRemoveMarketAuthorities) New() protoreflect.Message { + return new(fastReflection_MsgRemoveMarketAuthorities) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { - return (*MsgParams)(x) +func (x *fastReflection_MsgRemoveMarketAuthorities) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveMarketAuthorities)(x) } // Range iterates over every populated field in an undefined order, @@ -1600,16 +2822,16 @@ func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgParams_params, value) { +func (x *fastReflection_MsgRemoveMarketAuthorities) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RemoveAddresses) != 0 { + value := protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses}) + if !f(fd_MsgRemoveMarketAuthorities_remove_addresses, value) { return } } - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgParams_authority, value) { + if x.Admin != "" { + value := protoreflect.ValueOfString(x.Admin) + if !f(fd_MsgRemoveMarketAuthorities_admin, value) { return } } @@ -1626,17 +2848,17 @@ func (x *fastReflection_MsgParams) Range(f func(protoreflect.FieldDescriptor, pr // 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_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRemoveMarketAuthorities) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - return x.Params != nil - case "slinky.marketmap.v1.MsgParams.authority": - return x.Authority != "" + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + return len(x.RemoveAddresses) != 0 + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": + return x.Admin != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities does not contain field %s", fd.FullName())) } } @@ -1646,17 +2868,17 @@ func (x *fastReflection_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRemoveMarketAuthorities) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - x.Params = nil - case "slinky.marketmap.v1.MsgParams.authority": - x.Authority = "" + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + x.RemoveAddresses = nil + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": + x.Admin = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities does not contain field %s", fd.FullName())) } } @@ -1666,19 +2888,22 @@ func (x *fastReflection_MsgParams) Clear(fd protoreflect.FieldDescriptor) { // 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_MsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthorities) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.marketmap.v1.MsgParams.authority": - value := x.Authority + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + if len(x.RemoveAddresses) == 0 { + return protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{}) + } + listValue := &_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses} + return protoreflect.ValueOfList(listValue) + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": + value := x.Admin return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities does not contain field %s", descriptor.FullName())) } } @@ -1692,17 +2917,19 @@ func (x *fastReflection_MsgParams) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRemoveMarketAuthorities) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - x.Params = value.Message().Interface().(*Params) - case "slinky.marketmap.v1.MsgParams.authority": - x.Authority = value.Interface().(string) + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + lv := value.List() + clv := lv.(*_MsgRemoveMarketAuthorities_1_list) + x.RemoveAddresses = *clv.list + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": + x.Admin = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities does not contain field %s", fd.FullName())) } } @@ -1716,48 +2943,49 @@ func (x *fastReflection_MsgParams) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthorities) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - if x.Params == nil { - x.Params = new(Params) + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + if x.RemoveAddresses == nil { + x.RemoveAddresses = []string{} } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "slinky.marketmap.v1.MsgParams.authority": - panic(fmt.Errorf("field authority of message slinky.marketmap.v1.MsgParams is not mutable")) + value := &_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses} + return protoreflect.ValueOfList(value) + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": + panic(fmt.Errorf("field admin of message slinky.marketmap.v1.MsgRemoveMarketAuthorities is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities 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_MsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthorities) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "slinky.marketmap.v1.MsgParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.marketmap.v1.MsgParams.authority": + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.remove_addresses": + list := []string{} + return protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{list: &list}) + case "slinky.marketmap.v1.MsgRemoveMarketAuthorities.admin": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthorities")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthorities 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_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRemoveMarketAuthorities) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgRemoveMarketAuthorities", d.FullName())) } panic("unreachable") } @@ -1765,7 +2993,7 @@ func (x *fastReflection_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_MsgParams) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRemoveMarketAuthorities) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1776,7 +3004,7 @@ func (x *fastReflection_MsgParams) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRemoveMarketAuthorities) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1788,7 +3016,7 @@ func (x *fastReflection_MsgParams) SetUnknown(fields protoreflect.RawFields) { // 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_MsgParams) IsValid() bool { +func (x *fastReflection_MsgRemoveMarketAuthorities) IsValid() bool { return x != nil } @@ -1798,9 +3026,9 @@ func (x *fastReflection_MsgParams) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRemoveMarketAuthorities) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*MsgRemoveMarketAuthorities) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1812,11 +3040,13 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.RemoveAddresses) > 0 { + for _, s := range x.RemoveAddresses { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } - l = len(x.Authority) + l = len(x.Admin) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1830,7 +3060,7 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*MsgRemoveMarketAuthorities) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1849,26 +3079,21 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + if len(x.Admin) > 0 { + i -= len(x.Admin) + copy(dAtA[i:], x.Admin) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) i-- dAtA[i] = 0x12 } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.RemoveAddresses) > 0 { + for iNdEx := len(x.RemoveAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RemoveAddresses[iNdEx]) + copy(dAtA[i:], x.RemoveAddresses[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RemoveAddresses[iNdEx]))) + i-- + dAtA[i] = 0xa } - 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...) @@ -1881,7 +3106,7 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*MsgRemoveMarketAuthorities) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1913,17 +3138,17 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthorities: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthorities: 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 Params", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RemoveAddresses", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1933,31 +3158,27 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } + x.RemoveAddresses = append(x.RemoveAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1985,7 +3206,7 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Authority = string(dAtA[iNdEx:postIndex]) + x.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2023,24 +3244,24 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { } var ( - md_MsgParamsResponse protoreflect.MessageDescriptor + md_MsgRemoveMarketAuthoritiesResponse protoreflect.MessageDescriptor ) func init() { file_slinky_marketmap_v1_tx_proto_init() - md_MsgParamsResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgParamsResponse") + md_MsgRemoveMarketAuthoritiesResponse = File_slinky_marketmap_v1_tx_proto.Messages().ByName("MsgRemoveMarketAuthoritiesResponse") } -var _ protoreflect.Message = (*fastReflection_MsgParamsResponse)(nil) +var _ protoreflect.Message = (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(nil) -type fastReflection_MsgParamsResponse MsgParamsResponse +type fastReflection_MsgRemoveMarketAuthoritiesResponse MsgRemoveMarketAuthoritiesResponse -func (x *MsgParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(x) +func (x *MsgRemoveMarketAuthoritiesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(x) } -func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[4] +func (x *MsgRemoveMarketAuthoritiesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2051,43 +3272,43 @@ func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgParamsResponse_messageType fastReflection_MsgParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgParamsResponse_messageType{} +var _fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType{} -type fastReflection_MsgParamsResponse_messageType struct{} +type fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType struct{} -func (x fastReflection_MsgParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(nil) +func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(nil) } -func (x fastReflection_MsgParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) +func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgRemoveMarketAuthoritiesResponse) } -func (x fastReflection_MsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse +func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveMarketAuthoritiesResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgRemoveMarketAuthoritiesResponse } // 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_MsgParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgParamsResponse_messageType +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) New() protoreflect.Message { + return new(fastReflection_MsgRemoveMarketAuthoritiesResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgParamsResponse)(x) +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Interface() protoreflect.ProtoMessage { + return (*MsgRemoveMarketAuthoritiesResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -2095,7 +3316,7 @@ func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -2109,13 +3330,13 @@ func (x *fastReflection_MsgParamsResponse) Range(f func(protoreflect.FieldDescri // 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_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) 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.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse does not contain field %s", fd.FullName())) } } @@ -2125,13 +3346,13 @@ func (x *fastReflection_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse does not contain field %s", fd.FullName())) } } @@ -2141,13 +3362,13 @@ func (x *fastReflection_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor // 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_MsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) 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.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse does not contain field %s", descriptor.FullName())) } } @@ -2161,13 +3382,13 @@ func (x *fastReflection_MsgParamsResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) 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.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse does not contain field %s", fd.FullName())) } } @@ -2181,36 +3402,36 @@ func (x *fastReflection_MsgParamsResponse) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) 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.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) 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.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse")) } - panic(fmt.Errorf("message slinky.marketmap.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse", d.FullName())) } panic("unreachable") } @@ -2218,7 +3439,7 @@ func (x *fastReflection_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescri // 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_MsgParamsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2229,7 +3450,7 @@ func (x *fastReflection_MsgParamsResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2241,7 +3462,7 @@ func (x *fastReflection_MsgParamsResponse) SetUnknown(fields protoreflect.RawFie // 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_MsgParamsResponse) IsValid() bool { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) IsValid() bool { return x != nil } @@ -2251,9 +3472,9 @@ func (x *fastReflection_MsgParamsResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*MsgRemoveMarketAuthoritiesResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2275,7 +3496,7 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*MsgRemoveMarketAuthoritiesResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2305,7 +3526,7 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*MsgRemoveMarketAuthoritiesResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2337,10 +3558,10 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2391,25 +3612,23 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// CreateMarket contains all information needed to create a new market. -type CreateMarket struct { +// MsgCreateMarkets defines a message carrying a payload for creating markets in +// the x/marketmap module. +type MsgCreateMarkets struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Ticker is the on-chain representation of the ticker. This is the target - // ticker that the prices of the set of tickers will be converted to. - Ticker *Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` - // Providers maps provider names to their off-chain - // representations for the given ticker of the message. - Providers *Providers `protobuf:"bytes,2,opt,name=providers,proto3" json:"providers,omitempty"` - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - Paths *Paths `protobuf:"bytes,3,opt,name=paths,proto3" json:"paths,omitempty"` + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // CreateMarkets is the list of all markets to be created for the given + // transaction. + CreateMarkets []*Market `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets,omitempty"` } -func (x *CreateMarket) Reset() { - *x = CreateMarket{} +func (x *MsgCreateMarkets) Reset() { + *x = MsgCreateMarkets{} if protoimpl.UnsafeEnabled { mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2417,111 +3636,132 @@ func (x *CreateMarket) Reset() { } } -func (x *CreateMarket) String() string { +func (x *MsgCreateMarkets) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateMarket) ProtoMessage() {} +func (*MsgCreateMarkets) ProtoMessage() {} -// Deprecated: Use CreateMarket.ProtoReflect.Descriptor instead. -func (*CreateMarket) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgCreateMarkets.ProtoReflect.Descriptor instead. +func (*MsgCreateMarkets) Descriptor() ([]byte, []int) { return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{0} } -func (x *CreateMarket) GetTicker() *Ticker { +func (x *MsgCreateMarkets) GetAuthority() string { if x != nil { - return x.Ticker + return x.Authority } - return nil + return "" } -func (x *CreateMarket) GetProviders() *Providers { +func (x *MsgCreateMarkets) GetCreateMarkets() []*Market { if x != nil { - return x.Providers + return x.CreateMarkets } return nil } -func (x *CreateMarket) GetPaths() *Paths { - if x != nil { - return x.Paths +// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. +type MsgCreateMarketsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCreateMarketsResponse) Reset() { + *x = MsgCreateMarketsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil } -// MsgUpdateMarketMap defines a message carrying a payload for updating the +func (x *MsgCreateMarketsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateMarketsResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateMarketsResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateMarketsResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{1} +} + +// MsgUpdateMarkets defines a message carrying a payload for updating the // x/marketmap module. -type MsgUpdateMarketMap struct { +type MsgUpdateMarkets struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Signer is the signer of this transaction. - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - // CreateMarkets is the list of all markets to be created for the given + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // UpdateMarkets is the list of all markets to be updated for the given // transaction. - CreateMarkets []*CreateMarket `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets,omitempty"` + UpdateMarkets []*Market `protobuf:"bytes,2,rep,name=update_markets,json=updateMarkets,proto3" json:"update_markets,omitempty"` } -func (x *MsgUpdateMarketMap) Reset() { - *x = MsgUpdateMarketMap{} +func (x *MsgUpdateMarkets) Reset() { + *x = MsgUpdateMarkets{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[1] + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateMarketMap) String() string { +func (x *MsgUpdateMarkets) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateMarketMap) ProtoMessage() {} +func (*MsgUpdateMarkets) ProtoMessage() {} -// Deprecated: Use MsgUpdateMarketMap.ProtoReflect.Descriptor instead. -func (*MsgUpdateMarketMap) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{1} +// Deprecated: Use MsgUpdateMarkets.ProtoReflect.Descriptor instead. +func (*MsgUpdateMarkets) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{2} } -func (x *MsgUpdateMarketMap) GetSigner() string { +func (x *MsgUpdateMarkets) GetAuthority() string { if x != nil { - return x.Signer + return x.Authority } return "" } -func (x *MsgUpdateMarketMap) GetCreateMarkets() []*CreateMarket { +func (x *MsgUpdateMarkets) GetUpdateMarkets() []*Market { if x != nil { - return x.CreateMarkets + return x.UpdateMarkets } return nil } -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -type MsgUpdateMarketMapResponse struct { +// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. +type MsgUpdateMarketsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgUpdateMarketMapResponse) Reset() { - *x = MsgUpdateMarketMapResponse{} +func (x *MsgUpdateMarketsResponse) Reset() { + *x = MsgUpdateMarketsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[2] + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateMarketMapResponse) String() string { +func (x *MsgUpdateMarketsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateMarketMapResponse) ProtoMessage() {} +func (*MsgUpdateMarketsResponse) ProtoMessage() {} -// Deprecated: Use MsgUpdateMarketMapResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateMarketMapResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{2} +// Deprecated: Use MsgUpdateMarketsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateMarketsResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{3} } // MsgParams defines the Msg/Params request type. It contains the @@ -2541,7 +3781,7 @@ type MsgParams struct { func (x *MsgParams) Reset() { *x = MsgParams{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[3] + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2555,7 +3795,7 @@ func (*MsgParams) ProtoMessage() {} // Deprecated: Use MsgParams.ProtoReflect.Descriptor instead. func (*MsgParams) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{3} + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{4} } func (x *MsgParams) GetParams() *Params { @@ -2582,7 +3822,7 @@ type MsgParamsResponse struct { func (x *MsgParamsResponse) Reset() { *x = MsgParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[4] + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2596,7 +3836,84 @@ func (*MsgParamsResponse) ProtoMessage() {} // Deprecated: Use MsgParamsResponse.ProtoReflect.Descriptor instead. func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{4} + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{5} +} + +// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse +// request type. It contains the new addresses to remove from the list of +// authorities +type MsgRemoveMarketAuthorities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RemoveAddresses is the list of addresses to remove. + RemoveAddresses []string `protobuf:"bytes,1,rep,name=remove_addresses,json=removeAddresses,proto3" json:"remove_addresses,omitempty"` + // Admin defines the authority that is the x/marketmap + // Admin account. This account is set in the module parameters. + Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` +} + +func (x *MsgRemoveMarketAuthorities) Reset() { + *x = MsgRemoveMarketAuthorities{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRemoveMarketAuthorities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRemoveMarketAuthorities) ProtoMessage() {} + +// Deprecated: Use MsgRemoveMarketAuthorities.ProtoReflect.Descriptor instead. +func (*MsgRemoveMarketAuthorities) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgRemoveMarketAuthorities) GetRemoveAddresses() []string { + if x != nil { + return x.RemoveAddresses + } + return nil +} + +func (x *MsgRemoveMarketAuthorities) GetAdmin() string { + if x != nil { + return x.Admin + } + return "" +} + +// MsgRemoveMarketAuthoritiesResponse defines the +// Msg/RemoveMarketAuthoritiesResponse response type. +type MsgRemoveMarketAuthoritiesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgRemoveMarketAuthoritiesResponse) Reset() { + *x = MsgRemoveMarketAuthoritiesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_slinky_marketmap_v1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgRemoveMarketAuthoritiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgRemoveMarketAuthoritiesResponse) ProtoMessage() {} + +// Deprecated: Use MsgRemoveMarketAuthoritiesResponse.ProtoReflect.Descriptor instead. +func (*MsgRemoveMarketAuthoritiesResponse) Descriptor() ([]byte, []int) { + return file_slinky_marketmap_v1_tx_proto_rawDescGZIP(), []int{7} } var File_slinky_marketmap_v1_tx_proto protoreflect.FileDescriptor @@ -2615,70 +3932,98 @@ var file_slinky_marketmap_v1_tx_proto_rawDesc = []byte{ 0x61, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 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, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 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, 0x54, 0x69, 0x63, 0x6b, - 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, - 0x12, 0x42, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x22, 0xd1, 0x01, 0x0a, - 0x12, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x4d, 0x61, 0x70, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x48, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x73, 0x18, 0x02, 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, 0x0d, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0xe8, 0xa0, 0x1f, + 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, + 0xe7, 0xb0, 0x2a, 0x23, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x78, 0x2f, 0x6d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x48, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x02, 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, 0x0d, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0xe8, 0xa0, 0x1f, 0x00, + 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, + 0xb0, 0x2a, 0x23, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x78, 0x2f, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 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, 0x12, 0x36, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, 0x01, 0x0a, 0x1a, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x24, + 0x0a, 0x22, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb2, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x65, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x39, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x25, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2f, 0x78, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, - 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, - 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 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, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, - 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xcb, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x6b, 0x0a, 0x0f, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, - 0x27, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, - 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x1a, 0x2f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x73, 0x1a, 0x2d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x1a, 0x2d, 0x2e, 0x73, 0x6c, + 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x83, 0x01, 0x0a, + 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x06, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, - 0x2a, 0x01, 0x42, 0xc2, 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, 0x07, - 0x54, 0x78, 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, + 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x37, 0x2e, 0x73, 0x6c, 0x69, 0x6e, + 0x6b, 0x79, 0x2e, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 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, 0x07, 0x54, 0x78, 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 ( @@ -2693,33 +4038,36 @@ func file_slinky_marketmap_v1_tx_proto_rawDescGZIP() []byte { return file_slinky_marketmap_v1_tx_proto_rawDescData } -var file_slinky_marketmap_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_slinky_marketmap_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_slinky_marketmap_v1_tx_proto_goTypes = []interface{}{ - (*CreateMarket)(nil), // 0: slinky.marketmap.v1.CreateMarket - (*MsgUpdateMarketMap)(nil), // 1: slinky.marketmap.v1.MsgUpdateMarketMap - (*MsgUpdateMarketMapResponse)(nil), // 2: slinky.marketmap.v1.MsgUpdateMarketMapResponse - (*MsgParams)(nil), // 3: slinky.marketmap.v1.MsgParams - (*MsgParamsResponse)(nil), // 4: slinky.marketmap.v1.MsgParamsResponse - (*Ticker)(nil), // 5: slinky.marketmap.v1.Ticker - (*Providers)(nil), // 6: slinky.marketmap.v1.Providers - (*Paths)(nil), // 7: slinky.marketmap.v1.Paths - (*Params)(nil), // 8: slinky.marketmap.v1.Params + (*MsgCreateMarkets)(nil), // 0: slinky.marketmap.v1.MsgCreateMarkets + (*MsgCreateMarketsResponse)(nil), // 1: slinky.marketmap.v1.MsgCreateMarketsResponse + (*MsgUpdateMarkets)(nil), // 2: slinky.marketmap.v1.MsgUpdateMarkets + (*MsgUpdateMarketsResponse)(nil), // 3: slinky.marketmap.v1.MsgUpdateMarketsResponse + (*MsgParams)(nil), // 4: slinky.marketmap.v1.MsgParams + (*MsgParamsResponse)(nil), // 5: slinky.marketmap.v1.MsgParamsResponse + (*MsgRemoveMarketAuthorities)(nil), // 6: slinky.marketmap.v1.MsgRemoveMarketAuthorities + (*MsgRemoveMarketAuthoritiesResponse)(nil), // 7: slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse + (*Market)(nil), // 8: slinky.marketmap.v1.Market + (*Params)(nil), // 9: slinky.marketmap.v1.Params } var file_slinky_marketmap_v1_tx_proto_depIdxs = []int32{ - 5, // 0: slinky.marketmap.v1.CreateMarket.ticker:type_name -> slinky.marketmap.v1.Ticker - 6, // 1: slinky.marketmap.v1.CreateMarket.providers:type_name -> slinky.marketmap.v1.Providers - 7, // 2: slinky.marketmap.v1.CreateMarket.paths:type_name -> slinky.marketmap.v1.Paths - 0, // 3: slinky.marketmap.v1.MsgUpdateMarketMap.create_markets:type_name -> slinky.marketmap.v1.CreateMarket - 8, // 4: slinky.marketmap.v1.MsgParams.params:type_name -> slinky.marketmap.v1.Params - 1, // 5: slinky.marketmap.v1.Msg.UpdateMarketMap:input_type -> slinky.marketmap.v1.MsgUpdateMarketMap - 3, // 6: slinky.marketmap.v1.Msg.Params:input_type -> slinky.marketmap.v1.MsgParams - 2, // 7: slinky.marketmap.v1.Msg.UpdateMarketMap:output_type -> slinky.marketmap.v1.MsgUpdateMarketMapResponse - 4, // 8: slinky.marketmap.v1.Msg.Params:output_type -> slinky.marketmap.v1.MsgParamsResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] 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 + 8, // 0: slinky.marketmap.v1.MsgCreateMarkets.create_markets:type_name -> slinky.marketmap.v1.Market + 8, // 1: slinky.marketmap.v1.MsgUpdateMarkets.update_markets:type_name -> slinky.marketmap.v1.Market + 9, // 2: slinky.marketmap.v1.MsgParams.params:type_name -> slinky.marketmap.v1.Params + 0, // 3: slinky.marketmap.v1.Msg.CreateMarkets:input_type -> slinky.marketmap.v1.MsgCreateMarkets + 2, // 4: slinky.marketmap.v1.Msg.UpdateMarkets:input_type -> slinky.marketmap.v1.MsgUpdateMarkets + 4, // 5: slinky.marketmap.v1.Msg.Params:input_type -> slinky.marketmap.v1.MsgParams + 6, // 6: slinky.marketmap.v1.Msg.RemoveMarketAuthorities:input_type -> slinky.marketmap.v1.MsgRemoveMarketAuthorities + 1, // 7: slinky.marketmap.v1.Msg.CreateMarkets:output_type -> slinky.marketmap.v1.MsgCreateMarketsResponse + 3, // 8: slinky.marketmap.v1.Msg.UpdateMarkets:output_type -> slinky.marketmap.v1.MsgUpdateMarketsResponse + 5, // 9: slinky.marketmap.v1.Msg.Params:output_type -> slinky.marketmap.v1.MsgParamsResponse + 7, // 10: slinky.marketmap.v1.Msg.RemoveMarketAuthorities:output_type -> slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse + 7, // [7:11] is the sub-list for method output_type + 3, // [3:7] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_slinky_marketmap_v1_tx_proto_init() } @@ -2731,7 +4079,7 @@ func file_slinky_marketmap_v1_tx_proto_init() { file_slinky_marketmap_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_slinky_marketmap_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateMarket); i { + switch v := v.(*MsgCreateMarkets); i { case 0: return &v.state case 1: @@ -2743,7 +4091,7 @@ func file_slinky_marketmap_v1_tx_proto_init() { } } file_slinky_marketmap_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateMarketMap); i { + switch v := v.(*MsgCreateMarketsResponse); i { case 0: return &v.state case 1: @@ -2755,7 +4103,7 @@ func file_slinky_marketmap_v1_tx_proto_init() { } } file_slinky_marketmap_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateMarketMapResponse); i { + switch v := v.(*MsgUpdateMarkets); i { case 0: return &v.state case 1: @@ -2767,7 +4115,7 @@ func file_slinky_marketmap_v1_tx_proto_init() { } } file_slinky_marketmap_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgParams); i { + switch v := v.(*MsgUpdateMarketsResponse); i { case 0: return &v.state case 1: @@ -2779,6 +4127,18 @@ func file_slinky_marketmap_v1_tx_proto_init() { } } file_slinky_marketmap_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_marketmap_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgParamsResponse); i { case 0: return &v.state @@ -2790,6 +4150,30 @@ func file_slinky_marketmap_v1_tx_proto_init() { return nil } } + file_slinky_marketmap_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRemoveMarketAuthorities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_slinky_marketmap_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgRemoveMarketAuthoritiesResponse); 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{ @@ -2797,7 +4181,7 @@ func file_slinky_marketmap_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_slinky_marketmap_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/slinky/marketmap/v1/tx_grpc.pb.go b/api/slinky/marketmap/v1/tx_grpc.pb.go index 7012d5030..94e0fb0d9 100644 --- a/api/slinky/marketmap/v1/tx_grpc.pb.go +++ b/api/slinky/marketmap/v1/tx_grpc.pb.go @@ -19,18 +19,25 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateMarketMap_FullMethodName = "/slinky.marketmap.v1.Msg/UpdateMarketMap" - Msg_Params_FullMethodName = "/slinky.marketmap.v1.Msg/Params" + Msg_CreateMarkets_FullMethodName = "/slinky.marketmap.v1.Msg/CreateMarkets" + Msg_UpdateMarkets_FullMethodName = "/slinky.marketmap.v1.Msg/UpdateMarkets" + Msg_Params_FullMethodName = "/slinky.marketmap.v1.Msg/Params" + Msg_RemoveMarketAuthorities_FullMethodName = "/slinky.marketmap.v1.Msg/RemoveMarketAuthorities" ) // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type MsgClient interface { - // UpdateMarketMap creates markets from the given message. - UpdateMarketMap(ctx context.Context, in *MsgUpdateMarketMap, opts ...grpc.CallOption) (*MsgUpdateMarketMapResponse, error) + // CreateMarkets creates markets from the given message. + CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) + // UpdateMarkets updates markets from the given message. + UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) // Params defines a method for updating the x/marketmap module parameters. Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) } type msgClient struct { @@ -41,9 +48,18 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { return &msgClient{cc} } -func (c *msgClient) UpdateMarketMap(ctx context.Context, in *MsgUpdateMarketMap, opts ...grpc.CallOption) (*MsgUpdateMarketMapResponse, error) { - out := new(MsgUpdateMarketMapResponse) - err := c.cc.Invoke(ctx, Msg_UpdateMarketMap_FullMethodName, in, out, opts...) +func (c *msgClient) CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) { + out := new(MsgCreateMarketsResponse) + err := c.cc.Invoke(ctx, Msg_CreateMarkets_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) { + out := new(MsgUpdateMarketsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateMarkets_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -59,14 +75,28 @@ func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.Call return out, nil } +func (c *msgClient) RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) { + out := new(MsgRemoveMarketAuthoritiesResponse) + err := c.cc.Invoke(ctx, Msg_RemoveMarketAuthorities_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { - // UpdateMarketMap creates markets from the given message. - UpdateMarketMap(context.Context, *MsgUpdateMarketMap) (*MsgUpdateMarketMapResponse, error) + // CreateMarkets creates markets from the given message. + CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) + // UpdateMarkets updates markets from the given message. + UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) // Params defines a method for updating the x/marketmap module parameters. Params(context.Context, *MsgParams) (*MsgParamsResponse, error) + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) mustEmbedUnimplementedMsgServer() } @@ -74,12 +104,18 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (UnimplementedMsgServer) UpdateMarketMap(context.Context, *MsgUpdateMarketMap) (*MsgUpdateMarketMapResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMarketMap not implemented") +func (UnimplementedMsgServer) CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMarkets not implemented") +} +func (UnimplementedMsgServer) UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMarkets not implemented") } func (UnimplementedMsgServer) Params(context.Context, *MsgParams) (*MsgParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (UnimplementedMsgServer) RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveMarketAuthorities not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -93,20 +129,38 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { s.RegisterService(&Msg_ServiceDesc, srv) } -func _Msg_UpdateMarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateMarketMap) +func _Msg_CreateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateMarkets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateMarkets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateMarkets_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateMarkets(ctx, req.(*MsgCreateMarkets)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateMarkets) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpdateMarketMap(ctx, in) + return srv.(MsgServer).UpdateMarkets(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Msg_UpdateMarketMap_FullMethodName, + FullMethod: Msg_UpdateMarkets_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateMarketMap(ctx, req.(*MsgUpdateMarketMap)) + return srv.(MsgServer).UpdateMarkets(ctx, req.(*MsgUpdateMarkets)) } return interceptor(ctx, in, info, handler) } @@ -129,6 +183,24 @@ func _Msg_Params_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_RemoveMarketAuthorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveMarketAuthorities) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveMarketAuthorities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_RemoveMarketAuthorities_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveMarketAuthorities(ctx, req.(*MsgRemoveMarketAuthorities)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -137,13 +209,21 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "UpdateMarketMap", - Handler: _Msg_UpdateMarketMap_Handler, + MethodName: "CreateMarkets", + Handler: _Msg_CreateMarkets_Handler, + }, + { + MethodName: "UpdateMarkets", + Handler: _Msg_UpdateMarkets_Handler, }, { MethodName: "Params", Handler: _Msg_Params_Handler, }, + { + MethodName: "RemoveMarketAuthorities", + Handler: _Msg_RemoveMarketAuthorities_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "slinky/marketmap/v1/tx.proto", diff --git a/api/slinky/mm2/module/v1/module.pulsar.go b/api/slinky/mm2/module/v1/module.pulsar.go deleted file mode 100644 index 7c8db0ae6..000000000 --- a/api/slinky/mm2/module/v1/module.pulsar.go +++ /dev/null @@ -1,715 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1 - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_Module_2_list)(nil) - -type _Module_2_list struct { - list *[]string -} - -func (x *_Module_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Module_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Module_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Module_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Module_2_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Module at list field HooksOrder as it is not of Message kind")) -} - -func (x *_Module_2_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Module_2_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Module_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Module protoreflect.MessageDescriptor - fd_Module_authority protoreflect.FieldDescriptor - fd_Module_hooks_order protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_module_v1_module_proto_init() - md_Module = File_slinky_mm2_module_v1_module_proto.Messages().ByName("Module") - fd_Module_authority = md_Module.Fields().ByName("authority") - fd_Module_hooks_order = md_Module.Fields().ByName("hooks_order") -} - -var _ protoreflect.Message = (*fastReflection_Module)(nil) - -type fastReflection_Module Module - -func (x *Module) ProtoReflect() protoreflect.Message { - return (*fastReflection_Module)(x) -} - -func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_module_v1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Module_messageType fastReflection_Module_messageType -var _ protoreflect.MessageType = fastReflection_Module_messageType{} - -type fastReflection_Module_messageType struct{} - -func (x fastReflection_Module_messageType) Zero() protoreflect.Message { - return (*fastReflection_Module)(nil) -} -func (x fastReflection_Module_messageType) New() protoreflect.Message { - return new(fastReflection_Module) -} -func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// 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_Module) Type() protoreflect.MessageType { - return _fastReflection_Module_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Module) New() protoreflect.Message { - return new(fastReflection_Module) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { - return (*Module)(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_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_Module_authority, value) { - return - } - } - if len(x.HooksOrder) != 0 { - value := protoreflect.ValueOfList(&_Module_2_list{list: &x.HooksOrder}) - if !f(fd_Module_hooks_order, 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_Module) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.module.v1.Module.authority": - return x.Authority != "" - case "slinky.mm2.module.v1.Module.hooks_order": - return len(x.HooksOrder) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.module.v1.Module.authority": - x.Authority = "" - case "slinky.mm2.module.v1.Module.hooks_order": - x.HooksOrder = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.module.v1.Module.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "slinky.mm2.module.v1.Module.hooks_order": - if len(x.HooksOrder) == 0 { - return protoreflect.ValueOfList(&_Module_2_list{}) - } - listValue := &_Module_2_list{list: &x.HooksOrder} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.module.v1.Module.authority": - x.Authority = value.Interface().(string) - case "slinky.mm2.module.v1.Module.hooks_order": - lv := value.List() - clv := lv.(*_Module_2_list) - x.HooksOrder = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.module.v1.Module.hooks_order": - if x.HooksOrder == nil { - x.HooksOrder = []string{} - } - value := &_Module_2_list{list: &x.HooksOrder} - return protoreflect.ValueOfList(value) - case "slinky.mm2.module.v1.Module.authority": - panic(fmt.Errorf("field authority of message slinky.mm2.module.v1.Module is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.module.v1.Module.authority": - return protoreflect.ValueOfString("") - case "slinky.mm2.module.v1.Module.hooks_order": - list := []string{} - return protoreflect.ValueOfList(&_Module_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.module.v1.Module")) - } - panic(fmt.Errorf("message slinky.mm2.module.v1.Module 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_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.module.v1.Module", 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_Module) 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_Module) 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_Module) 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_Module) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.HooksOrder) > 0 { - for _, s := range x.HooksOrder { - l = len(s) - 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().(*Module) - 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.HooksOrder) > 0 { - for iNdEx := len(x.HooksOrder) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.HooksOrder[iNdEx]) - copy(dAtA[i:], x.HooksOrder[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.HooksOrder[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - 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().(*Module) - 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: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: 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 Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HooksOrder", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.HooksOrder = append(x.HooksOrder, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: slinky/mm2/module/v1/module.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Module is the config object of the builder module. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Authority defines the custom module authority. If not set, defaults to the - // governance module. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // HooksOrder specifies the order of marketmap hooks and should be a list - // of module names which provide a marketmap hooks instance. If no order is - // provided, then hooks will be applied in alphabetical order of module names. - HooksOrder []string `protobuf:"bytes,2,rep,name=hooks_order,json=hooksOrder,proto3" json:"hooks_order,omitempty"` -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_module_v1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_slinky_mm2_module_v1_module_proto_rawDescGZIP(), []int{0} -} - -func (x *Module) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *Module) GetHooksOrder() []string { - if x != nil { - return x.HooksOrder - } - return nil -} - -var File_slinky_mm2_module_v1_module_proto protoreflect.FileDescriptor - -var file_slinky_mm2_module_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x71, 0x0a, 0x06, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5f, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x3a, 0x28, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x22, 0x0a, 0x20, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, 0x70, 0x2d, 0x6d, 0x65, - 0x76, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x78, 0x2f, 0x6d, 0x6d, 0x32, 0x42, 0xca, - 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, - 0x32, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 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, 0x6d, 0x32, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4d, 0x4d, - 0xaa, 0x02, 0x14, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, 0x32, 0x2e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x20, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x17, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, - 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_slinky_mm2_module_v1_module_proto_rawDescOnce sync.Once - file_slinky_mm2_module_v1_module_proto_rawDescData = file_slinky_mm2_module_v1_module_proto_rawDesc -) - -func file_slinky_mm2_module_v1_module_proto_rawDescGZIP() []byte { - file_slinky_mm2_module_v1_module_proto_rawDescOnce.Do(func() { - file_slinky_mm2_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_module_v1_module_proto_rawDescData) - }) - return file_slinky_mm2_module_v1_module_proto_rawDescData -} - -var file_slinky_mm2_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_slinky_mm2_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: slinky.mm2.module.v1.Module -} -var file_slinky_mm2_module_v1_module_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_slinky_mm2_module_v1_module_proto_init() } -func file_slinky_mm2_module_v1_module_proto_init() { - if File_slinky_mm2_module_v1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_module_v1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_slinky_mm2_module_v1_module_proto_goTypes, - DependencyIndexes: file_slinky_mm2_module_v1_module_proto_depIdxs, - MessageInfos: file_slinky_mm2_module_v1_module_proto_msgTypes, - }.Build() - File_slinky_mm2_module_v1_module_proto = out.File - file_slinky_mm2_module_v1_module_proto_rawDesc = nil - file_slinky_mm2_module_v1_module_proto_goTypes = nil - file_slinky_mm2_module_v1_module_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/genesis.pulsar.go b/api/slinky/mm2/v1/genesis.pulsar.go deleted file mode 100644 index 8a9dfabf7..000000000 --- a/api/slinky/mm2/v1/genesis.pulsar.go +++ /dev/null @@ -1,750 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package mm2v1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_market_map protoreflect.FieldDescriptor - fd_GenesisState_last_updated protoreflect.FieldDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_genesis_proto_init() - md_GenesisState = File_slinky_mm2_v1_genesis_proto.Messages().ByName("GenesisState") - fd_GenesisState_market_map = md_GenesisState.Fields().ByName("market_map") - fd_GenesisState_last_updated = md_GenesisState.Fields().ByName("last_updated") - fd_GenesisState_params = md_GenesisState.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) - -type fastReflection_GenesisState GenesisState - -func (x *GenesisState) ProtoReflect() protoreflect.Message { - return (*fastReflection_GenesisState)(x) -} - -func (x *GenesisState) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_genesis_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType -var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} - -type fastReflection_GenesisState_messageType struct{} - -func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { - return (*fastReflection_GenesisState)(nil) -} -func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} -func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// 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_GenesisState) Type() protoreflect.MessageType { - return _fastReflection_GenesisState_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GenesisState) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { - return (*GenesisState)(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_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MarketMap != nil { - value := protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - if !f(fd_GenesisState_market_map, value) { - return - } - } - if x.LastUpdated != uint64(0) { - value := protoreflect.ValueOfUint64(x.LastUpdated) - if !f(fd_GenesisState_last_updated, value) { - return - } - } - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_GenesisState_params, 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_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - return x.MarketMap != nil - case "slinky.mm2.v1.GenesisState.last_updated": - return x.LastUpdated != uint64(0) - case "slinky.mm2.v1.GenesisState.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - x.MarketMap = nil - case "slinky.mm2.v1.GenesisState.last_updated": - x.LastUpdated = uint64(0) - case "slinky.mm2.v1.GenesisState.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - value := x.MarketMap - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.GenesisState.last_updated": - value := x.LastUpdated - return protoreflect.ValueOfUint64(value) - case "slinky.mm2.v1.GenesisState.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - x.MarketMap = value.Message().Interface().(*MarketMap) - case "slinky.mm2.v1.GenesisState.last_updated": - x.LastUpdated = value.Uint() - case "slinky.mm2.v1.GenesisState.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - if x.MarketMap == nil { - x.MarketMap = new(MarketMap) - } - return protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - case "slinky.mm2.v1.GenesisState.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "slinky.mm2.v1.GenesisState.last_updated": - panic(fmt.Errorf("field last_updated of message slinky.mm2.v1.GenesisState is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.GenesisState.market_map": - m := new(MarketMap) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.GenesisState.last_updated": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.mm2.v1.GenesisState.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.GenesisState")) - } - panic(fmt.Errorf("message slinky.mm2.v1.GenesisState 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_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.GenesisState", 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_GenesisState) 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_GenesisState) 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_GenesisState) 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_GenesisState) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GenesisState) - 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.MarketMap != nil { - l = options.Size(x.MarketMap) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastUpdated != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdated)) - } - if x.Params != nil { - l = options.Size(x.Params) - 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().(*GenesisState) - 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.Params != nil { - encoded, err := options.Marshal(x.Params) - 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] = 0x1a - } - if x.LastUpdated != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdated)) - i-- - dAtA[i] = 0x10 - } - if x.MarketMap != nil { - encoded, err := options.Marshal(x.MarketMap) - 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().(*GenesisState) - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: 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 MarketMap", 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.MarketMap == nil { - x.MarketMap = &MarketMap{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MarketMap); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - x.LastUpdated = 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.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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 -// protoc (unknown) -// source: slinky/mm2/v1/genesis.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GenesisState defines the x/marketmap module's genesis state. -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap *MarketMap `protobuf:"bytes,1,opt,name=market_map,json=marketMap,proto3" json:"market_map,omitempty"` - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // Params are the parameters for the x/marketmap module. - Params *Params `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_genesis_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState) ProtoMessage() {} - -// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. -func (*GenesisState) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetMarketMap() *MarketMap { - if x != nil { - return x.MarketMap - } - return nil -} - -func (x *GenesisState) GetLastUpdated() uint64 { - if x != nil { - return x.LastUpdated - } - return 0 -} - -func (x *GenesisState) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -var File_slinky_mm2_v1_genesis_proto protoreflect.FileDescriptor - -var file_slinky_mm2_v1_genesis_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, - 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x0c, 0x47, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x09, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x33, 0x0a, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0x9d, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6d, 0x32, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, - 0x32, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, - 0x32, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, - 0x32, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_slinky_mm2_v1_genesis_proto_rawDescOnce sync.Once - file_slinky_mm2_v1_genesis_proto_rawDescData = file_slinky_mm2_v1_genesis_proto_rawDesc -) - -func file_slinky_mm2_v1_genesis_proto_rawDescGZIP() []byte { - file_slinky_mm2_v1_genesis_proto_rawDescOnce.Do(func() { - file_slinky_mm2_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_v1_genesis_proto_rawDescData) - }) - return file_slinky_mm2_v1_genesis_proto_rawDescData -} - -var file_slinky_mm2_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_slinky_mm2_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: slinky.mm2.v1.GenesisState - (*MarketMap)(nil), // 1: slinky.mm2.v1.MarketMap - (*Params)(nil), // 2: slinky.mm2.v1.Params -} -var file_slinky_mm2_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: slinky.mm2.v1.GenesisState.market_map:type_name -> slinky.mm2.v1.MarketMap - 2, // 1: slinky.mm2.v1.GenesisState.params:type_name -> slinky.mm2.v1.Params - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_slinky_mm2_v1_genesis_proto_init() } -func file_slinky_mm2_v1_genesis_proto_init() { - if File_slinky_mm2_v1_genesis_proto != nil { - return - } - file_slinky_mm2_v1_market_proto_init() - file_slinky_mm2_v1_params_proto_init() - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_slinky_mm2_v1_genesis_proto_goTypes, - DependencyIndexes: file_slinky_mm2_v1_genesis_proto_depIdxs, - MessageInfos: file_slinky_mm2_v1_genesis_proto_msgTypes, - }.Build() - File_slinky_mm2_v1_genesis_proto = out.File - file_slinky_mm2_v1_genesis_proto_rawDesc = nil - file_slinky_mm2_v1_genesis_proto_goTypes = nil - file_slinky_mm2_v1_genesis_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/market.pulsar.go b/api/slinky/mm2/v1/market.pulsar.go deleted file mode 100644 index fcb509df6..000000000 --- a/api/slinky/mm2/v1/market.pulsar.go +++ /dev/null @@ -1,3040 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package mm2v1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - v1 "github.com/skip-mev/slinky/api/slinky/types/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sort "sort" - sync "sync" -) - -var _ protoreflect.List = (*_Market_2_list)(nil) - -type _Market_2_list struct { - list *[]*ProviderConfig -} - -func (x *_Market_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Market_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Market_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ProviderConfig) - (*x.list)[i] = concreteValue -} - -func (x *_Market_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*ProviderConfig) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Market_2_list) AppendMutable() protoreflect.Value { - v := new(ProviderConfig) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Market_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Market_2_list) NewElement() protoreflect.Value { - v := new(ProviderConfig) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Market_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Market protoreflect.MessageDescriptor - fd_Market_ticker protoreflect.FieldDescriptor - fd_Market_provider_configs protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_market_proto_init() - md_Market = File_slinky_mm2_v1_market_proto.Messages().ByName("Market") - fd_Market_ticker = md_Market.Fields().ByName("ticker") - fd_Market_provider_configs = md_Market.Fields().ByName("provider_configs") -} - -var _ protoreflect.Message = (*fastReflection_Market)(nil) - -type fastReflection_Market Market - -func (x *Market) ProtoReflect() protoreflect.Message { - return (*fastReflection_Market)(x) -} - -func (x *Market) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Market_messageType fastReflection_Market_messageType -var _ protoreflect.MessageType = fastReflection_Market_messageType{} - -type fastReflection_Market_messageType struct{} - -func (x fastReflection_Market_messageType) Zero() protoreflect.Message { - return (*fastReflection_Market)(nil) -} -func (x fastReflection_Market_messageType) New() protoreflect.Message { - return new(fastReflection_Market) -} -func (x fastReflection_Market_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Market -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Market) Descriptor() protoreflect.MessageDescriptor { - return md_Market -} - -// 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_Market) Type() protoreflect.MessageType { - return _fastReflection_Market_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Market) New() protoreflect.Message { - return new(fastReflection_Market) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Market) Interface() protoreflect.ProtoMessage { - return (*Market)(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_Market) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Ticker != nil { - value := protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) - if !f(fd_Market_ticker, value) { - return - } - } - if len(x.ProviderConfigs) != 0 { - value := protoreflect.ValueOfList(&_Market_2_list{list: &x.ProviderConfigs}) - if !f(fd_Market_provider_configs, 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_Market) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.Market.ticker": - return x.Ticker != nil - case "slinky.mm2.v1.Market.provider_configs": - return len(x.ProviderConfigs) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.Market.ticker": - x.Ticker = nil - case "slinky.mm2.v1.Market.provider_configs": - x.ProviderConfigs = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.Market.ticker": - value := x.Ticker - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.Market.provider_configs": - if len(x.ProviderConfigs) == 0 { - return protoreflect.ValueOfList(&_Market_2_list{}) - } - listValue := &_Market_2_list{list: &x.ProviderConfigs} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.Market.ticker": - x.Ticker = value.Message().Interface().(*Ticker) - case "slinky.mm2.v1.Market.provider_configs": - lv := value.List() - clv := lv.(*_Market_2_list) - x.ProviderConfigs = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Market.ticker": - if x.Ticker == nil { - x.Ticker = new(Ticker) - } - return protoreflect.ValueOfMessage(x.Ticker.ProtoReflect()) - case "slinky.mm2.v1.Market.provider_configs": - if x.ProviderConfigs == nil { - x.ProviderConfigs = []*ProviderConfig{} - } - value := &_Market_2_list{list: &x.ProviderConfigs} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Market.ticker": - m := new(Ticker) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.Market.provider_configs": - list := []*ProviderConfig{} - return protoreflect.ValueOfList(&_Market_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Market")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Market 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_Market) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.Market", 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_Market) 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_Market) 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_Market) 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_Market) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Market) - 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.Ticker != nil { - l = options.Size(x.Ticker) - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.ProviderConfigs) > 0 { - for _, e := range x.ProviderConfigs { - 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().(*Market) - 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.ProviderConfigs) > 0 { - for iNdEx := len(x.ProviderConfigs) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.ProviderConfigs[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] = 0x12 - } - } - if x.Ticker != nil { - encoded, err := options.Marshal(x.Ticker) - 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().(*Market) - 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: Market: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Market: 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 Ticker", 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.Ticker == nil { - x.Ticker = &Ticker{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Ticker); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProviderConfigs", 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.ProviderConfigs = append(x.ProviderConfigs, &ProviderConfig{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ProviderConfigs[len(x.ProviderConfigs)-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_Ticker protoreflect.MessageDescriptor - fd_Ticker_currency_pair protoreflect.FieldDescriptor - fd_Ticker_decimals protoreflect.FieldDescriptor - fd_Ticker_min_provider_count protoreflect.FieldDescriptor - fd_Ticker_enabled protoreflect.FieldDescriptor - fd_Ticker_metadata_JSON protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_market_proto_init() - md_Ticker = File_slinky_mm2_v1_market_proto.Messages().ByName("Ticker") - fd_Ticker_currency_pair = md_Ticker.Fields().ByName("currency_pair") - fd_Ticker_decimals = md_Ticker.Fields().ByName("decimals") - fd_Ticker_min_provider_count = md_Ticker.Fields().ByName("min_provider_count") - fd_Ticker_enabled = md_Ticker.Fields().ByName("enabled") - fd_Ticker_metadata_JSON = md_Ticker.Fields().ByName("metadata_JSON") -} - -var _ protoreflect.Message = (*fastReflection_Ticker)(nil) - -type fastReflection_Ticker Ticker - -func (x *Ticker) ProtoReflect() protoreflect.Message { - return (*fastReflection_Ticker)(x) -} - -func (x *Ticker) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Ticker_messageType fastReflection_Ticker_messageType -var _ protoreflect.MessageType = fastReflection_Ticker_messageType{} - -type fastReflection_Ticker_messageType struct{} - -func (x fastReflection_Ticker_messageType) Zero() protoreflect.Message { - return (*fastReflection_Ticker)(nil) -} -func (x fastReflection_Ticker_messageType) New() protoreflect.Message { - return new(fastReflection_Ticker) -} -func (x fastReflection_Ticker_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Ticker -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Ticker) Descriptor() protoreflect.MessageDescriptor { - return md_Ticker -} - -// 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_Ticker) Type() protoreflect.MessageType { - return _fastReflection_Ticker_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Ticker) New() protoreflect.Message { - return new(fastReflection_Ticker) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Ticker) Interface() protoreflect.ProtoMessage { - return (*Ticker)(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_Ticker) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CurrencyPair != nil { - value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - if !f(fd_Ticker_currency_pair, value) { - return - } - } - if x.Decimals != uint64(0) { - value := protoreflect.ValueOfUint64(x.Decimals) - if !f(fd_Ticker_decimals, value) { - return - } - } - if x.MinProviderCount != uint64(0) { - value := protoreflect.ValueOfUint64(x.MinProviderCount) - if !f(fd_Ticker_min_provider_count, value) { - return - } - } - if x.Enabled != false { - value := protoreflect.ValueOfBool(x.Enabled) - if !f(fd_Ticker_enabled, value) { - return - } - } - if x.Metadata_JSON != "" { - value := protoreflect.ValueOfString(x.Metadata_JSON) - if !f(fd_Ticker_metadata_JSON, 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_Ticker) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - return x.CurrencyPair != nil - case "slinky.mm2.v1.Ticker.decimals": - return x.Decimals != uint64(0) - case "slinky.mm2.v1.Ticker.min_provider_count": - return x.MinProviderCount != uint64(0) - case "slinky.mm2.v1.Ticker.enabled": - return x.Enabled != false - case "slinky.mm2.v1.Ticker.metadata_JSON": - return x.Metadata_JSON != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - x.CurrencyPair = nil - case "slinky.mm2.v1.Ticker.decimals": - x.Decimals = uint64(0) - case "slinky.mm2.v1.Ticker.min_provider_count": - x.MinProviderCount = uint64(0) - case "slinky.mm2.v1.Ticker.enabled": - x.Enabled = false - case "slinky.mm2.v1.Ticker.metadata_JSON": - x.Metadata_JSON = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - value := x.CurrencyPair - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.Ticker.decimals": - value := x.Decimals - return protoreflect.ValueOfUint64(value) - case "slinky.mm2.v1.Ticker.min_provider_count": - value := x.MinProviderCount - return protoreflect.ValueOfUint64(value) - case "slinky.mm2.v1.Ticker.enabled": - value := x.Enabled - return protoreflect.ValueOfBool(value) - case "slinky.mm2.v1.Ticker.metadata_JSON": - value := x.Metadata_JSON - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) - case "slinky.mm2.v1.Ticker.decimals": - x.Decimals = value.Uint() - case "slinky.mm2.v1.Ticker.min_provider_count": - x.MinProviderCount = value.Uint() - case "slinky.mm2.v1.Ticker.enabled": - x.Enabled = value.Bool() - case "slinky.mm2.v1.Ticker.metadata_JSON": - x.Metadata_JSON = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - if x.CurrencyPair == nil { - x.CurrencyPair = new(v1.CurrencyPair) - } - return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - case "slinky.mm2.v1.Ticker.decimals": - panic(fmt.Errorf("field decimals of message slinky.mm2.v1.Ticker is not mutable")) - case "slinky.mm2.v1.Ticker.min_provider_count": - panic(fmt.Errorf("field min_provider_count of message slinky.mm2.v1.Ticker is not mutable")) - case "slinky.mm2.v1.Ticker.enabled": - panic(fmt.Errorf("field enabled of message slinky.mm2.v1.Ticker is not mutable")) - case "slinky.mm2.v1.Ticker.metadata_JSON": - panic(fmt.Errorf("field metadata_JSON of message slinky.mm2.v1.Ticker is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Ticker.currency_pair": - m := new(v1.CurrencyPair) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.Ticker.decimals": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.mm2.v1.Ticker.min_provider_count": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.mm2.v1.Ticker.enabled": - return protoreflect.ValueOfBool(false) - case "slinky.mm2.v1.Ticker.metadata_JSON": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Ticker")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Ticker 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_Ticker) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.Ticker", 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_Ticker) 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_Ticker) 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_Ticker) 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_Ticker) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Ticker) - 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.CurrencyPair != nil { - l = options.Size(x.CurrencyPair) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Decimals != 0 { - n += 1 + runtime.Sov(uint64(x.Decimals)) - } - if x.MinProviderCount != 0 { - n += 1 + runtime.Sov(uint64(x.MinProviderCount)) - } - if x.Enabled { - n += 2 - } - l = len(x.Metadata_JSON) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Ticker) - 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.Metadata_JSON) > 0 { - i -= len(x.Metadata_JSON) - copy(dAtA[i:], x.Metadata_JSON) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata_JSON))) - i-- - dAtA[i] = 0x7a - } - if x.Enabled { - i-- - if x.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if x.MinProviderCount != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MinProviderCount)) - i-- - dAtA[i] = 0x18 - } - if x.Decimals != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Decimals)) - i-- - dAtA[i] = 0x10 - } - 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] = 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().(*Ticker) - 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: Ticker: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Ticker: 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 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 - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - x.Decimals = 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.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) - } - x.MinProviderCount = 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.MinProviderCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Enabled = bool(v != 0) - case 15: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Metadata_JSON = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_ProviderConfig protoreflect.MessageDescriptor - fd_ProviderConfig_name protoreflect.FieldDescriptor - fd_ProviderConfig_off_chain_ticker protoreflect.FieldDescriptor - fd_ProviderConfig_normalize_by_pair protoreflect.FieldDescriptor - fd_ProviderConfig_invert protoreflect.FieldDescriptor - fd_ProviderConfig_metadata_JSON protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_market_proto_init() - md_ProviderConfig = File_slinky_mm2_v1_market_proto.Messages().ByName("ProviderConfig") - fd_ProviderConfig_name = md_ProviderConfig.Fields().ByName("name") - fd_ProviderConfig_off_chain_ticker = md_ProviderConfig.Fields().ByName("off_chain_ticker") - fd_ProviderConfig_normalize_by_pair = md_ProviderConfig.Fields().ByName("normalize_by_pair") - fd_ProviderConfig_invert = md_ProviderConfig.Fields().ByName("invert") - fd_ProviderConfig_metadata_JSON = md_ProviderConfig.Fields().ByName("metadata_JSON") -} - -var _ protoreflect.Message = (*fastReflection_ProviderConfig)(nil) - -type fastReflection_ProviderConfig ProviderConfig - -func (x *ProviderConfig) ProtoReflect() protoreflect.Message { - return (*fastReflection_ProviderConfig)(x) -} - -func (x *ProviderConfig) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_market_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_ProviderConfig_messageType fastReflection_ProviderConfig_messageType -var _ protoreflect.MessageType = fastReflection_ProviderConfig_messageType{} - -type fastReflection_ProviderConfig_messageType struct{} - -func (x fastReflection_ProviderConfig_messageType) Zero() protoreflect.Message { - return (*fastReflection_ProviderConfig)(nil) -} -func (x fastReflection_ProviderConfig_messageType) New() protoreflect.Message { - return new(fastReflection_ProviderConfig) -} -func (x fastReflection_ProviderConfig_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ProviderConfig -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ProviderConfig) Descriptor() protoreflect.MessageDescriptor { - return md_ProviderConfig -} - -// 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_ProviderConfig) Type() protoreflect.MessageType { - return _fastReflection_ProviderConfig_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ProviderConfig) New() protoreflect.Message { - return new(fastReflection_ProviderConfig) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ProviderConfig) Interface() protoreflect.ProtoMessage { - return (*ProviderConfig)(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_ProviderConfig) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_ProviderConfig_name, value) { - return - } - } - if x.OffChainTicker != "" { - value := protoreflect.ValueOfString(x.OffChainTicker) - if !f(fd_ProviderConfig_off_chain_ticker, value) { - return - } - } - if x.NormalizeByPair != nil { - value := protoreflect.ValueOfMessage(x.NormalizeByPair.ProtoReflect()) - if !f(fd_ProviderConfig_normalize_by_pair, value) { - return - } - } - if x.Invert != false { - value := protoreflect.ValueOfBool(x.Invert) - if !f(fd_ProviderConfig_invert, value) { - return - } - } - if x.Metadata_JSON != "" { - value := protoreflect.ValueOfString(x.Metadata_JSON) - if !f(fd_ProviderConfig_metadata_JSON, 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_ProviderConfig) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.ProviderConfig.name": - return x.Name != "" - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - return x.OffChainTicker != "" - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - return x.NormalizeByPair != nil - case "slinky.mm2.v1.ProviderConfig.invert": - return x.Invert != false - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - return x.Metadata_JSON != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.ProviderConfig.name": - x.Name = "" - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - x.OffChainTicker = "" - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - x.NormalizeByPair = nil - case "slinky.mm2.v1.ProviderConfig.invert": - x.Invert = false - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - x.Metadata_JSON = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.ProviderConfig.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - value := x.OffChainTicker - return protoreflect.ValueOfString(value) - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - value := x.NormalizeByPair - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.ProviderConfig.invert": - value := x.Invert - return protoreflect.ValueOfBool(value) - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - value := x.Metadata_JSON - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.ProviderConfig.name": - x.Name = value.Interface().(string) - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - x.OffChainTicker = value.Interface().(string) - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - x.NormalizeByPair = value.Message().Interface().(*v1.CurrencyPair) - case "slinky.mm2.v1.ProviderConfig.invert": - x.Invert = value.Bool() - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - x.Metadata_JSON = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - if x.NormalizeByPair == nil { - x.NormalizeByPair = new(v1.CurrencyPair) - } - return protoreflect.ValueOfMessage(x.NormalizeByPair.ProtoReflect()) - case "slinky.mm2.v1.ProviderConfig.name": - panic(fmt.Errorf("field name of message slinky.mm2.v1.ProviderConfig is not mutable")) - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - panic(fmt.Errorf("field off_chain_ticker of message slinky.mm2.v1.ProviderConfig is not mutable")) - case "slinky.mm2.v1.ProviderConfig.invert": - panic(fmt.Errorf("field invert of message slinky.mm2.v1.ProviderConfig is not mutable")) - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - panic(fmt.Errorf("field metadata_JSON of message slinky.mm2.v1.ProviderConfig is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.ProviderConfig.name": - return protoreflect.ValueOfString("") - case "slinky.mm2.v1.ProviderConfig.off_chain_ticker": - return protoreflect.ValueOfString("") - case "slinky.mm2.v1.ProviderConfig.normalize_by_pair": - m := new(v1.CurrencyPair) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.ProviderConfig.invert": - return protoreflect.ValueOfBool(false) - case "slinky.mm2.v1.ProviderConfig.metadata_JSON": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ProviderConfig")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ProviderConfig 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_ProviderConfig) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.ProviderConfig", 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_ProviderConfig) 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_ProviderConfig) 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_ProviderConfig) 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_ProviderConfig) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ProviderConfig) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Name) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.OffChainTicker) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.NormalizeByPair != nil { - l = options.Size(x.NormalizeByPair) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Invert { - n += 2 - } - l = len(x.Metadata_JSON) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ProviderConfig) - 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.Metadata_JSON) > 0 { - i -= len(x.Metadata_JSON) - copy(dAtA[i:], x.Metadata_JSON) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata_JSON))) - i-- - dAtA[i] = 0x7a - } - if x.Invert { - i-- - if x.Invert { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if x.NormalizeByPair != nil { - encoded, err := options.Marshal(x.NormalizeByPair) - 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] = 0x1a - } - if len(x.OffChainTicker) > 0 { - i -= len(x.OffChainTicker) - copy(dAtA[i:], x.OffChainTicker) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OffChainTicker))) - i-- - dAtA[i] = 0x12 - } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) - 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().(*ProviderConfig) - 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: ProviderConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProviderConfig: 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 Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.OffChainTicker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NormalizeByPair", 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.NormalizeByPair == nil { - x.NormalizeByPair = &v1.CurrencyPair{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NormalizeByPair); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) - } - var v 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++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Invert = bool(v != 0) - case 15: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Metadata_JSON = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.Map = (*_MarketMap_1_map)(nil) - -type _MarketMap_1_map struct { - m *map[string]*Market -} - -func (x *_MarketMap_1_map) Len() int { - if x.m == nil { - return 0 - } - return len(*x.m) -} - -func (x *_MarketMap_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { - if x.m == nil { - return - } - for k, v := range *x.m { - mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) - mapValue := protoreflect.ValueOfMessage(v.ProtoReflect()) - if !f(mapKey, mapValue) { - break - } - } -} - -func (x *_MarketMap_1_map) Has(key protoreflect.MapKey) bool { - if x.m == nil { - return false - } - keyUnwrapped := key.String() - concreteValue := keyUnwrapped - _, ok := (*x.m)[concreteValue] - return ok -} - -func (x *_MarketMap_1_map) Clear(key protoreflect.MapKey) { - if x.m == nil { - return - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - delete(*x.m, concreteKey) -} - -func (x *_MarketMap_1_map) Get(key protoreflect.MapKey) protoreflect.Value { - if x.m == nil { - return protoreflect.Value{} - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if !ok { - return protoreflect.Value{} - } - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { - if !key.IsValid() || !value.IsValid() { - panic("invalid key or value provided") - } - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Market) - (*x.m)[concreteKey] = concreteValue -} - -func (x *_MarketMap_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { - keyUnwrapped := key.String() - concreteKey := keyUnwrapped - v, ok := (*x.m)[concreteKey] - if ok { - return protoreflect.ValueOfMessage(v.ProtoReflect()) - } - newValue := new(Market) - (*x.m)[concreteKey] = newValue - return protoreflect.ValueOfMessage(newValue.ProtoReflect()) -} - -func (x *_MarketMap_1_map) NewValue() protoreflect.Value { - v := new(Market) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MarketMap_1_map) IsValid() bool { - return x.m != nil -} - -var ( - md_MarketMap protoreflect.MessageDescriptor - fd_MarketMap_markets protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_market_proto_init() - md_MarketMap = File_slinky_mm2_v1_market_proto.Messages().ByName("MarketMap") - fd_MarketMap_markets = md_MarketMap.Fields().ByName("markets") -} - -var _ protoreflect.Message = (*fastReflection_MarketMap)(nil) - -type fastReflection_MarketMap MarketMap - -func (x *MarketMap) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketMap)(x) -} - -func (x *MarketMap) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_market_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_MarketMap_messageType fastReflection_MarketMap_messageType -var _ protoreflect.MessageType = fastReflection_MarketMap_messageType{} - -type fastReflection_MarketMap_messageType struct{} - -func (x fastReflection_MarketMap_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketMap)(nil) -} -func (x fastReflection_MarketMap_messageType) New() protoreflect.Message { - return new(fastReflection_MarketMap) -} -func (x fastReflection_MarketMap_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMap -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketMap) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMap -} - -// 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_MarketMap) Type() protoreflect.MessageType { - return _fastReflection_MarketMap_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketMap) New() protoreflect.Message { - return new(fastReflection_MarketMap) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketMap) Interface() protoreflect.ProtoMessage { - return (*MarketMap)(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_MarketMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Markets) != 0 { - value := protoreflect.ValueOfMap(&_MarketMap_1_map{m: &x.Markets}) - if !f(fd_MarketMap_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_MarketMap) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - return len(x.Markets) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - x.Markets = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - if len(x.Markets) == 0 { - return protoreflect.ValueOfMap(&_MarketMap_1_map{}) - } - mapValue := &_MarketMap_1_map{m: &x.Markets} - return protoreflect.ValueOfMap(mapValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - mv := value.Map() - cmv := mv.(*_MarketMap_1_map) - x.Markets = *cmv.m - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - if x.Markets == nil { - x.Markets = make(map[string]*Market) - } - value := &_MarketMap_1_map{m: &x.Markets} - return protoreflect.ValueOfMap(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMap.markets": - m := make(map[string]*Market) - return protoreflect.ValueOfMap(&_MarketMap_1_map{m: &m}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMap")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMap 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_MarketMap) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MarketMap", 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_MarketMap) 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_MarketMap) 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_MarketMap) 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_MarketMap) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketMap) - 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 { - SiZeMaP := func(k string, v *Market) { - l := 0 - if v != nil { - l = options.Size(v) - } - l += 1 + runtime.Sov(uint64(l)) - mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + l - n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) - } - if options.Deterministic { - sortme := make([]string, 0, len(x.Markets)) - for k := range x.Markets { - sortme = append(sortme, k) - } - sort.Strings(sortme) - for _, k := range sortme { - v := x.Markets[k] - SiZeMaP(k, v) - } - } else { - for k, v := range x.Markets { - SiZeMaP(k, v) - } - } - } - 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().(*MarketMap) - 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 { - MaRsHaLmAp := func(k string, v *Market) (protoiface.MarshalOutput, error) { - baseI := i - encoded, err := options.Marshal(v) - 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 - i -= len(k) - copy(dAtA[i:], k) - i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - return protoiface.MarshalOutput{}, nil - } - if options.Deterministic { - keysForMarkets := make([]string, 0, len(x.Markets)) - for k := range x.Markets { - keysForMarkets = append(keysForMarkets, string(k)) - } - sort.Slice(keysForMarkets, func(i, j int) bool { - return keysForMarkets[i] < keysForMarkets[j] - }) - for iNdEx := len(keysForMarkets) - 1; iNdEx >= 0; iNdEx-- { - v := x.Markets[string(keysForMarkets[iNdEx])] - out, err := MaRsHaLmAp(keysForMarkets[iNdEx], v) - if err != nil { - return out, err - } - } - } else { - for k := range x.Markets { - v := x.Markets[k] - out, err := MaRsHaLmAp(k, v) - if err != nil { - return out, err - } - } - } - } - 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().(*MarketMap) - 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: MarketMap: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMap: 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 - } - if x.Markets == nil { - x.Markets = make(map[string]*Market) - } - var mapkey string - var mapvalue *Market - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey 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++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postStringIndexmapkey > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen 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++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postmsgIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - mapvalue = &Market{} - if err := options.Unmarshal(dAtA[iNdEx:postmsgIndex], mapvalue); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - 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) > postIndex { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - x.Markets[mapkey] = mapvalue - 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 -// protoc (unknown) -// source: slinky/mm2/v1/market.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Market encapsulates a Ticker and its provider-specific configuration. -type Market struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The - // price feed is scaled to a number of decimal places and has a minimum number - // of providers required to consider the ticker valid. - Ticker *Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"` - // ProviderConfigs is the list of provider-specific configs for this Market. - ProviderConfigs []*ProviderConfig `protobuf:"bytes,2,rep,name=provider_configs,json=providerConfigs,proto3" json:"provider_configs,omitempty"` -} - -func (x *Market) Reset() { - *x = Market{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Market) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Market) ProtoMessage() {} - -// Deprecated: Use Market.ProtoReflect.Descriptor instead. -func (*Market) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_market_proto_rawDescGZIP(), []int{0} -} - -func (x *Market) GetTicker() *Ticker { - if x != nil { - return x.Ticker - } - return nil -} - -func (x *Market) GetProviderConfigs() []*ProviderConfig { - if x != nil { - return x.ProviderConfigs - } - return nil -} - -// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price -// feed is scaled to a number of decimal places and has a minimum number of -// providers required to consider the ticker valid. -type Ticker struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CurrencyPair is the currency pair for this ticker. - CurrencyPair *v1.CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair,omitempty"` - // Decimals is the number of decimal places for the ticker. The number of - // decimal places is used to convert the price to a human-readable format. - Decimals uint64 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` - // MinProviderCount is the minimum number of providers required to consider - // the ticker valid. - MinProviderCount uint64 `protobuf:"varint,3,opt,name=min_provider_count,json=minProviderCount,proto3" json:"min_provider_count,omitempty"` - // Enabled is the flag that denotes if the Ticker is enabled for price - // fetching by an oracle. - Enabled bool `protobuf:"varint,14,opt,name=enabled,proto3" json:"enabled,omitempty"` - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given ticker. - Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` -} - -func (x *Ticker) Reset() { - *x = Ticker{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Ticker) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Ticker) ProtoMessage() {} - -// Deprecated: Use Ticker.ProtoReflect.Descriptor instead. -func (*Ticker) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_market_proto_rawDescGZIP(), []int{1} -} - -func (x *Ticker) GetCurrencyPair() *v1.CurrencyPair { - if x != nil { - return x.CurrencyPair - } - return nil -} - -func (x *Ticker) GetDecimals() uint64 { - if x != nil { - return x.Decimals - } - return 0 -} - -func (x *Ticker) GetMinProviderCount() uint64 { - if x != nil { - return x.MinProviderCount - } - return 0 -} - -func (x *Ticker) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *Ticker) GetMetadata_JSON() string { - if x != nil { - return x.Metadata_JSON - } - return "" -} - -type ProviderConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name corresponds to the name of the provider for which the configuration is - // being set. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. - // The off-chain ticker is unique to a given provider and is used to fetch the - // price of the ticker from the provider. - OffChainTicker string `protobuf:"bytes,2,opt,name=off_chain_ticker,json=offChainTicker,proto3" json:"off_chain_ticker,omitempty"` - // NormalizeByPair is the currency pair for this ticker to be normalized by. - // For example, if the desired Ticker is BTD/USD, this market could be reached - // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is - // optional and nullable. - NormalizeByPair *v1.CurrencyPair `protobuf:"bytes,3,opt,name=normalize_by_pair,json=normalizeByPair,proto3" json:"normalize_by_pair,omitempty"` - // Invert is a boolean indicating if the BASE and QUOTE of the market should - // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE - Invert bool `protobuf:"varint,4,opt,name=invert,proto3" json:"invert,omitempty"` - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given provider config. - Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` -} - -func (x *ProviderConfig) Reset() { - *x = ProviderConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProviderConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProviderConfig) ProtoMessage() {} - -// Deprecated: Use ProviderConfig.ProtoReflect.Descriptor instead. -func (*ProviderConfig) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_market_proto_rawDescGZIP(), []int{2} -} - -func (x *ProviderConfig) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ProviderConfig) GetOffChainTicker() string { - if x != nil { - return x.OffChainTicker - } - return "" -} - -func (x *ProviderConfig) GetNormalizeByPair() *v1.CurrencyPair { - if x != nil { - return x.NormalizeByPair - } - return nil -} - -func (x *ProviderConfig) GetInvert() bool { - if x != nil { - return x.Invert - } - return false -} - -func (x *ProviderConfig) GetMetadata_JSON() string { - if x != nil { - return x.Metadata_JSON - } - return "" -} - -// MarketMap maps ticker strings to their Markets. -type MarketMap struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Markets is the full list of tickers and their associated configurations - // to be stored on-chain. - Markets map[string]*Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *MarketMap) Reset() { - *x = MarketMap{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_market_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MarketMap) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MarketMap) ProtoMessage() {} - -// Deprecated: Use MarketMap.ProtoReflect.Descriptor instead. -func (*MarketMap) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_market_proto_rawDescGZIP(), []int{3} -} - -func (x *MarketMap) GetMarkets() map[string]*Market { - if x != nil { - return x.Markets - } - return nil -} - -var File_slinky_mm2_v1_market_proto protoreflect.FileDescriptor - -var file_slinky_mm2_v1_market_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x23, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x76, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x06, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x12, 0x33, 0x0a, 0x06, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, - 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, - 0x22, 0xe5, 0x01, 0x0a, 0x06, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 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, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, - 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, - 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x53, 0x4f, 0x4e, 0x3a, 0x08, - 0x98, 0xa0, 0x1f, 0x00, 0x80, 0xdc, 0x20, 0x00, 0x22, 0xd6, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x28, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x63, - 0x6b, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x66, 0x66, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x11, 0x6e, 0x6f, 0x72, - 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x18, 0x03, - 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, 0x0f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x79, - 0x50, 0x61, 0x69, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x53, 0x4f, - 0x4e, 0x22, 0xaf, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x12, - 0x45, 0x0a, 0x07, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x25, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x1a, 0x51, 0x0a, 0x0c, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x08, 0x98, 0xa0, 0x1f, 0x00, 0x80, - 0xdc, 0x20, 0x00, 0x42, 0x9c, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6d, 0x32, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, - 0x32, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, - 0x32, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, - 0x32, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_slinky_mm2_v1_market_proto_rawDescOnce sync.Once - file_slinky_mm2_v1_market_proto_rawDescData = file_slinky_mm2_v1_market_proto_rawDesc -) - -func file_slinky_mm2_v1_market_proto_rawDescGZIP() []byte { - file_slinky_mm2_v1_market_proto_rawDescOnce.Do(func() { - file_slinky_mm2_v1_market_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_v1_market_proto_rawDescData) - }) - return file_slinky_mm2_v1_market_proto_rawDescData -} - -var file_slinky_mm2_v1_market_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_slinky_mm2_v1_market_proto_goTypes = []interface{}{ - (*Market)(nil), // 0: slinky.mm2.v1.Market - (*Ticker)(nil), // 1: slinky.mm2.v1.Ticker - (*ProviderConfig)(nil), // 2: slinky.mm2.v1.ProviderConfig - (*MarketMap)(nil), // 3: slinky.mm2.v1.MarketMap - nil, // 4: slinky.mm2.v1.MarketMap.MarketsEntry - (*v1.CurrencyPair)(nil), // 5: slinky.types.v1.CurrencyPair -} -var file_slinky_mm2_v1_market_proto_depIdxs = []int32{ - 1, // 0: slinky.mm2.v1.Market.ticker:type_name -> slinky.mm2.v1.Ticker - 2, // 1: slinky.mm2.v1.Market.provider_configs:type_name -> slinky.mm2.v1.ProviderConfig - 5, // 2: slinky.mm2.v1.Ticker.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 5, // 3: slinky.mm2.v1.ProviderConfig.normalize_by_pair:type_name -> slinky.types.v1.CurrencyPair - 4, // 4: slinky.mm2.v1.MarketMap.markets:type_name -> slinky.mm2.v1.MarketMap.MarketsEntry - 0, // 5: slinky.mm2.v1.MarketMap.MarketsEntry.value:type_name -> slinky.mm2.v1.Market - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] 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 -} - -func init() { file_slinky_mm2_v1_market_proto_init() } -func file_slinky_mm2_v1_market_proto_init() { - if File_slinky_mm2_v1_market_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_v1_market_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Market); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_market_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ticker); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_market_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProviderConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_market_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketMap); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_v1_market_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_slinky_mm2_v1_market_proto_goTypes, - DependencyIndexes: file_slinky_mm2_v1_market_proto_depIdxs, - MessageInfos: file_slinky_mm2_v1_market_proto_msgTypes, - }.Build() - File_slinky_mm2_v1_market_proto = out.File - file_slinky_mm2_v1_market_proto_rawDesc = nil - file_slinky_mm2_v1_market_proto_goTypes = nil - file_slinky_mm2_v1_market_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/params.pulsar.go b/api/slinky/mm2/v1/params.pulsar.go deleted file mode 100644 index d610a8fc0..000000000 --- a/api/slinky/mm2/v1/params.pulsar.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package mm2v1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_Params_1_list)(nil) - -type _Params_1_list struct { - list *[]string -} - -func (x *_Params_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Params_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Params_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Params_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Params_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Params at list field MarketAuthorities as it is not of Message kind")) -} - -func (x *_Params_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Params_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Params_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Params protoreflect.MessageDescriptor - fd_Params_market_authorities protoreflect.FieldDescriptor - fd_Params_admin protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_params_proto_init() - md_Params = File_slinky_mm2_v1_params_proto.Messages().ByName("Params") - fd_Params_market_authorities = md_Params.Fields().ByName("market_authorities") - fd_Params_admin = md_Params.Fields().ByName("admin") -} - -var _ protoreflect.Message = (*fastReflection_Params)(nil) - -type fastReflection_Params Params - -func (x *Params) ProtoReflect() protoreflect.Message { - return (*fastReflection_Params)(x) -} - -func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_params_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Params_messageType fastReflection_Params_messageType -var _ protoreflect.MessageType = fastReflection_Params_messageType{} - -type fastReflection_Params_messageType struct{} - -func (x fastReflection_Params_messageType) Zero() protoreflect.Message { - return (*fastReflection_Params)(nil) -} -func (x fastReflection_Params_messageType) New() protoreflect.Message { - return new(fastReflection_Params) -} -func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Params -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { - return md_Params -} - -// 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_Params) Type() protoreflect.MessageType { - return _fastReflection_Params_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Params) New() protoreflect.Message { - return new(fastReflection_Params) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { - return (*Params)(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_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.MarketAuthorities) != 0 { - value := protoreflect.ValueOfList(&_Params_1_list{list: &x.MarketAuthorities}) - if !f(fd_Params_market_authorities, value) { - return - } - } - if x.Admin != "" { - value := protoreflect.ValueOfString(x.Admin) - if !f(fd_Params_admin, 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_Params) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - return len(x.MarketAuthorities) != 0 - case "slinky.mm2.v1.Params.admin": - return x.Admin != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - x.MarketAuthorities = nil - case "slinky.mm2.v1.Params.admin": - x.Admin = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - if len(x.MarketAuthorities) == 0 { - return protoreflect.ValueOfList(&_Params_1_list{}) - } - listValue := &_Params_1_list{list: &x.MarketAuthorities} - return protoreflect.ValueOfList(listValue) - case "slinky.mm2.v1.Params.admin": - value := x.Admin - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - lv := value.List() - clv := lv.(*_Params_1_list) - x.MarketAuthorities = *clv.list - case "slinky.mm2.v1.Params.admin": - x.Admin = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - if x.MarketAuthorities == nil { - x.MarketAuthorities = []string{} - } - value := &_Params_1_list{list: &x.MarketAuthorities} - return protoreflect.ValueOfList(value) - case "slinky.mm2.v1.Params.admin": - panic(fmt.Errorf("field admin of message slinky.mm2.v1.Params is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.Params.market_authorities": - list := []string{} - return protoreflect.ValueOfList(&_Params_1_list{list: &list}) - case "slinky.mm2.v1.Params.admin": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.Params")) - } - panic(fmt.Errorf("message slinky.mm2.v1.Params 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_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.Params", 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_Params) 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_Params) 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_Params) 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_Params) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Params) - 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.MarketAuthorities) > 0 { - for _, s := range x.MarketAuthorities { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Admin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Params) - 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.Admin) > 0 { - i -= len(x.Admin) - copy(dAtA[i:], x.Admin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) - i-- - dAtA[i] = 0x12 - } - if len(x.MarketAuthorities) > 0 { - for iNdEx := len(x.MarketAuthorities) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.MarketAuthorities[iNdEx]) - copy(dAtA[i:], x.MarketAuthorities[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MarketAuthorities[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Params) - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: 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 MarketAuthorities", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.MarketAuthorities = append(x.MarketAuthorities, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: slinky/mm2/v1/params.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Params defines the parameters for the x/marketmap module. -type Params struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // MarketAuthorities is the list of authority accounts that are able to - // control updating the marketmap. - MarketAuthorities []string `protobuf:"bytes,1,rep,name=market_authorities,json=marketAuthorities,proto3" json:"market_authorities,omitempty"` - // Admin is an address that can remove addresses from the MarketAuthorities - // list. Only governance can add to the MarketAuthorities or change the Admin. - Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` -} - -func (x *Params) Reset() { - *x = Params{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_params_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Params) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Params) ProtoMessage() {} - -// Deprecated: Use Params.ProtoReflect.Descriptor instead. -func (*Params) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_params_proto_rawDescGZIP(), []int{0} -} - -func (x *Params) GetMarketAuthorities() []string { - if x != nil { - return x.MarketAuthorities - } - return nil -} - -func (x *Params) GetAdmin() string { - if x != nil { - return x.Admin - } - return "" -} - -var File_slinky_mm2_v1_params_proto protoreflect.FileDescriptor - -var file_slinky_mm2_v1_params_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x22, 0x4d, 0x0a, 0x06, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x11, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x42, 0x9c, 0x01, 0x0a, 0x11, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, - 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x24, 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, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x3b, - 0x6d, 0x6d, 0x32, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, 0x32, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_slinky_mm2_v1_params_proto_rawDescOnce sync.Once - file_slinky_mm2_v1_params_proto_rawDescData = file_slinky_mm2_v1_params_proto_rawDesc -) - -func file_slinky_mm2_v1_params_proto_rawDescGZIP() []byte { - file_slinky_mm2_v1_params_proto_rawDescOnce.Do(func() { - file_slinky_mm2_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_v1_params_proto_rawDescData) - }) - return file_slinky_mm2_v1_params_proto_rawDescData -} - -var file_slinky_mm2_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_slinky_mm2_v1_params_proto_goTypes = []interface{}{ - (*Params)(nil), // 0: slinky.mm2.v1.Params -} -var file_slinky_mm2_v1_params_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_slinky_mm2_v1_params_proto_init() } -func file_slinky_mm2_v1_params_proto_init() { - if File_slinky_mm2_v1_params_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Params); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_v1_params_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_slinky_mm2_v1_params_proto_goTypes, - DependencyIndexes: file_slinky_mm2_v1_params_proto_depIdxs, - MessageInfos: file_slinky_mm2_v1_params_proto_msgTypes, - }.Build() - File_slinky_mm2_v1_params_proto = out.File - file_slinky_mm2_v1_params_proto_rawDesc = nil - file_slinky_mm2_v1_params_proto_goTypes = nil - file_slinky_mm2_v1_params_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/query.pulsar.go b/api/slinky/mm2/v1/query.pulsar.go deleted file mode 100644 index 208b3e33b..000000000 --- a/api/slinky/mm2/v1/query.pulsar.go +++ /dev/null @@ -1,3902 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package mm2v1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - v1 "github.com/skip-mev/slinky/api/slinky/types/v1" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_MarketMapRequest protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_MarketMapRequest = File_slinky_mm2_v1_query_proto.Messages().ByName("MarketMapRequest") -} - -var _ protoreflect.Message = (*fastReflection_MarketMapRequest)(nil) - -type fastReflection_MarketMapRequest MarketMapRequest - -func (x *MarketMapRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketMapRequest)(x) -} - -func (x *MarketMapRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MarketMapRequest_messageType fastReflection_MarketMapRequest_messageType -var _ protoreflect.MessageType = fastReflection_MarketMapRequest_messageType{} - -type fastReflection_MarketMapRequest_messageType struct{} - -func (x fastReflection_MarketMapRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketMapRequest)(nil) -} -func (x fastReflection_MarketMapRequest_messageType) New() protoreflect.Message { - return new(fastReflection_MarketMapRequest) -} -func (x fastReflection_MarketMapRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMapRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketMapRequest) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMapRequest -} - -// 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_MarketMapRequest) Type() protoreflect.MessageType { - return _fastReflection_MarketMapRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketMapRequest) New() protoreflect.Message { - return new(fastReflection_MarketMapRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketMapRequest) Interface() protoreflect.ProtoMessage { - return (*MarketMapRequest)(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_MarketMapRequest) 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_MarketMapRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) 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.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapRequest 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_MarketMapRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MarketMapRequest", 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_MarketMapRequest) 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_MarketMapRequest) 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_MarketMapRequest) 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_MarketMapRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketMapRequest) - 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().(*MarketMapRequest) - 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().(*MarketMapRequest) - 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: MarketMapRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMapRequest: 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_MarketMapResponse protoreflect.MessageDescriptor - fd_MarketMapResponse_market_map protoreflect.FieldDescriptor - fd_MarketMapResponse_last_updated protoreflect.FieldDescriptor - fd_MarketMapResponse_chain_id protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_MarketMapResponse = File_slinky_mm2_v1_query_proto.Messages().ByName("MarketMapResponse") - fd_MarketMapResponse_market_map = md_MarketMapResponse.Fields().ByName("market_map") - fd_MarketMapResponse_last_updated = md_MarketMapResponse.Fields().ByName("last_updated") - fd_MarketMapResponse_chain_id = md_MarketMapResponse.Fields().ByName("chain_id") -} - -var _ protoreflect.Message = (*fastReflection_MarketMapResponse)(nil) - -type fastReflection_MarketMapResponse MarketMapResponse - -func (x *MarketMapResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketMapResponse)(x) -} - -func (x *MarketMapResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MarketMapResponse_messageType fastReflection_MarketMapResponse_messageType -var _ protoreflect.MessageType = fastReflection_MarketMapResponse_messageType{} - -type fastReflection_MarketMapResponse_messageType struct{} - -func (x fastReflection_MarketMapResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketMapResponse)(nil) -} -func (x fastReflection_MarketMapResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MarketMapResponse) -} -func (x fastReflection_MarketMapResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMapResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketMapResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MarketMapResponse -} - -// 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_MarketMapResponse) Type() protoreflect.MessageType { - return _fastReflection_MarketMapResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketMapResponse) New() protoreflect.Message { - return new(fastReflection_MarketMapResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketMapResponse) Interface() protoreflect.ProtoMessage { - return (*MarketMapResponse)(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_MarketMapResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MarketMap != nil { - value := protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - if !f(fd_MarketMapResponse_market_map, value) { - return - } - } - if x.LastUpdated != uint64(0) { - value := protoreflect.ValueOfUint64(x.LastUpdated) - if !f(fd_MarketMapResponse_last_updated, value) { - return - } - } - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_MarketMapResponse_chain_id, 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_MarketMapResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - return x.MarketMap != nil - case "slinky.mm2.v1.MarketMapResponse.last_updated": - return x.LastUpdated != uint64(0) - case "slinky.mm2.v1.MarketMapResponse.chain_id": - return x.ChainId != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - x.MarketMap = nil - case "slinky.mm2.v1.MarketMapResponse.last_updated": - x.LastUpdated = uint64(0) - case "slinky.mm2.v1.MarketMapResponse.chain_id": - x.ChainId = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - value := x.MarketMap - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.MarketMapResponse.last_updated": - value := x.LastUpdated - return protoreflect.ValueOfUint64(value) - case "slinky.mm2.v1.MarketMapResponse.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - x.MarketMap = value.Message().Interface().(*MarketMap) - case "slinky.mm2.v1.MarketMapResponse.last_updated": - x.LastUpdated = value.Uint() - case "slinky.mm2.v1.MarketMapResponse.chain_id": - x.ChainId = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - if x.MarketMap == nil { - x.MarketMap = new(MarketMap) - } - return protoreflect.ValueOfMessage(x.MarketMap.ProtoReflect()) - case "slinky.mm2.v1.MarketMapResponse.last_updated": - panic(fmt.Errorf("field last_updated of message slinky.mm2.v1.MarketMapResponse is not mutable")) - case "slinky.mm2.v1.MarketMapResponse.chain_id": - panic(fmt.Errorf("field chain_id of message slinky.mm2.v1.MarketMapResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketMapResponse.market_map": - m := new(MarketMap) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.MarketMapResponse.last_updated": - return protoreflect.ValueOfUint64(uint64(0)) - case "slinky.mm2.v1.MarketMapResponse.chain_id": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketMapResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketMapResponse 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_MarketMapResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MarketMapResponse", 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_MarketMapResponse) 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_MarketMapResponse) 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_MarketMapResponse) 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_MarketMapResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketMapResponse) - 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.MarketMap != nil { - l = options.Size(x.MarketMap) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastUpdated != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdated)) - } - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MarketMapResponse) - 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.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) - i-- - dAtA[i] = 0x1a - } - if x.LastUpdated != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdated)) - i-- - dAtA[i] = 0x10 - } - if x.MarketMap != nil { - encoded, err := options.Marshal(x.MarketMap) - 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().(*MarketMapResponse) - 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: MarketMapResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketMapResponse: 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 MarketMap", 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.MarketMap == nil { - x.MarketMap = &MarketMap{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MarketMap); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - x.LastUpdated = 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.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MarketRequest protoreflect.MessageDescriptor - fd_MarketRequest_currency_pair protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_MarketRequest = File_slinky_mm2_v1_query_proto.Messages().ByName("MarketRequest") - fd_MarketRequest_currency_pair = md_MarketRequest.Fields().ByName("currency_pair") -} - -var _ protoreflect.Message = (*fastReflection_MarketRequest)(nil) - -type fastReflection_MarketRequest MarketRequest - -func (x *MarketRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketRequest)(x) -} - -func (x *MarketRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_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_MarketRequest_messageType fastReflection_MarketRequest_messageType -var _ protoreflect.MessageType = fastReflection_MarketRequest_messageType{} - -type fastReflection_MarketRequest_messageType struct{} - -func (x fastReflection_MarketRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketRequest)(nil) -} -func (x fastReflection_MarketRequest_messageType) New() protoreflect.Message { - return new(fastReflection_MarketRequest) -} -func (x fastReflection_MarketRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketRequest) Descriptor() protoreflect.MessageDescriptor { - return md_MarketRequest -} - -// 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_MarketRequest) Type() protoreflect.MessageType { - return _fastReflection_MarketRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketRequest) New() protoreflect.Message { - return new(fastReflection_MarketRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketRequest) Interface() protoreflect.ProtoMessage { - return (*MarketRequest)(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_MarketRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CurrencyPair != nil { - value := protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - if !f(fd_MarketRequest_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_MarketRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MarketRequest.currency_pair": - return x.CurrencyPair != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketRequest.currency_pair": - x.CurrencyPair = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MarketRequest.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.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketRequest.currency_pair": - x.CurrencyPair = value.Message().Interface().(*v1.CurrencyPair) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketRequest.currency_pair": - if x.CurrencyPair == nil { - x.CurrencyPair = new(v1.CurrencyPair) - } - return protoreflect.ValueOfMessage(x.CurrencyPair.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketRequest.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.mm2.v1.MarketRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketRequest 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_MarketRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MarketRequest", 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_MarketRequest) 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_MarketRequest) 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_MarketRequest) 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_MarketRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketRequest) - 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.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().(*MarketRequest) - 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] = 0x1a - } - 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().(*MarketRequest) - 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: MarketRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 3: - 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 ( - md_MarketResponse protoreflect.MessageDescriptor - fd_MarketResponse_market protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_MarketResponse = File_slinky_mm2_v1_query_proto.Messages().ByName("MarketResponse") - fd_MarketResponse_market = md_MarketResponse.Fields().ByName("market") -} - -var _ protoreflect.Message = (*fastReflection_MarketResponse)(nil) - -type fastReflection_MarketResponse MarketResponse - -func (x *MarketResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MarketResponse)(x) -} - -func (x *MarketResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_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_MarketResponse_messageType fastReflection_MarketResponse_messageType -var _ protoreflect.MessageType = fastReflection_MarketResponse_messageType{} - -type fastReflection_MarketResponse_messageType struct{} - -func (x fastReflection_MarketResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MarketResponse)(nil) -} -func (x fastReflection_MarketResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MarketResponse) -} -func (x fastReflection_MarketResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MarketResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MarketResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MarketResponse -} - -// 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_MarketResponse) Type() protoreflect.MessageType { - return _fastReflection_MarketResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MarketResponse) New() protoreflect.Message { - return new(fastReflection_MarketResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MarketResponse) Interface() protoreflect.ProtoMessage { - return (*MarketResponse)(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_MarketResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Market != nil { - value := protoreflect.ValueOfMessage(x.Market.ProtoReflect()) - if !f(fd_MarketResponse_market, 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_MarketResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - return x.Market != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - x.Market = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - value := x.Market - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - x.Market = value.Message().Interface().(*Market) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - if x.Market == nil { - x.Market = new(Market) - } - return protoreflect.ValueOfMessage(x.Market.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MarketResponse.market": - m := new(Market) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MarketResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MarketResponse 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_MarketResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MarketResponse", 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_MarketResponse) 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_MarketResponse) 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_MarketResponse) 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_MarketResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MarketResponse) - 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.Market != nil { - l = options.Size(x.Market) - 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().(*MarketResponse) - 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.Market != nil { - encoded, err := options.Marshal(x.Market) - 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().(*MarketResponse) - 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: MarketResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MarketResponse: 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 Market", 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.Market == nil { - x.Market = &Market{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Market); 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_ParamsRequest protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_ParamsRequest = File_slinky_mm2_v1_query_proto.Messages().ByName("ParamsRequest") -} - -var _ protoreflect.Message = (*fastReflection_ParamsRequest)(nil) - -type fastReflection_ParamsRequest ParamsRequest - -func (x *ParamsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_ParamsRequest)(x) -} - -func (x *ParamsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ParamsRequest_messageType fastReflection_ParamsRequest_messageType -var _ protoreflect.MessageType = fastReflection_ParamsRequest_messageType{} - -type fastReflection_ParamsRequest_messageType struct{} - -func (x fastReflection_ParamsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_ParamsRequest)(nil) -} -func (x fastReflection_ParamsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_ParamsRequest) -} -func (x fastReflection_ParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ParamsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsRequest -} - -// 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_ParamsRequest) Type() protoreflect.MessageType { - return _fastReflection_ParamsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ParamsRequest) New() protoreflect.Message { - return new(fastReflection_ParamsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ParamsRequest) Interface() protoreflect.ProtoMessage { - return (*ParamsRequest)(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_ParamsRequest) 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_ParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) 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.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsRequest 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_ParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.ParamsRequest", 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_ParamsRequest) 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_ParamsRequest) 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_ParamsRequest) 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_ParamsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ParamsRequest) - 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().(*ParamsRequest) - 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().(*ParamsRequest) - 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: ParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ParamsRequest: 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_ParamsResponse protoreflect.MessageDescriptor - fd_ParamsResponse_params protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_ParamsResponse = File_slinky_mm2_v1_query_proto.Messages().ByName("ParamsResponse") - fd_ParamsResponse_params = md_ParamsResponse.Fields().ByName("params") -} - -var _ protoreflect.Message = (*fastReflection_ParamsResponse)(nil) - -type fastReflection_ParamsResponse ParamsResponse - -func (x *ParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_ParamsResponse)(x) -} - -func (x *ParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ParamsResponse_messageType fastReflection_ParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_ParamsResponse_messageType{} - -type fastReflection_ParamsResponse_messageType struct{} - -func (x fastReflection_ParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_ParamsResponse)(nil) -} -func (x fastReflection_ParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_ParamsResponse) -} -func (x fastReflection_ParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_ParamsResponse -} - -// 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_ParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_ParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ParamsResponse) New() protoreflect.Message { - return new(fastReflection_ParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ParamsResponse) Interface() protoreflect.ProtoMessage { - return (*ParamsResponse)(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_ParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_ParamsResponse_params, 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_ParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - return x.Params != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - x.Params = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - x.Params = value.Message().Interface().(*Params) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.ParamsResponse.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.ParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.ParamsResponse 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_ParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.ParamsResponse", 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_ParamsResponse) 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_ParamsResponse) 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_ParamsResponse) 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_ParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ParamsResponse) - 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.Params != nil { - l = options.Size(x.Params) - 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().(*ParamsResponse) - 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.Params != nil { - encoded, err := options.Marshal(x.Params) - 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().(*ParamsResponse) - 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: ParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ParamsResponse: 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 Params", 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.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); 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_LastUpdatedRequest protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_LastUpdatedRequest = File_slinky_mm2_v1_query_proto.Messages().ByName("LastUpdatedRequest") -} - -var _ protoreflect.Message = (*fastReflection_LastUpdatedRequest)(nil) - -type fastReflection_LastUpdatedRequest LastUpdatedRequest - -func (x *LastUpdatedRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_LastUpdatedRequest)(x) -} - -func (x *LastUpdatedRequest) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_LastUpdatedRequest_messageType fastReflection_LastUpdatedRequest_messageType -var _ protoreflect.MessageType = fastReflection_LastUpdatedRequest_messageType{} - -type fastReflection_LastUpdatedRequest_messageType struct{} - -func (x fastReflection_LastUpdatedRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_LastUpdatedRequest)(nil) -} -func (x fastReflection_LastUpdatedRequest_messageType) New() protoreflect.Message { - return new(fastReflection_LastUpdatedRequest) -} -func (x fastReflection_LastUpdatedRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_LastUpdatedRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_LastUpdatedRequest) Descriptor() protoreflect.MessageDescriptor { - return md_LastUpdatedRequest -} - -// 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_LastUpdatedRequest) Type() protoreflect.MessageType { - return _fastReflection_LastUpdatedRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_LastUpdatedRequest) New() protoreflect.Message { - return new(fastReflection_LastUpdatedRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_LastUpdatedRequest) Interface() protoreflect.ProtoMessage { - return (*LastUpdatedRequest)(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_LastUpdatedRequest) 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_LastUpdatedRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) 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.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedRequest")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedRequest 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_LastUpdatedRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.LastUpdatedRequest", 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_LastUpdatedRequest) 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_LastUpdatedRequest) 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_LastUpdatedRequest) 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_LastUpdatedRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*LastUpdatedRequest) - 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().(*LastUpdatedRequest) - 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().(*LastUpdatedRequest) - 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: LastUpdatedRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedRequest: 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_LastUpdatedResponse protoreflect.MessageDescriptor - fd_LastUpdatedResponse_last_updated protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_query_proto_init() - md_LastUpdatedResponse = File_slinky_mm2_v1_query_proto.Messages().ByName("LastUpdatedResponse") - fd_LastUpdatedResponse_last_updated = md_LastUpdatedResponse.Fields().ByName("last_updated") -} - -var _ protoreflect.Message = (*fastReflection_LastUpdatedResponse)(nil) - -type fastReflection_LastUpdatedResponse LastUpdatedResponse - -func (x *LastUpdatedResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_LastUpdatedResponse)(x) -} - -func (x *LastUpdatedResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_LastUpdatedResponse_messageType fastReflection_LastUpdatedResponse_messageType -var _ protoreflect.MessageType = fastReflection_LastUpdatedResponse_messageType{} - -type fastReflection_LastUpdatedResponse_messageType struct{} - -func (x fastReflection_LastUpdatedResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_LastUpdatedResponse)(nil) -} -func (x fastReflection_LastUpdatedResponse_messageType) New() protoreflect.Message { - return new(fastReflection_LastUpdatedResponse) -} -func (x fastReflection_LastUpdatedResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_LastUpdatedResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_LastUpdatedResponse) Descriptor() protoreflect.MessageDescriptor { - return md_LastUpdatedResponse -} - -// 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_LastUpdatedResponse) Type() protoreflect.MessageType { - return _fastReflection_LastUpdatedResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_LastUpdatedResponse) New() protoreflect.Message { - return new(fastReflection_LastUpdatedResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_LastUpdatedResponse) Interface() protoreflect.ProtoMessage { - return (*LastUpdatedResponse)(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_LastUpdatedResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.LastUpdated != uint64(0) { - value := protoreflect.ValueOfUint64(x.LastUpdated) - if !f(fd_LastUpdatedResponse_last_updated, 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_LastUpdatedResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - return x.LastUpdated != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - x.LastUpdated = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - value := x.LastUpdated - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - x.LastUpdated = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - panic(fmt.Errorf("field last_updated of message slinky.mm2.v1.LastUpdatedResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.LastUpdatedResponse.last_updated": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.LastUpdatedResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.LastUpdatedResponse 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_LastUpdatedResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.LastUpdatedResponse", 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_LastUpdatedResponse) 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_LastUpdatedResponse) 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_LastUpdatedResponse) 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_LastUpdatedResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*LastUpdatedResponse) - 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.LastUpdated != 0 { - n += 1 + runtime.Sov(uint64(x.LastUpdated)) - } - 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().(*LastUpdatedResponse) - 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.LastUpdated != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.LastUpdated)) - 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().(*LastUpdatedResponse) - 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: LastUpdatedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: LastUpdatedResponse: 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 LastUpdated", wireType) - } - x.LastUpdated = 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.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 -// protoc (unknown) -// source: slinky/mm2/v1/query.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MarketMapRequest is the query request for the MarketMap query. -// It takes no arguments. -type MarketMapRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MarketMapRequest) Reset() { - *x = MarketMapRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MarketMapRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MarketMapRequest) ProtoMessage() {} - -// Deprecated: Use MarketMapRequest.ProtoReflect.Descriptor instead. -func (*MarketMapRequest) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{0} -} - -// MarketMapResponse is the query response for the MarketMap query. -type MarketMapResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap *MarketMap `protobuf:"bytes,1,opt,name=market_map,json=marketMap,proto3" json:"market_map,omitempty"` - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // ChainId is the chain identifier for the market map. - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (x *MarketMapResponse) Reset() { - *x = MarketMapResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MarketMapResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MarketMapResponse) ProtoMessage() {} - -// Deprecated: Use MarketMapResponse.ProtoReflect.Descriptor instead. -func (*MarketMapResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *MarketMapResponse) GetMarketMap() *MarketMap { - if x != nil { - return x.MarketMap - } - return nil -} - -func (x *MarketMapResponse) GetLastUpdated() uint64 { - if x != nil { - return x.LastUpdated - } - return 0 -} - -func (x *MarketMapResponse) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -// MarketRequest is the query request for the Market query. -// It takes the currency pair of the market as an argument. -type MarketRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // CurrencyPair is the currency pair associated with the market being - // requested. - CurrencyPair *v1.CurrencyPair `protobuf:"bytes,3,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair,omitempty"` -} - -func (x *MarketRequest) Reset() { - *x = MarketRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MarketRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MarketRequest) ProtoMessage() {} - -// Deprecated: Use MarketRequest.ProtoReflect.Descriptor instead. -func (*MarketRequest) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{2} -} - -func (x *MarketRequest) GetCurrencyPair() *v1.CurrencyPair { - if x != nil { - return x.CurrencyPair - } - return nil -} - -// MarketResponse is the query response for the Market query. -type MarketResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Market is the configuration of a single market to be price-fetched for. - Market *Market `protobuf:"bytes,1,opt,name=market,proto3" json:"market,omitempty"` -} - -func (x *MarketResponse) Reset() { - *x = MarketResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MarketResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MarketResponse) ProtoMessage() {} - -// Deprecated: Use MarketResponse.ProtoReflect.Descriptor instead. -func (*MarketResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *MarketResponse) GetMarket() *Market { - if x != nil { - return x.Market - } - return nil -} - -// ParamsRequest is the request type for the Query/Params RPC method. -type ParamsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ParamsRequest) Reset() { - *x = ParamsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParamsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamsRequest) ProtoMessage() {} - -// Deprecated: Use ParamsRequest.ProtoReflect.Descriptor instead. -func (*ParamsRequest) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{4} -} - -// ParamsResponse is the response type for the Query/Params RPC method. -type ParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *ParamsResponse) Reset() { - *x = ParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParamsResponse) ProtoMessage() {} - -// Deprecated: Use ParamsResponse.ProtoReflect.Descriptor instead. -func (*ParamsResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{5} -} - -func (x *ParamsResponse) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// LastUpdatedRequest is the request type for the Query/LastUpdated RPC -// method. -type LastUpdatedRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *LastUpdatedRequest) Reset() { - *x = LastUpdatedRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LastUpdatedRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LastUpdatedRequest) ProtoMessage() {} - -// Deprecated: Use LastUpdatedRequest.ProtoReflect.Descriptor instead. -func (*LastUpdatedRequest) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{6} -} - -// LastUpdatedResponse is the response type for the Query/LastUpdated RPC -// method. -type LastUpdatedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastUpdated uint64 `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` -} - -func (x *LastUpdatedResponse) Reset() { - *x = LastUpdatedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_query_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LastUpdatedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LastUpdatedResponse) ProtoMessage() {} - -// Deprecated: Use LastUpdatedResponse.ProtoReflect.Descriptor instead. -func (*LastUpdatedResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_query_proto_rawDescGZIP(), []int{7} -} - -func (x *LastUpdatedResponse) GetLastUpdated() uint64 { - if x != nil { - return x.LastUpdated - } - return 0 -} - -var File_slinky_mm2_v1_query_proto protoreflect.FileDescriptor - -var file_slinky_mm2_v1_query_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6c, 0x69, - 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, - 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, - 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x12, 0x0a, 0x10, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x90, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5f, - 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x4d, 0x61, 0x70, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x4d, 0x61, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 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, 0x03, 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, 0x45, 0x0a, - 0x0e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x33, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 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, 0x45, 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2e, 0x6d, 0x6d, 0x32, 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, 0xc0, 0x03, 0x0a, - 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x70, 0x0a, 0x09, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x4d, 0x61, 0x70, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, - 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x4d, 0x61, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, - 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x64, 0x0a, 0x06, 0x4d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x12, 0x79, - 0x0a, 0x0b, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x21, 0x2e, - 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, - 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 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, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x64, 0x0a, 0x06, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x73, 0x6c, 0x69, 0x6e, 0x6b, - 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, - 0x9b, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, - 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x32, - 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6d, 0x32, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, - 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, 0x32, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0d, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x19, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_slinky_mm2_v1_query_proto_rawDescOnce sync.Once - file_slinky_mm2_v1_query_proto_rawDescData = file_slinky_mm2_v1_query_proto_rawDesc -) - -func file_slinky_mm2_v1_query_proto_rawDescGZIP() []byte { - file_slinky_mm2_v1_query_proto_rawDescOnce.Do(func() { - file_slinky_mm2_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_v1_query_proto_rawDescData) - }) - return file_slinky_mm2_v1_query_proto_rawDescData -} - -var file_slinky_mm2_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_slinky_mm2_v1_query_proto_goTypes = []interface{}{ - (*MarketMapRequest)(nil), // 0: slinky.mm2.v1.MarketMapRequest - (*MarketMapResponse)(nil), // 1: slinky.mm2.v1.MarketMapResponse - (*MarketRequest)(nil), // 2: slinky.mm2.v1.MarketRequest - (*MarketResponse)(nil), // 3: slinky.mm2.v1.MarketResponse - (*ParamsRequest)(nil), // 4: slinky.mm2.v1.ParamsRequest - (*ParamsResponse)(nil), // 5: slinky.mm2.v1.ParamsResponse - (*LastUpdatedRequest)(nil), // 6: slinky.mm2.v1.LastUpdatedRequest - (*LastUpdatedResponse)(nil), // 7: slinky.mm2.v1.LastUpdatedResponse - (*MarketMap)(nil), // 8: slinky.mm2.v1.MarketMap - (*v1.CurrencyPair)(nil), // 9: slinky.types.v1.CurrencyPair - (*Market)(nil), // 10: slinky.mm2.v1.Market - (*Params)(nil), // 11: slinky.mm2.v1.Params -} -var file_slinky_mm2_v1_query_proto_depIdxs = []int32{ - 8, // 0: slinky.mm2.v1.MarketMapResponse.market_map:type_name -> slinky.mm2.v1.MarketMap - 9, // 1: slinky.mm2.v1.MarketRequest.currency_pair:type_name -> slinky.types.v1.CurrencyPair - 10, // 2: slinky.mm2.v1.MarketResponse.market:type_name -> slinky.mm2.v1.Market - 11, // 3: slinky.mm2.v1.ParamsResponse.params:type_name -> slinky.mm2.v1.Params - 0, // 4: slinky.mm2.v1.Query.MarketMap:input_type -> slinky.mm2.v1.MarketMapRequest - 2, // 5: slinky.mm2.v1.Query.Market:input_type -> slinky.mm2.v1.MarketRequest - 6, // 6: slinky.mm2.v1.Query.LastUpdated:input_type -> slinky.mm2.v1.LastUpdatedRequest - 4, // 7: slinky.mm2.v1.Query.Params:input_type -> slinky.mm2.v1.ParamsRequest - 1, // 8: slinky.mm2.v1.Query.MarketMap:output_type -> slinky.mm2.v1.MarketMapResponse - 3, // 9: slinky.mm2.v1.Query.Market:output_type -> slinky.mm2.v1.MarketResponse - 7, // 10: slinky.mm2.v1.Query.LastUpdated:output_type -> slinky.mm2.v1.LastUpdatedResponse - 5, // 11: slinky.mm2.v1.Query.Params:output_type -> slinky.mm2.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 -} - -func init() { file_slinky_mm2_v1_query_proto_init() } -func file_slinky_mm2_v1_query_proto_init() { - if File_slinky_mm2_v1_query_proto != nil { - return - } - file_slinky_mm2_v1_market_proto_init() - file_slinky_mm2_v1_params_proto_init() - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketMapRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketMapResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParamsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_query_proto_msgTypes[5].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_mm2_v1_query_proto_msgTypes[6].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_mm2_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LastUpdatedResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_v1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_slinky_mm2_v1_query_proto_goTypes, - DependencyIndexes: file_slinky_mm2_v1_query_proto_depIdxs, - MessageInfos: file_slinky_mm2_v1_query_proto_msgTypes, - }.Build() - File_slinky_mm2_v1_query_proto = out.File - file_slinky_mm2_v1_query_proto_rawDesc = nil - file_slinky_mm2_v1_query_proto_goTypes = nil - file_slinky_mm2_v1_query_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/query_grpc.pb.go b/api/slinky/mm2/v1/query_grpc.pb.go deleted file mode 100644 index 38f2d9762..000000000 --- a/api/slinky/mm2/v1/query_grpc.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: slinky/mm2/v1/query.proto - -package mm2v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Query_MarketMap_FullMethodName = "/slinky.mm2.v1.Query/MarketMap" - Query_Market_FullMethodName = "/slinky.mm2.v1.Query/Market" - Query_LastUpdated_FullMethodName = "/slinky.mm2.v1.Query/LastUpdated" - Query_Params_FullMethodName = "/slinky.mm2.v1.Query/Params" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type QueryClient interface { - // MarketMap returns the full market map stored in the x/marketmap - // module. - MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) - // Market returns a market stored in the x/marketmap - // module. - Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) - // LastUpdated returns the last height the market map was updated at. - LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) - // Params returns the current x/marketmap module parameters. - Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) { - out := new(MarketMapResponse) - err := c.cc.Invoke(ctx, Query_MarketMap_FullMethodName, 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, Query_Market_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) { - out := new(LastUpdatedResponse) - err := c.cc.Invoke(ctx, Query_LastUpdated_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { - out := new(ParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) - 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 -type QueryServer interface { - // MarketMap returns the full market map stored in the x/marketmap - // module. - MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) - // Market returns a market stored in the x/marketmap - // module. - Market(context.Context, *MarketRequest) (*MarketResponse, error) - // LastUpdated returns the last height the market map was updated at. - LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) - // Params returns the current x/marketmap module parameters. - Params(context.Context, *ParamsRequest) (*ParamsResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MarketMap not implemented") -} -func (UnimplementedQueryServer) Market(context.Context, *MarketRequest) (*MarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") -} -func (UnimplementedQueryServer) LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LastUpdated not implemented") -} -func (UnimplementedQueryServer) Params(context.Context, *ParamsRequest) (*ParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MarketMapRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MarketMap(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_MarketMap_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MarketMap(ctx, req.(*MarketMapRequest)) - } - 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 { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Market(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Market_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Market(ctx, req.(*MarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LastUpdatedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LastUpdated(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_LastUpdated_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LastUpdated(ctx, req.(*LastUpdatedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*ParamsRequest)) - } - 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) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "slinky.mm2.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MarketMap", - Handler: _Query_MarketMap_Handler, - }, - { - MethodName: "Market", - Handler: _Query_Market_Handler, - }, - { - MethodName: "LastUpdated", - Handler: _Query_LastUpdated_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "slinky/mm2/v1/query.proto", -} diff --git a/api/slinky/mm2/v1/tx.pulsar.go b/api/slinky/mm2/v1/tx.pulsar.go deleted file mode 100644 index 181ba38bc..000000000 --- a/api/slinky/mm2/v1/tx.pulsar.go +++ /dev/null @@ -1,4188 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package mm2v1 - -import ( - _ "cosmossdk.io/api/amino" - _ "cosmossdk.io/api/cosmos/msg/v1" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_MsgCreateMarkets_2_list)(nil) - -type _MsgCreateMarkets_2_list struct { - list *[]*Market -} - -func (x *_MsgCreateMarkets_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgCreateMarkets_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgCreateMarkets_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Market) - (*x.list)[i] = concreteValue -} - -func (x *_MsgCreateMarkets_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Market) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgCreateMarkets_2_list) AppendMutable() protoreflect.Value { - v := new(Market) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgCreateMarkets_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgCreateMarkets_2_list) NewElement() protoreflect.Value { - v := new(Market) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgCreateMarkets_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgCreateMarkets protoreflect.MessageDescriptor - fd_MsgCreateMarkets_authority protoreflect.FieldDescriptor - fd_MsgCreateMarkets_create_markets protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgCreateMarkets = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgCreateMarkets") - fd_MsgCreateMarkets_authority = md_MsgCreateMarkets.Fields().ByName("authority") - fd_MsgCreateMarkets_create_markets = md_MsgCreateMarkets.Fields().ByName("create_markets") -} - -var _ protoreflect.Message = (*fastReflection_MsgCreateMarkets)(nil) - -type fastReflection_MsgCreateMarkets MsgCreateMarkets - -func (x *MsgCreateMarkets) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgCreateMarkets)(x) -} - -func (x *MsgCreateMarkets) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgCreateMarkets_messageType fastReflection_MsgCreateMarkets_messageType -var _ protoreflect.MessageType = fastReflection_MsgCreateMarkets_messageType{} - -type fastReflection_MsgCreateMarkets_messageType struct{} - -func (x fastReflection_MsgCreateMarkets_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgCreateMarkets)(nil) -} -func (x fastReflection_MsgCreateMarkets_messageType) New() protoreflect.Message { - return new(fastReflection_MsgCreateMarkets) -} -func (x fastReflection_MsgCreateMarkets_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgCreateMarkets -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgCreateMarkets) Descriptor() protoreflect.MessageDescriptor { - return md_MsgCreateMarkets -} - -// 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_MsgCreateMarkets) Type() protoreflect.MessageType { - return _fastReflection_MsgCreateMarkets_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgCreateMarkets) New() protoreflect.Message { - return new(fastReflection_MsgCreateMarkets) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgCreateMarkets) Interface() protoreflect.ProtoMessage { - return (*MsgCreateMarkets)(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_MsgCreateMarkets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgCreateMarkets_authority, value) { - return - } - } - if len(x.CreateMarkets) != 0 { - value := protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{list: &x.CreateMarkets}) - if !f(fd_MsgCreateMarkets_create_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_MsgCreateMarkets) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.authority": - return x.Authority != "" - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - return len(x.CreateMarkets) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.authority": - x.Authority = "" - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - x.CreateMarkets = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - if len(x.CreateMarkets) == 0 { - return protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{}) - } - listValue := &_MsgCreateMarkets_2_list{list: &x.CreateMarkets} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.authority": - x.Authority = value.Interface().(string) - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - lv := value.List() - clv := lv.(*_MsgCreateMarkets_2_list) - x.CreateMarkets = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - if x.CreateMarkets == nil { - x.CreateMarkets = []*Market{} - } - value := &_MsgCreateMarkets_2_list{list: &x.CreateMarkets} - return protoreflect.ValueOfList(value) - case "slinky.mm2.v1.MsgCreateMarkets.authority": - panic(fmt.Errorf("field authority of message slinky.mm2.v1.MsgCreateMarkets is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgCreateMarkets.authority": - return protoreflect.ValueOfString("") - case "slinky.mm2.v1.MsgCreateMarkets.create_markets": - list := []*Market{} - return protoreflect.ValueOfList(&_MsgCreateMarkets_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarkets 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_MsgCreateMarkets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgCreateMarkets", 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_MsgCreateMarkets) 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_MsgCreateMarkets) 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_MsgCreateMarkets) 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_MsgCreateMarkets) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgCreateMarkets) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.CreateMarkets) > 0 { - for _, e := range x.CreateMarkets { - 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().(*MsgCreateMarkets) - 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.CreateMarkets) > 0 { - for iNdEx := len(x.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.CreateMarkets[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] = 0x12 - } - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - 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().(*MsgCreateMarkets) - 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: MsgCreateMarkets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateMarkets: 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 Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", 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.CreateMarkets = append(x.CreateMarkets, &Market{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CreateMarkets[len(x.CreateMarkets)-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_MsgCreateMarketsResponse protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgCreateMarketsResponse = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgCreateMarketsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgCreateMarketsResponse)(nil) - -type fastReflection_MsgCreateMarketsResponse MsgCreateMarketsResponse - -func (x *MsgCreateMarketsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgCreateMarketsResponse)(x) -} - -func (x *MsgCreateMarketsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgCreateMarketsResponse_messageType fastReflection_MsgCreateMarketsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgCreateMarketsResponse_messageType{} - -type fastReflection_MsgCreateMarketsResponse_messageType struct{} - -func (x fastReflection_MsgCreateMarketsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgCreateMarketsResponse)(nil) -} -func (x fastReflection_MsgCreateMarketsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgCreateMarketsResponse) -} -func (x fastReflection_MsgCreateMarketsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgCreateMarketsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgCreateMarketsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgCreateMarketsResponse -} - -// 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_MsgCreateMarketsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgCreateMarketsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgCreateMarketsResponse) New() protoreflect.Message { - return new(fastReflection_MsgCreateMarketsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgCreateMarketsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgCreateMarketsResponse)(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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) 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.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgCreateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgCreateMarketsResponse 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_MsgCreateMarketsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgCreateMarketsResponse", 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) 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_MsgCreateMarketsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgCreateMarketsResponse) - 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().(*MsgCreateMarketsResponse) - 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().(*MsgCreateMarketsResponse) - 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: MsgCreateMarketsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateMarketsResponse: 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 = (*_MsgUpdateMarkets_2_list)(nil) - -type _MsgUpdateMarkets_2_list struct { - list *[]*Market -} - -func (x *_MsgUpdateMarkets_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgUpdateMarkets_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgUpdateMarkets_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Market) - (*x.list)[i] = concreteValue -} - -func (x *_MsgUpdateMarkets_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Market) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgUpdateMarkets_2_list) AppendMutable() protoreflect.Value { - v := new(Market) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgUpdateMarkets_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgUpdateMarkets_2_list) NewElement() protoreflect.Value { - v := new(Market) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgUpdateMarkets_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgUpdateMarkets protoreflect.MessageDescriptor - fd_MsgUpdateMarkets_authority protoreflect.FieldDescriptor - fd_MsgUpdateMarkets_update_markets protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgUpdateMarkets = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgUpdateMarkets") - fd_MsgUpdateMarkets_authority = md_MsgUpdateMarkets.Fields().ByName("authority") - fd_MsgUpdateMarkets_update_markets = md_MsgUpdateMarkets.Fields().ByName("update_markets") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateMarkets)(nil) - -type fastReflection_MsgUpdateMarkets MsgUpdateMarkets - -func (x *MsgUpdateMarkets) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateMarkets)(x) -} - -func (x *MsgUpdateMarkets) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_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_MsgUpdateMarkets_messageType fastReflection_MsgUpdateMarkets_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateMarkets_messageType{} - -type fastReflection_MsgUpdateMarkets_messageType struct{} - -func (x fastReflection_MsgUpdateMarkets_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateMarkets)(nil) -} -func (x fastReflection_MsgUpdateMarkets_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarkets) -} -func (x fastReflection_MsgUpdateMarkets_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarkets -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateMarkets) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarkets -} - -// 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_MsgUpdateMarkets) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateMarkets_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateMarkets) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarkets) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateMarkets) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateMarkets)(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_MsgUpdateMarkets) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgUpdateMarkets_authority, value) { - return - } - } - if len(x.UpdateMarkets) != 0 { - value := protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets}) - if !f(fd_MsgUpdateMarkets_update_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_MsgUpdateMarkets) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - return x.Authority != "" - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - return len(x.UpdateMarkets) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - x.Authority = "" - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - x.UpdateMarkets = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - if len(x.UpdateMarkets) == 0 { - return protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{}) - } - listValue := &_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - x.Authority = value.Interface().(string) - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - lv := value.List() - clv := lv.(*_MsgUpdateMarkets_2_list) - x.UpdateMarkets = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - if x.UpdateMarkets == nil { - x.UpdateMarkets = []*Market{} - } - value := &_MsgUpdateMarkets_2_list{list: &x.UpdateMarkets} - return protoreflect.ValueOfList(value) - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - panic(fmt.Errorf("field authority of message slinky.mm2.v1.MsgUpdateMarkets is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgUpdateMarkets.authority": - return protoreflect.ValueOfString("") - case "slinky.mm2.v1.MsgUpdateMarkets.update_markets": - list := []*Market{} - return protoreflect.ValueOfList(&_MsgUpdateMarkets_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarkets")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarkets 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_MsgUpdateMarkets) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgUpdateMarkets", 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) 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_MsgUpdateMarkets) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateMarkets) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.UpdateMarkets) > 0 { - for _, e := range x.UpdateMarkets { - 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().(*MsgUpdateMarkets) - 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.UpdateMarkets) > 0 { - for iNdEx := len(x.UpdateMarkets) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.UpdateMarkets[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] = 0x12 - } - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - 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().(*MsgUpdateMarkets) - 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: MsgUpdateMarkets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarkets: 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 Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateMarkets", 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.UpdateMarkets = append(x.UpdateMarkets, &Market{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UpdateMarkets[len(x.UpdateMarkets)-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_MsgUpdateMarketsResponse protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgUpdateMarketsResponse = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgUpdateMarketsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateMarketsResponse)(nil) - -type fastReflection_MsgUpdateMarketsResponse MsgUpdateMarketsResponse - -func (x *MsgUpdateMarketsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketsResponse)(x) -} - -func (x *MsgUpdateMarketsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_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_MsgUpdateMarketsResponse_messageType fastReflection_MsgUpdateMarketsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateMarketsResponse_messageType{} - -type fastReflection_MsgUpdateMarketsResponse_messageType struct{} - -func (x fastReflection_MsgUpdateMarketsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateMarketsResponse)(nil) -} -func (x fastReflection_MsgUpdateMarketsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketsResponse) -} -func (x fastReflection_MsgUpdateMarketsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateMarketsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateMarketsResponse -} - -// 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_MsgUpdateMarketsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateMarketsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateMarketsResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateMarketsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateMarketsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateMarketsResponse)(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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) 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.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgUpdateMarketsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgUpdateMarketsResponse 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_MsgUpdateMarketsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgUpdateMarketsResponse", 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) 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_MsgUpdateMarketsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateMarketsResponse) - 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().(*MsgUpdateMarketsResponse) - 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().(*MsgUpdateMarketsResponse) - 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: MsgUpdateMarketsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateMarketsResponse: 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_MsgParams protoreflect.MessageDescriptor - fd_MsgParams_params protoreflect.FieldDescriptor - fd_MsgParams_authority protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgParams = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgParams") - fd_MsgParams_params = md_MsgParams.Fields().ByName("params") - fd_MsgParams_authority = md_MsgParams.Fields().ByName("authority") -} - -var _ protoreflect.Message = (*fastReflection_MsgParams)(nil) - -type fastReflection_MsgParams MsgParams - -func (x *MsgParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParams)(x) -} - -func (x *MsgParams) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgParams_messageType fastReflection_MsgParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgParams_messageType{} - -type fastReflection_MsgParams_messageType struct{} - -func (x fastReflection_MsgParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParams)(nil) -} -func (x fastReflection_MsgParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParams) -} -func (x fastReflection_MsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams -} - -// 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_MsgParams) Type() protoreflect.MessageType { - return _fastReflection_MsgParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParams) New() protoreflect.Message { - return new(fastReflection_MsgParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { - return (*MsgParams)(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_MsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Params != nil { - value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - if !f(fd_MsgParams_params, value) { - return - } - } - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgParams_authority, 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_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MsgParams.params": - return x.Params != nil - case "slinky.mm2.v1.MsgParams.authority": - return x.Authority != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgParams.params": - x.Params = nil - case "slinky.mm2.v1.MsgParams.authority": - x.Authority = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MsgParams.params": - value := x.Params - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "slinky.mm2.v1.MsgParams.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgParams.params": - x.Params = value.Message().Interface().(*Params) - case "slinky.mm2.v1.MsgParams.authority": - x.Authority = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgParams.params": - if x.Params == nil { - x.Params = new(Params) - } - return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "slinky.mm2.v1.MsgParams.authority": - panic(fmt.Errorf("field authority of message slinky.mm2.v1.MsgParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgParams.params": - m := new(Params) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "slinky.mm2.v1.MsgParams.authority": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParams")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParams 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_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgParams", 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_MsgParams) 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_MsgParams) 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_MsgParams) 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_MsgParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParams) - 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.Params != nil { - l = options.Size(x.Params) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgParams) - 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.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0x12 - } - if x.Params != nil { - encoded, err := options.Marshal(x.Params) - 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().(*MsgParams) - 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: MsgParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: 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 Params", 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.Params == nil { - x.Params = &Params{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgParamsResponse protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgParamsResponse = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgParamsResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgParamsResponse)(nil) - -type fastReflection_MsgParamsResponse MsgParamsResponse - -func (x *MsgParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(x) -} - -func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgParamsResponse_messageType fastReflection_MsgParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgParamsResponse_messageType{} - -type fastReflection_MsgParamsResponse_messageType struct{} - -func (x fastReflection_MsgParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(nil) -} -func (x fastReflection_MsgParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) -} -func (x fastReflection_MsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse -} - -// 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_MsgParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgParamsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgParamsResponse)(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_MsgParamsResponse) 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_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) 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.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgParamsResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgParamsResponse 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_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgParamsResponse", 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_MsgParamsResponse) 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_MsgParamsResponse) 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_MsgParamsResponse) 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_MsgParamsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParamsResponse) - 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().(*MsgParamsResponse) - 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().(*MsgParamsResponse) - 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: MsgParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: 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 = (*_MsgRemoveMarketAuthorities_1_list)(nil) - -type _MsgRemoveMarketAuthorities_1_list struct { - list *[]string -} - -func (x *_MsgRemoveMarketAuthorities_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgRemoveMarketAuthorities_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_MsgRemoveMarketAuthorities_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgRemoveMarketAuthorities_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgRemoveMarketAuthorities_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgRemoveMarketAuthorities at list field RemoveAddresses as it is not of Message kind")) -} - -func (x *_MsgRemoveMarketAuthorities_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgRemoveMarketAuthorities_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_MsgRemoveMarketAuthorities_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgRemoveMarketAuthorities protoreflect.MessageDescriptor - fd_MsgRemoveMarketAuthorities_remove_addresses protoreflect.FieldDescriptor - fd_MsgRemoveMarketAuthorities_admin protoreflect.FieldDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgRemoveMarketAuthorities = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgRemoveMarketAuthorities") - fd_MsgRemoveMarketAuthorities_remove_addresses = md_MsgRemoveMarketAuthorities.Fields().ByName("remove_addresses") - fd_MsgRemoveMarketAuthorities_admin = md_MsgRemoveMarketAuthorities.Fields().ByName("admin") -} - -var _ protoreflect.Message = (*fastReflection_MsgRemoveMarketAuthorities)(nil) - -type fastReflection_MsgRemoveMarketAuthorities MsgRemoveMarketAuthorities - -func (x *MsgRemoveMarketAuthorities) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRemoveMarketAuthorities)(x) -} - -func (x *MsgRemoveMarketAuthorities) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRemoveMarketAuthorities_messageType fastReflection_MsgRemoveMarketAuthorities_messageType -var _ protoreflect.MessageType = fastReflection_MsgRemoveMarketAuthorities_messageType{} - -type fastReflection_MsgRemoveMarketAuthorities_messageType struct{} - -func (x fastReflection_MsgRemoveMarketAuthorities_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRemoveMarketAuthorities)(nil) -} -func (x fastReflection_MsgRemoveMarketAuthorities_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRemoveMarketAuthorities) -} -func (x fastReflection_MsgRemoveMarketAuthorities_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveMarketAuthorities -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRemoveMarketAuthorities) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveMarketAuthorities -} - -// 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_MsgRemoveMarketAuthorities) Type() protoreflect.MessageType { - return _fastReflection_MsgRemoveMarketAuthorities_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRemoveMarketAuthorities) New() protoreflect.Message { - return new(fastReflection_MsgRemoveMarketAuthorities) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRemoveMarketAuthorities) Interface() protoreflect.ProtoMessage { - return (*MsgRemoveMarketAuthorities)(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_MsgRemoveMarketAuthorities) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.RemoveAddresses) != 0 { - value := protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses}) - if !f(fd_MsgRemoveMarketAuthorities_remove_addresses, value) { - return - } - } - if x.Admin != "" { - value := protoreflect.ValueOfString(x.Admin) - if !f(fd_MsgRemoveMarketAuthorities_admin, 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_MsgRemoveMarketAuthorities) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - return len(x.RemoveAddresses) != 0 - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - return x.Admin != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - x.RemoveAddresses = nil - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - x.Admin = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - if len(x.RemoveAddresses) == 0 { - return protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{}) - } - listValue := &_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses} - return protoreflect.ValueOfList(listValue) - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - value := x.Admin - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - lv := value.List() - clv := lv.(*_MsgRemoveMarketAuthorities_1_list) - x.RemoveAddresses = *clv.list - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - x.Admin = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - if x.RemoveAddresses == nil { - x.RemoveAddresses = []string{} - } - value := &_MsgRemoveMarketAuthorities_1_list{list: &x.RemoveAddresses} - return protoreflect.ValueOfList(value) - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - panic(fmt.Errorf("field admin of message slinky.mm2.v1.MsgRemoveMarketAuthorities is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.remove_addresses": - list := []string{} - return protoreflect.ValueOfList(&_MsgRemoveMarketAuthorities_1_list{list: &list}) - case "slinky.mm2.v1.MsgRemoveMarketAuthorities.admin": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthorities")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthorities 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_MsgRemoveMarketAuthorities) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgRemoveMarketAuthorities", 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_MsgRemoveMarketAuthorities) 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_MsgRemoveMarketAuthorities) 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_MsgRemoveMarketAuthorities) 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_MsgRemoveMarketAuthorities) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRemoveMarketAuthorities) - 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.RemoveAddresses) > 0 { - for _, s := range x.RemoveAddresses { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Admin) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgRemoveMarketAuthorities) - 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.Admin) > 0 { - i -= len(x.Admin) - copy(dAtA[i:], x.Admin) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Admin))) - i-- - dAtA[i] = 0x12 - } - if len(x.RemoveAddresses) > 0 { - for iNdEx := len(x.RemoveAddresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.RemoveAddresses[iNdEx]) - copy(dAtA[i:], x.RemoveAddresses[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RemoveAddresses[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgRemoveMarketAuthorities) - 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: MsgRemoveMarketAuthorities: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthorities: 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 RemoveAddresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.RemoveAddresses = append(x.RemoveAddresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgRemoveMarketAuthoritiesResponse protoreflect.MessageDescriptor -) - -func init() { - file_slinky_mm2_v1_tx_proto_init() - md_MsgRemoveMarketAuthoritiesResponse = File_slinky_mm2_v1_tx_proto.Messages().ByName("MsgRemoveMarketAuthoritiesResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(nil) - -type fastReflection_MsgRemoveMarketAuthoritiesResponse MsgRemoveMarketAuthoritiesResponse - -func (x *MsgRemoveMarketAuthoritiesResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(x) -} - -func (x *MsgRemoveMarketAuthoritiesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType{} - -type fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType struct{} - -func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgRemoveMarketAuthoritiesResponse)(nil) -} -func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgRemoveMarketAuthoritiesResponse) -} -func (x fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveMarketAuthoritiesResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgRemoveMarketAuthoritiesResponse -} - -// 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_MsgRemoveMarketAuthoritiesResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgRemoveMarketAuthoritiesResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) New() protoreflect.Message { - return new(fastReflection_MsgRemoveMarketAuthoritiesResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgRemoveMarketAuthoritiesResponse) Interface() protoreflect.ProtoMessage { - return (*MsgRemoveMarketAuthoritiesResponse)(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_MsgRemoveMarketAuthoritiesResponse) 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_MsgRemoveMarketAuthoritiesResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) 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.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse")) - } - panic(fmt.Errorf("message slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse 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_MsgRemoveMarketAuthoritiesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse", 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_MsgRemoveMarketAuthoritiesResponse) 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_MsgRemoveMarketAuthoritiesResponse) 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_MsgRemoveMarketAuthoritiesResponse) 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_MsgRemoveMarketAuthoritiesResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgRemoveMarketAuthoritiesResponse) - 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().(*MsgRemoveMarketAuthoritiesResponse) - 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().(*MsgRemoveMarketAuthoritiesResponse) - 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: MsgRemoveMarketAuthoritiesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: 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, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: slinky/mm2/v1/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgCreateMarkets defines a message carrying a payload for creating markets in -// the x/marketmap module. -type MsgCreateMarkets struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // CreateMarkets is the list of all markets to be created for the given - // transaction. - CreateMarkets []*Market `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets,omitempty"` -} - -func (x *MsgCreateMarkets) Reset() { - *x = MsgCreateMarkets{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateMarkets) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreateMarkets) ProtoMessage() {} - -// Deprecated: Use MsgCreateMarkets.ProtoReflect.Descriptor instead. -func (*MsgCreateMarkets) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgCreateMarkets) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgCreateMarkets) GetCreateMarkets() []*Market { - if x != nil { - return x.CreateMarkets - } - return nil -} - -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -type MsgCreateMarketsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgCreateMarketsResponse) Reset() { - *x = MsgCreateMarketsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreateMarketsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreateMarketsResponse) ProtoMessage() {} - -// Deprecated: Use MsgCreateMarketsResponse.ProtoReflect.Descriptor instead. -func (*MsgCreateMarketsResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{1} -} - -// MsgUpdateMarkets defines a message carrying a payload for updating the -// x/marketmap module. -type MsgUpdateMarkets struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // UpdateMarkets is the list of all markets to be updated for the given - // transaction. - UpdateMarkets []*Market `protobuf:"bytes,2,rep,name=update_markets,json=updateMarkets,proto3" json:"update_markets,omitempty"` -} - -func (x *MsgUpdateMarkets) Reset() { - *x = MsgUpdateMarkets{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateMarkets) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateMarkets) ProtoMessage() {} - -// Deprecated: Use MsgUpdateMarkets.ProtoReflect.Descriptor instead. -func (*MsgUpdateMarkets) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{2} -} - -func (x *MsgUpdateMarkets) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgUpdateMarkets) GetUpdateMarkets() []*Market { - if x != nil { - return x.UpdateMarkets - } - return nil -} - -// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. -type MsgUpdateMarketsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateMarketsResponse) Reset() { - *x = MsgUpdateMarketsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateMarketsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateMarketsResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateMarketsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateMarketsResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{3} -} - -// MsgParams defines the Msg/Params request type. It contains the -// new parameters for the x/marketmap module. -type MsgParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Params defines the new parameters for the x/marketmap module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - // Authority defines the authority that is updating the x/marketmap module - // parameters. - Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (x *MsgParams) Reset() { - *x = MsgParams{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgParams) ProtoMessage() {} - -// Deprecated: Use MsgParams.ProtoReflect.Descriptor instead. -func (*MsgParams) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgParams) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -func (x *MsgParams) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -// MsgParamsResponse defines the Msg/Params response type. -type MsgParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgParamsResponse) Reset() { - *x = MsgParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgParamsResponse) ProtoMessage() {} - -// Deprecated: Use MsgParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{5} -} - -// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse -// request type. It contains the new addresses to remove from the list of -// authorities -type MsgRemoveMarketAuthorities struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // RemoveAddresses is the list of addresses to remove. - RemoveAddresses []string `protobuf:"bytes,1,rep,name=remove_addresses,json=removeAddresses,proto3" json:"remove_addresses,omitempty"` - // Admin defines the authority that is the x/marketmap - // Admin account. This account is set in the module parameters. - Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` -} - -func (x *MsgRemoveMarketAuthorities) Reset() { - *x = MsgRemoveMarketAuthorities{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRemoveMarketAuthorities) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRemoveMarketAuthorities) ProtoMessage() {} - -// Deprecated: Use MsgRemoveMarketAuthorities.ProtoReflect.Descriptor instead. -func (*MsgRemoveMarketAuthorities) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{6} -} - -func (x *MsgRemoveMarketAuthorities) GetRemoveAddresses() []string { - if x != nil { - return x.RemoveAddresses - } - return nil -} - -func (x *MsgRemoveMarketAuthorities) GetAdmin() string { - if x != nil { - return x.Admin - } - return "" -} - -// MsgRemoveMarketAuthoritiesResponse defines the -// Msg/RemoveMarketAuthoritiesResponse response type. -type MsgRemoveMarketAuthoritiesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgRemoveMarketAuthoritiesResponse) Reset() { - *x = MsgRemoveMarketAuthoritiesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_slinky_mm2_v1_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRemoveMarketAuthoritiesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgRemoveMarketAuthoritiesResponse) ProtoMessage() {} - -// Deprecated: Use MsgRemoveMarketAuthoritiesResponse.ProtoReflect.Descriptor instead. -func (*MsgRemoveMarketAuthoritiesResponse) Descriptor() ([]byte, []int) { - return file_slinky_mm2_v1_tx_proto_rawDescGZIP(), []int{7} -} - -var File_slinky_mm2_v1_tx_proto protoreflect.FileDescriptor - -var file_slinky_mm2_v1_tx_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1a, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x6d, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xca, 0x01, 0x0a, - 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, - 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0xe8, - 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x78, 0x2f, 0x6d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6c, 0x69, - 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x3a, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2f, 0x78, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x6d, 0x61, - 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x88, - 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x33, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, - 0x01, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x29, 0x0a, - 0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x24, 0x0a, 0x22, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x81, 0x03, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 0x12, 0x59, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x73, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, - 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x1f, - 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, 0x1a, - 0x27, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x20, 0x2e, 0x73, - 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, - 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x6e, - 0x6b, 0x79, 0x2e, 0x6d, 0x6d, 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x1a, 0x31, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, - 0x32, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x98, - 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x6d, 0x6d, - 0x32, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x24, 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, 0x6d, 0x32, 0x2f, 0x76, 0x31, 0x3b, - 0x6d, 0x6d, 0x32, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x4d, 0x58, 0xaa, 0x02, 0x0d, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x2e, 0x4d, 0x6d, 0x32, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x53, 0x6c, - 0x69, 0x6e, 0x6b, 0x79, 0x5c, 0x4d, 0x6d, 0x32, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, 0x6c, 0x69, 0x6e, 0x6b, 0x79, - 0x3a, 0x3a, 0x4d, 0x6d, 0x32, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_slinky_mm2_v1_tx_proto_rawDescOnce sync.Once - file_slinky_mm2_v1_tx_proto_rawDescData = file_slinky_mm2_v1_tx_proto_rawDesc -) - -func file_slinky_mm2_v1_tx_proto_rawDescGZIP() []byte { - file_slinky_mm2_v1_tx_proto_rawDescOnce.Do(func() { - file_slinky_mm2_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_slinky_mm2_v1_tx_proto_rawDescData) - }) - return file_slinky_mm2_v1_tx_proto_rawDescData -} - -var file_slinky_mm2_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_slinky_mm2_v1_tx_proto_goTypes = []interface{}{ - (*MsgCreateMarkets)(nil), // 0: slinky.mm2.v1.MsgCreateMarkets - (*MsgCreateMarketsResponse)(nil), // 1: slinky.mm2.v1.MsgCreateMarketsResponse - (*MsgUpdateMarkets)(nil), // 2: slinky.mm2.v1.MsgUpdateMarkets - (*MsgUpdateMarketsResponse)(nil), // 3: slinky.mm2.v1.MsgUpdateMarketsResponse - (*MsgParams)(nil), // 4: slinky.mm2.v1.MsgParams - (*MsgParamsResponse)(nil), // 5: slinky.mm2.v1.MsgParamsResponse - (*MsgRemoveMarketAuthorities)(nil), // 6: slinky.mm2.v1.MsgRemoveMarketAuthorities - (*MsgRemoveMarketAuthoritiesResponse)(nil), // 7: slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse - (*Market)(nil), // 8: slinky.mm2.v1.Market - (*Params)(nil), // 9: slinky.mm2.v1.Params -} -var file_slinky_mm2_v1_tx_proto_depIdxs = []int32{ - 8, // 0: slinky.mm2.v1.MsgCreateMarkets.create_markets:type_name -> slinky.mm2.v1.Market - 8, // 1: slinky.mm2.v1.MsgUpdateMarkets.update_markets:type_name -> slinky.mm2.v1.Market - 9, // 2: slinky.mm2.v1.MsgParams.params:type_name -> slinky.mm2.v1.Params - 0, // 3: slinky.mm2.v1.Msg.CreateMarkets:input_type -> slinky.mm2.v1.MsgCreateMarkets - 2, // 4: slinky.mm2.v1.Msg.UpdateMarkets:input_type -> slinky.mm2.v1.MsgUpdateMarkets - 4, // 5: slinky.mm2.v1.Msg.Params:input_type -> slinky.mm2.v1.MsgParams - 6, // 6: slinky.mm2.v1.Msg.RemoveMarketAuthorities:input_type -> slinky.mm2.v1.MsgRemoveMarketAuthorities - 1, // 7: slinky.mm2.v1.Msg.CreateMarkets:output_type -> slinky.mm2.v1.MsgCreateMarketsResponse - 3, // 8: slinky.mm2.v1.Msg.UpdateMarkets:output_type -> slinky.mm2.v1.MsgUpdateMarketsResponse - 5, // 9: slinky.mm2.v1.Msg.Params:output_type -> slinky.mm2.v1.MsgParamsResponse - 7, // 10: slinky.mm2.v1.Msg.RemoveMarketAuthorities:output_type -> slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse - 7, // [7:11] is the sub-list for method output_type - 3, // [3:7] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_slinky_mm2_v1_tx_proto_init() } -func file_slinky_mm2_v1_tx_proto_init() { - if File_slinky_mm2_v1_tx_proto != nil { - return - } - file_slinky_mm2_v1_market_proto_init() - file_slinky_mm2_v1_params_proto_init() - if !protoimpl.UnsafeEnabled { - file_slinky_mm2_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgCreateMarkets); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgCreateMarketsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateMarkets); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateMarketsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgParamsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRemoveMarketAuthorities); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_slinky_mm2_v1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRemoveMarketAuthoritiesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_slinky_mm2_v1_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_slinky_mm2_v1_tx_proto_goTypes, - DependencyIndexes: file_slinky_mm2_v1_tx_proto_depIdxs, - MessageInfos: file_slinky_mm2_v1_tx_proto_msgTypes, - }.Build() - File_slinky_mm2_v1_tx_proto = out.File - file_slinky_mm2_v1_tx_proto_rawDesc = nil - file_slinky_mm2_v1_tx_proto_goTypes = nil - file_slinky_mm2_v1_tx_proto_depIdxs = nil -} diff --git a/api/slinky/mm2/v1/tx_grpc.pb.go b/api/slinky/mm2/v1/tx_grpc.pb.go deleted file mode 100644 index b272f7be8..000000000 --- a/api/slinky/mm2/v1/tx_grpc.pb.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: slinky/mm2/v1/tx.proto - -package mm2v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Msg_CreateMarkets_FullMethodName = "/slinky.mm2.v1.Msg/CreateMarkets" - Msg_UpdateMarkets_FullMethodName = "/slinky.mm2.v1.Msg/UpdateMarkets" - Msg_Params_FullMethodName = "/slinky.mm2.v1.Msg/Params" - Msg_RemoveMarketAuthorities_FullMethodName = "/slinky.mm2.v1.Msg/RemoveMarketAuthorities" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type MsgClient interface { - // CreateMarkets creates markets from the given message. - CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) - // UpdateMarkets updates markets from the given message. - UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) - // Params defines a method for updating the x/marketmap module parameters. - Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) - // RemoveMarketAuthorities defines a method for removing market authorities - // from the x/marketmap module. the signer must be the admin. - RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) { - out := new(MsgCreateMarketsResponse) - err := c.cc.Invoke(ctx, Msg_CreateMarkets_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) { - out := new(MsgUpdateMarketsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateMarkets_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) { - out := new(MsgParamsResponse) - err := c.cc.Invoke(ctx, Msg_Params_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) { - out := new(MsgRemoveMarketAuthoritiesResponse) - err := c.cc.Invoke(ctx, Msg_RemoveMarketAuthorities_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -type MsgServer interface { - // CreateMarkets creates markets from the given message. - CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) - // UpdateMarkets updates markets from the given message. - UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) - // Params defines a method for updating the x/marketmap module parameters. - Params(context.Context, *MsgParams) (*MsgParamsResponse, error) - // RemoveMarketAuthorities defines a method for removing market authorities - // from the x/marketmap module. the signer must be the admin. - RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateMarkets not implemented") -} -func (UnimplementedMsgServer) UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMarkets not implemented") -} -func (UnimplementedMsgServer) Params(context.Context, *MsgParams) (*MsgParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (UnimplementedMsgServer) RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveMarketAuthorities not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_CreateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateMarkets) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_CreateMarkets_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateMarkets(ctx, req.(*MsgCreateMarkets)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateMarkets) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateMarkets_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateMarkets(ctx, req.(*MsgUpdateMarkets)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_Params_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Params(ctx, req.(*MsgParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RemoveMarketAuthorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveMarketAuthorities) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RemoveMarketAuthorities(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_RemoveMarketAuthorities_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveMarketAuthorities(ctx, req.(*MsgRemoveMarketAuthorities)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "slinky.mm2.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateMarkets", - Handler: _Msg_CreateMarkets_Handler, - }, - { - MethodName: "UpdateMarkets", - Handler: _Msg_UpdateMarkets_Handler, - }, - { - MethodName: "Params", - Handler: _Msg_Params_Handler, - }, - { - MethodName: "RemoveMarketAuthorities", - Handler: _Msg_RemoveMarketAuthorities_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "slinky/mm2/v1/tx.proto", -} diff --git a/cmd/slinky-config/main.go b/cmd/slinky-config/main.go index 49e8e50df..58e106cdc 100644 --- a/cmd/slinky-config/main.go +++ b/cmd/slinky-config/main.go @@ -34,7 +34,7 @@ import ( "github.com/skip-mev/slinky/providers/websockets/mexc" "github.com/skip-mev/slinky/providers/websockets/okx" mmclienttypes "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) const ( diff --git a/cmd/slinky/main.go b/cmd/slinky/main.go index 8f70d1a07..848cb6944 100644 --- a/cmd/slinky/main.go +++ b/cmd/slinky/main.go @@ -21,7 +21,7 @@ import ( oraclefactory "github.com/skip-mev/slinky/providers/factories/oracle" oracleserver "github.com/skip-mev/slinky/service/servers/oracle" promserver "github.com/skip-mev/slinky/service/servers/prometheus" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var ( diff --git a/oracle/mocks/mock_oracle.go b/oracle/mocks/mock_oracle.go index db3dc3a86..2e5b3f90a 100644 --- a/oracle/mocks/mock_oracle.go +++ b/oracle/mocks/mock_oracle.go @@ -20,6 +20,10 @@ type Oracle struct { func (_m *Oracle) GetLastSyncTime() time.Time { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetLastSyncTime") + } + var r0 time.Time if rf, ok := ret.Get(0).(func() time.Time); ok { r0 = rf() @@ -34,6 +38,10 @@ func (_m *Oracle) GetLastSyncTime() time.Time { func (_m *Oracle) GetPrices() map[string]*big.Float { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetPrices") + } + var r0 map[string]*big.Float if rf, ok := ret.Get(0).(func() map[string]*big.Float); ok { r0 = rf() @@ -50,6 +58,10 @@ func (_m *Oracle) GetPrices() map[string]*big.Float { func (_m *Oracle) IsRunning() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IsRunning") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -64,6 +76,10 @@ func (_m *Oracle) IsRunning() bool { func (_m *Oracle) Start(ctx context.Context) error { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Start") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(ctx) diff --git a/oracle/orchestrator/helpers_test.go b/oracle/orchestrator/helpers_test.go index baa930eba..9ba708c79 100644 --- a/oracle/orchestrator/helpers_test.go +++ b/oracle/orchestrator/helpers_test.go @@ -23,7 +23,7 @@ import ( providertypes "github.com/skip-mev/slinky/providers/types" "github.com/skip-mev/slinky/providers/websockets/okx" mmclienttypes "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var ( diff --git a/oracle/orchestrator/market_mapper_test.go b/oracle/orchestrator/market_mapper_test.go index bdeb52bfd..001dc386c 100644 --- a/oracle/orchestrator/market_mapper_test.go +++ b/oracle/orchestrator/market_mapper_test.go @@ -13,7 +13,7 @@ import ( "github.com/skip-mev/slinky/oracle/orchestrator" oraclefactory "github.com/skip-mev/slinky/providers/factories/oracle" mmclienttypes "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestListenForMarketMapUpdates(t *testing.T) { diff --git a/oracle/orchestrator/options.go b/oracle/orchestrator/options.go index 0264f8544..d281be23f 100644 --- a/oracle/orchestrator/options.go +++ b/oracle/orchestrator/options.go @@ -6,7 +6,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" "github.com/skip-mev/slinky/pkg/math/oracle" mmclienttypes "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // Option is a functional option for the market map state. diff --git a/oracle/orchestrator/orchestrator.go b/oracle/orchestrator/orchestrator.go index 21d8003fb..5f1f8ee97 100644 --- a/oracle/orchestrator/orchestrator.go +++ b/oracle/orchestrator/orchestrator.go @@ -13,7 +13,7 @@ import ( providermetrics "github.com/skip-mev/slinky/providers/base/metrics" wsmetrics "github.com/skip-mev/slinky/providers/base/websocket/metrics" mmclienttypes "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // ProviderOrchestrator is a stateful orchestrator that is responsible for maintaining diff --git a/oracle/orchestrator/update.go b/oracle/orchestrator/update.go index 6af905f74..8e6d68478 100644 --- a/oracle/orchestrator/update.go +++ b/oracle/orchestrator/update.go @@ -7,7 +7,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" "github.com/skip-mev/slinky/providers/base" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // UpdateWithMarketMap updates the orchestrator's market map and updates the providers' diff --git a/oracle/orchestrator/update_test.go b/oracle/orchestrator/update_test.go index b939187eb..bb5f685ce 100644 --- a/oracle/orchestrator/update_test.go +++ b/oracle/orchestrator/update_test.go @@ -14,7 +14,7 @@ import ( oraclefactory "github.com/skip-mev/slinky/providers/factories/oracle" providertypes "github.com/skip-mev/slinky/providers/types" "github.com/skip-mev/slinky/providers/websockets/okx" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestUpdateWithMarketMap(t *testing.T) { diff --git a/oracle/types/market.go b/oracle/types/market.go index 9153f92d7..79f635688 100644 --- a/oracle/types/market.go +++ b/oracle/types/market.go @@ -4,7 +4,7 @@ import ( "fmt" pkgtypes "github.com/skip-mev/slinky/pkg/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // ProviderTickersFromMarketMap returns the set of provider tickers a given provider should diff --git a/oracle/types/market_test.go b/oracle/types/market_test.go index d870aed4f..c60d1474e 100644 --- a/oracle/types/market_test.go +++ b/oracle/types/market_test.go @@ -7,7 +7,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" pkgtypes "github.com/skip-mev/slinky/pkg/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestProviderTickersFromMarketMap(t *testing.T) { diff --git a/pkg/math/oracle/helper_test.go b/pkg/math/oracle/helper_test.go index 0aae5011b..2f87a793d 100644 --- a/pkg/math/oracle/helper_test.go +++ b/pkg/math/oracle/helper_test.go @@ -8,7 +8,7 @@ import ( "github.com/skip-mev/slinky/providers/apis/binance" "github.com/skip-mev/slinky/providers/apis/coinbase" "github.com/skip-mev/slinky/providers/websockets/kucoin" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var ( diff --git a/pkg/math/oracle/median.go b/pkg/math/oracle/median.go index 1f9be7bd5..75f078225 100644 --- a/pkg/math/oracle/median.go +++ b/pkg/math/oracle/median.go @@ -10,7 +10,7 @@ import ( oraclemetrics "github.com/skip-mev/slinky/oracle/metrics" "github.com/skip-mev/slinky/oracle/types" "github.com/skip-mev/slinky/pkg/math" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var _ types.PriceAggregator = &MedianAggregator{} diff --git a/pkg/math/oracle/median_test.go b/pkg/math/oracle/median_test.go index 0f7ff61a9..9c0eaff1b 100644 --- a/pkg/math/oracle/median_test.go +++ b/pkg/math/oracle/median_test.go @@ -14,7 +14,7 @@ import ( "github.com/skip-mev/slinky/providers/apis/binance" "github.com/skip-mev/slinky/providers/apis/coinbase" "github.com/skip-mev/slinky/providers/websockets/kucoin" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestAggregateData(t *testing.T) { diff --git a/pkg/math/oracle/utils.go b/pkg/math/oracle/utils.go index 58e38bdad..8122cf6b6 100644 --- a/pkg/math/oracle/utils.go +++ b/pkg/math/oracle/utils.go @@ -7,7 +7,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" pkgtypes "github.com/skip-mev/slinky/pkg/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // GetProviderPrice returns the relevant provider price. Note that the aggregator's diff --git a/pkg/math/oracle/utils_test.go b/pkg/math/oracle/utils_test.go index 1d667d146..1633d79ef 100644 --- a/pkg/math/oracle/utils_test.go +++ b/pkg/math/oracle/utils_test.go @@ -9,7 +9,7 @@ import ( "github.com/skip-mev/slinky/oracle/constants" "github.com/skip-mev/slinky/oracle/types" "github.com/skip-mev/slinky/pkg/math/oracle" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestGetProviderPrice(t *testing.T) { diff --git a/proto/slinky/marketmap/module/v1/module.proto b/proto/slinky/marketmap/module/v1/module.proto index e222b1114..9c3bc333c 100644 --- a/proto/slinky/marketmap/module/v1/module.proto +++ b/proto/slinky/marketmap/module/v1/module.proto @@ -18,4 +18,4 @@ message Module { // of module names which provide a marketmap hooks instance. If no order is // provided, then hooks will be applied in alphabetical order of module names. repeated string hooks_order = 2; -} +} \ No newline at end of file diff --git a/proto/slinky/marketmap/v1/market.proto b/proto/slinky/marketmap/v1/market.proto index c8cf00c6f..b2f9df01f 100644 --- a/proto/slinky/marketmap/v1/market.proto +++ b/proto/slinky/marketmap/v1/market.proto @@ -6,6 +6,20 @@ option go_package = "github.com/skip-mev/slinky/x/marketmap/types"; import "gogoproto/gogo.proto"; import "slinky/types/v1/currency_pair.proto"; +// Market encapsulates a Ticker and its provider-specific configuration. +message Market { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + + // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + // price feed is scaled to a number of decimal places and has a minimum number + // of providers required to consider the ticker valid. + Ticker ticker = 1 [ (gogoproto.nullable) = false ]; + + // ProviderConfigs is the list of provider-specific configs for this Market. + repeated ProviderConfig provider_configs = 2 [ (gogoproto.nullable) = false ]; +} + // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price // feed is scaled to a number of decimal places and has a minimum number of // providers required to consider the ticker valid. @@ -43,76 +57,28 @@ message ProviderConfig { // The off-chain ticker is unique to a given provider and is used to fetch the // price of the ticker from the provider. string off_chain_ticker = 2; -} - -// Path is the list of convertable markets that will be used to convert the -// prices of a set of tickers to a common ticker. -message Path { - // Operations is an ordered list of operations that will be taken. These must - // be topologically sorted to ensure that the conversion is possible i.e. DAG. - repeated Operation operations = 1 [ (gogoproto.nullable) = false ]; -} - -// Operation represents the operation configuration for a given ticker. -message Operation { - // CurrencyPair is the on-chain currency pair for this ticker. - slinky.types.v1.CurrencyPair currency_pair = 1 - [ (gogoproto.nullable) = false ]; - - // Invert is a boolean that indicates whether the price of the ticker should - // be inverted. - bool invert = 2; - - // Provider is the name of the provider that will be used to fetch the price - // of the ticker. - string provider = 3; -} -message Paths { - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - repeated Path paths = 1 [ (gogoproto.nullable) = false ]; -} + // NormalizeByPair is the currency pair for this ticker to be normalized by. + // For example, if the desired Ticker is BTD/USD, this market could be reached + // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + // optional and nullable. + slinky.types.v1.CurrencyPair normalize_by_pair = 3; -message Providers { - // Providers is the list of provider configurations for the given ticker. - repeated ProviderConfig providers = 1 [ (gogoproto.nullable) = false ]; -} + // Invert is a boolean indicating if the BASE and QUOTE of the market should + // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + bool invert = 4; -// AggregationType is the type of aggregation that will be used to aggregate the -// prices of the tickers. -enum AggregationType { - // UNKOWN_AGGREGATION_TYPE is the default value for the aggregation type. - UNKNOWN_AGGREGATION_TYPE = 0; - - // IndexPriceAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // either directly or using the index price to a common currency pair. - INDEX_PRICE_AGGREGATION = 1; - - // StandardMedianAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // to a common currency pair and then takes the median of the prices. No - // conversions are done if the prices are already in the common currency pair. - STANDARD_MEDIAN_AGGREGATION = 2; + // MetadataJSON is a string of JSON that encodes any extra configuration + // for the given provider config. + string metadata_JSON = 15; } +// MarketMap maps ticker strings to their Markets. message MarketMap { option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; - // Tickers is the full list of tickers and their associated configurations + // Markets is the full list of tickers and their associated configurations // to be stored on-chain. - map tickers = 1 [ (gogoproto.nullable) = false ]; - - // Paths is a map from CurrencyPair to all paths that resolve to that pair - map paths = 2 [ (gogoproto.nullable) = false ]; - - // Providers is a map from CurrencyPair to each of to provider-specific - // configs associated with it. - map providers = 3 [ (gogoproto.nullable) = false ]; - - // AggregationType is the type of aggregation that will be used to aggregate - // the prices of the tickers. - AggregationType aggregation_type = 4; + map markets = 1 [ (gogoproto.nullable) = false ]; } diff --git a/proto/slinky/marketmap/v1/params.proto b/proto/slinky/marketmap/v1/params.proto index 78a746bb1..b93f590ea 100644 --- a/proto/slinky/marketmap/v1/params.proto +++ b/proto/slinky/marketmap/v1/params.proto @@ -5,11 +5,11 @@ option go_package = "github.com/skip-mev/slinky/x/marketmap/types"; // Params defines the parameters for the x/marketmap module. message Params { - // MarketAuthority is the authority account that is able to control updating - // the marketmap. - string market_authority = 1; + // MarketAuthorities is the list of authority accounts that are able to + // control updating the marketmap. + repeated string market_authorities = 1; - // Version is the schema version for the MarketMap data structure and query - // response. - uint64 version = 2; + // Admin is an address that can remove addresses from the MarketAuthorities + // list. Only governance can add to the MarketAuthorities or change the Admin. + string admin = 2; } diff --git a/proto/slinky/marketmap/v1/query.proto b/proto/slinky/marketmap/v1/query.proto index 43e5b184c..94a36300a 100644 --- a/proto/slinky/marketmap/v1/query.proto +++ b/proto/slinky/marketmap/v1/query.proto @@ -3,6 +3,7 @@ package slinky.marketmap.v1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "slinky/types/v1/currency_pair.proto"; import "slinky/marketmap/v1/market.proto"; import "slinky/marketmap/v1/params.proto"; @@ -12,12 +13,18 @@ option go_package = "github.com/skip-mev/slinky/x/marketmap/types"; service Query { // MarketMap returns the full market map stored in the x/marketmap // module. - rpc MarketMap(GetMarketMapRequest) returns (GetMarketMapResponse) { + rpc MarketMap(MarketMapRequest) returns (MarketMapResponse) { option (google.api.http).get = "/slinky/marketmap/v1/marketmap"; } + // Market returns a market stored in the x/marketmap + // module. + rpc Market(MarketRequest) returns (MarketResponse) { + option (google.api.http).get = "/slinky/marketmap/v1/market"; + } + // LastUpdated returns the last height the market map was updated at. - rpc LastUpdated(GetLastUpdatedRequest) returns (GetLastUpdatedResponse) { + rpc LastUpdated(LastUpdatedRequest) returns (LastUpdatedResponse) { option (google.api.http).get = "/slinky/marketmap/v1/last_updated"; } @@ -29,12 +36,12 @@ service Query { } } -// GetMarketMapRequest is the query request for the GetMarketMap query. +// MarketMapRequest is the query request for the MarketMap query. // It takes no arguments. -message GetMarketMapRequest {} +message MarketMapRequest {} -// GetMarketMapResponse is the query response for the GetMarketMap query. -message GetMarketMapResponse { +// MarketMapResponse is the query response for the MarketMap query. +message MarketMapResponse { // MarketMap defines the global set of market configurations for all providers // and markets. MarketMap market_map = 1 [ (gogoproto.nullable) = false ]; @@ -44,12 +51,23 @@ message GetMarketMapResponse { // is a new update to the map. uint64 last_updated = 2; - // Version is the schema version for the MarketMap data structure and query - // response. - uint64 version = 3; - // ChainId is the chain identifier for the market map. - string chain_id = 4; + string chain_id = 3; +} + +// MarketRequest is the query request for the Market query. +// It takes the currency pair of the market as an argument. +message MarketRequest { + // CurrencyPair is the currency pair associated with the market being + // requested. + slinky.types.v1.CurrencyPair currency_pair = 3 + [ (gogoproto.nullable) = false ]; +} + +// MarketResponse is the query response for the Market query. +message MarketResponse { + // Market is the configuration of a single market to be price-fetched for. + Market market = 1 [ (gogoproto.nullable) = false ]; } // ParamsRequest is the request type for the Query/Params RPC method. @@ -58,10 +76,10 @@ message ParamsRequest {} // ParamsResponse is the response type for the Query/Params RPC method. message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } -// GetLastUpdatedRequest is the request type for the Query/LastUpdated RPC +// LastUpdatedRequest is the request type for the Query/LastUpdated RPC // method. -message GetLastUpdatedRequest {} +message LastUpdatedRequest {} -// GetLastUpdatedResponse is the response type for the Query/LastUpdated RPC +// LastUpdatedResponse is the response type for the Query/LastUpdated RPC // method. -message GetLastUpdatedResponse { uint64 last_updated = 1; } +message LastUpdatedResponse { uint64 last_updated = 1; } \ No newline at end of file diff --git a/proto/slinky/marketmap/v1/tx.proto b/proto/slinky/marketmap/v1/tx.proto index 2534ccce9..b873fe126 100644 --- a/proto/slinky/marketmap/v1/tx.proto +++ b/proto/slinky/marketmap/v1/tx.proto @@ -14,46 +14,60 @@ option go_package = "github.com/skip-mev/slinky/x/marketmap/types"; service Msg { option (cosmos.msg.v1.service) = true; - // UpdateMarketMap creates markets from the given message. - rpc UpdateMarketMap(MsgUpdateMarketMap) returns (MsgUpdateMarketMapResponse); + // CreateMarkets creates markets from the given message. + rpc CreateMarkets(MsgCreateMarkets) returns (MsgCreateMarketsResponse); + + // UpdateMarkets updates markets from the given message. + rpc UpdateMarkets(MsgUpdateMarkets) returns (MsgUpdateMarketsResponse); // Params defines a method for updating the x/marketmap module parameters. rpc Params(MsgParams) returns (MsgParamsResponse); + + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + rpc RemoveMarketAuthorities(MsgRemoveMarketAuthorities) + returns (MsgRemoveMarketAuthoritiesResponse); } -// CreateMarket contains all information needed to create a new market. -message CreateMarket { - // Ticker is the on-chain representation of the ticker. This is the target - // ticker that the prices of the set of tickers will be converted to. - Ticker ticker = 1 [ (gogoproto.nullable) = false ]; +// MsgCreateMarkets defines a message carrying a payload for creating markets in +// the x/marketmap module. +message MsgCreateMarkets { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/marketmap/MsgCreateMarkets"; + + option (gogoproto.equal) = false; - // Providers maps provider names to their off-chain - // representations for the given ticker of the message. - Providers providers = 2 [ (gogoproto.nullable) = false ]; + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - Paths paths = 3 [ (gogoproto.nullable) = false ]; + // CreateMarkets is the list of all markets to be created for the given + // transaction. + repeated Market create_markets = 2 [ (gogoproto.nullable) = false ]; } -// MsgUpdateMarketMap defines a message carrying a payload for updating the +// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. +message MsgCreateMarketsResponse {} + +// MsgUpdateMarkets defines a message carrying a payload for updating the // x/marketmap module. -message MsgUpdateMarketMap { - option (cosmos.msg.v1.signer) = "signer"; - option (amino.name) = "slinky/x/marketmap/MsgUpdateMarketMap"; +message MsgUpdateMarkets { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "slinky/x/marketmap/MsgUpdateMarkets"; option (gogoproto.equal) = false; - // Signer is the signer of this transaction. - string signer = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - // CreateMarkets is the list of all markets to be created for the given + // UpdateMarkets is the list of all markets to be updated for the given // transaction. - repeated CreateMarket create_markets = 2 [ (gogoproto.nullable) = false ]; + repeated Market update_markets = 2 [ (gogoproto.nullable) = false ]; } -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -message MsgUpdateMarketMapResponse {} +// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. +message MsgUpdateMarketsResponse {} // MsgParams defines the Msg/Params request type. It contains the // new parameters for the x/marketmap module. @@ -69,3 +83,21 @@ message MsgParams { // MsgParamsResponse defines the Msg/Params response type. message MsgParamsResponse {} + +// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse +// request type. It contains the new addresses to remove from the list of +// authorities +message MsgRemoveMarketAuthorities { + option (cosmos.msg.v1.signer) = "admin"; + + // RemoveAddresses is the list of addresses to remove. + repeated string remove_addresses = 1; + + // Admin defines the authority that is the x/marketmap + // Admin account. This account is set in the module parameters. + string admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgRemoveMarketAuthoritiesResponse defines the +// Msg/RemoveMarketAuthoritiesResponse response type. +message MsgRemoveMarketAuthoritiesResponse {} diff --git a/proto/slinky/mm2/module/v1/module.proto b/proto/slinky/mm2/module/v1/module.proto deleted file mode 100644 index 24273a3c4..000000000 --- a/proto/slinky/mm2/module/v1/module.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -package slinky.mm2.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the builder module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import : "github.com/skip-mev/slinky/x/mm2" - }; - - // Authority defines the custom module authority. If not set, defaults to the - // governance module. - string authority = 1; - - // HooksOrder specifies the order of marketmap hooks and should be a list - // of module names which provide a marketmap hooks instance. If no order is - // provided, then hooks will be applied in alphabetical order of module names. - repeated string hooks_order = 2; -} \ No newline at end of file diff --git a/proto/slinky/mm2/v1/genesis.proto b/proto/slinky/mm2/v1/genesis.proto deleted file mode 100644 index 5644a76e3..000000000 --- a/proto/slinky/mm2/v1/genesis.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package slinky.mm2.v1; - -import "gogoproto/gogo.proto"; -import "slinky/mm2/v1/market.proto"; -import "slinky/mm2/v1/params.proto"; - -option go_package = "github.com/skip-mev/slinky/x/mm2/types"; - -// GenesisState defines the x/marketmap module's genesis state. -message GenesisState { - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap market_map = 1 [ (gogoproto.nullable) = false ]; - - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - uint64 last_updated = 2; - - // Params are the parameters for the x/marketmap module. - Params params = 3 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/slinky/mm2/v1/market.proto b/proto/slinky/mm2/v1/market.proto deleted file mode 100644 index 359976b48..000000000 --- a/proto/slinky/mm2/v1/market.proto +++ /dev/null @@ -1,84 +0,0 @@ -syntax = "proto3"; -package slinky.mm2.v1; - -option go_package = "github.com/skip-mev/slinky/x/mm2/types"; - -import "gogoproto/gogo.proto"; -import "slinky/types/v1/currency_pair.proto"; - -// Market encapsulates a Ticker and its provider-specific configuration. -message Market { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - - // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The - // price feed is scaled to a number of decimal places and has a minimum number - // of providers required to consider the ticker valid. - Ticker ticker = 1 [ (gogoproto.nullable) = false ]; - - // ProviderConfigs is the list of provider-specific configs for this Market. - repeated ProviderConfig provider_configs = 2 [ (gogoproto.nullable) = false ]; -} - -// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price -// feed is scaled to a number of decimal places and has a minimum number of -// providers required to consider the ticker valid. -message Ticker { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - - // CurrencyPair is the currency pair for this ticker. - slinky.types.v1.CurrencyPair currency_pair = 1 - [ (gogoproto.nullable) = false ]; - - // Decimals is the number of decimal places for the ticker. The number of - // decimal places is used to convert the price to a human-readable format. - uint64 decimals = 2; - - // MinProviderCount is the minimum number of providers required to consider - // the ticker valid. - uint64 min_provider_count = 3; - - // Enabled is the flag that denotes if the Ticker is enabled for price - // fetching by an oracle. - bool enabled = 14; - - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given ticker. - string metadata_JSON = 15; -} - -message ProviderConfig { - // Name corresponds to the name of the provider for which the configuration is - // being set. - string name = 1; - - // OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. - // The off-chain ticker is unique to a given provider and is used to fetch the - // price of the ticker from the provider. - string off_chain_ticker = 2; - - // NormalizeByPair is the currency pair for this ticker to be normalized by. - // For example, if the desired Ticker is BTD/USD, this market could be reached - // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is - // optional and nullable. - slinky.types.v1.CurrencyPair normalize_by_pair = 3; - - // Invert is a boolean indicating if the BASE and QUOTE of the market should - // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE - bool invert = 4; - - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given provider config. - string metadata_JSON = 15; -} - -// MarketMap maps ticker strings to their Markets. -message MarketMap { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - - // Markets is the full list of tickers and their associated configurations - // to be stored on-chain. - map markets = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/slinky/mm2/v1/params.proto b/proto/slinky/mm2/v1/params.proto deleted file mode 100644 index 1700ea87e..000000000 --- a/proto/slinky/mm2/v1/params.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package slinky.mm2.v1; - -option go_package = "github.com/skip-mev/slinky/x/mm2/types"; - -// Params defines the parameters for the x/marketmap module. -message Params { - // MarketAuthorities is the list of authority accounts that are able to - // control updating the marketmap. - repeated string market_authorities = 1; - - // Admin is an address that can remove addresses from the MarketAuthorities - // list. Only governance can add to the MarketAuthorities or change the Admin. - string admin = 2; -} diff --git a/proto/slinky/mm2/v1/query.proto b/proto/slinky/mm2/v1/query.proto deleted file mode 100644 index 37297f3de..000000000 --- a/proto/slinky/mm2/v1/query.proto +++ /dev/null @@ -1,85 +0,0 @@ -syntax = "proto3"; -package slinky.mm2.v1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "slinky/types/v1/currency_pair.proto"; -import "slinky/mm2/v1/market.proto"; -import "slinky/mm2/v1/params.proto"; - -option go_package = "github.com/skip-mev/slinky/x/mm2/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. - rpc MarketMap(MarketMapRequest) returns (MarketMapResponse) { - option (google.api.http).get = "/slinky/mm2/v1/marketmap"; - } - - // Market returns a market stored in the x/marketmap - // module. - rpc Market(MarketRequest) returns (MarketResponse) { - option (google.api.http).get = "/slinky/mm2/v1/market"; - } - - // LastUpdated returns the last height the market map was updated at. - rpc LastUpdated(LastUpdatedRequest) returns (LastUpdatedResponse) { - option (google.api.http).get = "/slinky/mm2/v1/last_updated"; - } - - // Params returns the current x/marketmap module parameters. - rpc Params(ParamsRequest) returns (ParamsResponse) { - option (google.api.http) = { - get : "/slinky/mm2/v1/params" - }; - } -} - -// MarketMapRequest is the query request for the MarketMap query. -// It takes no arguments. -message MarketMapRequest {} - -// MarketMapResponse is the query response for the MarketMap query. -message MarketMapResponse { - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap market_map = 1 [ (gogoproto.nullable) = false ]; - - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - uint64 last_updated = 2; - - // ChainId is the chain identifier for the market map. - string chain_id = 3; -} - -// MarketRequest is the query request for the Market query. -// It takes the currency pair of the market as an argument. -message MarketRequest { - // CurrencyPair is the currency pair associated with the market being - // requested. - slinky.types.v1.CurrencyPair currency_pair = 3 - [ (gogoproto.nullable) = false ]; -} - -// MarketResponse is the query response for the Market query. -message MarketResponse { - // Market is the configuration of a single market to be price-fetched for. - Market market = 1 [ (gogoproto.nullable) = false ]; -} - -// ParamsRequest is the request type for the Query/Params RPC method. -message ParamsRequest {} - -// ParamsResponse is the response type for the Query/Params RPC method. -message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } - -// LastUpdatedRequest is the request type for the Query/LastUpdated RPC -// method. -message LastUpdatedRequest {} - -// LastUpdatedResponse is the response type for the Query/LastUpdated RPC -// method. -message LastUpdatedResponse { uint64 last_updated = 1; } \ No newline at end of file diff --git a/proto/slinky/mm2/v1/tx.proto b/proto/slinky/mm2/v1/tx.proto deleted file mode 100644 index 3e6321f0f..000000000 --- a/proto/slinky/mm2/v1/tx.proto +++ /dev/null @@ -1,103 +0,0 @@ -syntax = "proto3"; -package slinky.mm2.v1; - -import "cosmos/msg/v1/msg.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; -import "slinky/mm2/v1/market.proto"; -import "slinky/mm2/v1/params.proto"; - -option go_package = "github.com/skip-mev/slinky/x/mm2/types"; - -// Msg is the message service for the x/marketmap module. -service Msg { - option (cosmos.msg.v1.service) = true; - - // CreateMarkets creates markets from the given message. - rpc CreateMarkets(MsgCreateMarkets) returns (MsgCreateMarketsResponse); - - // UpdateMarkets updates markets from the given message. - rpc UpdateMarkets(MsgUpdateMarkets) returns (MsgUpdateMarketsResponse); - - // Params defines a method for updating the x/marketmap module parameters. - rpc Params(MsgParams) returns (MsgParamsResponse); - - // RemoveMarketAuthorities defines a method for removing market authorities - // from the x/marketmap module. the signer must be the admin. - rpc RemoveMarketAuthorities(MsgRemoveMarketAuthorities) - returns (MsgRemoveMarketAuthoritiesResponse); -} - -// MsgCreateMarkets defines a message carrying a payload for creating markets in -// the x/marketmap module. -message MsgCreateMarkets { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "slinky/x/marketmap/MsgCreateMarkets"; - - option (gogoproto.equal) = false; - - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // CreateMarkets is the list of all markets to be created for the given - // transaction. - repeated Market create_markets = 2 [ (gogoproto.nullable) = false ]; -} - -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -message MsgCreateMarketsResponse {} - -// MsgUpdateMarkets defines a message carrying a payload for updating the -// x/marketmap module. -message MsgUpdateMarkets { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "slinky/x/marketmap/MsgUpdateMarkets"; - - option (gogoproto.equal) = false; - - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - - // UpdateMarkets is the list of all markets to be updated for the given - // transaction. - repeated Market update_markets = 2 [ (gogoproto.nullable) = false ]; -} - -// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. -message MsgUpdateMarketsResponse {} - -// MsgParams defines the Msg/Params request type. It contains the -// new parameters for the x/marketmap module. -message MsgParams { - option (cosmos.msg.v1.signer) = "authority"; - - // Params defines the new parameters for the x/marketmap module. - Params params = 1 [ (gogoproto.nullable) = false ]; - // Authority defines the authority that is updating the x/marketmap module - // parameters. - string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; -} - -// MsgParamsResponse defines the Msg/Params response type. -message MsgParamsResponse {} - -// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse -// request type. It contains the new addresses to remove from the list of -// authorities -message MsgRemoveMarketAuthorities { - option (cosmos.msg.v1.signer) = "admin"; - - // RemoveAddresses is the list of addresses to remove. - repeated string remove_addresses = 1; - - // Admin defines the authority that is the x/marketmap - // Admin account. This account is set in the module parameters. - string admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; -} - -// MsgRemoveMarketAuthoritiesResponse defines the -// Msg/RemoveMarketAuthoritiesResponse response type. -message MsgRemoveMarketAuthoritiesResponse {} diff --git a/providers/apis/defi/raydium/mocks/solana_jsonrpc_client.go b/providers/apis/defi/raydium/mocks/solana_jsonrpc_client.go index e8d6145cb..a2aacdaa4 100644 --- a/providers/apis/defi/raydium/mocks/solana_jsonrpc_client.go +++ b/providers/apis/defi/raydium/mocks/solana_jsonrpc_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. package mocks diff --git a/providers/apis/defi/uniswapv3/mocks/EVMClient.go b/providers/apis/defi/uniswapv3/mocks/EVMClient.go index b91db5fe9..b3cbaf910 100644 --- a/providers/apis/defi/uniswapv3/mocks/EVMClient.go +++ b/providers/apis/defi/uniswapv3/mocks/EVMClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.30.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. package mocks @@ -18,6 +18,10 @@ type EVMClient struct { func (_m *EVMClient) BatchCallContext(ctx context.Context, calls []rpc.BatchElem) error { ret := _m.Called(ctx, calls) + if len(ret) == 0 { + panic("no return value specified for BatchCallContext") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, []rpc.BatchElem) error); ok { r0 = rf(ctx, calls) diff --git a/providers/apis/dydx/helper_test.go b/providers/apis/dydx/helper_test.go index cd070f71d..ba325fadf 100644 --- a/providers/apis/dydx/helper_test.go +++ b/providers/apis/dydx/helper_test.go @@ -10,7 +10,7 @@ import ( "github.com/skip-mev/slinky/providers/websockets/kucoin" "github.com/skip-mev/slinky/providers/websockets/mexc" "github.com/skip-mev/slinky/providers/websockets/okx" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) const dYdXResponseValid = ` diff --git a/providers/apis/dydx/parse.go b/providers/apis/dydx/parse.go index ce2e33e6a..e8305c5a2 100644 --- a/providers/apis/dydx/parse.go +++ b/providers/apis/dydx/parse.go @@ -22,7 +22,7 @@ import ( "github.com/skip-mev/slinky/providers/websockets/kucoin" "github.com/skip-mev/slinky/providers/websockets/mexc" "github.com/skip-mev/slinky/providers/websockets/okx" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // ProviderMapping is referencing the different providers that are supported by the dYdX market params. diff --git a/providers/apis/dydx/parse_test.go b/providers/apis/dydx/parse_test.go index a0eb2b483..cbc352ccd 100644 --- a/providers/apis/dydx/parse_test.go +++ b/providers/apis/dydx/parse_test.go @@ -14,7 +14,7 @@ import ( "github.com/skip-mev/slinky/providers/websockets/kucoin" "github.com/skip-mev/slinky/providers/websockets/mexc" "github.com/skip-mev/slinky/providers/websockets/okx" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestConvertMarketParamsToMarketMap(t *testing.T) { diff --git a/providers/apis/marketmap/api_handler.go b/providers/apis/marketmap/api_handler.go index b81439c80..5e0f0efa8 100644 --- a/providers/apis/marketmap/api_handler.go +++ b/providers/apis/marketmap/api_handler.go @@ -10,7 +10,7 @@ import ( "github.com/skip-mev/slinky/oracle/config" "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var _ types.MarketMapAPIDataHandler = (*APIHandler)(nil) diff --git a/providers/apis/marketmap/api_handler_test.go b/providers/apis/marketmap/api_handler_test.go index 4e612d828..e083e11bf 100644 --- a/providers/apis/marketmap/api_handler_test.go +++ b/providers/apis/marketmap/api_handler_test.go @@ -14,7 +14,7 @@ import ( "github.com/skip-mev/slinky/providers/base/testutils" providertypes "github.com/skip-mev/slinky/providers/types" "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) var ( diff --git a/providers/base/api/metrics/mocks/mock_metrics.go b/providers/base/api/metrics/mocks/mock_metrics.go index 2d71d4ad2..97628d1b7 100644 --- a/providers/base/api/metrics/mocks/mock_metrics.go +++ b/providers/base/api/metrics/mocks/mock_metrics.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.40.1. DO NOT EDIT. +// Code generated by mockery v2.42.2. DO NOT EDIT. package mocks @@ -22,9 +22,9 @@ func (_m *APIMetrics) AddHTTPStatusCode(providerName string, resp *http.Response _m.Called(providerName, resp) } -// AddProviderResponse provides a mock function with given fields: providerName, id, status -func (_m *APIMetrics) AddProviderResponse(providerName string, id string, status types.ErrorCode) { - _m.Called(providerName, id, status) +// AddProviderResponse provides a mock function with given fields: providerName, id, errorCode +func (_m *APIMetrics) AddProviderResponse(providerName string, id string, errorCode types.ErrorCode) { + _m.Called(providerName, id, errorCode) } // ObserveProviderResponseLatency provides a mock function with given fields: providerName, duration diff --git a/providers/factories/oracle/marketmap.go b/providers/factories/oracle/marketmap.go index 551410926..a334de625 100644 --- a/providers/factories/oracle/marketmap.go +++ b/providers/factories/oracle/marketmap.go @@ -13,7 +13,7 @@ import ( apimetrics "github.com/skip-mev/slinky/providers/base/api/metrics" providermetrics "github.com/skip-mev/slinky/providers/base/metrics" "github.com/skip-mev/slinky/service/clients/marketmap/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // MarketMapProviderFactory returns a sample implementation of the market map provider. This provider diff --git a/scripts/protocgen-pulsar.sh b/scripts/protocgen-pulsar.sh index 7d042569b..682c49e7d 100644 --- a/scripts/protocgen-pulsar.sh +++ b/scripts/protocgen-pulsar.sh @@ -34,9 +34,5 @@ sed -i.bak 's|cosmossdk.io/api/slinky/types/v1|github.com/skip-mev/slinky/api/sl echo "fixing market.pulsar.go" sed -i.bak 's|cosmossdk.io/api/slinky/types/v1|github.com/skip-mev/slinky/api/slinky/types/v1|g' ./api/slinky/marketmap/v1/market.pulsar.go && rm ./api/slinky/marketmap/v1/market.pulsar.go.bak +sed -i.bak 's|cosmossdk.io/api/slinky/types/v1|github.com/skip-mev/slinky/api/slinky/types/v1|g' ./api/slinky/marketmap/v1/query.pulsar.go && rm ./api/slinky/marketmap/v1/query.pulsar.go.bak sed -i.bak 's|cosmossdk.io/api/slinky/oracle/v1|github.com/skip-mev/slinky/api/slinky/oracle/v1|g' ./api/slinky/marketmap/v1/market.pulsar.go && rm ./api/slinky/marketmap/v1/market.pulsar.go.bak - -echo "fixing market.pulsar.go" -sed -i.bak 's|cosmossdk.io/api/slinky/types/v1|github.com/skip-mev/slinky/api/slinky/types/v1|g' ./api/slinky/mm2/v1/market.pulsar.go && rm ./api/slinky/mm2/v1/market.pulsar.go.bak -sed -i.bak 's|cosmossdk.io/api/slinky/types/v1|github.com/skip-mev/slinky/api/slinky/types/v1|g' ./api/slinky/mm2/v1/query.pulsar.go && rm ./api/slinky/mm2/v1/query.pulsar.go.bak -sed -i.bak 's|cosmossdk.io/api/slinky/oracle/v1|github.com/skip-mev/slinky/api/slinky/oracle/v1|g' ./api/slinky/mm2/v1/market.pulsar.go && rm ./api/slinky/mm2/v1/market.pulsar.go.bak diff --git a/service/clients/marketmap/types/types.go b/service/clients/marketmap/types/types.go index 06c800c4f..62fdf8cc7 100644 --- a/service/clients/marketmap/types/types.go +++ b/service/clients/marketmap/types/types.go @@ -11,7 +11,7 @@ import ( apimetrics "github.com/skip-mev/slinky/providers/base/api/metrics" providermetrics "github.com/skip-mev/slinky/providers/base/metrics" providertypes "github.com/skip-mev/slinky/providers/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) // ConfigType is the type of the API/WebSocket configuration. diff --git a/service/servers/oracle/server_test.go b/service/servers/oracle/server_test.go index ee245f0f4..a94bff7fa 100644 --- a/service/servers/oracle/server_test.go +++ b/service/servers/oracle/server_test.go @@ -22,7 +22,7 @@ import ( "github.com/skip-mev/slinky/service/metrics" server "github.com/skip-mev/slinky/service/servers/oracle" stypes "github.com/skip-mev/slinky/service/servers/oracle/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) const ( diff --git a/tests/integration/slinky_integration_test.go b/tests/integration/slinky_integration_test.go index 370ce808a..f8308ab83 100644 --- a/tests/integration/slinky_integration_test.go +++ b/tests/integration/slinky_integration_test.go @@ -4,10 +4,6 @@ import ( "fmt" "testing" - "github.com/skip-mev/slinky/x/incentives" - marketmapmodule "github.com/skip-mev/slinky/x/mm2" - "github.com/skip-mev/slinky/x/sla" - "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/bank" @@ -19,7 +15,10 @@ import ( "github.com/skip-mev/slinky/tests/integration" "github.com/skip-mev/slinky/x/alerts" + "github.com/skip-mev/slinky/x/incentives" + marketmapmodule "github.com/skip-mev/slinky/x/marketmap" "github.com/skip-mev/slinky/x/oracle" + "github.com/skip-mev/slinky/x/sla" ) var ( diff --git a/tests/integration/slinky_setup.go b/tests/integration/slinky_setup.go index be759b03f..d2929df92 100644 --- a/tests/integration/slinky_setup.go +++ b/tests/integration/slinky_setup.go @@ -36,7 +36,7 @@ import ( slinkyabci "github.com/skip-mev/slinky/abci/ve/types" oracleconfig "github.com/skip-mev/slinky/oracle/config" slinkytypes "github.com/skip-mev/slinky/pkg/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) diff --git a/tests/integration/slinky_slashing_setup.go b/tests/integration/slinky_slashing_setup.go index d53e01418..9bbd38f2b 100644 --- a/tests/integration/slinky_slashing_setup.go +++ b/tests/integration/slinky_slashing_setup.go @@ -27,7 +27,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" "github.com/skip-mev/slinky/providers/static" alerttypes "github.com/skip-mev/slinky/x/alerts/types" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" ) const gasPrice = 100 diff --git a/tests/integration/slinky_slashing_suite.go b/tests/integration/slinky_slashing_suite.go index dcd253934..daea8ccc8 100644 --- a/tests/integration/slinky_slashing_suite.go +++ b/tests/integration/slinky_slashing_suite.go @@ -6,8 +6,6 @@ import ( "math/big" "strings" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" - "cosmossdk.io/math" cmtabci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/codec" @@ -22,6 +20,7 @@ import ( slinkyabci "github.com/skip-mev/slinky/abci/ve/types" slinkytypes "github.com/skip-mev/slinky/pkg/types" alerttypes "github.com/skip-mev/slinky/x/alerts/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) diff --git a/tests/integration/slinky_suite.go b/tests/integration/slinky_suite.go index bac1db735..a46475381 100644 --- a/tests/integration/slinky_suite.go +++ b/tests/integration/slinky_suite.go @@ -21,7 +21,7 @@ import ( "github.com/skip-mev/slinky/oracle/types" slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/providers/static" - mmtypes "github.com/skip-mev/slinky/x/mm2/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) diff --git a/tests/simapp/app.go b/tests/simapp/app.go index bb3ea63ba..679fb9fdf 100644 --- a/tests/simapp/app.go +++ b/tests/simapp/app.go @@ -23,7 +23,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - testdata_pulsar "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" + testdatapulsar "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -72,8 +72,8 @@ import ( alertskeeper "github.com/skip-mev/slinky/x/alerts/keeper" "github.com/skip-mev/slinky/x/incentives" incentiveskeeper "github.com/skip-mev/slinky/x/incentives/keeper" - marketmapmodule "github.com/skip-mev/slinky/x/mm2" - marketmapkeeper "github.com/skip-mev/slinky/x/mm2/keeper" + marketmapmodule "github.com/skip-mev/slinky/x/marketmap" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/skip-mev/slinky/x/oracle" oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" ) @@ -410,7 +410,7 @@ func NewSimApp( // app.RegisterUpgradeHandlers() // add test gRPC service for testing gRPC queries in isolation - testdata_pulsar.RegisterQueryServer(app.GRPCQueryRouter(), testdata_pulsar.QueryImpl{}) + testdatapulsar.RegisterQueryServer(app.GRPCQueryRouter(), testdatapulsar.QueryImpl{}) // create the simulation manager and define the order of the modules for deterministic simulations // diff --git a/tests/simapp/config.go b/tests/simapp/config.go index 0de635584..73efe9b49 100644 --- a/tests/simapp/config.go +++ b/tests/simapp/config.go @@ -3,8 +3,6 @@ package simapp import ( "time" - "google.golang.org/protobuf/types/known/durationpb" - runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" @@ -24,6 +22,7 @@ import ( upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject" + "google.golang.org/protobuf/types/known/durationpb" alertmodulev1 "github.com/skip-mev/slinky/api/slinky/alerts/module/v1" incentivesmodulev1 "github.com/skip-mev/slinky/api/slinky/incentives/module/v1" @@ -46,7 +45,7 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects _ "github.com/skip-mev/slinky/x/incentives" // import for side-effects - _ "github.com/skip-mev/slinky/x/mm2" // import for side-effects + _ "github.com/skip-mev/slinky/x/marketmap" // import for side-effects _ "github.com/skip-mev/slinky/x/oracle" // import for side-effects "cosmossdk.io/core/appconfig" @@ -70,11 +69,11 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - marketmapmodulev1 "github.com/skip-mev/slinky/api/slinky/mm2/module/v1" + marketmapmodulev1 "github.com/skip-mev/slinky/api/slinky/marketmap/module/v1" alerttypes "github.com/skip-mev/slinky/x/alerts/types" "github.com/skip-mev/slinky/x/alerts/types/strategies" incentivetypes "github.com/skip-mev/slinky/x/incentives/types" - marketmaptypes "github.com/skip-mev/slinky/x/mm2/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) diff --git a/x/marketmap/README.md b/x/marketmap/README.md deleted file mode 100644 index c46f40734..000000000 --- a/x/marketmap/README.md +++ /dev/null @@ -1,342 +0,0 @@ -# `x/marketmap` - -## Contents - -* [Concepts](#concepts) -* [Integration](#integtration) -* [State](#state) - * [MarketMap](#marketmap) - * [Params](#params) - * [MarketAuthority](#marketauthority) - * [Version](#version) -* [Events](#events) -* [Hooks](#hooks) - * [AfterMarketCreated](#aftermarketcreated) - * [AfterMarketUpdated](#aftermarketupdated) -* [Client](#client) - * [CLI](#cli) - * [gRPC](#grpc) - -## Concepts - -The `x/marketmap` module encapsulates a system for creating and updating a unified configuration that is stored on-chain -and consumed by a set of oracle service providers (Slinky oracle, etc.). - -The core goal of the system is to collect off-chain market updates and to post them on chain, informing oracle service -providers to fetch prices for new markets. - -The data is stored in a `MarketMap` data structure which can be queried and consumed by oracle services. - -## Integration - -When integrating `x/marketmap` into your Cosmos SDK application, some considerations must be made: - -### Module Hooks - -Integrating modules can use the [hooks](#hooks) exposed by `x/marketmap` to update their state whenever -changes are made to the marketmap. - -An example of this can be seen in `x/oracle`'s implementation of the `AfterMarketCreated` hook. This hook -triggers the creation of a `CurrencyPairState` that corresponds to the new `Ticker` that was created in the marketmap. -This allows for a unified flow where updates to the market map prepare the `x/oracle` module for new price feeds. - -### Genesis Order - -Any modules that integrate with `x/marketmap` must set their `InitGenesis` to occur _before_ the `x/marketmap` module's -`InitGenesis`. This is so that logic any consuming modules may want to implement in `AfterMarketGenesis` will be -run properly. - -## State - -### MarketMap - -The market map data is as follows: - -```protobuf -// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price -// feed is scaled to a number of decimal places and has a minimum number of -// providers required to consider the ticker valid. -message Ticker { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - - // CurrencyPair is the currency pair for this ticker. - slinky.types.v1.CurrencyPair currency_pair = 1 - [ (gogoproto.nullable) = false ]; - - // Decimals is the number of decimal places for the ticker. The number of - // decimal places is used to convert the price to a human-readable format. - uint64 decimals = 3; - // MinProviderCount is the minimum number of providers required to consider - // the ticker valid. - uint64 min_provider_count = 4; - - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given ticker. - string metadata_JSON = 15; -} - -message ProviderConfig { - // Name corresponds to the name of the provider for which the configuration is - // being set. - string name = 1; - - // OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. - // The off-chain ticker is unique to a given provider and is used to fetch the - // price of the ticker from the provider. - string off_chain_ticker = 2; -} - -// Path is the list of convertable markets that will be used to convert the -// prices of a set of tickers to a common ticker. -message Path { - // Operations is an ordered list of operations that will be taken. These must - // be topologically sorted to ensure that the conversion is possible i.e. DAG. - repeated Operation operations = 1 [ (gogoproto.nullable) = false ]; -} - -// Operation represents the operation configuration for a given ticker. -message Operation { - // CurrencyPair is the on-chain currency pair for this ticker. - slinky.types.v1.CurrencyPair currency_pair = 1 - [ (gogoproto.nullable) = false ]; - - // Invert is a boolean that indicates whether the price of the ticker should - // be inverted. - bool invert = 2; -} - -message Paths { - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - repeated Path paths = 1 [ (gogoproto.nullable) = false ]; -} - -message Providers { - // Providers is the list of provider configurations for the given ticker. - repeated ProviderConfig providers = 1 [ (gogoproto.nullable) = false ]; -} - -message MarketMap { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - - // Tickers is the full list of tickers and their associated configurations - // to be stored on-chain. - map tickers = 1 [ (gogoproto.nullable) = false ]; - - // Paths is a map from CurrencyPair to all paths that resolve to that pair - map paths = 2 [ (gogoproto.nullable) = false ]; - - // Providers is a map from CurrencyPair to each of to provider-specific - // configs associated with it. - map providers = 3 [ (gogoproto.nullable) = false ]; -} -``` - -The `MarketMap` message itself is not stored in state. Rather, ticker strings are used as key prefixes -so that the data can be stored in a map-like structure, while retaining determinism. - -### Params - -The `x/marketmap` module stores its params in the keeper state. The params can be updated with governance or the -keeper authority address. - -The `x/marketmap` module contains the following parameters: - -| Key | Type | Example | -| MarketAuthority | string | "cosmos1vq93x443c0fznuf6...q4jd28ke6r46p999s0" | -| Version | uint64 | 20 | - -#### MarketAuthority - -The MarketAuthority is the bech32 address that is permitted to submit market updates to the chain. - -#### Version - -Version is the version of the MarketMap schema. This version is returned in the `GetMarketMap` query and can be used -by oracle service providers to verify the schema they are consuming. When being modified via governance, the new value -must always be greater than the current value. - -## Events - -The marketmap module emits the following events: - -### CreateMarket - -| Attribute Key | Attribute Value | -|--------------------|-----------------| -| currency_pair | {CurrencyPair} | -| decimals | {uint64} | -| min_provider_count | {uint64} | -| metadata | {json string} | -| providers | {[]Provider} | -| paths | {[]Path]} | - -## Hooks - -Other modules can register routines to execute after a certain event has occurred in `x/marketmap`. -The following hooks can be registered: - -### AfterMarketCreated - -* `AfterMarketCreated(ctx sdk.Context, ticker marketmaptypes.Ticker) error` - * Called after a new market is created in `CreateMarket` message server. - -### AfterMarketUpdated - -* `AfterMarketUpdated(ctx sdk.Context, ticker marketmaptypes.Ticker) error` - * Called after a new market is updated in `UpdateMarket` message server. - -### AfterMarketGenesis - -* `AfterMarketGenesis(ctx sdk.Context, tickers map[string]marketmaptypes.Ticker) error` - * Called at the end of `InitGenesis` for the `x/marketmap` keeper. - -## Client - -### gRPC - -A user can query the `marketmap` module using gRPC endpoints. - -#### MarketMap - -The `MarketMap` endpoint queries the full state of the market map as well as associated information such as -`LastUpdated` and `Version`. - -Example: - -```shell -grpcurl -plaintext localhost:9090 slinky.marketmap.v1.Query/MarketMap -``` - -Example response: - -```json -{ - "marketMap": { - "tickers": { - "BITCOIN/USD": { - "currencyPair": { - "Base": "BITCOIN", - "Quote": "USD" - }, - "decimals": "8", - "minProviderCount": "3" - } - }, - "paths": { - "BITCOIN/USD": { - "paths": [ - { - "operations": [ - { - "currencyPair": { - "Base": "BITCOIN", - "Quote": "USD" - } - } - ] - } - ] - } - }, - "providers": { - "BITCOIN/USD": { - "providers": [ - { - "name": "kucoin", - "offChainTicker": "btc_usd" - }, - { - "name": "mexc", - "offChainTicker": "btc-usd" - }, - { - "name": "binance", - "offChainTicker": "BTCUSD" - } - ] - } - } - }, - "lastUpdated": "1" -} -``` - -#### LastUpdated - -The `LastUpdated` endpoint queries the last block height that the market map was updated. -This can be consumed by oracle service providers to recognize when their local configurations -must be updated using the heavier `MarketMap` query. - -Example: - -```shell -grpcurl -plaintext localhost:9090 slinky.marketmap.v1.Query/LastUpdated -``` - -Example response: - -```json -{ - "lastUpdated": "1" -} -``` - -#### Params - -The params query allows users to query values set as marketmap parameters. - -Example: - -```shell -grpcurl -plaintext localhost:9090 slinky.marketmap.v1.Query/Params -``` - -Example response: - -```json -{ - "params": { - "marketAuthority": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" - } -} -``` - -### CLI - -A user can query the `marketmap` module using the CLI. - -#### MarketMap - -The `MarketMap` endpoint queries the full state of the market map as well as associated information such as -`LastUpdated` and `Version`. - -Example: - -```shell - slinkyd q marketmap market-map -``` - -#### LastUpdated - -The `LastUpdated` query queries the last block height that the market map was updated. -This can be consumed by oracle service providers to recognize when their local configurations -must be updated using the heavier `MarketMap` query. - -Example: - -```shell - slinkyd q marketmap last-updated -``` - -#### Params - -The params query allows users to query values set as marketmap parameters. - -Example: - -```shell - slinkyd q marketmap params -``` diff --git a/x/marketmap/client/cli/query.go b/x/marketmap/client/cli/query.go index 46a1ca020..d4a9d27f2 100644 --- a/x/marketmap/client/cli/query.go +++ b/x/marketmap/client/cli/query.go @@ -5,10 +5,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" + slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/x/marketmap/types" ) -// GetQueryCmd returns the parent command for all x/alerts cli query commands. +// GetQueryCmd returns the parent command for all x/marketmap cli query commands. func GetQueryCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, @@ -22,6 +23,7 @@ func GetQueryCmd() *cobra.Command { CmdQueryParams(), CmdQueryMarketMap(), CmdQueryLastUpdated(), + CmdQueryMarket(), ) return cmd @@ -65,7 +67,39 @@ func CmdQueryMarketMap() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.MarketMap(clientCtx.CmdContext, &types.GetMarketMapRequest{}) + res, err := queryClient.MarketMap(clientCtx.CmdContext, &types.MarketMapRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +func CmdQueryMarket() *cobra.Command { + cmd := &cobra.Command{ + Use: "market", + Short: "Query the a market using the given currency pair", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + cp, err := slinkytypes.CurrencyPairFromString(args[0]) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.Market(clientCtx.CmdContext, &types.MarketRequest{ + CurrencyPair: cp, + }) if err != nil { return err } @@ -90,7 +124,7 @@ func CmdQueryLastUpdated() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.LastUpdated(clientCtx.CmdContext, &types.GetLastUpdatedRequest{}) + res, err := queryClient.LastUpdated(clientCtx.CmdContext, &types.LastUpdatedRequest{}) if err != nil { return err } diff --git a/x/marketmap/keeper/genesis.go b/x/marketmap/keeper/genesis.go index f9fd608d1..630b7ded3 100644 --- a/x/marketmap/keeper/genesis.go +++ b/x/marketmap/keeper/genesis.go @@ -1,8 +1,6 @@ package keeper import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/skip-mev/slinky/x/marketmap/types" @@ -18,18 +16,8 @@ func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) { panic(err) } - for _, ticker := range gs.MarketMap.Tickers { - paths, ok := gs.MarketMap.Paths[ticker.String()] - if !ok { - panic(fmt.Errorf("paths for ticker %s not found", ticker.String())) - } - - providers, ok := gs.MarketMap.Providers[ticker.String()] - if !ok { - panic(fmt.Errorf("providers for ticker %s not found", ticker.String())) - } - - if err := k.CreateMarket(ctx, ticker, paths, providers); err != nil { + for _, market := range gs.MarketMap.Markets { + if err := k.CreateMarket(ctx, market); err != nil { panic(err) } } @@ -42,39 +30,33 @@ func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) { panic(err) } - if err := k.hooks.LegacyAfterMarketGenesis(ctx, gs.MarketMap.Tickers); err != nil { + if err := k.hooks.AfterMarketGenesis(ctx, gs.MarketMap.Markets); err != nil { panic(err) } } // ExportGenesis retrieves the genesis from state. func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - tickers, err := k.GetAllTickersMap(ctx) + markets, err := k.GetAllMarkets(ctx) if err != nil { panic(err) } - paths, err := k.GetAllPathsMap(ctx) - if err != nil { - panic(err) - } - - providers, err := k.GetAllProvidersMap(ctx) + lastUpdated, err := k.GetLastUpdated(ctx) if err != nil { panic(err) } - lastUpdated, err := k.GetLastUpdated(ctx) + params, err := k.GetParams(ctx) if err != nil { panic(err) } return &types.GenesisState{ MarketMap: types.MarketMap{ - Tickers: tickers, - Paths: paths, - Providers: providers, + Markets: markets, }, LastUpdated: lastUpdated, + Params: params, } } diff --git a/x/marketmap/keeper/genesis_test.go b/x/marketmap/keeper/genesis_test.go index 4147f1a36..6ff52c1d2 100644 --- a/x/marketmap/keeper/genesis_test.go +++ b/x/marketmap/keeper/genesis_test.go @@ -13,8 +13,7 @@ func (s *KeeperTestSuite) TestInitGenesisInvalidGenesis() { gs := types.GenesisState{ MarketMap: types.DefaultGenesisState().MarketMap, Params: types.Params{ - MarketAuthority: "invalid", - Version: 0, + MarketAuthorities: []string{"invalid"}, }, } @@ -29,20 +28,10 @@ func (s *KeeperTestSuite) TestInitGenesisInvalidGenesis() { gs := types.DefaultGenesisState() gs.MarketMap = types.MarketMap{ - Tickers: map[string]types.Ticker{ - ethusdt.String(): ethusdt, - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - }, - Paths: map[string]types.Paths{ - ethusdt.String(): ethusdtPaths, - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - }, - Providers: map[string]types.Providers{ - ethusdt.String(): ethusdtProviders, - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): ethusdt, + btcusdt.Ticker.String(): btcusdt, + usdcusd.Ticker.String(): usdcusd, }, } @@ -54,38 +43,51 @@ func (s *KeeperTestSuite) TestInitGenesisInvalidGenesis() { }) } -func (s *KeeperTestSuite) TestInitGenesisValid() { - s.Run("init valid default genesis", func() { +func (s *KeeperTestSuite) TestInitExportGenesisValid() { + s.Run("init valid default genesis and export", func() { gs := types.DefaultGenesisState() s.Require().NotPanics(func() { s.keeper.InitGenesis(s.ctx, *gs) }) + + var gotState *types.GenesisState + s.Require().NotPanics(func() { + gotState = s.keeper.ExportGenesis(s.ctx) + }) + + s.Require().Equal(gs, gotState) }) s.Run("init valid genesis with fields", func() { // first register x/oracle genesis ogs := oracletypes.DefaultGenesisState() - ogs.NextId = 3 + ogs.NextId = 4 ogs.CurrencyPairGenesis = []oracletypes.CurrencyPairGenesis{ { - CurrencyPair: ethusdt.CurrencyPair, + CurrencyPair: ethusdt.Ticker.CurrencyPair, CurrencyPairPrice: &oracletypes.QuotePrice{Price: sdkmath.NewInt(19)}, Nonce: 0, Id: 0, }, { - CurrencyPair: btcusdt.CurrencyPair, + CurrencyPair: btcusdt.Ticker.CurrencyPair, CurrencyPairPrice: &oracletypes.QuotePrice{Price: sdkmath.NewInt(19)}, Nonce: 0, Id: 1, }, { - CurrencyPair: usdcusd.CurrencyPair, + CurrencyPair: usdcusd.Ticker.CurrencyPair, CurrencyPairPrice: nil, Nonce: 0, Id: 2, }, + { + CurrencyPair: usdtusd.Ticker.CurrencyPair, + CurrencyPairPrice: nil, + Nonce: 0, + Id: 3, + }, } s.Require().NotPanics(func() { @@ -94,37 +96,22 @@ func (s *KeeperTestSuite) TestInitGenesisValid() { gs := types.DefaultGenesisState() gs.MarketMap = types.MarketMap{ - Tickers: map[string]types.Ticker{ - ethusdt.String(): ethusdt, - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - }, - Paths: map[string]types.Paths{ - ethusdt.String(): ethusdtPaths, - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - }, - Providers: map[string]types.Providers{ - ethusdt.String(): ethusdtProviders, - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, - }, + Markets: marketsMap, } s.Require().NotPanics(func() { s.keeper.InitGenesis(s.ctx, *gs) }) - gotTickers, err := s.keeper.GetAllTickersMap(s.ctx) + gotMarkets, err := s.keeper.GetAllMarkets(s.ctx) s.Require().NoError(err) - s.Require().Equal(gs.MarketMap.Tickers, gotTickers) + s.Require().Equal(gs.MarketMap.Markets, gotMarkets) - gotPaths, err := s.keeper.GetAllPathsMap(s.ctx) - s.Require().NoError(err) - s.Require().Equal(gs.MarketMap.Paths, gotPaths) + var gotState *types.GenesisState + s.Require().NotPanics(func() { + gotState = s.keeper.ExportGenesis(s.ctx) + }) - gotProviders, err := s.keeper.GetAllProvidersMap(s.ctx) - s.Require().NoError(err) - s.Require().Equal(gs.MarketMap.Providers, gotProviders) + s.Require().Equal(gs, gotState) }) } diff --git a/x/marketmap/keeper/grpc_query.go b/x/marketmap/keeper/grpc_query.go deleted file mode 100644 index 8575c242a..000000000 --- a/x/marketmap/keeper/grpc_query.go +++ /dev/null @@ -1,96 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/slinky/x/marketmap/types" -) - -type queryServerImpl struct { - k *Keeper -} - -// NewQueryServer returns an implementation of the x/marketmap QueryServer. -func NewQueryServer(k *Keeper) types.QueryServer { - return &queryServerImpl{k} -} - -// MarketMap returns the full MarketMap and associated information stored in the x/marketmap module. -func (q queryServerImpl) MarketMap(goCtx context.Context, req *types.GetMarketMapRequest) (*types.GetMarketMapResponse, error) { - if req == nil { - return nil, fmt.Errorf("request cannot be nil") - } - - // unwrap the context - ctx := sdk.UnwrapSDKContext(goCtx) - - tickers, err := q.k.GetAllTickersMap(ctx) - if err != nil { - return nil, err - } - - paths, err := q.k.GetAllPathsMap(ctx) - if err != nil { - return nil, err - } - - providers, err := q.k.GetAllProvidersMap(ctx) - if err != nil { - return nil, err - } - - params, err := q.k.GetParams(ctx) - if err != nil { - return nil, err - } - - lastUpdated, err := q.k.GetLastUpdated(ctx) - return &types.GetMarketMapResponse{ - MarketMap: types.MarketMap{ - Tickers: tickers, - Paths: paths, - Providers: providers, - }, - LastUpdated: lastUpdated, - Version: params.Version, - ChainId: ctx.ChainID(), - }, - err -} - -// Params returns the parameters stored in the x/marketmap module. -func (q queryServerImpl) Params(goCtx context.Context, req *types.ParamsRequest) (*types.ParamsResponse, error) { - if req == nil { - return nil, fmt.Errorf("request cannot be nil") - } - - // unwrap the context - ctx := sdk.UnwrapSDKContext(goCtx) - - params, err := q.k.params.Get(ctx) - if err != nil { - return nil, err - } - - return &types.ParamsResponse{Params: params}, nil -} - -// LastUpdated returns the last height the marketmap was updated in the x/marketmap module. -func (q queryServerImpl) LastUpdated(goCtx context.Context, req *types.GetLastUpdatedRequest) (*types.GetLastUpdatedResponse, error) { - if req == nil { - return nil, fmt.Errorf("request cannot be nil") - } - - // unwrap the context - ctx := sdk.UnwrapSDKContext(goCtx) - - lastUpdated, err := q.k.lastUpdated.Get(ctx) - if err != nil { - return nil, err - } - - return &types.GetLastUpdatedResponse{LastUpdated: lastUpdated}, nil -} diff --git a/x/marketmap/keeper/grpc_query_test.go b/x/marketmap/keeper/grpc_query_test.go deleted file mode 100644 index 214cf25c1..000000000 --- a/x/marketmap/keeper/grpc_query_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package keeper_test - -import ( - "github.com/skip-mev/slinky/x/marketmap/keeper" - "github.com/skip-mev/slinky/x/marketmap/types" -) - -func (s *KeeperTestSuite) TestMarketMap() { - qs := keeper.NewQueryServer(s.keeper) - s.ctx = s.ctx.WithChainID("test-chain") - - s.Run("invalid for nil request", func() { - _, err := qs.MarketMap(s.ctx, nil) - s.Require().Error(err) - }) - - s.Run("run query with no state", func() { - resp, err := qs.MarketMap(s.ctx, &types.GetMarketMapRequest{}) - s.Require().NoError(err) - - expected := &types.GetMarketMapResponse{ - MarketMap: types.MarketMap{ - Tickers: make(map[string]types.Ticker), - Paths: make(map[string]types.Paths), - Providers: make(map[string]types.Providers), - }, - LastUpdated: uint64(s.ctx.BlockHeight()), - Version: 10, - ChainId: "test-chain", - } - - s.Require().Equal(expected, resp) - }) - - s.Run("run query with state", func() { - expectedMarketMap := types.MarketMap{ - Tickers: make(map[string]types.Ticker), - Paths: make(map[string]types.Paths), - Providers: make(map[string]types.Providers), - } - for _, ticker := range markets.tickers { - marketPaths, ok := markets.paths[ticker.String()] - s.Require().True(ok) - marketProviders, ok := markets.providers[ticker.String()] - s.Require().True(ok) - s.Require().NoError(s.keeper.CreateMarket(s.ctx, ticker, marketPaths, marketProviders)) - expectedMarketMap.Tickers[ticker.String()] = ticker - expectedMarketMap.Paths[ticker.String()] = marketPaths - expectedMarketMap.Providers[ticker.String()] = marketProviders - } - - resp, err := qs.MarketMap(s.ctx, &types.GetMarketMapRequest{}) - s.Require().NoError(err) - - expected := &types.GetMarketMapResponse{ - MarketMap: expectedMarketMap, - LastUpdated: uint64(s.ctx.BlockHeight()), - ChainId: "test-chain", - } - - s.Require().Equal(expected.LastUpdated, resp.LastUpdated) - s.Require().Equal(expected.MarketMap, resp.MarketMap) - }) -} - -func (s *KeeperTestSuite) TestParams() { - params := types.DefaultParams() - s.Require().NoError(s.keeper.SetParams(s.ctx, params)) - - qs := keeper.NewQueryServer(s.keeper) - - s.Run("run valid request", func() { - resp, err := qs.Params(s.ctx, &types.ParamsRequest{}) - s.Require().NoError(err) - - s.Require().Equal(params, resp.Params) - }) - - s.Run("run invalid nil request", func() { - _, err := qs.Params(s.ctx, nil) - s.Require().Error(err) - }) -} - -func (s *KeeperTestSuite) TestLastUpdated() { - qs := keeper.NewQueryServer(s.keeper) - // set initial states - for _, ticker := range markets.tickers { - marketPaths, ok := markets.paths[ticker.String()] - s.Require().True(ok) - marketProviders, ok := markets.providers[ticker.String()] - s.Require().True(ok) - s.Require().NoError(s.keeper.CreateMarket(s.ctx, ticker, marketPaths, marketProviders)) - } - - s.Run("run valid request", func() { - resp, err := qs.LastUpdated(s.ctx, &types.GetLastUpdatedRequest{}) - s.Require().NoError(err) - - s.Require().Equal(uint64(s.ctx.BlockHeight()), resp.LastUpdated) - }) - - s.Run("run invalid nil request", func() { - _, err := qs.LastUpdated(s.ctx, nil) - s.Require().Error(err) - }) -} diff --git a/x/marketmap/keeper/keeper.go b/x/marketmap/keeper/keeper.go index 211f906c2..1da68b780 100644 --- a/x/marketmap/keeper/keeper.go +++ b/x/marketmap/keeper/keeper.go @@ -8,7 +8,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/x/marketmap/types" ) @@ -22,17 +21,9 @@ type Keeper struct { // registered hooks hooks types.MarketMapHooks - // tickers is keyed by CurrencyPair string (BASE/QUOTE) and contains - // the list of all Tickers. - tickers collections.Map[types.TickerString, types.Ticker] - - // paths is keyed by CurrencyPair string (BASE/QUOTE) and contains - // the list of all Paths. - paths collections.Map[types.TickerString, types.Paths] - - // providers is keyed by CurrencyPair string (BASE/QUOTE) and contains - // the list of all Providers. - providers collections.Map[types.TickerString, types.Providers] + // markets is keyed by CurrencyPair string (BASE/QUOTE) and contains + // the list of all Markets. + markets collections.Map[types.TickerString, types.Market] // lastUpdated is the last block height the marketmap was updated. lastUpdated collections.Item[uint64] @@ -56,9 +47,7 @@ func NewKeeper(ss store.KVStoreService, cdc codec.BinaryCodec, authority sdk.Acc return &Keeper{ cdc: cdc, authority: authority, - tickers: collections.NewMap(sb, types.TickersPrefix, "tickers", types.TickersCodec, codec.CollValue[types.Ticker](cdc)), - paths: collections.NewMap(sb, types.PathsPrefix, "paths", types.TickersCodec, codec.CollValue[types.Paths](cdc)), - providers: collections.NewMap(sb, types.ProvidersPrefix, "providers", types.TickersCodec, codec.CollValue[types.Providers](cdc)), + markets: collections.NewMap(sb, types.MarketsPrefix, "markets", types.TickersCodec, codec.CollValue[types.Market](cdc)), lastUpdated: collections.NewItem[uint64](sb, types.LastUpdatedPrefix, "last_updated", types.LastUpdatedCodec), params: params, } @@ -74,28 +63,15 @@ func (k *Keeper) GetLastUpdated(ctx sdk.Context) (uint64, error) { return k.lastUpdated.Get(ctx) } -// GetTicker returns a ticker from the store by its currency pair string ID. -func (k *Keeper) GetTicker(ctx sdk.Context, tickerStr string) (types.Ticker, error) { - return k.tickers.Get(ctx, types.TickerString(tickerStr)) -} - -// GetAllTickers returns the set of Ticker objects currently stored in state. -func (k *Keeper) GetAllTickers(ctx sdk.Context) ([]types.Ticker, error) { - iter, err := k.tickers.Iterate(ctx, nil) - if err != nil { - return nil, err - } - tickers, err := iter.Values() - if err != nil { - return nil, err - } - return tickers, err +// GetMarket returns a market from the store by its currency pair string ID. +func (k *Keeper) GetMarket(ctx sdk.Context, tickerStr string) (types.Market, error) { + return k.markets.Get(ctx, types.TickerString(tickerStr)) } -// GetAllTickersMap returns the set of Ticker objects currently stored in state -// as a map[TickerString] -> Tickers. -func (k *Keeper) GetAllTickersMap(ctx sdk.Context) (map[string]types.Ticker, error) { - iter, err := k.tickers.Iterate(ctx, nil) +// GetAllMarkets returns the set of Market objects currently stored in state +// as a map[TickerString] -> Markets. +func (k *Keeper) GetAllMarkets(ctx sdk.Context) (map[string]types.Market, error) { + iter, err := k.markets.Iterate(ctx, nil) if err != nil { return nil, err } @@ -104,7 +80,7 @@ func (k *Keeper) GetAllTickersMap(ctx sdk.Context) (map[string]types.Ticker, err return nil, err } - m := make(map[string]types.Ticker, len(keyValues)) + m := make(map[string]types.Market, len(keyValues)) for _, keyValue := range keyValues { m[string(keyValue.Key)] = keyValue.Value } @@ -112,109 +88,34 @@ func (k *Keeper) GetAllTickersMap(ctx sdk.Context) (map[string]types.Ticker, err return m, nil } -// CreateTicker initializes a new Ticker. +// CreateMarket initializes a new Market. // The Ticker.String corresponds to a market, and must be unique. -func (k *Keeper) CreateTicker(ctx sdk.Context, ticker types.Ticker) error { - tickerString := types.TickerString(ticker.String()) - +func (k *Keeper) CreateMarket(ctx sdk.Context, market types.Market) error { // Check if Ticker already exists for the provider - alreadyExists, err := k.tickers.Has(ctx, tickerString) - if err != nil { - return err - } - if alreadyExists { - return types.NewTickerAlreadyExistsError(tickerString) - } - // Create the config - return k.tickers.Set(ctx, tickerString, ticker) -} - -// GetAllProvidersMap returns the set of Providers objects currently stored in state -// as a map[TickerString] -> Providers. -func (k *Keeper) GetAllProvidersMap(ctx sdk.Context) (map[string]types.Providers, error) { - iter, err := k.providers.Iterate(ctx, nil) - if err != nil { - return nil, err - } - keyValues, err := iter.KeyValues() - if err != nil { - return nil, err - } - - m := make(map[string]types.Providers, len(keyValues)) - for _, keyValue := range keyValues { - m[string(keyValue.Key)] = keyValue.Value - } - - return m, nil -} - -// CreateProviders initializes a new providers. -// The Ticker.String corresponds to a market, and must be unique. -func (k *Keeper) CreateProviders(ctx sdk.Context, providers types.Providers, ticker types.Ticker) error { - // Check if MarketConfig already exists for the provider - alreadyExists, err := k.providers.Has(ctx, types.TickerString(ticker.String())) + alreadyExists, err := k.markets.Has(ctx, types.TickerString(market.Ticker.String())) if err != nil { return err } if alreadyExists { - return types.NewTickerAlreadyExistsError(types.TickerString(ticker.String())) + return types.NewMarketAlreadyExistsError(types.TickerString(market.Ticker.String())) } // Create the config - return k.providers.Set(ctx, types.TickerString(ticker.String()), providers) + return k.markets.Set(ctx, types.TickerString(market.Ticker.String()), market) } -// GetAllPathsMap returns the set of Paths objects currently stored in state -// as a map[TickerString] -> Paths. -func (k *Keeper) GetAllPathsMap(ctx sdk.Context) (map[string]types.Paths, error) { - iter, err := k.paths.Iterate(ctx, nil) - if err != nil { - return nil, err - } - keyValues, err := iter.KeyValues() - if err != nil { - return nil, err - } - - m := make(map[string]types.Paths, len(keyValues)) - for _, keyValue := range keyValues { - m[string(keyValue.Key)] = keyValue.Value - } - - return m, nil -} - -// CreatePaths initializes a new Paths. -// The Ticker.String corresponds to a market, and must be unique. -func (k *Keeper) CreatePaths(ctx sdk.Context, paths types.Paths, ticker types.Ticker) error { - // Check if MarketConfig already exists for the provider - alreadyExists, err := k.paths.Has(ctx, types.TickerString(ticker.String())) +// UpdateMarket updates a Market. +// The Ticker.String corresponds to a market, and exist unique. +func (k *Keeper) UpdateMarket(ctx sdk.Context, market types.Market) error { + // Check if Ticker already exists for the provider + alreadyExists, err := k.markets.Has(ctx, types.TickerString(market.Ticker.String())) if err != nil { return err } - if alreadyExists { - return types.NewTickerAlreadyExistsError(types.TickerString(ticker.String())) + if !alreadyExists { + return types.NewMarketDoesNotExistsError(types.TickerString(market.Ticker.String())) } // Create the config - return k.paths.Set(ctx, types.TickerString(ticker.String()), paths) -} - -// CreateMarket sets the ticker, paths, and providers for a given market. It also -// sets the LastUpdated field to the current block height. -func (k *Keeper) CreateMarket(ctx sdk.Context, ticker types.Ticker, paths types.Paths, providers types.Providers) error { - if err := k.CreateTicker(ctx, ticker); err != nil { - return err - } - - if err := k.CreatePaths(ctx, paths, ticker); err != nil { - return err - } - - if err := k.CreateProviders(ctx, providers, ticker); err != nil { - return err - } - - return k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) + return k.markets.Set(ctx, types.TickerString(market.Ticker.String()), market) } // SetParams sets the x/marketmap module's parameters. @@ -229,29 +130,32 @@ func (k *Keeper) GetParams(ctx sdk.Context) (types.Params, error) { // ValidateState is called after keeper modifications have been made to the market map to verify that // the aggregate of all updates has led to a valid state. -func (k *Keeper) ValidateState(ctx sdk.Context, creates []types.CreateMarket) error { - for _, create := range creates { - // check that all paths already exist in the keeper store: - for _, path := range create.Paths.Paths { - for _, op := range path.Operations { - cp := op.CurrencyPair - if op.Invert { - cp = slinkytypes.CurrencyPair{ - Base: cp.Quote, - Quote: cp.Base, - } - } +func (k *Keeper) ValidateState(ctx sdk.Context, updates []types.Market) error { + for _, market := range updates { + if err := k.IsMarketValid(ctx, market); err != nil { + return err + } + } + + return nil +} - has, err := k.tickers.Has(ctx, types.TickerString(cp.String())) - if err != nil { - return err - } +// IsMarketValid checks if a market is valid by statefully checking if each of the currency pairs +// specified by its provider configs are valid and in state. +func (k *Keeper) IsMarketValid(ctx sdk.Context, market types.Market) error { + // check that all markets already exist in the keeper store: + for _, providerConfig := range market.ProviderConfigs { + if providerConfig.NormalizeByPair != nil { + has, err := k.markets.Has(ctx, types.TickerString(providerConfig.NormalizeByPair.String())) + if err != nil { + return err + } - if !has { - return fmt.Errorf("currency pair %s in path %s does not exist", cp.String(), path.ShowRoute()) - } + if !has { + return fmt.Errorf("currency pair %s in provider config does not exist", providerConfig.NormalizeByPair.String()) } } } + return nil } diff --git a/x/marketmap/keeper/keeper_test.go b/x/marketmap/keeper/keeper_test.go index 5d6234664..3731d849b 100644 --- a/x/marketmap/keeper/keeper_test.go +++ b/x/marketmap/keeper/keeper_test.go @@ -3,6 +3,11 @@ package keeper_test import ( "testing" + "github.com/skip-mev/chaintestutil/sample" + + oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" + oracletypes "github.com/skip-mev/slinky/x/oracle/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" @@ -13,21 +18,22 @@ import ( slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/skip-mev/slinky/x/marketmap/types" - oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" - oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) +var r = sample.Rand() + type KeeperTestSuite struct { suite.Suite ctx sdk.Context // Keeper variables - authority sdk.AccAddress + authority sdk.AccAddress + marketAuthorities []string + admin string + keeper *keeper.Keeper oracleKeeper oraclekeeper.Keeper - - hooks types.MarketMapHooks } func (s *KeeperTestSuite) initKeeper() *keeper.Keeper { @@ -53,17 +59,24 @@ func (s *KeeperTestSuite) initKeeper() *keeper.Keeper { k := keeper.NewKeeper(mmSS, encCfg.Codec, s.authority) s.Require().NoError(k.SetLastUpdated(s.ctx, uint64(s.ctx.BlockHeight()))) - params := types.NewParams(s.authority.String(), 10) + s.admin = sample.Address(r) + s.marketAuthorities = []string{sample.Address(r), sample.Address(r), sample.Address(r)} + + params := types.Params{ + MarketAuthorities: s.marketAuthorities, + Admin: s.admin, + } s.Require().NoError(k.SetParams(s.ctx, params)) - s.oracleKeeper = oraclekeeper.NewKeeper(oracleSS, encCfg.Codec, nil, s.authority) - s.hooks = types.MultiMarketMapHooks{ + s.oracleKeeper = oraclekeeper.NewKeeper(oracleSS, encCfg.Codec, k, s.authority) + hooks := types.MultiMarketMapHooks{ s.oracleKeeper.Hooks(), } + k.SetHooks(hooks) - oracleGenesis := oracletypes.DefaultGenesisState() - s.Require().NotPanics(func() { s.oracleKeeper.InitGenesis(s.ctx, *oracleGenesis) }) - k.SetHooks(s.hooks) + s.Require().NotPanics(func() { + s.oracleKeeper.InitGenesis(s.ctx, *oracletypes.DefaultGenesisState()) + }) return k } @@ -77,33 +90,16 @@ func TestKeeperTestSuite(t *testing.T) { } var ( - btcusdt = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - } - - btcusdtPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - }, - }, + btcusdt = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USDT", }, + Decimals: 8, + MinProviderCount: 1, }, - } - - btcusdtProviders = types.Providers{ - Providers: []types.ProviderConfig{ + ProviderConfigs: []types.ProviderConfig{ { Name: "kucoin", OffChainTicker: "btc-usdt", @@ -111,33 +107,16 @@ var ( }, } - usdtusd = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - } - - usdtusdPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - }, - }, + usdtusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "USDT", + Quote: "USD", }, + Decimals: 8, + MinProviderCount: 1, }, - } - - usdtusdProviders = types.Providers{ - Providers: []types.ProviderConfig{ + ProviderConfigs: []types.ProviderConfig{ { Name: "kucoin", OffChainTicker: "usdt-usd", @@ -145,33 +124,16 @@ var ( }, } - usdcusd = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - } - - usdcusdPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - }, - }, + usdcusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "USDC", + Quote: "USD", }, + Decimals: 8, + MinProviderCount: 1, }, - } - - usdcusdProviders = types.Providers{ - Providers: []types.ProviderConfig{ + ProviderConfigs: []types.ProviderConfig{ { Name: "kucoin", OffChainTicker: "usdc-usd", @@ -179,33 +141,16 @@ var ( }, } - ethusdt = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - } - - ethusdtPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - }, - }, + ethusdt = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "ETHEREUM", + Quote: "USDT", }, + Decimals: 8, + MinProviderCount: 1, }, - } - - ethusdtProviders = types.Providers{ - Providers: []types.ProviderConfig{ + ProviderConfigs: []types.ProviderConfig{ { Name: "kucoin", OffChainTicker: "eth-usdt", @@ -213,83 +158,48 @@ var ( }, } - tickers = map[string]types.Ticker{ - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - usdtusd.String(): usdtusd, - ethusdt.String(): ethusdt, + markets = []types.Market{ + btcusdt, + usdcusd, + usdtusd, + ethusdt, } - paths = map[string]types.Paths{ - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - usdtusd.String(): usdtusdPaths, - ethusdt.String(): ethusdtPaths, - } - - providers = map[string]types.Providers{ - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, - usdtusd.String(): usdtusdProviders, - ethusdt.String(): ethusdtProviders, - } - - markets = struct { - tickers map[string]types.Ticker - paths map[string]types.Paths - providers map[string]types.Providers - }{ - tickers: tickers, - paths: paths, - providers: providers, + marketsMap = map[string]types.Market{ + btcusdt.Ticker.String(): btcusdt, + usdcusd.Ticker.String(): usdcusd, + usdtusd.Ticker.String(): usdtusd, + ethusdt.Ticker.String(): ethusdt, } ) func (s *KeeperTestSuite) TestGets() { - s.Run("get no tickers", func() { - got, err := s.keeper.GetAllTickers(s.ctx) + s.Run("get empty market map", func() { + got, err := s.keeper.GetAllMarkets(s.ctx) s.Require().NoError(err) - s.Require().Equal([]types.Ticker(nil), got) + s.Require().Equal(map[string]types.Market{}, got) }) s.Run("setup initial markets", func() { - for _, ticker := range markets.tickers { - marketPaths, ok := markets.paths[ticker.String()] - s.Require().True(ok) - marketProviders, ok := markets.providers[ticker.String()] - s.Require().True(ok) - s.Require().NoError(s.keeper.CreateMarket(s.ctx, ticker, marketPaths, marketProviders)) + for _, market := range markets { + s.Require().NoError(s.keeper.CreateMarket(s.ctx, market)) } s.Run("unable to set markets again", func() { - for _, ticker := range markets.tickers { - s.Require().ErrorIs(s.keeper.CreateTicker(s.ctx, ticker), types.NewTickerAlreadyExistsError(types.TickerString(ticker.String()))) + for _, market := range markets { + s.Require().ErrorIs(s.keeper.CreateMarket(s.ctx, market), types.NewMarketAlreadyExistsError(types.TickerString(market.Ticker.String()))) } }) - }) - s.Run("get all tickers", func() { - got, err := s.keeper.GetAllTickersMap(s.ctx) - s.Require().NoError(err) - - s.Require().Equal(len(tickers), len(got)) - s.Require().Equal(tickers, got) - }) - - s.Run("get all paths", func() { - got, err := s.keeper.GetAllPathsMap(s.ctx) - s.Require().NoError(err) - - s.Require().Equal(len(paths), len(got)) - s.Require().Equal(paths, got) + s.Require().NoError(s.keeper.ValidateState(s.ctx, markets)) }) - s.Run("get all providers", func() { - got, err := s.keeper.GetAllProvidersMap(s.ctx) + s.Run("get all tickers", func() { + got, err := s.keeper.GetAllMarkets(s.ctx) s.Require().NoError(err) - s.Require().Equal(len(providers), len(got)) - s.Require().Equal(providers, got) + s.Require().Equal(len(markets), len(got)) + s.Require().Equal(marketsMap, got) }) } @@ -305,3 +215,60 @@ func (s *KeeperTestSuite) TestSetParams() { s.Require().Equal(params, params2) }) } + +func (s *KeeperTestSuite) TestInvalidCreate() { + // invalid market with a normalize pair not in state + invalidMarket := types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USDT", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-usdt", + NormalizeByPair: &slinkytypes.CurrencyPair{Base: "invalid", Quote: "pair"}, + }, + }, + } + + s.Require().NoError(s.keeper.CreateMarket(s.ctx, invalidMarket)) + s.Require().Error(s.keeper.ValidateState(s.ctx, []types.Market{invalidMarket})) +} + +func (s *KeeperTestSuite) TestInvalidUpdate() { + // create a valid market + s.Require().NoError(s.keeper.CreateMarket(s.ctx, btcusdt)) + + // invalid market with a normalize pair not in state + invalidMarket := btcusdt + invalidMarket.ProviderConfigs = append(invalidMarket.ProviderConfigs, types.ProviderConfig{ + Name: "huobi", + OffChainTicker: "btc-usdt", + NormalizeByPair: &slinkytypes.CurrencyPair{Base: "invalid", Quote: "pair"}, + }) + + s.Require().NoError(s.keeper.UpdateMarket(s.ctx, invalidMarket)) + s.Require().Error(s.keeper.ValidateState(s.ctx, []types.Market{invalidMarket})) +} + +func (s *KeeperTestSuite) TestValidUpdate() { + // create a valid markets + s.Require().NoError(s.keeper.CreateMarket(s.ctx, btcusdt)) + s.Require().NoError(s.keeper.CreateMarket(s.ctx, ethusdt)) + + // valid market with a normalize pair that is in state + validMarket := btcusdt + validMarket.ProviderConfigs = append(validMarket.ProviderConfigs, types.ProviderConfig{ + Name: "huobi", + OffChainTicker: "btc-usdt", + NormalizeByPair: ðusdt.Ticker.CurrencyPair, + }) + + s.Require().NoError(s.keeper.UpdateMarket(s.ctx, validMarket)) + s.Require().NoError(s.keeper.ValidateState(s.ctx, []types.Market{validMarket})) +} diff --git a/x/marketmap/keeper/msg_server.go b/x/marketmap/keeper/msg_server.go index 65c36b0b6..e3b933d1d 100644 --- a/x/marketmap/keeper/msg_server.go +++ b/x/marketmap/keeper/msg_server.go @@ -3,6 +3,7 @@ package keeper import ( "context" "fmt" + "slices" "strconv" sdk "github.com/cosmos/cosmos-sdk/types" @@ -22,9 +23,9 @@ func NewMsgServer(k *Keeper) types.MsgServer { var _ types.MsgServer = (*msgServer)(nil) -// UpdateMarketMap updates the marketmap from the given message. All updates are made to the market map and then -// the resulting final state is checked to verify that the end state is valid. -func (ms msgServer) UpdateMarketMap(goCtx context.Context, msg *types.MsgUpdateMarketMap) (*types.MsgUpdateMarketMapResponse, error) { +// CreateMarkets updates the marketmap by creating markets from the given message. All updates are made to the market +// map and then the resulting final state is checked to verify that the end state is valid. +func (ms msgServer) CreateMarkets(goCtx context.Context, msg *types.MsgCreateMarkets) (*types.MsgCreateMarketsResponse, error) { if msg == nil { return nil, fmt.Errorf("unable to process nil msg") } @@ -36,20 +37,21 @@ func (ms msgServer) UpdateMarketMap(goCtx context.Context, msg *types.MsgUpdateM return nil, fmt.Errorf("unable to get marketmap params: %w", err) } - if msg.Signer != params.MarketAuthority { - return nil, fmt.Errorf("request signer %s does not match module market authority %s", msg.Signer, params.MarketAuthority) + found := checkMarketAuthority(msg.Authority, params) + if !found { + return nil, fmt.Errorf("request signer %s does not match module market authorities", msg.Authority) } // create markets for _, market := range msg.CreateMarkets { - err = ms.k.CreateMarket(ctx, market.Ticker, market.Paths, market.Providers) + err = ms.k.CreateMarket(ctx, market) if err != nil { return nil, err } - err = ms.k.hooks.LegacyAfterMarketCreated(ctx, market.Ticker) + err = ms.k.hooks.AfterMarketCreated(ctx, market) if err != nil { - return nil, fmt.Errorf("unable to handle hook for ticker %s: %w", market.Ticker.String(), err) + return nil, fmt.Errorf("unable to run create market hook: %w", err) } event := sdk.NewEvent( @@ -58,22 +60,67 @@ func (ms msgServer) UpdateMarketMap(goCtx context.Context, msg *types.MsgUpdateM sdk.NewAttribute(types.AttributeKeyDecimals, strconv.FormatUint(market.Ticker.Decimals, 10)), sdk.NewAttribute(types.AttributeKeyMinProviderCount, strconv.FormatUint(market.Ticker.MinProviderCount, 10)), sdk.NewAttribute(types.AttributeKeyMetadata, market.Ticker.Metadata_JSON), - sdk.NewAttribute(types.AttributeKeyProviders, market.Providers.String()), - sdk.NewAttribute(types.AttributeKeyPaths, market.Paths.String()), ) ctx.EventManager().EmitEvent(event) } - // update markets - // TODO - // validate that the new state of the marketmap is valid err = ms.k.ValidateState(ctx, msg.CreateMarkets) if err != nil { return nil, fmt.Errorf("invalid state resulting from update: %w", err) } - return &types.MsgUpdateMarketMapResponse{}, nil + return &types.MsgCreateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) +} + +// UpdateMarkets updates the marketmap by updating markets from the given message. All updates are made to the market +// map and then the resulting final state is checked to verify that the end state is valid. +func (ms msgServer) UpdateMarkets(goCtx context.Context, msg *types.MsgUpdateMarkets) (*types.MsgUpdateMarketsResponse, error) { + if msg == nil { + return nil, fmt.Errorf("unable to process nil msg") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + params, err := ms.k.GetParams(ctx) + if err != nil { + return nil, fmt.Errorf("unable to get marketmap params: %w", err) + } + + found := checkMarketAuthority(msg.Authority, params) + if !found { + return nil, fmt.Errorf("request signer %s does not match module market authorities", msg.Authority) + } + + for _, market := range msg.UpdateMarkets { + err = ms.k.UpdateMarket(ctx, market) + if err != nil { + return nil, fmt.Errorf("unable to update market: %w", err) + } + + err = ms.k.hooks.AfterMarketUpdated(ctx, market) + if err != nil { + return nil, fmt.Errorf("unable to run update market hook: %w", err) + } + + event := sdk.NewEvent( + types.EventTypeUpdateMarket, + sdk.NewAttribute(types.AttributeKeyCurrencyPair, market.Ticker.String()), + sdk.NewAttribute(types.AttributeKeyDecimals, strconv.FormatUint(market.Ticker.Decimals, 10)), + sdk.NewAttribute(types.AttributeKeyMinProviderCount, strconv.FormatUint(market.Ticker.MinProviderCount, 10)), + sdk.NewAttribute(types.AttributeKeyMetadata, market.Ticker.Metadata_JSON), + ) + ctx.EventManager().EmitEvent(event) + + } + + // validate that the new state of the marketmap is valid + err = ms.k.ValidateState(ctx, msg.UpdateMarkets) + if err != nil { + return nil, fmt.Errorf("invalid state resulting from update: %w", err) + } + + return &types.MsgUpdateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) } // Params updates the x/marketmap module's Params. @@ -82,24 +129,68 @@ func (ms msgServer) Params(goCtx context.Context, msg *types.MsgParams) (*types. return nil, fmt.Errorf("unable to process nil msg") } - // Update the module's parameters. ctx := sdk.UnwrapSDKContext(goCtx) + + if msg.Authority != ms.k.authority.String() { + return nil, fmt.Errorf("request authority %s does not match module keeper authority %s", msg.Authority, ms.k.authority.String()) + } + + if err := ms.k.SetParams(ctx, msg.Params); err != nil { + return nil, err + } + + return &types.MsgParamsResponse{}, nil +} + +func (ms msgServer) RemoveMarketAuthorities(goCtx context.Context, msg *types.MsgRemoveMarketAuthorities) (*types.MsgRemoveMarketAuthoritiesResponse, error) { + if msg == nil { + return nil, fmt.Errorf("unable to process nil msg") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + params, err := ms.k.GetParams(ctx) if err != nil { return nil, err } - if msg.Authority != ms.k.authority.String() { - return nil, fmt.Errorf("request authority %s does not match module keeper authority %s", msg.Authority, ms.k.authority.String()) + if msg.Admin != params.Admin { + return nil, fmt.Errorf("request admin %s does not match module admin %s", msg.Admin, params.Admin) } - if msg.Params.Version < params.Version { - return nil, fmt.Errorf("request version %d is less than current params version %d", msg.Params.Version, params.Version) + if len(msg.RemoveAddresses) > len(params.MarketAuthorities) { + return nil, fmt.Errorf("remove addresses must be a subset of the current market authorities") } - if err := ms.k.SetParams(ctx, msg.Params); err != nil { + removeAddresses := make(map[string]struct{}, len(msg.RemoveAddresses)) + for _, remove := range msg.RemoveAddresses { + removeAddresses[remove] = struct{}{} + } + + for i, address := range params.MarketAuthorities { + if _, found := removeAddresses[address]; found { + params.MarketAuthorities = slices.Delete(params.MarketAuthorities, i, i+1) + } + } + + if err := ms.k.SetParams(ctx, params); err != nil { return nil, err } - return &types.MsgParamsResponse{}, nil + return &types.MsgRemoveMarketAuthoritiesResponse{}, nil +} + +// checkMarketAuthority checks if the given authority is the x/marketmap's list of MarketAuthorities. +func checkMarketAuthority(authority string, params types.Params) bool { + if len(params.MarketAuthorities) == 0 { + return false + } + + for _, auth := range params.MarketAuthorities { + if authority == auth { + return true + } + } + + return false } diff --git a/x/marketmap/keeper/msg_server_test.go b/x/marketmap/keeper/msg_server_test.go index 302ee8ab2..7acdb6414 100644 --- a/x/marketmap/keeper/msg_server_test.go +++ b/x/marketmap/keeper/msg_server_test.go @@ -1,120 +1,205 @@ package keeper_test import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/skip-mev/chaintestutil/sample" + slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/skip-mev/slinky/x/marketmap/types" ) -func (s *KeeperTestSuite) TestMsgServerCreateMarket() { +func (s *KeeperTestSuite) TestMsgServerCreateMarkets() { msgServer := keeper.NewMsgServer(s.keeper) - qs := keeper.NewQueryServer(s.keeper) // create initial markets - msg := &types.MsgUpdateMarketMap{ - Signer: s.authority.String(), - CreateMarkets: []types.CreateMarket{ - { - Ticker: btcusdt, - Providers: btcusdtProviders, - Paths: btcusdtPaths, - }, - { - Ticker: usdtusd, - Providers: usdtusdProviders, - Paths: usdtusdPaths, - }, + msg := &types.MsgCreateMarkets{ + Authority: s.marketAuthorities[1], + CreateMarkets: []types.Market{ + btcusdt, + usdtusd, }, } - resp, err := msgServer.UpdateMarketMap(s.ctx, msg) + resp, err := msgServer.CreateMarkets(s.ctx, msg) s.Require().NoError(err) s.Require().NotNil(resp) // query the market map - queryResp, err := qs.MarketMap(s.ctx, &types.GetMarketMapRequest{}) + mm, err := s.keeper.GetAllMarkets(s.ctx) s.Require().NoError(err) - s.Require().Equal(queryResp.MarketMap, types.MarketMap{ - Tickers: map[string]types.Ticker{ - btcusdt.String(): btcusdt, - usdtusd.String(): usdtusd, - }, - Paths: map[string]types.Paths{ - btcusdt.String(): btcusdtPaths, - usdtusd.String(): usdtusdPaths, - }, - Providers: map[string]types.Providers{ - btcusdt.String(): btcusdtProviders, - usdtusd.String(): usdtusdProviders, + s.Require().Equal(types.MarketMap{Markets: mm}, types.MarketMap{ + Markets: map[string]types.Market{ + btcusdt.Ticker.String(): btcusdt, + usdtusd.Ticker.String(): usdtusd, }, }) // query the oracle module to see if they were created via hooks cps := s.oracleKeeper.GetAllCurrencyPairs(s.ctx) - s.Require().Equal([]slinkytypes.CurrencyPair{btcusdt.CurrencyPair, usdtusd.CurrencyPair}, cps) + s.Require().Equal([]slinkytypes.CurrencyPair{btcusdt.Ticker.CurrencyPair, usdtusd.Ticker.CurrencyPair}, cps) s.Run("unable to process for invalid authority", func() { - msg = &types.MsgUpdateMarketMap{ - Signer: "invalid", + msg = &types.MsgCreateMarkets{ + Authority: "invalid", } - resp, err = msgServer.UpdateMarketMap(s.ctx, msg) + resp, err = msgServer.CreateMarkets(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + s.Run("unable to process for invalid authority (valid bech32)", func() { + msg = &types.MsgCreateMarkets{ + Authority: sdk.AccAddress("invalid").String(), + } + resp, err = msgServer.CreateMarkets(s.ctx, msg) s.Require().Error(err) s.Require().Nil(resp) }) // set a market in the map s.Run("unable to process nil request", func() { - resp, err = msgServer.UpdateMarketMap(s.ctx, nil) + resp, err = msgServer.CreateMarkets(s.ctx, nil) s.Require().Error(err) s.Require().Nil(resp) }) s.Run("unable to create market that already exists", func() { - msg = &types.MsgUpdateMarketMap{ - Signer: s.authority.String(), - CreateMarkets: []types.CreateMarket{ - { - Ticker: btcusdt, - Providers: btcusdtProviders, - Paths: btcusdtPaths, - }, + msg = &types.MsgCreateMarkets{ + Authority: s.authority.String(), + CreateMarkets: []types.Market{ + btcusdt, }, } - resp, err = msgServer.UpdateMarketMap(s.ctx, msg) + resp, err = msgServer.CreateMarkets(s.ctx, msg) s.Require().Error(err) s.Require().Nil(resp) }) - s.Run("unable to create market with paths that are not on chain tickers", func() { - msg = &types.MsgUpdateMarketMap{ - Signer: s.authority.String(), - CreateMarkets: []types.CreateMarket{ + s.Run("unable to create market with normalize by that is not on chain tickers", func() { + msg = &types.MsgCreateMarkets{ + Authority: s.authority.String(), + CreateMarkets: []types.Market{ { - Ticker: ethusdt, - Providers: ethusdtProviders, - Paths: types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "MOG", - }, - }, - { - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "MOG", - Quote: "USDT", - }, - }, - }, + Ticker: ethusdt.Ticker, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "eth-usdt", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "INVALID", + Quote: "PAIR", }, }, }, }, }, } - resp, err = msgServer.UpdateMarketMap(s.ctx, msg) + resp, err = msgServer.CreateMarkets(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) +} + +func (s *KeeperTestSuite) TestMsgServerUpdateMarkets() { + msgServer := keeper.NewMsgServer(s.keeper) + + // create initial markets + createMsg := &types.MsgCreateMarkets{ + Authority: s.marketAuthorities[0], + CreateMarkets: []types.Market{ + btcusdt, + usdtusd, + }, + } + createResp, err := msgServer.CreateMarkets(s.ctx, createMsg) + s.Require().NoError(err) + s.Require().NotNil(createResp) + + // query the market map + mm, err := s.keeper.GetAllMarkets(s.ctx) + s.Require().NoError(err) + s.Require().Equal(types.MarketMap{Markets: mm}, types.MarketMap{ + Markets: map[string]types.Market{ + btcusdt.Ticker.String(): btcusdt, + usdtusd.Ticker.String(): usdtusd, + }, + }) + + // TODO: test hooks + + s.Run("unable to process for invalid authority", func() { + msg := &types.MsgUpdateMarkets{ + Authority: "invalid", + } + resp, err := msgServer.UpdateMarkets(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + s.Run("unable to process for invalid authority (valid bech32)", func() { + msg := &types.MsgUpdateMarkets{ + Authority: sdk.AccAddress("invalid").String(), + } + resp, err := msgServer.UpdateMarkets(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + // set a market in the map + s.Run("unable to process nil request", func() { + resp, err := msgServer.UpdateMarkets(s.ctx, nil) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + s.Run("able to update market that already exists", func() { + tickerUpdate := btcusdt + tickerUpdate.Ticker.Decimals = 1 + + msg := &types.MsgUpdateMarkets{ + Authority: s.marketAuthorities[2], + UpdateMarkets: []types.Market{ + tickerUpdate, + }, + } + resp, err := msgServer.UpdateMarkets(s.ctx, msg) + s.Require().NoError(err) + s.Require().NotNil(resp) + }) + + s.Run("unable to update when paths refers to non-existent ticker", func() { + tickerUpdate := btcusdt + tickerUpdate.Ticker.Decimals = 1 + tickerUpdate.ProviderConfigs = []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-usdc", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "INVALID", + Quote: "PAIR", + }, + }, + } + + msg := &types.MsgUpdateMarkets{ + Authority: s.authority.String(), + UpdateMarkets: []types.Market{ + tickerUpdate, + }, + } + resp, err := msgServer.UpdateMarkets(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + s.Run("unable to update market if it does not already exist", func() { + msg := &types.MsgUpdateMarkets{ + Authority: s.authority.String(), + UpdateMarkets: []types.Market{ + ethusdt, + }, + } + resp, err := msgServer.UpdateMarkets(s.ctx, msg) s.Require().Error(err) s.Require().Nil(resp) }) @@ -138,42 +223,106 @@ func (s *KeeperTestSuite) TestMsgServerParams() { s.Require().Nil(resp) }) - s.Run("unable to process for version lower than current versions", func() { + s.Run("unable to process for invalid authority (valid bech32)", func() { msg := &types.MsgParams{ - Authority: s.authority.String(), - Params: types.NewParams( - types.DefaultMarketAuthority, - 0, - ), + Authority: sdk.AccAddress("invalid").String(), } resp, err := msgServer.Params(s.ctx, msg) s.Require().Error(err) s.Require().Nil(resp) }) - s.Run("unable to process a req with no params", func() { + s.Run("accepts a req with valid params", func() { msg := &types.MsgParams{ Authority: s.authority.String(), + Params: types.Params{ + MarketAuthorities: []string{types.DefaultMarketAuthority, sample.Address(r)}, + Admin: sample.Address(r), + }, } resp, err := msgServer.Params(s.ctx, msg) + s.Require().NoError(err) + s.Require().NotNil(resp) + + params, err := s.keeper.GetParams(s.ctx) + s.Require().NoError(err) + s.Require().Equal(msg.Params, params) + }) +} + +func (s *KeeperTestSuite) TestMsgServerRemoveMarketAuthorities() { + msgServer := keeper.NewMsgServer(s.keeper) + + s.Run("unable to process nil request", func() { + resp, err := msgServer.RemoveMarketAuthorities(s.ctx, nil) s.Require().Error(err) s.Require().Nil(resp) }) - s.Run("accepts a req with valid params", func() { - msg := &types.MsgParams{ - Authority: s.authority.String(), - Params: types.NewParams( - types.DefaultMarketAuthority, - 11, - ), + s.Run("unable to process for invalid authority", func() { + msg := &types.MsgRemoveMarketAuthorities{ + Admin: "invalid", } - resp, err := msgServer.Params(s.ctx, msg) + resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + }) + + s.Run("accepts a req that removes one authority", func() { + msg := &types.MsgRemoveMarketAuthorities{ + Admin: s.admin, + RemoveAddresses: []string{s.marketAuthorities[0]}, + } + resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) s.Require().NoError(err) s.Require().NotNil(resp) + // check new authorities params, err := s.keeper.GetParams(s.ctx) s.Require().NoError(err) - s.Require().Equal(msg.Params, params) + s.Require().Equal(s.marketAuthorities[1:], params.MarketAuthorities) + + // reset + s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ + MarketAuthorities: s.marketAuthorities, + Admin: s.admin, + })) + }) + + s.Run("accepts a req that removes multiple authorities", func() { + msg := &types.MsgRemoveMarketAuthorities{ + Admin: s.admin, + RemoveAddresses: []string{s.marketAuthorities[0], s.marketAuthorities[2]}, + } + resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) + s.Require().NoError(err) + s.Require().NotNil(resp) + + // check new authorities + params, err := s.keeper.GetParams(s.ctx) + s.Require().NoError(err) + s.Require().Equal([]string{s.marketAuthorities[1]}, params.MarketAuthorities) + + // reset + s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ + MarketAuthorities: s.marketAuthorities, + Admin: s.admin, + })) + }) + + s.Run("unable to accept a req that removes more authorities than exist in state", func() { + msg := &types.MsgRemoveMarketAuthorities{ + Admin: s.admin, + RemoveAddresses: []string{sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r)}, + } + resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) + s.Require().Error(err) + s.Require().Nil(resp) + + // reset + s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ + MarketAuthorities: s.marketAuthorities, + Admin: s.admin, + })) }) } diff --git a/x/mm2/keeper/query.go b/x/marketmap/keeper/query.go similarity index 98% rename from x/mm2/keeper/query.go rename to x/marketmap/keeper/query.go index 94185b0eb..9851b7b9f 100644 --- a/x/mm2/keeper/query.go +++ b/x/marketmap/keeper/query.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/slinky/x/mm2/types" + "github.com/skip-mev/slinky/x/marketmap/types" ) type queryServerImpl struct { diff --git a/x/mm2/keeper/query_test.go b/x/marketmap/keeper/query_test.go similarity index 97% rename from x/mm2/keeper/query_test.go rename to x/marketmap/keeper/query_test.go index c9ff1fda8..57b2b2934 100644 --- a/x/mm2/keeper/query_test.go +++ b/x/marketmap/keeper/query_test.go @@ -2,8 +2,8 @@ package keeper_test import ( slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/keeper" - "github.com/skip-mev/slinky/x/mm2/types" + "github.com/skip-mev/slinky/x/marketmap/keeper" + "github.com/skip-mev/slinky/x/marketmap/types" ) func (s *KeeperTestSuite) TestMarketMap() { diff --git a/x/mm2/module.go b/x/marketmap/module.go similarity index 96% rename from x/mm2/module.go rename to x/marketmap/module.go index 6493f3b07..2682591e0 100644 --- a/x/mm2/module.go +++ b/x/marketmap/module.go @@ -1,4 +1,4 @@ -package mm2 +package marketmap import ( "context" @@ -20,10 +20,10 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/maps" - marketmapmodulev1 "github.com/skip-mev/slinky/api/slinky/mm2/module/v1" - "github.com/skip-mev/slinky/x/mm2/client/cli" - "github.com/skip-mev/slinky/x/mm2/keeper" - "github.com/skip-mev/slinky/x/mm2/types" + marketmapmodulev1 "github.com/skip-mev/slinky/api/slinky/marketmap/module/v1" + "github.com/skip-mev/slinky/x/marketmap/client/cli" + "github.com/skip-mev/slinky/x/marketmap/keeper" + "github.com/skip-mev/slinky/x/marketmap/types" ) // ConsensusVersion is the x/marketmap module's current version, as modules integrate and updates are made, this value determines what diff --git a/x/marketmap/module/depinject.go b/x/marketmap/module/depinject.go deleted file mode 100644 index ffb966f9c..000000000 --- a/x/marketmap/module/depinject.go +++ /dev/null @@ -1,103 +0,0 @@ -package module - -import ( - "fmt" - "sort" - - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" - "cosmossdk.io/depinject" - "github.com/cosmos/cosmos-sdk/codec" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "golang.org/x/exp/maps" - - marketmapmodulev1 "github.com/skip-mev/slinky/api/slinky/marketmap/module/v1" - "github.com/skip-mev/slinky/x/marketmap/keeper" - "github.com/skip-mev/slinky/x/marketmap/types" -) - -var _ depinject.OnePerModuleType = AppModule{} - -func init() { - appmodule.Register( - &marketmapmodulev1.Module{}, - appmodule.Provide(ProvideModule), - appmodule.Invoke(InvokeSetMarketMapHooks), - ) -} - -// Inputs contains the dependencies required for module construction. -type Inputs struct { - depinject.In - - // module dependencies - Config *marketmapmodulev1.Module - Cdc codec.Codec - StoreService store.KVStoreService -} - -// Outputs defines the constructor outputs for the module. -type Outputs struct { - depinject.Out - - MarketMapKeeper *keeper.Keeper - Module appmodule.AppModule -} - -// ProvideModule is the depinject constructor for the module. -func ProvideModule(in Inputs) Outputs { - authority := authtypes.NewModuleAddress(govtypes.ModuleName) - if in.Config.Authority != "" { - authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) - } - - marketmapKeeper := keeper.NewKeeper(in.StoreService, in.Cdc, authority) - - m := NewAppModule(in.Cdc, marketmapKeeper) - - return Outputs{ - MarketMapKeeper: marketmapKeeper, - Module: m, - } -} - -// InvokeSetMarketMapHooks uses the module config to set the hooks on the module. -func InvokeSetMarketMapHooks( - config *marketmapmodulev1.Module, - keeper *keeper.Keeper, - hooks map[string]types.MarketMapHooksWrapper, -) error { - // all arguments to invokers are optional - if keeper == nil || config == nil { - return nil - } - - modNames := maps.Keys(hooks) - order := config.HooksOrder - if len(order) == 0 { - order = modNames - sort.Strings(order) - } - - if len(order) != len(modNames) { - return fmt.Errorf("len(hooks_order: %v) != len(hooks modules: %v)", order, modNames) - } - - if len(modNames) == 0 { - return nil - } - - var multiHooks types.MultiMarketMapHooks - for _, modName := range order { - hook, ok := hooks[modName] - if !ok { - return fmt.Errorf("can't find marketmap hooks for module %s", modName) - } - - multiHooks = append(multiHooks, hook) - } - - keeper.SetHooks(multiHooks) - return nil -} diff --git a/x/marketmap/module/module.go b/x/marketmap/module/module.go deleted file mode 100644 index e6b38eac5..000000000 --- a/x/marketmap/module/module.go +++ /dev/null @@ -1,158 +0,0 @@ -package module - -import ( - "context" - "encoding/json" - - "cosmossdk.io/core/appmodule" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - "github.com/skip-mev/slinky/x/marketmap/client/cli" - "github.com/skip-mev/slinky/x/marketmap/keeper" - "github.com/skip-mev/slinky/x/marketmap/types" -) - -// ConsensusVersion is the x/marketmap module's current version, as modules integrate and updates are made, this value determines what -// version of the module is being run by the chain. -const ConsensusVersion = 1 - -var ( - _ module.HasName = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.AppModuleBasic = AppModule{} - _ module.HasServices = AppModule{} - - _ appmodule.AppModule = AppModule{} - _ appmodule.HasBeginBlocker = AppModule{} - _ appmodule.HasEndBlocker = AppModule{} -) - -// AppModuleBasic is the base struct for the x/marketmap module. It implements the module.AppModuleBasic interface. -type AppModuleBasic struct { - cdc codec.Codec -} - -// Name returns the canonical name of the module. -func (amb AppModuleBasic) Name() string { - return types.ModuleName -} - -// GetTxCmd is a no-op, as no txs are registered for submission (apart from messages that can only be executed by governance). -func (amb AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -// GetQueryCmd returns the x/oracle module base query cli-command. -func (amb AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// RegisterLegacyAminoCodec registers the necessary types from the x/marketmap module for amino serialization. -func (amb AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} - -// RegisterInterfaces registers the necessary implementations / interfaces in the x/marketmap module w/ the interface-registry ir. -func (amb AppModuleBasic) RegisterInterfaces(ir codectypes.InterfaceRegistry) { - types.RegisterInterfaces(ir) -} - -// RegisterGRPCGatewayRoutes registers the necessary REST routes for the GRPC-gateway to the x/marketmap module QueryService on mux. -// This method panics on failure. -func (amb AppModuleBasic) RegisterGRPCGatewayRoutes(cliCtx client.Context, mux *runtime.ServeMux) { - // register the gate-way routes w/ the provided mux - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(cliCtx)); err != nil { - panic(err) - } -} - -// DefaultGenesis returns default genesis state as raw bytes for the marketmap -// module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - gs := types.DefaultGenesisState() - return cdc.MustMarshalJSON(gs) -} - -// ValidateGenesis performs genesis state validation for the marketmap module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - var gs types.GenesisState - if err := cdc.UnmarshalJSON(bz, &gs); err != nil { - return err - } - - return gs.ValidateBasic() -} - -// RegisterInvariants registers the invariants of the marketmap module. If an invariant -// deviates from its predicted value, the InvariantRegistry triggers appropriate -// logic (most often the chain will be halted). No invariants exist for the marketmap module. -func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// AppModule is the actual app module for x/marketmap. -type AppModule struct { - AppModuleBasic - k *keeper.Keeper -} - -// BeginBlock is a no-op for x/marketmap. -func (am AppModule) BeginBlock(_ context.Context) error { - return nil -} - -// EndBlock is a no-op for x/marketmap. -func (am AppModule) EndBlock(_ context.Context) error { - return nil -} - -// InitGenesis performs the genesis initialization for the x/marketmap module. It determines the -// genesis state to initialize from via a json-encoded genesis-state. This method returns no validator set updates. -// This method panics on any errors. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, bz json.RawMessage) { - // unmarshal genesis-state (panic on errors) - var gs types.GenesisState - cdc.MustUnmarshalJSON(bz, &gs) - - // initialize genesis - am.k.InitGenesis(ctx, gs) -} - -// ExportGenesis returns the oracle module's exported genesis state as raw -// JSON bytes. This method panics on any error. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := am.k.ExportGenesis(ctx) - return cdc.MustMarshalJSON(gs) -} - -// RegisterServices registers the module's services with the app's module configurator. -func (am AppModule) RegisterServices(cfc module.Configurator) { - // register MsgServer - types.RegisterMsgServer(cfc.MsgServer(), keeper.NewMsgServer(am.k)) - - // register Query Service - types.RegisterQueryServer(cfc.QueryServer(), keeper.NewQueryServer(am.k)) -} - -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} - -// IsAppModule implements the appmodule.AppModule interface. It is a no-op. -func (am AppModule) IsAppModule() {} - -// NewAppModule constructs a new application module for the x/marketmap module. -func NewAppModule(cdc codec.Codec, k *keeper.Keeper) AppModule { - return AppModule{ - AppModuleBasic: AppModuleBasic{ - cdc: cdc, - }, - k: k, - } -} diff --git a/x/marketmap/types/codec.go b/x/marketmap/types/codec.go index a1419fd96..7e90eef60 100644 --- a/x/marketmap/types/codec.go +++ b/x/marketmap/types/codec.go @@ -12,7 +12,8 @@ import ( // cdc. These types are used for amino serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // register the msg-types - legacy.RegisterAminoMsg(cdc, &MsgUpdateMarketMap{}, "slinky/x/marketmap/MsgUpdateMarketMap") + legacy.RegisterAminoMsg(cdc, &MsgCreateMarkets{}, "slinky/x/marketmap/MsgCreateMarkets") + legacy.RegisterAminoMsg(cdc, &MsgUpdateMarkets{}, "slinky/x/marketmap/MsgUpdateMarkets") legacy.RegisterAminoMsg(cdc, &MsgParams{}, "slinky/x/marketmap/MsgParams") } @@ -20,7 +21,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry codectypes.InterfaceRegistry) { // register the implementations of Msg-type registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgUpdateMarketMap{}, + &MsgCreateMarkets{}, + &MsgUpdateMarkets{}, &MsgParams{}, ) diff --git a/x/marketmap/types/errors.go b/x/marketmap/types/errors.go index d1d304916..effcebcf3 100644 --- a/x/marketmap/types/errors.go +++ b/x/marketmap/types/errors.go @@ -2,16 +2,30 @@ package types import "fmt" -// TickerAlreadyExistsError is an error indicating the given Ticker exists in state. -type TickerAlreadyExistsError struct { +// MarketAlreadyExistsError is an error indicating the given Market exists in state. +type MarketAlreadyExistsError struct { ticker TickerString } -func NewTickerAlreadyExistsError(ticker TickerString) TickerAlreadyExistsError { - return TickerAlreadyExistsError{ticker: ticker} +func NewMarketAlreadyExistsError(ticker TickerString) MarketAlreadyExistsError { + return MarketAlreadyExistsError{ticker: ticker} } -// Error returns the error string for TickerAlreadyExistsError. -func (e TickerAlreadyExistsError) Error() string { +// Error returns the error string for MarketAlreadyExistsError. +func (e MarketAlreadyExistsError) Error() string { return fmt.Sprintf("market already exists for ticker %s", e.ticker) } + +// MarketDoesNotExistsError is an error indicating the given Market does not exist in state. +type MarketDoesNotExistsError struct { + ticker TickerString +} + +func NewMarketDoesNotExistsError(ticker TickerString) MarketDoesNotExistsError { + return MarketDoesNotExistsError{ticker: ticker} +} + +// Error returns the error string for MarketDoesNotExistsError. +func (e MarketDoesNotExistsError) Error() string { + return fmt.Sprintf("market does not exist for ticker %s", e.ticker) +} diff --git a/x/marketmap/types/events.go b/x/marketmap/types/events.go index 5ef42df29..74e0ee560 100644 --- a/x/marketmap/types/events.go +++ b/x/marketmap/types/events.go @@ -10,6 +10,4 @@ const ( AttributeKeyDecimals = "decimals" AttributeKeyMinProviderCount = "min_provider_count" AttributeKeyMetadata = "metadata" - AttributeKeyProviders = "providers" - AttributeKeyPaths = "paths" ) diff --git a/x/marketmap/types/genesis.go b/x/marketmap/types/genesis.go index 8c97555c3..2b073dd5b 100644 --- a/x/marketmap/types/genesis.go +++ b/x/marketmap/types/genesis.go @@ -26,9 +26,7 @@ func (gs *GenesisState) ValidateBasic() error { func DefaultGenesisState() *GenesisState { return &GenesisState{ MarketMap: MarketMap{ - Tickers: make(map[string]Ticker), - Paths: make(map[string]Paths), - Providers: make(map[string]Providers), + Markets: make(map[string]Market), }, LastUpdated: 0, Params: DefaultParams(), diff --git a/x/marketmap/types/genesis_test.go b/x/marketmap/types/genesis_test.go index 512364f0d..04584e1ef 100644 --- a/x/marketmap/types/genesis_test.go +++ b/x/marketmap/types/genesis_test.go @@ -17,54 +17,17 @@ func TestGenesisState(t *testing.T) { t.Run("invalid params - fail", func(t *testing.T) { gs := types.DefaultGenesisState() - gs.Params.MarketAuthority = "invalid" + gs.Params.MarketAuthorities = []string{"invalid"} require.Error(t, gs.ValidateBasic()) }) t.Run("good populated genesis state", func(t *testing.T) { gs := types.GenesisState{ MarketMap: types.MarketMap{ - Tickers: map[string]types.Ticker{ - ethusdt.String(): ethusdt, - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - }, - Paths: map[string]types.Paths{ - ethusdt.String(): ethusdtPaths, - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - }, - Providers: map[string]types.Providers{ - ethusdt.String(): ethusdtProviders, - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, - }, + Markets: markets, }, Params: types.DefaultParams(), } require.NoError(t, gs.ValidateBasic()) }) - - t.Run("bad genesis state - mistmatch", func(t *testing.T) { - gs := types.GenesisState{ - MarketMap: types.MarketMap{ - Tickers: map[string]types.Ticker{ - ethusdt.String(): ethusdt, - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - }, - Paths: map[string]types.Paths{ - ethusdt.String(): ethusdtPaths, - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - }, - Providers: map[string]types.Providers{ - usdtusd.String(): usdtusdProviders, - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, - }, - }, - } - require.Error(t, gs.ValidateBasic()) - }) } diff --git a/x/marketmap/types/hooks.go b/x/marketmap/types/hooks.go index d76160dbc..401d3b65e 100644 --- a/x/marketmap/types/hooks.go +++ b/x/marketmap/types/hooks.go @@ -4,12 +4,14 @@ import sdk "github.com/cosmos/cosmos-sdk/types" // MarketMapHooks is the interface that defines the hooks that can be integrated by other modules. type MarketMapHooks interface { - LegacyAfterMarketCreated(ctx sdk.Context, ticker Ticker) error + // AfterMarketCreated is called after CreateMarket is called. + AfterMarketCreated(ctx sdk.Context, market Market) error - LegacyAfterMarketUpdated(ctx sdk.Context, ticker Ticker) error + // AfterMarketUpdated is called after UpdateMarket is called. + AfterMarketUpdated(ctx sdk.Context, market Market) error - // LegacyAfterMarketGenesis is called after x/marketmap init genesis. - LegacyAfterMarketGenesis(ctx sdk.Context, tickers map[string]Ticker) error + // AfterMarketGenesis is called after x/marketmap init genesis. + AfterMarketGenesis(ctx sdk.Context, tickers map[string]Market) error } var _ MarketMapHooks = &MultiMarketMapHooks{} @@ -17,10 +19,10 @@ var _ MarketMapHooks = &MultiMarketMapHooks{} // MultiMarketMapHooks defines an array of MarketMapHooks which can be executed in sequence. type MultiMarketMapHooks []MarketMapHooks -// LegacyAfterMarketCreated calls all AfterMarketCreated hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) LegacyAfterMarketCreated(ctx sdk.Context, ticker Ticker) error { +// AfterMarketCreated calls all AfterMarketCreated hooks registered to the MultiMarketMapHooks. +func (mh MultiMarketMapHooks) AfterMarketCreated(ctx sdk.Context, market Market) error { for i := range mh { - if err := mh[i].LegacyAfterMarketCreated(ctx, ticker); err != nil { + if err := mh[i].AfterMarketCreated(ctx, market); err != nil { return err } } @@ -28,10 +30,10 @@ func (mh MultiMarketMapHooks) LegacyAfterMarketCreated(ctx sdk.Context, ticker T return nil } -// LegacyAfterMarketUpdated calls all AfterMarketUpdated hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) LegacyAfterMarketUpdated(ctx sdk.Context, ticker Ticker) error { +// AfterMarketUpdated calls all AfterMarketUpdated hooks registered to the MultiMarketMapHooks. +func (mh MultiMarketMapHooks) AfterMarketUpdated(ctx sdk.Context, market Market) error { for i := range mh { - if err := mh[i].LegacyAfterMarketUpdated(ctx, ticker); err != nil { + if err := mh[i].AfterMarketUpdated(ctx, market); err != nil { return err } } @@ -39,10 +41,10 @@ func (mh MultiMarketMapHooks) LegacyAfterMarketUpdated(ctx sdk.Context, ticker T return nil } -// LegacyAfterMarketGenesis calls all AfterMarketGenesis hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) LegacyAfterMarketGenesis(ctx sdk.Context, tickers map[string]Ticker) error { +// AfterMarketGenesis calls all AfterMarketGenesis hooks registered to the MultiMarketMapHooks. +func (mh MultiMarketMapHooks) AfterMarketGenesis(ctx sdk.Context, markets map[string]Market) error { for i := range mh { - if err := mh[i].LegacyAfterMarketGenesis(ctx, tickers); err != nil { + if err := mh[i].AfterMarketGenesis(ctx, markets); err != nil { return err } } diff --git a/x/marketmap/types/keys.go b/x/marketmap/types/keys.go index b9312197b..85700ed5b 100644 --- a/x/marketmap/types/keys.go +++ b/x/marketmap/types/keys.go @@ -13,20 +13,14 @@ const ( ) var ( - // TickersPrefix is the key prefix for Tickers. - TickersPrefix = collections.NewPrefix(0) - - // PathsPrefix is the key prefix for Paths. - PathsPrefix = collections.NewPrefix(1) - - // ProvidersPrefix is the key prefix for Providers. - ProvidersPrefix = collections.NewPrefix(2) - // LastUpdatedPrefix is the key prefix for the lastUpdated height. - LastUpdatedPrefix = collections.NewPrefix(3) + LastUpdatedPrefix = collections.NewPrefix(1) + + // MarketsPrefix is the key prefix for Markets. + MarketsPrefix = collections.NewPrefix(2) // ParamsPrefix is the key prefix of the module Params. - ParamsPrefix = collections.NewPrefix(4) + ParamsPrefix = collections.NewPrefix(3) // TickersCodec is the collections.KeyCodec value used for the markets map. TickersCodec = codec.NewStringKeyCodec[TickerString]() diff --git a/x/marketmap/types/market.go b/x/marketmap/types/market.go index 1d0c5b142..93b916196 100644 --- a/x/marketmap/types/market.go +++ b/x/marketmap/types/market.go @@ -2,176 +2,111 @@ package types import ( "fmt" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" -) - -const ( - // MaxConversionOperations is the maximum number of conversion operations that can be used - // to convert a set of prices to a common ticker. This implementation only supports a maximum - // of 2 conversion operations - either a direct conversion or a conversion using the index price. - // This is specific to the IndexPriceAggregation. - MaxConversionOperations = 2 - - // IndexPrice is the provider name for the index price. This is specific to the IndexPriceAggregation. - IndexPrice = "index_price" ) -// ValidateBasic performs aggregate validation for all fields in the MarketMap. We consider -// the market map to be valid iff: +// ValidateBasic validates the market map configuration and its expected configuration. // -// 1. Each ticker a provider supports is included in the main set of tickers. -// 2. Each ticker is valid. -// 3. Each provider is valid. +// In particular, this will +// +// 1. Ensure that the market map is valid (ValidateBasic). This ensures that each of the provider's +// markets are supported by the market map. +// 2. Ensure that each provider config has a valid corresponding ticker. func (mm *MarketMap) ValidateBasic() error { - if len(mm.Tickers) < len(mm.Providers) { - return fmt.Errorf("each ticker a provider includes must have a corresponding ticker in the main set of tickers") - } - - seenCPs := make(map[string]struct{}) - for tickerStr, ticker := range mm.Tickers { - if err := ticker.ValidateBasic(); err != nil { + for _, market := range mm.Markets { + if err := market.ValidateBasic(); err != nil { return err } - if tickerStr != ticker.String() { - return fmt.Errorf("ticker string %s does not match ticker %s", tickerStr, ticker.String()) + for _, providerConfig := range market.ProviderConfigs { + if providerConfig.NormalizeByPair != nil { + if _, found := mm.Markets[providerConfig.NormalizeByPair.String()]; !found { + return fmt.Errorf("provider's (%s) pair for normalization (%s) was not found in the marketmap", providerConfig.Name, providerConfig.NormalizeByPair.String()) + } + } } - - seenCPs[ticker.String()] = struct{}{} } - // check if all providers refer to tickers - for tickerStr, providers := range mm.Providers { - // check if the ticker is supported - if _, ok := mm.Tickers[tickerStr]; !ok { - return fmt.Errorf("provider %s refers to an unsupported ticker", tickerStr) - } - - if err := providers.ValidateBasic(); err != nil { - return fmt.Errorf("ticker %s has invalid providers: %w", tickerStr, err) - } - } - return ValidateIndexPriceAggregation(*mm) + return nil } // String returns the string representation of the market map. func (mm *MarketMap) String() string { return fmt.Sprintf( - "MarketMap: {Tickers: %v, Providers: %v, Paths: %v, AggregationType: %s}", - mm.Tickers, - mm.Providers, - mm.Paths, - mm.AggregationType, + "MarketMap: {Markets %v}", + mm.Markets, ) } -// ValidateIndexPriceAggregation validates the market map configuration and its expected configuration for -// this aggregator. In particular, this will -// -// 1. Ensure that the market map is valid (ValidateBasic). This ensures that each of the provider's -// markets are supported by the market map. -// 2. Ensure that each path has a corresponding ticker. -// 3. Ensure that each path has a valid number of operations. -// 4. Ensure that each operation has a valid ticker and that the provider supports the ticker. -func ValidateIndexPriceAggregation( - marketMap MarketMap, -) error { - for ticker, paths := range marketMap.Paths { - // The ticker must be supported by the market map. Otherwise, we do not how to resolve the - // prices. - if _, ok := marketMap.Tickers[ticker]; !ok { - return fmt.Errorf("path includes a ticker that is not supported: %s", ticker) - } - - for _, path := range paths.Paths { - operations := path.Operations - if len(operations) == 0 || len(operations) > MaxConversionOperations { - return fmt.Errorf( - "the expected number of operations is between 1 and %d; got %d operations for %s", - MaxConversionOperations, - len(operations), - ticker, - ) - } +// ValidateBasic performs stateless validation of a Market. +func (m *Market) ValidateBasic() error { + if err := m.Ticker.ValidateBasic(); err != nil { + return err + } - first := operations[0] - if _, ok := marketMap.Tickers[first.CurrencyPair.String()]; !ok { - return fmt.Errorf("operation included a ticker that is not supported: %s", first.CurrencyPair.String()) - } - if err := checkIfProviderSupportsTicker(first.Provider, first.CurrencyPair, marketMap); err != nil { - return err - } + if uint64(len(m.ProviderConfigs)) < m.Ticker.MinProviderCount { + return fmt.Errorf("this ticker must have at least %d providers; got %d", + m.Ticker.MinProviderCount, + len(m.ProviderConfigs), + ) + } - if len(operations) != 2 { - continue - } + seenProviders := make(map[string]struct{}) + for _, providerConfig := range m.ProviderConfigs { + if err := providerConfig.ValidateBasic(); err != nil { + return err + } - second := operations[1] - if second.Provider != IndexPrice { - return fmt.Errorf("expected index price provider for second operation; got %s", second.Provider) - } - if _, ok := marketMap.Tickers[second.CurrencyPair.String()]; !ok { - return fmt.Errorf("index operation included a ticker that is not supported: %s", second.CurrencyPair.String()) - } + // check for duplicate providers + key := providerConfig.Name + providerConfig.OffChainTicker + if _, seen := seenProviders[key]; seen { + return fmt.Errorf("duplicate (provider, off-chain-ticker) found: %s", key) } + seenProviders[key] = struct{}{} + } return nil } -// checkIfProviderSupportsTicker checks if the provider supports the given ticker. -func checkIfProviderSupportsTicker( - provider string, - cp slinkytypes.CurrencyPair, - marketMap MarketMap, -) error { - providers, ok := marketMap.Providers[cp.String()] - if !ok { - return fmt.Errorf("provider %s included a ticker %s that has no providers supporting it", provider, cp.String()) - } - - for _, p := range providers.Providers { - if p.Name == provider { - return nil - } - } - - return fmt.Errorf("provider %s does not support ticker: %s", provider, cp.String()) +// String returns the string representation of the market. +func (m *Market) String() string { + return fmt.Sprintf( + "Market: {Ticker %v Providers: %v}", m.Ticker, m.ProviderConfigs, + ) } -// Equal returns true iff the MarketMap is equal to the given MarketMap. +// Equal returns true if the MarketMap is equal to the given MarketMap. func (mm *MarketMap) Equal(other MarketMap) bool { - if len(mm.Tickers) != len(other.Tickers) { + if len(mm.Markets) != len(other.Markets) { return false } - if len(mm.Providers) != len(other.Providers) { - return false - } + for tickerStr, market := range mm.Markets { + otherMarket, found := other.Markets[tickerStr] + if !found { + return false + } - if len(mm.Paths) != len(other.Paths) { - return false + if !market.Equal(otherMarket) { + return false + } } - if mm.AggregationType != other.AggregationType { - return false - } + return true +} - for ticker, tickerData := range mm.Tickers { - if !tickerData.Equal(other.Tickers[ticker]) { - return false - } +// Equal returns true if the Market is equal to the given Market. +func (m *Market) Equal(other Market) bool { + if !m.Ticker.Equal(other.Ticker) { + return false } - for ticker, providerData := range mm.Providers { - if !providerData.Equal(other.Providers[ticker]) { - return false - } + if len(m.ProviderConfigs) != len(other.ProviderConfigs) { + return false } - for ticker, pathData := range mm.Paths { - if !pathData.Equal(other.Paths[ticker]) { + for i, providerConfig := range m.ProviderConfigs { + if !providerConfig.Equal(other.ProviderConfigs[i]) { return false } } diff --git a/x/marketmap/types/market.pb.go b/x/marketmap/types/market.pb.go index aeacda200..54be4408c 100644 --- a/x/marketmap/types/market.pb.go +++ b/x/marketmap/types/market.pb.go @@ -24,42 +24,60 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// AggregationType is the type of aggregation that will be used to aggregate the -// prices of the tickers. -type AggregationType int32 - -const ( - // UNKOWN_AGGREGATION_TYPE is the default value for the aggregation type. - AggregationType_UNKNOWN_AGGREGATION_TYPE AggregationType = 0 - // IndexPriceAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // either directly or using the index price to a common currency pair. - AggregationType_INDEX_PRICE_AGGREGATION AggregationType = 1 - // StandardMedianAggregation is the type of aggregation that will be used to - // aggregate the prices of the tickers. Specifically, this converts the prices - // to a common currency pair and then takes the median of the prices. No - // conversions are done if the prices are already in the common currency pair. - AggregationType_STANDARD_MEDIAN_AGGREGATION AggregationType = 2 -) - -var AggregationType_name = map[int32]string{ - 0: "UNKNOWN_AGGREGATION_TYPE", - 1: "INDEX_PRICE_AGGREGATION", - 2: "STANDARD_MEDIAN_AGGREGATION", +// Market encapsulates a Ticker and its provider-specific configuration. +type Market struct { + // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The + // price feed is scaled to a number of decimal places and has a minimum number + // of providers required to consider the ticker valid. + Ticker Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker"` + // ProviderConfigs is the list of provider-specific configs for this Market. + ProviderConfigs []ProviderConfig `protobuf:"bytes,2,rep,name=provider_configs,json=providerConfigs,proto3" json:"provider_configs"` +} + +func (m *Market) Reset() { *m = Market{} } +func (*Market) ProtoMessage() {} +func (*Market) Descriptor() ([]byte, []int) { + return fileDescriptor_fefe265720fc8a78, []int{0} } - -var AggregationType_value = map[string]int32{ - "UNKNOWN_AGGREGATION_TYPE": 0, - "INDEX_PRICE_AGGREGATION": 1, - "STANDARD_MEDIAN_AGGREGATION": 2, +func (m *Market) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Market) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Market.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Market) XXX_Merge(src proto.Message) { + xxx_messageInfo_Market.Merge(m, src) +} +func (m *Market) XXX_Size() int { + return m.Size() +} +func (m *Market) XXX_DiscardUnknown() { + xxx_messageInfo_Market.DiscardUnknown(m) } -func (x AggregationType) String() string { - return proto.EnumName(AggregationType_name, int32(x)) +var xxx_messageInfo_Market proto.InternalMessageInfo + +func (m *Market) GetTicker() Ticker { + if m != nil { + return m.Ticker + } + return Ticker{} } -func (AggregationType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{0} +func (m *Market) GetProviderConfigs() []ProviderConfig { + if m != nil { + return m.ProviderConfigs + } + return nil } // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price @@ -85,7 +103,7 @@ type Ticker struct { func (m *Ticker) Reset() { *m = Ticker{} } func (*Ticker) ProtoMessage() {} func (*Ticker) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{0} + return fileDescriptor_fefe265720fc8a78, []int{1} } func (m *Ticker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -157,13 +175,24 @@ type ProviderConfig struct { // The off-chain ticker is unique to a given provider and is used to fetch the // price of the ticker from the provider. OffChainTicker string `protobuf:"bytes,2,opt,name=off_chain_ticker,json=offChainTicker,proto3" json:"off_chain_ticker,omitempty"` + // NormalizeByPair is the currency pair for this ticker to be normalized by. + // For example, if the desired Ticker is BTD/USD, this market could be reached + // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is + // optional and nullable. + NormalizeByPair *types.CurrencyPair `protobuf:"bytes,3,opt,name=normalize_by_pair,json=normalizeByPair,proto3" json:"normalize_by_pair,omitempty"` + // Invert is a boolean indicating if the BASE and QUOTE of the market should + // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE + Invert bool `protobuf:"varint,4,opt,name=invert,proto3" json:"invert,omitempty"` + // MetadataJSON is a string of JSON that encodes any extra configuration + // for the given provider config. + Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` } func (m *ProviderConfig) Reset() { *m = ProviderConfig{} } func (m *ProviderConfig) String() string { return proto.CompactTextString(m) } func (*ProviderConfig) ProtoMessage() {} func (*ProviderConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{1} + return fileDescriptor_fefe265720fc8a78, []int{2} } func (m *ProviderConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,229 +235,38 @@ func (m *ProviderConfig) GetOffChainTicker() string { return "" } -// Path is the list of convertable markets that will be used to convert the -// prices of a set of tickers to a common ticker. -type Path struct { - // Operations is an ordered list of operations that will be taken. These must - // be topologically sorted to ensure that the conversion is possible i.e. DAG. - Operations []Operation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations"` -} - -func (m *Path) Reset() { *m = Path{} } -func (m *Path) String() string { return proto.CompactTextString(m) } -func (*Path) ProtoMessage() {} -func (*Path) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{2} -} -func (m *Path) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Path) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Path.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 *Path) XXX_Merge(src proto.Message) { - xxx_messageInfo_Path.Merge(m, src) -} -func (m *Path) XXX_Size() int { - return m.Size() -} -func (m *Path) XXX_DiscardUnknown() { - xxx_messageInfo_Path.DiscardUnknown(m) -} - -var xxx_messageInfo_Path proto.InternalMessageInfo - -func (m *Path) GetOperations() []Operation { +func (m *ProviderConfig) GetNormalizeByPair() *types.CurrencyPair { if m != nil { - return m.Operations + return m.NormalizeByPair } return nil } -// Operation represents the operation configuration for a given ticker. -type Operation struct { - // CurrencyPair is the on-chain currency pair for this ticker. - CurrencyPair types.CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` - // Invert is a boolean that indicates whether the price of the ticker should - // be inverted. - Invert bool `protobuf:"varint,2,opt,name=invert,proto3" json:"invert,omitempty"` - // Provider is the name of the provider that will be used to fetch the price - // of the ticker. - Provider string `protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{3} -} -func (m *Operation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation.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 *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) -} -func (m *Operation) XXX_Size() int { - return m.Size() -} -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) -} - -var xxx_messageInfo_Operation proto.InternalMessageInfo - -func (m *Operation) GetCurrencyPair() types.CurrencyPair { - if m != nil { - return m.CurrencyPair - } - return types.CurrencyPair{} -} - -func (m *Operation) GetInvert() bool { +func (m *ProviderConfig) GetInvert() bool { if m != nil { return m.Invert } return false } -func (m *Operation) GetProvider() string { +func (m *ProviderConfig) GetMetadata_JSON() string { if m != nil { - return m.Provider + return m.Metadata_JSON } return "" } -type Paths struct { - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - Paths []Path `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths"` -} - -func (m *Paths) Reset() { *m = Paths{} } -func (m *Paths) String() string { return proto.CompactTextString(m) } -func (*Paths) ProtoMessage() {} -func (*Paths) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{4} -} -func (m *Paths) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Paths) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Paths.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 *Paths) XXX_Merge(src proto.Message) { - xxx_messageInfo_Paths.Merge(m, src) -} -func (m *Paths) XXX_Size() int { - return m.Size() -} -func (m *Paths) XXX_DiscardUnknown() { - xxx_messageInfo_Paths.DiscardUnknown(m) -} - -var xxx_messageInfo_Paths proto.InternalMessageInfo - -func (m *Paths) GetPaths() []Path { - if m != nil { - return m.Paths - } - return nil -} - -type Providers struct { - // Providers is the list of provider configurations for the given ticker. - Providers []ProviderConfig `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers"` -} - -func (m *Providers) Reset() { *m = Providers{} } -func (m *Providers) String() string { return proto.CompactTextString(m) } -func (*Providers) ProtoMessage() {} -func (*Providers) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{5} -} -func (m *Providers) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Providers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Providers.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 *Providers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Providers.Merge(m, src) -} -func (m *Providers) XXX_Size() int { - return m.Size() -} -func (m *Providers) XXX_DiscardUnknown() { - xxx_messageInfo_Providers.DiscardUnknown(m) -} - -var xxx_messageInfo_Providers proto.InternalMessageInfo - -func (m *Providers) GetProviders() []ProviderConfig { - if m != nil { - return m.Providers - } - return nil -} - +// MarketMap maps ticker strings to their Markets. type MarketMap struct { - // Tickers is the full list of tickers and their associated configurations + // Markets is the full list of tickers and their associated configurations // to be stored on-chain. - Tickers map[string]Ticker `protobuf:"bytes,1,rep,name=tickers,proto3" json:"tickers" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Paths is a map from CurrencyPair to all paths that resolve to that pair - Paths map[string]Paths `protobuf:"bytes,2,rep,name=paths,proto3" json:"paths" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Providers is a map from CurrencyPair to each of to provider-specific - // configs associated with it. - Providers map[string]Providers `protobuf:"bytes,3,rep,name=providers,proto3" json:"providers" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // AggregationType is the type of aggregation that will be used to aggregate - // the prices of the tickers. - AggregationType AggregationType `protobuf:"varint,4,opt,name=aggregation_type,json=aggregationType,proto3,enum=slinky.marketmap.v1.AggregationType" json:"aggregation_type,omitempty"` + Markets map[string]Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *MarketMap) Reset() { *m = MarketMap{} } func (*MarketMap) ProtoMessage() {} func (*MarketMap) Descriptor() ([]byte, []int) { - return fileDescriptor_fefe265720fc8a78, []int{6} + return fileDescriptor_fefe265720fc8a78, []int{3} } func (m *MarketMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -457,99 +295,107 @@ func (m *MarketMap) XXX_DiscardUnknown() { var xxx_messageInfo_MarketMap proto.InternalMessageInfo -func (m *MarketMap) GetTickers() map[string]Ticker { - if m != nil { - return m.Tickers - } - return nil -} - -func (m *MarketMap) GetPaths() map[string]Paths { - if m != nil { - return m.Paths - } - return nil -} - -func (m *MarketMap) GetProviders() map[string]Providers { +func (m *MarketMap) GetMarkets() map[string]Market { if m != nil { - return m.Providers + return m.Markets } return nil } -func (m *MarketMap) GetAggregationType() AggregationType { - if m != nil { - return m.AggregationType - } - return AggregationType_UNKNOWN_AGGREGATION_TYPE -} - func init() { - proto.RegisterEnum("slinky.marketmap.v1.AggregationType", AggregationType_name, AggregationType_value) + proto.RegisterType((*Market)(nil), "slinky.marketmap.v1.Market") proto.RegisterType((*Ticker)(nil), "slinky.marketmap.v1.Ticker") proto.RegisterType((*ProviderConfig)(nil), "slinky.marketmap.v1.ProviderConfig") - proto.RegisterType((*Path)(nil), "slinky.marketmap.v1.Path") - proto.RegisterType((*Operation)(nil), "slinky.marketmap.v1.Operation") - proto.RegisterType((*Paths)(nil), "slinky.marketmap.v1.Paths") - proto.RegisterType((*Providers)(nil), "slinky.marketmap.v1.Providers") proto.RegisterType((*MarketMap)(nil), "slinky.marketmap.v1.MarketMap") - proto.RegisterMapType((map[string]Paths)(nil), "slinky.marketmap.v1.MarketMap.PathsEntry") - proto.RegisterMapType((map[string]Providers)(nil), "slinky.marketmap.v1.MarketMap.ProvidersEntry") - proto.RegisterMapType((map[string]Ticker)(nil), "slinky.marketmap.v1.MarketMap.TickersEntry") + proto.RegisterMapType((map[string]Market)(nil), "slinky.marketmap.v1.MarketMap.MarketsEntry") } func init() { proto.RegisterFile("slinky/marketmap/v1/market.proto", fileDescriptor_fefe265720fc8a78) } var fileDescriptor_fefe265720fc8a78 = []byte{ - // 743 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x6f, 0xd3, 0x48, - 0x14, 0xc7, 0xe3, 0x24, 0x6d, 0xe3, 0xd7, 0x36, 0x8d, 0x66, 0x57, 0xbb, 0xde, 0x74, 0x71, 0xad, - 0x94, 0x43, 0x80, 0xd6, 0x21, 0x01, 0x24, 0xd4, 0x03, 0x52, 0x9a, 0x84, 0x10, 0x4a, 0x9d, 0xe0, - 0x06, 0x15, 0x10, 0x92, 0x35, 0x75, 0x26, 0xa9, 0x95, 0xf8, 0x87, 0x6c, 0x27, 0x22, 0x37, 0xae, - 0xdc, 0x38, 0x72, 0xe4, 0xcf, 0xe9, 0xb1, 0x47, 0x84, 0x10, 0x42, 0xad, 0xf8, 0x3f, 0x90, 0xc7, - 0x76, 0xe2, 0x20, 0x97, 0x5e, 0xb8, 0xcd, 0x7b, 0xf3, 0x7d, 0x9f, 0xd1, 0xfb, 0xbe, 0xf1, 0x18, - 0x04, 0x67, 0xa4, 0x19, 0xc3, 0x69, 0x49, 0xc7, 0xf6, 0x90, 0xb8, 0x3a, 0xb6, 0x4a, 0x93, 0x72, - 0x10, 0x88, 0x96, 0x6d, 0xba, 0x26, 0xfa, 0xcb, 0x57, 0x88, 0x33, 0x85, 0x38, 0x29, 0xe7, 0xff, - 0x1e, 0x98, 0x03, 0x93, 0xee, 0x97, 0xbc, 0x95, 0x2f, 0xcd, 0x6f, 0x07, 0x30, 0x77, 0x6a, 0x11, - 0xc7, 0x03, 0xa9, 0x63, 0xdb, 0x26, 0x86, 0x3a, 0x55, 0x2c, 0xac, 0xd9, 0xbe, 0xa8, 0xf0, 0x83, - 0x81, 0xe5, 0xae, 0xa6, 0x0e, 0x89, 0x8d, 0x9e, 0xc0, 0xfa, 0x82, 0x82, 0x63, 0x04, 0xa6, 0xb8, - 0x5a, 0xb9, 0x21, 0x06, 0x47, 0x52, 0x8e, 0x38, 0x29, 0x8b, 0xb5, 0x40, 0xd5, 0xc1, 0x9a, 0xbd, - 0x9f, 0x3e, 0xfb, 0xb6, 0x95, 0x90, 0xd7, 0xd4, 0x48, 0x0e, 0xe5, 0x21, 0xd3, 0x23, 0xaa, 0xa6, - 0xe3, 0x91, 0xc3, 0x25, 0x05, 0xa6, 0x98, 0x96, 0x67, 0x31, 0xda, 0x01, 0xa4, 0x6b, 0x86, 0x62, - 0xd9, 0xe6, 0x44, 0xeb, 0x11, 0x5b, 0x51, 0xcd, 0xb1, 0xe1, 0x72, 0x29, 0xaa, 0xca, 0xe9, 0x9a, - 0xd1, 0x09, 0x36, 0x6a, 0x5e, 0x1e, 0x71, 0xb0, 0x42, 0x0c, 0x7c, 0x32, 0x22, 0x3d, 0x2e, 0x2b, - 0x30, 0xc5, 0x8c, 0x1c, 0x86, 0x68, 0x1b, 0xd6, 0x75, 0xe2, 0xe2, 0x1e, 0x76, 0xb1, 0xf2, 0xf4, - 0xa8, 0x2d, 0x71, 0x1b, 0x02, 0x53, 0x64, 0xe5, 0xb5, 0x30, 0xe9, 0xe5, 0xf6, 0x32, 0x1f, 0x3f, - 0x6d, 0x25, 0xde, 0x7d, 0x15, 0x12, 0x05, 0x09, 0xb2, 0x73, 0xb2, 0xd1, 0xd7, 0x06, 0x08, 0x41, - 0xda, 0xc0, 0x3a, 0xa1, 0x5d, 0xb2, 0x32, 0x5d, 0xa3, 0x22, 0xe4, 0xcc, 0x7e, 0x5f, 0x51, 0x4f, - 0xb1, 0x66, 0x28, 0x2e, 0xb5, 0x85, 0x36, 0xc0, 0xca, 0x59, 0xb3, 0xdf, 0xaf, 0x79, 0x69, 0xdf, - 0xac, 0xc2, 0x33, 0x48, 0x77, 0xb0, 0x7b, 0x8a, 0xea, 0x00, 0xa6, 0x45, 0x6c, 0xec, 0x6a, 0xa6, - 0xe1, 0x70, 0x8c, 0x90, 0x2a, 0xae, 0x56, 0x78, 0x31, 0x66, 0x48, 0x62, 0x3b, 0x94, 0x05, 0x96, - 0x45, 0xea, 0x0a, 0xef, 0x19, 0x60, 0x67, 0xfb, 0x7f, 0x70, 0x10, 0xff, 0xc0, 0xb2, 0x66, 0x4c, - 0x88, 0xed, 0xd2, 0x2e, 0x32, 0x72, 0x10, 0x79, 0x03, 0x0a, 0x07, 0x40, 0xad, 0x67, 0xe5, 0x59, - 0x5c, 0x78, 0x04, 0x4b, 0x5e, 0x67, 0x0e, 0x7a, 0x00, 0x4b, 0x96, 0xb7, 0x08, 0xba, 0xfa, 0x2f, - 0xb6, 0x2b, 0x4f, 0x1a, 0x1c, 0xed, 0xab, 0x0b, 0x5d, 0x60, 0x43, 0xa7, 0x1d, 0xd4, 0x04, 0x36, - 0x04, 0x87, 0x9c, 0xed, 0x78, 0xce, 0xc2, 0x70, 0x02, 0xe2, 0xbc, 0xb6, 0xf0, 0x25, 0x0d, 0xec, - 0x21, 0x2d, 0x38, 0xc4, 0x16, 0x3a, 0x80, 0x15, 0x7f, 0x3a, 0x21, 0xf4, 0x4e, 0x2c, 0x74, 0x56, - 0x20, 0xfa, 0x53, 0x73, 0x1a, 0x86, 0x6b, 0x4f, 0x03, 0x78, 0x48, 0x40, 0x8d, 0xb0, 0xcf, 0x24, - 0x45, 0xdd, 0xba, 0x06, 0x45, 0xcd, 0x89, 0x82, 0xfc, 0x6a, 0xf4, 0x3c, 0xda, 0x6a, 0x8a, 0xa2, - 0x76, 0xaf, 0x43, 0x85, 0xfa, 0x28, 0x6e, 0x4e, 0x41, 0x6d, 0xc8, 0xe1, 0xc1, 0xc0, 0x26, 0x03, - 0x7a, 0x2f, 0x14, 0x6f, 0xee, 0x5c, 0x5a, 0x60, 0x8a, 0xd9, 0xca, 0xcd, 0x58, 0x72, 0x75, 0x2e, - 0xee, 0x4e, 0x2d, 0x22, 0x6f, 0xe0, 0xc5, 0x44, 0xfe, 0x18, 0xd6, 0xa2, 0x4e, 0xa0, 0x1c, 0xa4, - 0x86, 0x64, 0x1a, 0x7c, 0x02, 0xde, 0x12, 0x95, 0x61, 0x69, 0x82, 0x47, 0x63, 0x42, 0x2f, 0xcc, - 0x6a, 0x65, 0x33, 0xf6, 0x1c, 0x9f, 0x21, 0xfb, 0xca, 0xbd, 0xe4, 0x43, 0x26, 0xdf, 0x05, 0x98, - 0xfb, 0x12, 0x83, 0xbd, 0xbb, 0x88, 0xcd, 0x5f, 0x79, 0x97, 0x9c, 0x28, 0xf5, 0xcd, 0xfc, 0xa3, - 0xbd, 0x92, 0x7c, 0x7f, 0x91, 0xcc, 0xff, 0xf6, 0x76, 0x45, 0xe9, 0xf3, 0xc7, 0xe1, 0xb6, 0x0e, - 0x1b, 0xbf, 0x58, 0x87, 0xfe, 0x07, 0xee, 0x85, 0x74, 0x20, 0xb5, 0x8f, 0x25, 0xa5, 0xda, 0x6c, - 0xca, 0x8d, 0x66, 0xb5, 0xdb, 0x6a, 0x4b, 0x4a, 0xf7, 0x55, 0xa7, 0x91, 0x4b, 0xa0, 0x4d, 0xf8, - 0xb7, 0x25, 0xd5, 0x1b, 0x2f, 0x95, 0x8e, 0xdc, 0xaa, 0x35, 0xa2, 0x8a, 0x1c, 0x83, 0xb6, 0x60, - 0xf3, 0xa8, 0x5b, 0x95, 0xea, 0x55, 0xb9, 0xae, 0x1c, 0x36, 0xea, 0xad, 0xea, 0x02, 0x22, 0x97, - 0xdc, 0x7f, 0x7c, 0x76, 0xc1, 0x33, 0xe7, 0x17, 0x3c, 0xf3, 0xfd, 0x82, 0x67, 0x3e, 0x5c, 0xf2, - 0x89, 0xf3, 0x4b, 0x3e, 0xf1, 0xf9, 0x92, 0x4f, 0xbc, 0xde, 0x19, 0x68, 0xee, 0xe9, 0xf8, 0x44, - 0x54, 0x4d, 0xbd, 0xe4, 0x0c, 0x35, 0x6b, 0x57, 0x27, 0x93, 0x52, 0xf0, 0x8c, 0xbf, 0x8d, 0xfc, - 0x15, 0xe8, 0x0b, 0x70, 0xb2, 0x4c, 0x9f, 0xf0, 0x7b, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x0c, - 0x89, 0x08, 0xe7, 0x36, 0x06, 0x00, 0x00, + // 550 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x8a, 0x13, 0x4d, + 0x14, 0xed, 0x4a, 0xf2, 0x65, 0x92, 0x9a, 0x4c, 0x92, 0xaf, 0x14, 0x69, 0x22, 0xf6, 0x34, 0xc9, + 0xa6, 0xc1, 0xb1, 0x43, 0xc6, 0x8d, 0xce, 0x32, 0x41, 0xf1, 0x87, 0xd1, 0xa1, 0x1d, 0x10, 0xdc, + 0x34, 0x95, 0x4e, 0x25, 0x53, 0x24, 0x5d, 0xd5, 0x54, 0x57, 0x1a, 0xe3, 0xca, 0x47, 0x70, 0xe9, + 0x52, 0xf0, 0x31, 0x7c, 0x81, 0x59, 0xce, 0x4a, 0x5c, 0x88, 0x48, 0x82, 0xef, 0x21, 0x5d, 0x5d, + 0xc9, 0x74, 0x20, 0xc2, 0xec, 0xee, 0xbd, 0x75, 0xea, 0xdc, 0x3a, 0xa7, 0xee, 0x85, 0x76, 0x3c, + 0xa3, 0x6c, 0xba, 0xe8, 0x86, 0x58, 0x4c, 0x89, 0x0c, 0x71, 0xd4, 0x4d, 0x7a, 0x3a, 0x71, 0x23, + 0xc1, 0x25, 0x47, 0xb7, 0x32, 0x84, 0xbb, 0x41, 0xb8, 0x49, 0xaf, 0x75, 0x7b, 0xc2, 0x27, 0x5c, + 0x9d, 0x77, 0xd3, 0x28, 0x83, 0xb6, 0x3a, 0x9a, 0x4c, 0x2e, 0x22, 0x12, 0xa7, 0x44, 0xc1, 0x5c, + 0x08, 0xc2, 0x82, 0x85, 0x1f, 0x61, 0x2a, 0x32, 0x50, 0xfb, 0x2b, 0x80, 0xe5, 0x53, 0xc5, 0x85, + 0x1e, 0xc3, 0xb2, 0xa4, 0xc1, 0x94, 0x08, 0x13, 0xd8, 0xc0, 0xd9, 0x3f, 0xbe, 0xeb, 0xee, 0xe8, + 0xe5, 0x9e, 0x2b, 0x48, 0xbf, 0x74, 0xf9, 0xeb, 0xd0, 0xf0, 0xf4, 0x05, 0x74, 0x0e, 0x9b, 0x91, + 0xe0, 0x09, 0x1d, 0x11, 0xe1, 0x07, 0x9c, 0x8d, 0xe9, 0x24, 0x36, 0x0b, 0x76, 0xd1, 0xd9, 0x3f, + 0xee, 0xec, 0x24, 0x39, 0xd3, 0xe0, 0x81, 0xc2, 0x6a, 0xb2, 0x46, 0xb4, 0x55, 0x8d, 0x4f, 0x2a, + 0x9f, 0xbf, 0x1c, 0x1a, 0x1f, 0x7f, 0xda, 0x46, 0xfb, 0x0f, 0x80, 0xe5, 0xac, 0x31, 0x7a, 0x06, + 0x0f, 0xb6, 0x74, 0xe8, 0xc7, 0xde, 0x5b, 0xf7, 0x51, 0x6a, 0xd3, 0x1e, 0x03, 0x8d, 0x3a, 0xc3, + 0x74, 0xfd, 0xdc, 0x5a, 0x90, 0xab, 0xa1, 0x16, 0xac, 0x8c, 0x48, 0x40, 0x43, 0x3c, 0x4b, 0x1f, + 0x0b, 0x9c, 0x92, 0xb7, 0xc9, 0xd1, 0x11, 0x44, 0x21, 0x65, 0x7e, 0x4e, 0xd4, 0x9c, 0x49, 0xb3, + 0xa8, 0x50, 0xcd, 0x90, 0xb2, 0x6b, 0x01, 0x73, 0x26, 0x91, 0x09, 0xf7, 0x08, 0xc3, 0xc3, 0x19, + 0x19, 0x99, 0x75, 0x1b, 0x38, 0x15, 0x6f, 0x9d, 0xa2, 0x0e, 0x3c, 0x08, 0x89, 0xc4, 0x23, 0x2c, + 0xb1, 0xff, 0xe2, 0xcd, 0xeb, 0x57, 0x66, 0xc3, 0x06, 0x4e, 0xd5, 0xab, 0xad, 0x8b, 0x69, 0x2d, + 0xa7, 0xf3, 0x3b, 0x80, 0xf5, 0x6d, 0x6f, 0x10, 0x82, 0x25, 0x86, 0x43, 0xa2, 0x64, 0x56, 0x3d, + 0x15, 0x23, 0x07, 0x36, 0xf9, 0x78, 0xec, 0x07, 0x17, 0x98, 0x32, 0x5f, 0xff, 0x59, 0x41, 0x9d, + 0xd7, 0xf9, 0x78, 0x3c, 0x48, 0xcb, 0xda, 0xad, 0xe7, 0xf0, 0x7f, 0xc6, 0x45, 0x88, 0x67, 0xf4, + 0x03, 0xf1, 0x87, 0xda, 0xb1, 0xe2, 0x0d, 0x1c, 0xf3, 0x1a, 0x9b, 0x7b, 0xfd, 0xcc, 0xae, 0x3b, + 0xb0, 0x4c, 0x59, 0x42, 0x84, 0x34, 0x4b, 0x4a, 0xa3, 0xce, 0x6e, 0x24, 0xb1, 0xfd, 0x0d, 0xc0, + 0x6a, 0x36, 0x66, 0xa7, 0x38, 0x42, 0x2f, 0xe1, 0x5e, 0x36, 0x0e, 0xb1, 0x09, 0xd4, 0x94, 0xdc, + 0xdf, 0x39, 0x25, 0x9b, 0x0b, 0x3a, 0x8a, 0x9f, 0x30, 0x29, 0x16, 0xfa, 0x2f, 0xd7, 0x0c, 0xad, + 0xb7, 0xb0, 0x96, 0x3f, 0x46, 0x4d, 0x58, 0x9c, 0x92, 0x85, 0xf6, 0x2b, 0x0d, 0x51, 0x0f, 0xfe, + 0x97, 0xe0, 0xd9, 0x9c, 0x28, 0x8f, 0xfe, 0x35, 0xd7, 0x19, 0x87, 0x97, 0x21, 0x4f, 0x0a, 0x8f, + 0xc0, 0xf5, 0xb7, 0xf4, 0x9f, 0x5e, 0x2e, 0x2d, 0x70, 0xb5, 0xb4, 0xc0, 0xef, 0xa5, 0x05, 0x3e, + 0xad, 0x2c, 0xe3, 0x6a, 0x65, 0x19, 0x3f, 0x56, 0x96, 0xf1, 0xee, 0x68, 0x42, 0xe5, 0xc5, 0x7c, + 0xe8, 0x06, 0x3c, 0xec, 0xc6, 0x53, 0x1a, 0x3d, 0x08, 0x49, 0xd2, 0xd5, 0x7b, 0xf7, 0x3e, 0xb7, + 0xc6, 0xca, 0xe3, 0x61, 0x59, 0xed, 0xdc, 0xc3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x09, 0xf7, + 0x02, 0xad, 0xe7, 0x03, 0x00, 0x00, +} + +func (m *Market) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Market) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Market) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProviderConfigs) > 0 { + for iNdEx := len(m.ProviderConfigs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProviderConfigs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Ticker.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *Ticker) Marshal() (dAtA []byte, err error) { @@ -632,6 +478,35 @@ func (m *ProviderConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Metadata_JSON) > 0 { + i -= len(m.Metadata_JSON) + copy(dAtA[i:], m.Metadata_JSON) + i = encodeVarintMarket(dAtA, i, uint64(len(m.Metadata_JSON))) + i-- + dAtA[i] = 0x7a + } + if m.Invert { + i-- + if m.Invert { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.NormalizeByPair != nil { + { + size, err := m.NormalizeByPair.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMarket(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if len(m.OffChainTicker) > 0 { i -= len(m.OffChainTicker) copy(dAtA[i:], m.OffChainTicker) @@ -649,7 +524,7 @@ func (m *ProviderConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Path) Marshal() (dAtA []byte, err error) { +func (m *MarketMap) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -659,20 +534,22 @@ func (m *Path) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Path) MarshalTo(dAtA []byte) (int, error) { +func (m *MarketMap) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Path) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MarketMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Operations) > 0 { - for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Markets) > 0 { + for k := range m.Markets { + v := m.Markets[k] + baseI := i { - size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -680,247 +557,48 @@ func (m *Path) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintMarket(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintMarket(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintMarket(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } -func (m *Operation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintMarket(dAtA []byte, offset int, v uint64) int { + offset -= sovMarket(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Market) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintMarket(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0x1a - } - if m.Invert { - i-- - if m.Invert { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - { - size, err := m.CurrencyPair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Paths) 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 *Paths) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Paths) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Paths) > 0 { - for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Paths[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Providers) 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 *Providers) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Providers) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Providers) > 0 { - for iNdEx := len(m.Providers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Providers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MarketMap) 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 *MarketMap) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AggregationType != 0 { - i = encodeVarintMarket(dAtA, i, uint64(m.AggregationType)) - i-- - dAtA[i] = 0x20 - } - if len(m.Providers) > 0 { - for k := range m.Providers { - v := m.Providers[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintMarket(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintMarket(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Paths) > 0 { - for k := range m.Paths { - v := m.Paths[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintMarket(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintMarket(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Tickers) > 0 { - for k := range m.Tickers { - v := m.Tickers[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintMarket(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintMarket(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa + l = m.Ticker.Size() + n += 1 + l + sovMarket(uint64(l)) + if len(m.ProviderConfigs) > 0 { + for _, e := range m.ProviderConfigs { + l = e.Size() + n += 1 + l + sovMarket(uint64(l)) } } - return len(dAtA) - i, nil + return n } -func encodeVarintMarket(dAtA []byte, offset int, v uint64) int { - offset -= sovMarket(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Ticker) Size() (n int) { if m == nil { return 0 @@ -959,624 +637,45 @@ func (m *ProviderConfig) Size() (n int) { if l > 0 { n += 1 + l + sovMarket(uint64(l)) } - return n -} - -func (m *Path) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Operations) > 0 { - for _, e := range m.Operations { - l = e.Size() - n += 1 + l + sovMarket(uint64(l)) - } - } - return n -} - -func (m *Operation) Size() (n int) { - if m == nil { - return 0 + if m.NormalizeByPair != nil { + l = m.NormalizeByPair.Size() + n += 1 + l + sovMarket(uint64(l)) } - var l int - _ = l - l = m.CurrencyPair.Size() - n += 1 + l + sovMarket(uint64(l)) if m.Invert { n += 2 } - l = len(m.Provider) + l = len(m.Metadata_JSON) if l > 0 { n += 1 + l + sovMarket(uint64(l)) } return n } -func (m *Paths) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Paths) > 0 { - for _, e := range m.Paths { - l = e.Size() - n += 1 + l + sovMarket(uint64(l)) - } - } - return n -} - -func (m *Providers) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Providers) > 0 { - for _, e := range m.Providers { - l = e.Size() - n += 1 + l + sovMarket(uint64(l)) - } - } - return n -} - func (m *MarketMap) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Tickers) > 0 { - for k, v := range m.Tickers { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovMarket(uint64(len(k))) + 1 + l + sovMarket(uint64(l)) - n += mapEntrySize + 1 + sovMarket(uint64(mapEntrySize)) - } - } - if len(m.Paths) > 0 { - for k, v := range m.Paths { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovMarket(uint64(len(k))) + 1 + l + sovMarket(uint64(l)) - n += mapEntrySize + 1 + sovMarket(uint64(mapEntrySize)) - } - } - if len(m.Providers) > 0 { - for k, v := range m.Providers { + if len(m.Markets) > 0 { + for k, v := range m.Markets { _ = k _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovMarket(uint64(len(k))) + 1 + l + sovMarket(uint64(l)) - n += mapEntrySize + 1 + sovMarket(uint64(mapEntrySize)) - } - } - if m.AggregationType != 0 { - n += 1 + sovMarket(uint64(m.AggregationType)) - } - return n -} - -func sovMarket(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMarket(x uint64) (n int) { - return sovMarket(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Ticker) 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 ErrIntOverflowMarket - } - 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: Ticker: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ticker: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CurrencyPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) - } - m.MinProviderCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinProviderCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata_JSON = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProviderConfig) 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 ErrIntOverflowMarket - } - 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: ProviderConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProviderConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OffChainTicker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Path) 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 ErrIntOverflowMarket - } - 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: Path: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Path: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operations = append(m.Operations, Operation{}) - if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation) 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 ErrIntOverflowMarket - } - 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: Operation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CurrencyPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invert = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + l = v.Size() + mapEntrySize := 1 + len(k) + sovMarket(uint64(len(k))) + 1 + l + sovMarket(uint64(l)) + n += mapEntrySize + 1 + sovMarket(uint64(mapEntrySize)) } } + return n +} - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func sovMarket(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMarket(x uint64) (n int) { + return sovMarket(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Paths) Unmarshal(dAtA []byte) error { +func (m *Market) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1599,15 +698,48 @@ func (m *Paths) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Paths: wiretype end group for non-group") + return fmt.Errorf("proto: Market: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Paths: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Market: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Ticker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderConfigs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1634,8 +766,8 @@ func (m *Paths) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Paths = append(m.Paths, Path{}) - if err := m.Paths[len(m.Paths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ProviderConfigs = append(m.ProviderConfigs, ProviderConfig{}) + if err := m.ProviderConfigs[len(m.ProviderConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1660,7 +792,7 @@ func (m *Paths) Unmarshal(dAtA []byte) error { } return nil } -func (m *Providers) Unmarshal(dAtA []byte) error { +func (m *Ticker) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1683,15 +815,15 @@ func (m *Providers) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Providers: wiretype end group for non-group") + return fmt.Errorf("proto: Ticker: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Providers: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Ticker: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Providers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyPair", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1718,11 +850,100 @@ func (m *Providers) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Providers = append(m.Providers, ProviderConfig{}) - if err := m.Providers[len(m.Providers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CurrencyPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) + } + m.MinProviderCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinProviderCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata_JSON = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMarket(dAtA[iNdEx:]) @@ -1744,7 +965,7 @@ func (m *Providers) Unmarshal(dAtA []byte) error { } return nil } -func (m *MarketMap) Unmarshal(dAtA []byte) error { +func (m *ProviderConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1767,17 +988,17 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MarketMap: wiretype end group for non-group") + return fmt.Errorf("proto: ProviderConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MarketMap: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProviderConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tickers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMarket @@ -1787,124 +1008,59 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tickers == nil { - m.Tickers = make(map[string]Ticker) - } - var mapkey string - mapvalue := &Ticker{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthMarket - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthMarket - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthMarket - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthMarket - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Ticker{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } } - m.Tickers[mapkey] = *mapvalue + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OffChainTicker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NormalizeByPair", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1931,109 +1087,118 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Paths == nil { - m.Paths = make(map[string]Paths) + if m.NormalizeByPair == nil { + m.NormalizeByPair = &types.CurrencyPair{} } - var mapkey string - mapvalue := &Paths{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.NormalizeByPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthMarket - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthMarket - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthMarket - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthMarket - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Paths{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Invert = bool(v != 0) + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMarket + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } } - m.Paths[mapkey] = *mapvalue + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMarket + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMarket + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata_JSON = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipMarket(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMarket + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MarketMap) 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 ErrIntOverflowMarket + } + 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: MarketMap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketMap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Providers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Markets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2060,11 +1225,11 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Providers == nil { - m.Providers = make(map[string]Providers) + if m.Markets == nil { + m.Markets = make(map[string]Market) } var mapkey string - mapvalue := &Providers{} + mapvalue := &Market{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -2138,7 +1303,7 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &Providers{} + mapvalue = &Market{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -2158,27 +1323,8 @@ func (m *MarketMap) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Providers[mapkey] = *mapvalue + m.Markets[mapkey] = *mapvalue iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AggregationType", wireType) - } - m.AggregationType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AggregationType |= AggregationType(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipMarket(dAtA[iNdEx:]) diff --git a/x/marketmap/types/market_test.go b/x/marketmap/types/market_test.go index d932b4650..615725932 100644 --- a/x/marketmap/types/market_test.go +++ b/x/marketmap/types/market_test.go @@ -1 +1,345 @@ package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/skip-mev/slinky/oracle/constants" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + "github.com/skip-mev/slinky/providers/apis/coinbase" + "github.com/skip-mev/slinky/x/marketmap/types" +) + +var ( + btcusdt = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USDT", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-usdt", + }, + }, + } + + btcusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USD", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-usdt", + NormalizeByPair: &usdtusd.Ticker.CurrencyPair, + }, + }, + } + + usdtusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "USDT", + Quote: "USD", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "usdt-usd", + }, + }, + } + + usdcusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "USDC", + Quote: "USD", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "usdc-usd", + }, + }, + } + + ethusdt = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "ETHEREUM", + Quote: "USDT", + }, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "eth-usdt", + }, + }, + } + + ethusd = types.Market{ + Ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "ETHEREUM", + Quote: "USD", + }, + Decimals: 8, + MinProviderCount: 3, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "eth-usdt", + NormalizeByPair: &usdtusd.Ticker.CurrencyPair, + }, + { + Name: "binance", + OffChainTicker: "eth-usdt", + NormalizeByPair: &usdtusd.Ticker.CurrencyPair, + }, + { + Name: "mexc", + OffChainTicker: "eth-usdt", + NormalizeByPair: &usdtusd.Ticker.CurrencyPair, + }, + }, + } + + markets = map[string]types.Market{ + btcusdt.Ticker.String(): btcusdt, + btcusd.Ticker.String(): btcusd, + usdtusd.Ticker.String(): usdtusd, + usdcusd.Ticker.String(): usdcusd, + ethusdt.Ticker.String(): ethusdt, + ethusd.Ticker.String(): ethusd, + } +) + +func TestMarketMapValidateBasic(t *testing.T) { + testCases := []struct { + name string + marketMap types.MarketMap + expectErr bool + }{ + { + name: "valid empty", + marketMap: types.MarketMap{}, + expectErr: false, + }, + { + name: "valid map", + marketMap: types.MarketMap{ + Markets: markets, + }, + expectErr: false, + }, + { + name: "market with no ticker", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): { + ProviderConfigs: []types.ProviderConfig{ + { + Name: coinbase.Name, + OffChainTicker: "BTC-USD", + }, + }, + }, + }, + }, + expectErr: true, + }, + { + name: "empty market", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): {}, + }, + }, + expectErr: true, + }, + { + name: "provider config includes a ticker that is not supported", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): { + Ticker: types.Ticker{ + CurrencyPair: constants.BITCOIN_USD, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: coinbase.Name, + OffChainTicker: "btc-usd", + NormalizeByPair: &slinkytypes.CurrencyPair{Base: "not", Quote: "real"}, + Invert: false, + Metadata_JSON: "", + }, + }, + }, + }, + }, + expectErr: true, + }, + { + name: "empty provider name", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): { + Ticker: types.Ticker{ + CurrencyPair: constants.BITCOIN_USD, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "", + OffChainTicker: "btc-usd", + Invert: false, + Metadata_JSON: "", + }, + }, + }, + }, + }, + expectErr: true, + }, + { + name: "no provider configs", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): { + Ticker: types.Ticker{ + CurrencyPair: constants.BITCOIN_USD, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{}, + }, + }, + }, + expectErr: true, + }, + { + name: "valid single provider", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + constants.BITCOIN_USD.String(): { + Ticker: types.Ticker{ + CurrencyPair: constants.BITCOIN_USD, + Decimals: 8, + MinProviderCount: 1, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: coinbase.Name, + OffChainTicker: "BTC-USD", + }, + }, + }, + }, + }, + expectErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + err := tc.marketMap.ValidateBasic() + if tc.expectErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestMarketMapEqual(t *testing.T) { + cases := []struct { + name string + marketMap types.MarketMap + other types.MarketMap + expect bool + }{ + { + name: "empty market map", + marketMap: types.MarketMap{}, + other: types.MarketMap{}, + expect: true, + }, + { + name: "same market map", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): ethusdt, + }, + }, + other: types.MarketMap{ + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): ethusdt, + }, + }, + expect: true, + }, + { + name: "different tickers", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): ethusdt, + }, + }, + other: types.MarketMap{ + Markets: map[string]types.Market{ + btcusdt.Ticker.String(): btcusdt, + }, + }, + expect: false, + }, + { + name: "different providers", + marketMap: types.MarketMap{ + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): ethusdt, + }, + }, + other: types.MarketMap{ + Markets: map[string]types.Market{ + ethusdt.Ticker.String(): { + Ticker: ethusdt.Ticker, + ProviderConfigs: btcusdt.ProviderConfigs, + }, + }, + }, + expect: false, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + require.Equal(t, tc.expect, tc.marketMap.Equal(tc.other)) + }) + } +} diff --git a/x/marketmap/types/msg.go b/x/marketmap/types/msg.go index fe57efaac..b68120334 100644 --- a/x/marketmap/types/msg.go +++ b/x/marketmap/types/msg.go @@ -7,48 +7,88 @@ import ( ) var ( - _ sdk.Msg = &MsgUpdateMarketMap{} + _ sdk.Msg = &MsgCreateMarkets{} + _ sdk.Msg = &MsgUpdateMarkets{} _ sdk.Msg = &MsgParams{} + _ sdk.Msg = &MsgRemoveMarketAuthorities{} ) // ValidateBasic determines whether the information in the message is formatted correctly, specifically // whether the signer is a valid acc-address. -func (m *MsgUpdateMarketMap) ValidateBasic() error { +func (m *MsgCreateMarkets) ValidateBasic() error { // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { return err } + if len(m.CreateMarkets) == 0 { + return fmt.Errorf("no markets to create") + } + for _, market := range m.CreateMarkets { - if err := market.Ticker.ValidateBasic(); err != nil { + if err := market.ValidateBasic(); err != nil { return err } + } + + return nil +} + +// ValidateBasic determines whether the information in the message is formatted correctly, specifically +// whether the signer is a valid acc-address. +func (m *MsgUpdateMarkets) ValidateBasic() error { + // validate signer address + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return err + } + + if len(m.UpdateMarkets) == 0 { + return fmt.Errorf("no markets to update") + } - for _, path := range market.Paths.Paths { - if err := path.ValidateBasic(); err != nil { - return err - } + for _, market := range m.UpdateMarkets { + if err := market.ValidateBasic(); err != nil { + return err } + } + + return nil +} + +// ValidateBasic determines whether the information in the message is formatted correctly, specifically +// whether the signer is a valid acc-address. +func (m *MsgParams) ValidateBasic() error { + // validate signer address + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return err + } + + return m.Params.ValidateBasic() +} - if uint64(len(market.Providers.Providers)) < market.Ticker.MinProviderCount { - return fmt.Errorf("this ticker must have at least %d providers; got %d", - market.Ticker.MinProviderCount, - len(market.Providers.Providers), - ) +// ValidateBasic determines whether the information in the message is formatted correctly, specifically +// whether the signer is a valid acc-address. +func (m *MsgRemoveMarketAuthorities) ValidateBasic() error { + // validate signer address + if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { + return err + } + + if len(m.RemoveAddresses) == 0 { + return fmt.Errorf("addresses to remove cannot be nil") + } + + seenAuthorities := make(map[string]struct{}, len(m.RemoveAddresses)) + for _, authority := range m.RemoveAddresses { + if _, seen := seenAuthorities[authority]; seen { + return fmt.Errorf("duplicate address %s found", authority) } - seenProviders := make(map[string]struct{}, len(market.Providers.Providers)) - for _, provider := range market.Providers.Providers { - if err := provider.ValidateBasic(); err != nil { - return err - } - - // check for duplicate providers - if _, seen := seenProviders[provider.Name]; seen { - return fmt.Errorf("duplicate provider found: %s", provider.Name) - } - seenProviders[provider.Name] = struct{}{} + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + return fmt.Errorf("invalid market authority string: %w", err) } + + seenAuthorities[authority] = struct{}{} } return nil diff --git a/x/marketmap/types/msg_test.go b/x/marketmap/types/msg_test.go index 60d603cc8..0c3beeb8a 100644 --- a/x/marketmap/types/msg_test.go +++ b/x/marketmap/types/msg_test.go @@ -24,49 +24,42 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { tcs := []struct { name string - msg types.MsgUpdateMarketMap + msg types.MsgCreateMarkets expectPass bool }{ { - "if the signer is not an acc-address - fail", - types.MsgUpdateMarketMap{ - Signer: "invalid", + "if the authority is not an acc-address - fail", + types.MsgCreateMarkets{ + Authority: "invalid", }, false, }, { - "invalid ticker - fail", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + "if there are no creates - fail", + types.MsgCreateMarkets{ + Authority: sample.Address(sample.Rand()), + }, + false, + }, + { + "invalid ticker (0 decimals) - fail", + types.MsgCreateMarkets{ + Authority: sample.Address(sample.Rand()), + CreateMarkets: []types.Market{ { Ticker: types.Ticker{ CurrencyPair: validCurrencyPair, Decimals: 0, MinProviderCount: 0, }, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", }, - }, - Paths: types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: validTicker.CurrencyPair, - Invert: false, - }, - }, - }, + { + Name: "mexc", + OffChainTicker: "btceth", }, }, }, @@ -75,30 +68,38 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { false, }, { - "invalid num providers - fail", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + "invalid num providers (need more than 1) - fail", + types.MsgCreateMarkets{ + Authority: sample.Address(sample.Rand()), + CreateMarkets: []types.Market{ { Ticker: validTicker, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", }, }, - Paths: types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: validTicker.CurrencyPair, - Invert: false, - }, - }, - }, + }, + }, + }, + false, + }, + { + "invalid empty off-chain ticker - fail", + types.MsgCreateMarkets{ + Authority: sample.Address(sample.Rand()), + CreateMarkets: []types.Market{ + { + Ticker: validTicker, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", + }, + { + Name: "mexc", + OffChainTicker: "", }, }, }, @@ -107,34 +108,91 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { false, }, { - "invalid empty offchain ticker - fail", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + "valid message", + types.MsgCreateMarkets{ + Authority: sample.Address(sample.Rand()), + CreateMarkets: []types.Market{ { Ticker: validTicker, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", + }, + { + Name: "mexc", + OffChainTicker: "btceth", }, }, - Paths: types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: validTicker.CurrencyPair, - Invert: false, - }, - }, - }, + }, + }, + }, + true, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + if !tc.expectPass { + require.NotNil(t, err) + } else { + require.Nil(t, err) + } + }) + } +} + +func TestValidateBasicMsgUpdateMarket(t *testing.T) { + validCurrencyPair := slinkytypes.CurrencyPair{ + Base: "BTC", + Quote: "ETH", + } + + validTicker := types.Ticker{ + CurrencyPair: validCurrencyPair, + Decimals: 8, + MinProviderCount: 2, + } + + tcs := []struct { + name string + msg types.MsgUpdateMarkets + expectPass bool + }{ + { + "if the Authority is not an acc-address - fail", + types.MsgUpdateMarkets{ + Authority: "invalid", + }, + false, + }, + { + "if there are no creates - fail", + types.MsgUpdateMarkets{ + Authority: sample.Address(sample.Rand()), + }, + false, + }, + { + "invalid ticker (decimals) - fail", + types.MsgUpdateMarkets{ + Authority: sample.Address(sample.Rand()), + UpdateMarkets: []types.Market{ + { + Ticker: types.Ticker{ + CurrencyPair: validCurrencyPair, + Decimals: 0, + MinProviderCount: 0, + }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", + }, + { + Name: "mexc", + OffChainTicker: "btceth", }, }, }, @@ -143,51 +201,39 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { false, }, { - "invalid no paths - fail", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + "invalid num providers (need more than 1) - fail", + types.MsgUpdateMarkets{ + Authority: sample.Address(sample.Rand()), + UpdateMarkets: []types.Market{ { Ticker: validTicker, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", }, }, - Paths: types.Paths{}, }, }, }, false, }, { - "invalid path - fail", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + "invalid empty offchain ticker - fail", + types.MsgUpdateMarkets{ + Authority: sample.Address(sample.Rand()), + UpdateMarkets: []types.Market{ { Ticker: validTicker, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", + }, + { + Name: "mexc", + OffChainTicker: "", }, - }, - Paths: types.Paths{ - Paths: make([]types.Path, 0), }, }, }, @@ -196,33 +242,19 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { }, { "valid message", - types.MsgUpdateMarketMap{ - Signer: sample.Address(sample.Rand()), - CreateMarkets: []types.CreateMarket{ + types.MsgUpdateMarkets{ + Authority: sample.Address(sample.Rand()), + UpdateMarkets: []types.Market{ { Ticker: validTicker, - Providers: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, + ProviderConfigs: []types.ProviderConfig{ + { + Name: "kucoin", + OffChainTicker: "btc-eth", }, - }, - Paths: types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: validTicker.CurrencyPair, - Invert: false, - }, - }, - }, + { + Name: "mexc", + OffChainTicker: "btceth", }, }, }, @@ -243,3 +275,108 @@ func TestValidateBasicMsgCreateMarket(t *testing.T) { }) } } + +func TestValidateBasicMsgParams(t *testing.T) { + rng := sample.Rand() + + tcs := []struct { + name string + msg types.MsgParams + expectPass bool + }{ + { + "if the Authority is not an acc-address - fail", + types.MsgParams{ + Authority: "invalid", + }, + false, + }, + { + name: "invalid params (no authorities) - fail", + msg: types.MsgParams{ + Params: types.Params{ + MarketAuthorities: nil, + }, + Authority: sample.Address(rng), + }, + expectPass: false, + }, + { + name: "valid params", + msg: types.MsgParams{ + Params: types.Params{ + MarketAuthorities: []string{sample.Address(rng)}, + Admin: sample.Address(rng), + }, + Authority: sample.Address(rng), + }, + expectPass: true, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + if !tc.expectPass { + require.NotNil(t, err) + } else { + require.Nil(t, err) + } + }) + } +} + +func TestValidateBasicMsgRemoveMarketAuthorities(t *testing.T) { + rng := sample.Rand() + + sampleAuth := sample.Address(rng) + + tcs := []struct { + name string + msg types.MsgRemoveMarketAuthorities + expectPass bool + }{ + { + "if the Admin is not an acc-address - fail", + types.MsgRemoveMarketAuthorities{ + Admin: "invalid", + }, + false, + }, + { + name: "invalid message (no authorities) - fail", + msg: types.MsgRemoveMarketAuthorities{ + RemoveAddresses: nil, + Admin: sample.Address(rng), + }, + expectPass: false, + }, + { + name: "valid message", + msg: types.MsgRemoveMarketAuthorities{ + RemoveAddresses: []string{sample.Address(rng)}, + Admin: sample.Address(rng), + }, + expectPass: true, + }, + { + name: "invalid message (duplicate authorities", + msg: types.MsgRemoveMarketAuthorities{ + RemoveAddresses: []string{sampleAuth, sampleAuth}, + Admin: sample.Address(rng), + }, + expectPass: false, + }, + } + + for _, tc := range tcs { + t.Run(tc.name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + if !tc.expectPass { + require.NotNil(t, err) + } else { + require.Nil(t, err) + } + }) + } +} diff --git a/x/marketmap/types/params.go b/x/marketmap/types/params.go index 5ce0560eb..adcc93bcc 100644 --- a/x/marketmap/types/params.go +++ b/x/marketmap/types/params.go @@ -8,34 +8,54 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) -const ( - // DefaultVersion is the default value for the Version Param. - DefaultVersion = 0 +var ( + // DefaultMarketAuthority is the default value for the market authority Param. + DefaultMarketAuthority = authtypes.NewModuleAddress(govtypes.ModuleName).String() + // DefaultAdmin is the default value for the market admin Param. + DefaultAdmin = authtypes.NewModuleAddress(govtypes.ModuleName).String() ) -// DefaultMarketAuthority is the default value for the market authority Param. -var DefaultMarketAuthority = authtypes.NewModuleAddress(govtypes.ModuleName).String() - // DefaultParams returns default marketmap parameters. func DefaultParams() Params { return Params{ - MarketAuthority: DefaultMarketAuthority, - Version: DefaultVersion, + MarketAuthorities: []string{DefaultMarketAuthority}, + Admin: DefaultAdmin, } } // NewParams returns a new Params instance. -func NewParams(authority string, version uint64) Params { - return Params{ - MarketAuthority: authority, - Version: version, +func NewParams(authorities []string, admin string) (Params, error) { + if authorities == nil { + return Params{}, fmt.Errorf("cannot create Params with nil authority") } + + return Params{ + MarketAuthorities: authorities, + Admin: admin, + }, nil } // ValidateBasic performs stateless validation of the Params. func (p *Params) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(p.MarketAuthority); err != nil { - return fmt.Errorf("invalid market authority string: %w", err) + if p.MarketAuthorities == nil { + return fmt.Errorf("cannot create Params with empty market authorities") + } + + seenAuthorities := make(map[string]struct{}, len(p.MarketAuthorities)) + for _, authority := range p.MarketAuthorities { + if _, seen := seenAuthorities[authority]; seen { + return fmt.Errorf("duplicate authority %s found", authority) + } + + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + return fmt.Errorf("invalid market authority string: %w", err) + } + + seenAuthorities[authority] = struct{}{} + } + + if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { + return fmt.Errorf("invalid marketmap admin string: %w", err) } return nil diff --git a/x/marketmap/types/params.pb.go b/x/marketmap/types/params.pb.go index 6b7239ea2..9fe5a12be 100644 --- a/x/marketmap/types/params.pb.go +++ b/x/marketmap/types/params.pb.go @@ -24,12 +24,12 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the x/marketmap module. type Params struct { - // MarketAuthority is the authority account that is able to control updating - // the marketmap. - MarketAuthority string `protobuf:"bytes,1,opt,name=market_authority,json=marketAuthority,proto3" json:"market_authority,omitempty"` - // Version is the schema version for the MarketMap data structure and query - // response. - Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // MarketAuthorities is the list of authority accounts that are able to + // control updating the marketmap. + MarketAuthorities []string `protobuf:"bytes,1,rep,name=market_authorities,json=marketAuthorities,proto3" json:"market_authorities,omitempty"` + // Admin is an address that can remove addresses from the MarketAuthorities + // list. Only governance can add to the MarketAuthorities or change the Admin. + Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -65,18 +65,18 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetMarketAuthority() string { +func (m *Params) GetMarketAuthorities() []string { if m != nil { - return m.MarketAuthority + return m.MarketAuthorities } - return "" + return nil } -func (m *Params) GetVersion() uint64 { +func (m *Params) GetAdmin() string { if m != nil { - return m.Version + return m.Admin } - return 0 + return "" } func init() { @@ -90,15 +90,15 @@ var fileDescriptor_ee4934564ff92a6f = []byte{ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xce, 0xc9, 0xcc, 0xcb, 0xae, 0xd4, 0xcf, 0x4d, 0x2c, 0xca, 0x4e, 0x2d, 0xc9, 0x4d, 0x2c, 0xd0, 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xa8, - 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x54, 0xf2, 0xe5, 0x62, 0x0b, 0x00, 0x2b, 0x12, 0xd2, 0xe4, - 0x12, 0x80, 0xc8, 0xc4, 0x27, 0x96, 0x96, 0x64, 0xe4, 0x17, 0x65, 0x96, 0x54, 0x4a, 0x30, 0x2a, - 0x30, 0x6a, 0x70, 0x06, 0xf1, 0x43, 0xc4, 0x1d, 0x61, 0xc2, 0x42, 0x12, 0x5c, 0xec, 0x65, 0xa9, - 0x45, 0xc5, 0x99, 0xf9, 0x79, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x30, 0xae, 0x93, 0xdb, + 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x54, 0xf2, 0xe5, 0x62, 0x0b, 0x00, 0x2b, 0x12, 0xd2, 0xe5, + 0x12, 0x82, 0xc8, 0xc4, 0x27, 0x96, 0x96, 0x64, 0xe4, 0x17, 0x65, 0x96, 0x64, 0xa6, 0x16, 0x4b, + 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x09, 0x42, 0x64, 0x1c, 0x11, 0x12, 0x42, 0x22, 0x5c, 0xac, + 0x89, 0x29, 0xb9, 0x99, 0x79, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x10, 0x8e, 0x93, 0xdb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x17, 0x67, 0x67, 0x16, 0xe8, 0xe6, 0xa6, 0x96, 0xe9, 0x43, 0xdd, 0x5c, 0x81, 0xe4, 0xea, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x93, 0x8d, 0x01, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x57, 0x0b, 0x3d, 0xe1, 0xd6, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xfb, 0xbf, 0x2c, 0xd6, 0x00, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -121,17 +121,21 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Version != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.Version)) + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintParams(dAtA, i, uint64(len(m.Admin))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(m.MarketAuthority) > 0 { - i -= len(m.MarketAuthority) - copy(dAtA[i:], m.MarketAuthority) - i = encodeVarintParams(dAtA, i, uint64(len(m.MarketAuthority))) - i-- - dAtA[i] = 0xa + if len(m.MarketAuthorities) > 0 { + for iNdEx := len(m.MarketAuthorities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MarketAuthorities[iNdEx]) + copy(dAtA[i:], m.MarketAuthorities[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.MarketAuthorities[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } @@ -153,13 +157,16 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = len(m.MarketAuthority) + if len(m.MarketAuthorities) > 0 { + for _, s := range m.MarketAuthorities { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + l = len(m.Admin) if l > 0 { n += 1 + l + sovParams(uint64(l)) } - if m.Version != 0 { - n += 1 + sovParams(uint64(m.Version)) - } return n } @@ -200,7 +207,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketAuthority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MarketAuthorities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -228,13 +235,13 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MarketAuthority = string(dAtA[iNdEx:postIndex]) + m.MarketAuthorities = append(m.MarketAuthorities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) } - m.Version = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowParams @@ -244,11 +251,24 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/marketmap/types/params_test.go b/x/marketmap/types/params_test.go index dcc9dd18f..59558be36 100644 --- a/x/marketmap/types/params_test.go +++ b/x/marketmap/types/params_test.go @@ -3,6 +3,7 @@ package types_test import ( "testing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/require" "github.com/skip-mev/slinky/x/marketmap/types" @@ -22,8 +23,43 @@ func TestValidateBasic(t *testing.T) { expectErr: false, }, { - name: "invalid authority", - params: types.NewParams("incorrect", 10), + name: "valid multiple authorities", + params: types.Params{ + MarketAuthorities: []string{authtypes.NewModuleAddress(authtypes.ModuleName).String(), types.DefaultMarketAuthority}, + Admin: types.DefaultAdmin, + }, + expectErr: false, + }, + { + name: "invalid admin", + params: types.Params{ + MarketAuthorities: []string{authtypes.NewModuleAddress(authtypes.ModuleName).String(), types.DefaultMarketAuthority}, + Admin: "invalid", + }, + expectErr: true, + }, + { + name: "invalid duplicate authority", + params: types.Params{ + MarketAuthorities: []string{types.DefaultMarketAuthority, types.DefaultMarketAuthority}, + Admin: types.DefaultAdmin, + }, + expectErr: true, + }, + { + name: "invalid authority string", + params: types.Params{ + MarketAuthorities: []string{"incorrect"}, + Admin: types.DefaultAdmin, + }, + expectErr: true, + }, + { + name: "invalid nil authority", + params: types.Params{ + MarketAuthorities: nil, + Admin: types.DefaultAdmin, + }, expectErr: true, }, { diff --git a/x/marketmap/types/path.go b/x/marketmap/types/path.go deleted file mode 100644 index 06269b4c1..000000000 --- a/x/marketmap/types/path.go +++ /dev/null @@ -1,238 +0,0 @@ -package types - -import ( - "fmt" - "strings" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" -) - -// NewPath returns a new Path instance. A Path is a list of convertable markets -// that will be used to convert the prices of a set of tickers to a common ticker. -func NewPath(ops ...Operation) (Path, error) { - p := Path{ - Operations: ops, - } - - if err := p.ValidateBasic(); err != nil { - return Path{}, err - } - - return p, nil -} - -// Match returns true if the path matches the provided ticker. -func (p *Path) Match(ticker string) bool { - if len(p.Operations) == 0 { - return false - } - - first := p.Operations[0] - base := first.CurrencyPair.Base - if first.Invert { - base = first.CurrencyPair.Quote - } - - last := p.Operations[len(p.Operations)-1] - quote := last.CurrencyPair.Quote - if last.Invert { - quote = last.CurrencyPair.Base - } - - return ticker == fmt.Sprintf("%s/%s", base, quote) -} - -// GetCurrencyPairs returns the set of CurrencyPairs in the path. Note that some of the CurrencyPairs -// may need to be inverted. This function does NOT return the inverted CurrencyPairs. -func (p *Path) GetCurrencyPairs() []slinkytypes.CurrencyPair { - cps := make([]slinkytypes.CurrencyPair, len(p.Operations)) - for i, op := range p.Operations { - cps[i] = op.CurrencyPair - } - return cps -} - -// ShowRoute returns the route of the path in human-readable format. -func (p *Path) ShowRoute() string { - hops := make([]string, len(p.Operations)) - for i, op := range p.Operations { - base := op.CurrencyPair.Base - if op.Invert { - base = op.CurrencyPair.Quote - } - - quote := op.CurrencyPair.Quote - if op.Invert { - quote = op.CurrencyPair.Base - } - - hops[i] = fmt.Sprintf("%s/%s", base, quote) - } - - return strings.Join(hops, " -> ") -} - -// ValidateBasic performs basic validation on the Path. Specifically this will check -// that order is topologically sorted for each market. For example, if the oracle -// receives a price for BTC/USDT and USDT/USD, the order must be BTC/USDT -> USDT/USD. -// Alternatively, if the oracle receives a price for BTC/USDT and USD/USDT, the order -// must be BTC/USDT -> USD/USDT (inverted == true). -func (p *Path) ValidateBasic() error { - if len(p.Operations) == 0 { - return fmt.Errorf("path cannot be empty") - } - - first := p.Operations[0] - if err := first.ValidateBasic(); err != nil { - return err - } - - if len(p.Operations) == 1 { - return nil - } - - if len(p.Operations) > MaxPathLength { - return fmt.Errorf("length of path cannot be longer than %d, got %d", MaxPathLength, len(p.Operations)) - } - - quote := first.CurrencyPair.Quote - if first.Invert { - quote = first.CurrencyPair.Base - } - - // Ensure that the path is a directed acyclic graph. - seen := map[slinkytypes.CurrencyPair]struct{}{ - first.CurrencyPair: {}, - } - for _, op := range p.Operations[1:] { - if err := op.ValidateBasic(); err != nil { - return err - } - - if op.Invert { - if _, ok := seen[op.CurrencyPair.Invert()]; ok { - return fmt.Errorf("duplicated pair found") - } - } - - if _, ok := seen[op.CurrencyPair]; ok { - return fmt.Errorf("path is not a directed acyclic graph") - } - seen[op.CurrencyPair] = struct{}{} - - switch { - case !op.Invert && quote != op.CurrencyPair.Base: - return fmt.Errorf("invalid path; expected %s, got %s", quote, op.CurrencyPair.Base) - case !op.Invert && quote == op.CurrencyPair.Base: - quote = op.CurrencyPair.Quote - case op.Invert && quote != op.CurrencyPair.Quote: - return fmt.Errorf("invalid path; expected %s, got %s", quote, op.CurrencyPair.Quote) - case op.Invert && quote == op.CurrencyPair.Quote: - quote = op.CurrencyPair.Base - } - } - - return nil -} - -// NewOperation returns a new Operation instance. An Operation is a single step -// in a path that represents a conversion from one ticker to another. The operation's -// ticker is a price feed that is supported by a set of providers and may be inverted -// if necessary. -func NewOperation(cp slinkytypes.CurrencyPair, invert bool) (Operation, error) { - o := Operation{ - CurrencyPair: cp, - Invert: invert, - } - - if err := o.ValidateBasic(); err != nil { - return Operation{}, err - } - - return o, nil -} - -// ValidateBasic performs basic validation on the Operation. -func (o *Operation) ValidateBasic() error { - return o.CurrencyPair.ValidateBasic() -} - -// ValidateBasic performs basic validation on the Paths. -func (p *Paths) ValidateBasic(cp slinkytypes.CurrencyPair) error { - if len(p.Paths) == 0 { - return fmt.Errorf("at least one path is required for a ticker to be calculated") - } - - // Track the routes to ensure that there are no duplicates. - routes := make(map[string]struct{}) - for _, path := range p.Paths { - if err := path.ValidateBasic(); err != nil { - return err - } - - route := path.ShowRoute() - if _, ok := routes[route]; ok { - return fmt.Errorf("duplicate route found: %s", route) - } - routes[route] = struct{}{} - - // Ensure that the path ends up converting to the ticker. - if !path.Match(cp.String()) { - return fmt.Errorf("path does not match ticker") - } - } - - return nil -} - -// UniqueTickers returns all unique tickers across all paths that -// are part of the Paths. This is particularly useful for determining the -// set of markets that are required for a given ticker as well as ensuring -// that a given set of providers can provide the required markets. -func (p *Paths) UniqueTickers() map[slinkytypes.CurrencyPair]struct{} { - seen := make(map[slinkytypes.CurrencyPair]struct{}) - - for _, path := range p.Paths { - for _, cp := range path.GetCurrencyPairs() { - seen[cp] = struct{}{} - } - } - - return seen -} - -// Equal returns true iff the Paths is equal to the given Paths. -func (p *Paths) Equal(other Paths) bool { - if len(p.Paths) != len(other.Paths) { - return false - } - - for i, path := range p.Paths { - if !path.Equal(other.Paths[i]) { - return false - } - } - - return true -} - -// Equal returns true iff the Path is equal to the given Path. -func (p *Path) Equal(other Path) bool { - if len(p.Operations) != len(other.Operations) { - return false - } - - for i, op := range p.Operations { - if !op.Equal(other.Operations[i]) { - return false - } - } - - return true -} - -// Equal returns true iff the Operation is equal to the given Operation. -func (o *Operation) Equal(other Operation) bool { - return o.CurrencyPair.Equal(other.CurrencyPair) && - o.Invert == other.Invert && o.Provider == other.Provider -} diff --git a/x/marketmap/types/path_test.go b/x/marketmap/types/path_test.go deleted file mode 100644 index 204082832..000000000 --- a/x/marketmap/types/path_test.go +++ /dev/null @@ -1,600 +0,0 @@ -package types_test - -import ( - "testing" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - - "github.com/stretchr/testify/require" - - "github.com/skip-mev/slinky/x/marketmap/types" -) - -var ( - btcusdt = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - } - - btcusdtPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - }, - }, - }, - }, - } - - btcusdtProviders = types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdt", - }, - }, - } - - usdtusd = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - } - - usdtusdPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - }, - }, - }, - }, - } - - usdtusdProviders = types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdt-usd", - }, - }, - } - - usdcusd = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - } - - usdcusdPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - }, - }, - }, - }, - } - - usdcusdProviders = types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdc-usd", - }, - }, - } - - ethusdt = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - } - - ethusdtPaths = types.Paths{ - Paths: []types.Path{ - { - Operations: []types.Operation{ - { - Provider: "kucoin", - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - }, - }, - }, - }, - } - - ethusdtProviders = types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "eth-usdt", - }, - }, - } - - usdteth = types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "ETHEREUM", - }, - Decimals: 8, - MinProviderCount: 1, - } - - tickers = map[string]types.Ticker{ - btcusdt.String(): btcusdt, - usdcusd.String(): usdcusd, - usdtusd.String(): usdtusd, - ethusdt.String(): ethusdt, - } - - paths = map[string]types.Paths{ - btcusdt.String(): btcusdtPaths, - usdcusd.String(): usdcusdPaths, - usdtusd.String(): usdtusdPaths, - ethusdt.String(): ethusdtPaths, - } - - providers = map[string]types.Providers{ - btcusdt.String(): btcusdtProviders, - usdcusd.String(): usdcusdProviders, - usdtusd.String(): usdtusdProviders, - ethusdt.String(): ethusdtProviders, - } - - markets = struct { - tickers map[string]types.Ticker - paths map[string]types.Paths - providers map[string]types.Providers - }{ - tickers: tickers, - paths: paths, - providers: providers, - } - - _ = markets -) - -func TestPaths(t *testing.T) { - testCases := []struct { - name string - paths types.Paths - currencyPair slinkytypes.CurrencyPair - expErr bool - }{ - { - name: "valid", - paths: btcusdtPaths, - currencyPair: btcusdt.CurrencyPair, - expErr: false, - }, - { - name: "invalid", - paths: types.Paths{}, - currencyPair: btcusdt.CurrencyPair, - expErr: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.paths.ValidateBasic(tc.currencyPair) - if tc.expErr { - require.Error(t, err) - return - } - - require.NoError(t, err) - }) - } -} - -func TestPathsEqual(t *testing.T) { - cases := []struct { - name string - paths types.Paths - other types.Paths - exp bool - }{ - { - name: "equal paths", - paths: btcusdtPaths, - other: btcusdtPaths, - exp: true, - }, - { - name: "different length", - paths: btcusdtPaths, - other: types.Paths{}, - exp: false, - }, - { - name: "different paths", - paths: btcusdtPaths, - other: ethusdtPaths, - exp: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.paths.Equal(tc.other), tc.exp) - }) - } -} - -func TestPath(t *testing.T) { - testCases := []struct { - name string - path types.Path - target string - expErr bool - }{ - { - name: "empty path", - path: types.Path{}, - target: "", - expErr: true, - }, - { - name: "invalid path with a single operation", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: slinkytypes.CurrencyPair{}, - }, - }, - }, - target: "", - expErr: true, - }, - { - name: "invalid path with multiple operations with a bad ticker in the route", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: slinkytypes.CurrencyPair{}, - }, - }, - }, - target: "", - expErr: true, - }, - { - name: "invalid path with multiple operations and mismatching tickers", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: ethusdt.CurrencyPair, - }, - }, - }, - target: "", - expErr: true, - }, - { - name: "invalid path with multiple operations and cyclic graph", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - Invert: true, - }, - }, - }, - target: "", - expErr: true, - }, - { - name: "invalid path with multiple operations inverted duplicate", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: ethusdt.CurrencyPair, - }, - { - CurrencyPair: usdteth.CurrencyPair, - Invert: true, - }, - }, - }, - target: "", - expErr: true, - }, - { - name: "valid path with a single operation", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - }, - }, - target: "BITCOIN/USDT", - expErr: false, - }, - { - name: "valid path with multiple operations", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - }, - }, - }, - target: "BITCOIN/USD", - expErr: false, - }, - { - name: "valid path with multiple operations and inverted tickers", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: usdtusd.CurrencyPair, - Invert: true, - }, - { - CurrencyPair: btcusdt.CurrencyPair, - Invert: true, - }, - }, - }, - target: "USD/BITCOIN", - expErr: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.path.ValidateBasic() - if tc.expErr { - require.Error(t, err) - } else { - require.NoError(t, err) - require.True(t, tc.path.Match(tc.target)) - } - }) - } -} - -func TestPathEqual(t *testing.T) { - cases := []struct { - name string - path types.Path - other types.Path - exp bool - }{ - { - name: "equal paths", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - }, - }, - }, - other: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - }, - }, - }, - exp: true, - }, - { - name: "different length", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - }, - }, - other: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - { - CurrencyPair: usdtusd.CurrencyPair, - }, - }, - }, - exp: false, - }, - { - name: "different operations", - path: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: btcusdt.CurrencyPair, - }, - }, - }, - other: types.Path{ - Operations: []types.Operation{ - { - CurrencyPair: usdtusd.CurrencyPair, - }, - }, - }, - exp: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.path.Equal(tc.other), tc.exp) - }) - } -} - -func TestOperation(t *testing.T) { - t.Run("valid operation", func(t *testing.T) { - cp := slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - } - - _, err := types.NewOperation(cp, false) - require.NoError(t, err) - }) - - t.Run("invalid operation", func(t *testing.T) { - cp := slinkytypes.CurrencyPair{} - _, err := types.NewOperation(cp, false) - require.Error(t, err) - }) -} - -func TestOperationEqual(t *testing.T) { - cases := []struct { - name string - op types.Operation - other types.Operation - exp bool - }{ - { - name: "equal operations", - op: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - other: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - exp: true, - }, - { - name: "different base", - op: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - other: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - exp: false, - }, - { - name: "different invert strategy", - op: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - other: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: true, - }, - exp: false, - }, - { - name: "different provider", - op: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "kucoin", - Invert: false, - }, - other: types.Operation{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Provider: "binance", - Invert: false, - }, - exp: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.op.Equal(tc.other), tc.exp) - }) - } -} diff --git a/x/marketmap/types/provider.go b/x/marketmap/types/provider.go index bc51ccc0e..ab1fb7e3c 100644 --- a/x/marketmap/types/provider.go +++ b/x/marketmap/types/provider.go @@ -2,62 +2,65 @@ package types import ( "fmt" -) -const ( - MaxProviderNameFieldLength = 128 - MaxProviderTickerFieldLength = 256 + "github.com/skip-mev/slinky/pkg/json" ) -// ValidateBasic performs basic validation on Providers. -func (p *Providers) ValidateBasic() error { - for _, provider := range p.Providers { - if err := provider.ValidateBasic(); err != nil { - return err - } - } - - return nil -} - // ValidateBasic performs basic validation on a ProviderConfig. func (pc *ProviderConfig) ValidateBasic() error { if len(pc.Name) == 0 { return fmt.Errorf("provider name must not be empty") } - if len(pc.Name) > MaxProviderNameFieldLength { - return fmt.Errorf("provider length is longer than maximum length of %d", MaxProviderNameFieldLength) - } - if len(pc.OffChainTicker) == 0 { return fmt.Errorf("provider offchain ticker must not be empty") } - if len(pc.OffChainTicker) > MaxProviderTickerFieldLength { - return fmt.Errorf("provider offchain ticker is longer than maximum length of %d", MaxProviderTickerFieldLength) + // NormalizeByPair is allowed to be empty + if pc.NormalizeByPair != nil { + if err := pc.NormalizeByPair.ValidateBasic(); err != nil { + return err + } + } + + if len(pc.Metadata_JSON) > MaxMetadataJSONFieldLength { + return fmt.Errorf("metadata json field is longer than maximum length of %d", MaxMetadataJSONFieldLength) + } + + if err := json.IsValid([]byte(pc.Metadata_JSON)); err != nil { + return fmt.Errorf("invalid provider config metadata json: %w", err) } return nil } -// Equal returns true iff the Providers is equal to the given Providers. -func (p *Providers) Equal(other Providers) bool { - if len(p.Providers) != len(other.Providers) { +// Equal returns true iff the ProviderConfig is equal to the given ProviderConfig. +func (pc *ProviderConfig) Equal(other ProviderConfig) bool { + if pc.Name != other.Name { + return false + } + + if pc.OffChainTicker != other.OffChainTicker { return false } - for i, provider := range p.Providers { - if !provider.Equal(other.Providers[i]) { + if pc.Invert != other.Invert { + return false + } + + if pc.NormalizeByPair == nil { + if other.NormalizeByPair != nil { + return false + } + } else { + if other.NormalizeByPair == nil { return false } - } - return true -} + if !pc.NormalizeByPair.Equal(*other.NormalizeByPair) { + return false + } + } -// Equal returns true iff the ProviderConfig is equal to the given ProviderConfig. -func (pc *ProviderConfig) Equal(other ProviderConfig) bool { - return pc.Name == other.Name && - pc.OffChainTicker == other.OffChainTicker + return pc.Metadata_JSON == other.Metadata_JSON } diff --git a/x/marketmap/types/provider_test.go b/x/marketmap/types/provider_test.go index a66dcccaf..0a4ec238d 100644 --- a/x/marketmap/types/provider_test.go +++ b/x/marketmap/types/provider_test.go @@ -5,6 +5,7 @@ import ( "github.com/stretchr/testify/require" + slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/skip-mev/slinky/testutil" "github.com/skip-mev/slinky/x/marketmap/types" ) @@ -14,126 +15,133 @@ func TestProviderConfigValidateBasic(t *testing.T) { pc := types.ProviderConfig{ Name: "mexc", OffChainTicker: "ticker", + Metadata_JSON: "", } require.NoError(t, pc.ValidateBasic()) }) - t.Run("invalid empty name - fail", func(t *testing.T) { + t.Run("valid config inverted - pass", func(t *testing.T) { + pc := types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Invert: true, + Metadata_JSON: "", + } + require.NoError(t, pc.ValidateBasic()) + }) + t.Run("valid config with normalize by - pass", func(t *testing.T) { + pc := types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "BASE", + Quote: "QUOTE", + }, + Metadata_JSON: "", + } + require.NoError(t, pc.ValidateBasic()) + }) + t.Run("invalid config with normalize by - fail", func(t *testing.T) { + pc := types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "BASE", + Quote: "", + }, + Metadata_JSON: "", + } + require.Error(t, pc.ValidateBasic()) + }) + t.Run("invalid name - fail", func(t *testing.T) { pc := types.ProviderConfig{ Name: "", OffChainTicker: "ticker", + Metadata_JSON: "", } require.Error(t, pc.ValidateBasic()) }) - t.Run("invalid empty offchain ticker - fail", func(t *testing.T) { + t.Run("invalid offchain ticker - fail", func(t *testing.T) { pc := types.ProviderConfig{ Name: "mexc", OffChainTicker: "", + Metadata_JSON: "", } require.Error(t, pc.ValidateBasic()) }) - t.Run("invalid too long name - fail", func(t *testing.T) { + t.Run("invalid json - fail", func(t *testing.T) { pc := types.ProviderConfig{ - Name: testutil.RandomString(types.MaxProviderNameFieldLength + 1), + Name: "mexc", OffChainTicker: "ticker", + Metadata_JSON: "invalid", } require.Error(t, pc.ValidateBasic()) }) - t.Run("invalid too long offchain ticker - fail", func(t *testing.T) { + t.Run("invalid json length - fail", func(t *testing.T) { pc := types.ProviderConfig{ Name: "mexc", - OffChainTicker: testutil.RandomString(types.MaxProviderTickerFieldLength + 1), + OffChainTicker: "ticker", + Metadata_JSON: testutil.RandomString(types.MaxMetadataJSONFieldLength + 1), } require.Error(t, pc.ValidateBasic()) }) } -func TestProvidersEqual(t *testing.T) { +func TestProviderConfigEqual(t *testing.T) { cases := []struct { name string - p types.Providers - other types.Providers + pc types.ProviderConfig + other types.ProviderConfig exp bool }{ { - name: "equal", - p: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "mexc", - OffChainTicker: "ticker", - }, - }, + name: "equal - basic", + pc: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Metadata_JSON: "", }, - other: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "mexc", - OffChainTicker: "ticker", - }, - }, + other: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Metadata_JSON: "", }, exp: true, }, { - name: "different length", - p: types.Providers{ - Providers: []types.ProviderConfig{}, - }, - other: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "mexc", - OffChainTicker: "ticker", - }, - }, - }, - exp: false, - }, - { - name: "different provider", - p: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "mexc", - OffChainTicker: "ticker", - }, + name: "equal - inverted with normalize by", + pc: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "BASE", + Quote: "QUOTE", }, + Invert: true, + Metadata_JSON: "", }, - other: types.Providers{ - Providers: []types.ProviderConfig{ - { - Name: "binance", - OffChainTicker: "ticker", - }, + other: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "BASE", + Quote: "QUOTE", }, + Invert: true, + Metadata_JSON: "", }, - exp: false, + exp: true, }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.exp, tc.p.Equal(tc.other)) - }) - } -} - -func TestProviderConfigEqual(t *testing.T) { - cases := []struct { - name string - pc types.ProviderConfig - other types.ProviderConfig - exp bool - }{ { - name: "equal", + name: "equal - same metadata", pc: types.ProviderConfig{ Name: "mexc", OffChainTicker: "ticker", + Metadata_JSON: "{data: 1}", }, other: types.ProviderConfig{ Name: "mexc", OffChainTicker: "ticker", + Metadata_JSON: "{data: 1}", }, exp: true, }, @@ -161,6 +169,60 @@ func TestProviderConfigEqual(t *testing.T) { }, exp: false, }, + { + name: "different invert", + pc: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Invert: true, + Metadata_JSON: "", + }, + other: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Invert: false, + Metadata_JSON: "", + }, + exp: false, + }, + { + name: "different normalize by", + pc: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Invert: true, + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "BASE", + Quote: "QUOTE", + }, + Metadata_JSON: "", + }, + other: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Invert: true, + NormalizeByPair: &slinkytypes.CurrencyPair{ + Base: "QUOTE", + Quote: "QUOTE", + }, + Metadata_JSON: "", + }, + exp: false, + }, + { + name: "different metadata", + pc: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Metadata_JSON: "{data: 1}", + }, + other: types.ProviderConfig{ + Name: "mexc", + OffChainTicker: "ticker", + Metadata_JSON: "", + }, + exp: false, + }, } for _, tc := range cases { diff --git a/x/marketmap/types/query.pb.go b/x/marketmap/types/query.pb.go index c19f78c5f..f64f932eb 100644 --- a/x/marketmap/types/query.pb.go +++ b/x/marketmap/types/query.pb.go @@ -9,6 +9,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + types "github.com/skip-mev/slinky/pkg/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -29,23 +30,23 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GetMarketMapRequest is the query request for the GetMarketMap query. +// MarketMapRequest is the query request for the MarketMap query. // It takes no arguments. -type GetMarketMapRequest struct { +type MarketMapRequest struct { } -func (m *GetMarketMapRequest) Reset() { *m = GetMarketMapRequest{} } -func (m *GetMarketMapRequest) String() string { return proto.CompactTextString(m) } -func (*GetMarketMapRequest) ProtoMessage() {} -func (*GetMarketMapRequest) Descriptor() ([]byte, []int) { +func (m *MarketMapRequest) Reset() { *m = MarketMapRequest{} } +func (m *MarketMapRequest) String() string { return proto.CompactTextString(m) } +func (*MarketMapRequest) ProtoMessage() {} +func (*MarketMapRequest) Descriptor() ([]byte, []int) { return fileDescriptor_b5d6ff68f3c474a0, []int{0} } -func (m *GetMarketMapRequest) XXX_Unmarshal(b []byte) error { +func (m *MarketMapRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetMarketMapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MarketMapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetMarketMapRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_MarketMapRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,20 +56,20 @@ func (m *GetMarketMapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *GetMarketMapRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMarketMapRequest.Merge(m, src) +func (m *MarketMapRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketMapRequest.Merge(m, src) } -func (m *GetMarketMapRequest) XXX_Size() int { +func (m *MarketMapRequest) XXX_Size() int { return m.Size() } -func (m *GetMarketMapRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetMarketMapRequest.DiscardUnknown(m) +func (m *MarketMapRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MarketMapRequest.DiscardUnknown(m) } -var xxx_messageInfo_GetMarketMapRequest proto.InternalMessageInfo +var xxx_messageInfo_MarketMapRequest proto.InternalMessageInfo -// GetMarketMapResponse is the query response for the GetMarketMap query. -type GetMarketMapResponse struct { +// MarketMapResponse is the query response for the MarketMap query. +type MarketMapResponse struct { // MarketMap defines the global set of market configurations for all providers // and markets. MarketMap MarketMap `protobuf:"bytes,1,opt,name=market_map,json=marketMap,proto3" json:"market_map"` @@ -76,25 +77,22 @@ type GetMarketMapResponse struct { // This field can be used as an optimization for clients checking if there // is a new update to the map. LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // Version is the schema version for the MarketMap data structure and query - // response. - Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` // ChainId is the chain identifier for the market map. - ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } -func (m *GetMarketMapResponse) Reset() { *m = GetMarketMapResponse{} } -func (m *GetMarketMapResponse) String() string { return proto.CompactTextString(m) } -func (*GetMarketMapResponse) ProtoMessage() {} -func (*GetMarketMapResponse) Descriptor() ([]byte, []int) { +func (m *MarketMapResponse) Reset() { *m = MarketMapResponse{} } +func (m *MarketMapResponse) String() string { return proto.CompactTextString(m) } +func (*MarketMapResponse) ProtoMessage() {} +func (*MarketMapResponse) Descriptor() ([]byte, []int) { return fileDescriptor_b5d6ff68f3c474a0, []int{1} } -func (m *GetMarketMapResponse) XXX_Unmarshal(b []byte) error { +func (m *MarketMapResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetMarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetMarketMapResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MarketMapResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -104,44 +102,131 @@ func (m *GetMarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *GetMarketMapResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMarketMapResponse.Merge(m, src) +func (m *MarketMapResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketMapResponse.Merge(m, src) } -func (m *GetMarketMapResponse) XXX_Size() int { +func (m *MarketMapResponse) XXX_Size() int { return m.Size() } -func (m *GetMarketMapResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetMarketMapResponse.DiscardUnknown(m) +func (m *MarketMapResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MarketMapResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetMarketMapResponse proto.InternalMessageInfo +var xxx_messageInfo_MarketMapResponse proto.InternalMessageInfo -func (m *GetMarketMapResponse) GetMarketMap() MarketMap { +func (m *MarketMapResponse) GetMarketMap() MarketMap { if m != nil { return m.MarketMap } return MarketMap{} } -func (m *GetMarketMapResponse) GetLastUpdated() uint64 { +func (m *MarketMapResponse) GetLastUpdated() uint64 { if m != nil { return m.LastUpdated } return 0 } -func (m *GetMarketMapResponse) GetVersion() uint64 { +func (m *MarketMapResponse) GetChainId() string { if m != nil { - return m.Version + return m.ChainId + } + return "" +} + +// MarketRequest is the query request for the Market query. +// It takes the currency pair of the market as an argument. +type MarketRequest struct { + // CurrencyPair is the currency pair associated with the market being + // requested. + CurrencyPair types.CurrencyPair `protobuf:"bytes,3,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` +} + +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} +} +func (m *MarketRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarketRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return 0 } +func (m *MarketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketRequest.Merge(m, src) +} +func (m *MarketRequest) XXX_Size() int { + return m.Size() +} +func (m *MarketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MarketRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MarketRequest proto.InternalMessageInfo -func (m *GetMarketMapResponse) GetChainId() string { +func (m *MarketRequest) GetCurrencyPair() types.CurrencyPair { if m != nil { - return m.ChainId + return m.CurrencyPair } - return "" + return types.CurrencyPair{} +} + +// MarketResponse is the query response for the Market query. +type MarketResponse struct { + // Market is the configuration of a single market to be price-fetched for. + Market Market `protobuf:"bytes,1,opt,name=market,proto3" json:"market"` +} + +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} +} +func (m *MarketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MarketResponse.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 *MarketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MarketResponse.Merge(m, src) +} +func (m *MarketResponse) XXX_Size() int { + return m.Size() +} +func (m *MarketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MarketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MarketResponse proto.InternalMessageInfo + +func (m *MarketResponse) GetMarket() Market { + if m != nil { + return m.Market + } + return Market{} } // ParamsRequest is the request type for the Query/Params RPC method. @@ -152,7 +237,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{2} + return fileDescriptor_b5d6ff68f3c474a0, []int{4} } func (m *ParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -190,7 +275,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{3} + return fileDescriptor_b5d6ff68f3c474a0, []int{5} } func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -226,23 +311,23 @@ func (m *ParamsResponse) GetParams() Params { return Params{} } -// GetLastUpdatedRequest is the request type for the Query/LastUpdated RPC +// LastUpdatedRequest is the request type for the Query/LastUpdated RPC // method. -type GetLastUpdatedRequest struct { +type LastUpdatedRequest struct { } -func (m *GetLastUpdatedRequest) Reset() { *m = GetLastUpdatedRequest{} } -func (m *GetLastUpdatedRequest) String() string { return proto.CompactTextString(m) } -func (*GetLastUpdatedRequest) ProtoMessage() {} -func (*GetLastUpdatedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{4} +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} } -func (m *GetLastUpdatedRequest) XXX_Unmarshal(b []byte) error { +func (m *LastUpdatedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetLastUpdatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LastUpdatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetLastUpdatedRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_LastUpdatedRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -252,36 +337,36 @@ func (m *GetLastUpdatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *GetLastUpdatedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLastUpdatedRequest.Merge(m, src) +func (m *LastUpdatedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LastUpdatedRequest.Merge(m, src) } -func (m *GetLastUpdatedRequest) XXX_Size() int { +func (m *LastUpdatedRequest) XXX_Size() int { return m.Size() } -func (m *GetLastUpdatedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetLastUpdatedRequest.DiscardUnknown(m) +func (m *LastUpdatedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LastUpdatedRequest.DiscardUnknown(m) } -var xxx_messageInfo_GetLastUpdatedRequest proto.InternalMessageInfo +var xxx_messageInfo_LastUpdatedRequest proto.InternalMessageInfo -// GetLastUpdatedResponse is the response type for the Query/LastUpdated RPC +// LastUpdatedResponse is the response type for the Query/LastUpdated RPC // method. -type GetLastUpdatedResponse struct { +type LastUpdatedResponse struct { LastUpdated uint64 `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` } -func (m *GetLastUpdatedResponse) Reset() { *m = GetLastUpdatedResponse{} } -func (m *GetLastUpdatedResponse) String() string { return proto.CompactTextString(m) } -func (*GetLastUpdatedResponse) ProtoMessage() {} -func (*GetLastUpdatedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b5d6ff68f3c474a0, []int{5} +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} } -func (m *GetLastUpdatedResponse) XXX_Unmarshal(b []byte) error { +func (m *LastUpdatedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetLastUpdatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LastUpdatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetLastUpdatedResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_LastUpdatedResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -291,19 +376,19 @@ func (m *GetLastUpdatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *GetLastUpdatedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLastUpdatedResponse.Merge(m, src) +func (m *LastUpdatedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LastUpdatedResponse.Merge(m, src) } -func (m *GetLastUpdatedResponse) XXX_Size() int { +func (m *LastUpdatedResponse) XXX_Size() int { return m.Size() } -func (m *GetLastUpdatedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetLastUpdatedResponse.DiscardUnknown(m) +func (m *LastUpdatedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LastUpdatedResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetLastUpdatedResponse proto.InternalMessageInfo +var xxx_messageInfo_LastUpdatedResponse proto.InternalMessageInfo -func (m *GetLastUpdatedResponse) GetLastUpdated() uint64 { +func (m *LastUpdatedResponse) GetLastUpdated() uint64 { if m != nil { return m.LastUpdated } @@ -311,49 +396,55 @@ func (m *GetLastUpdatedResponse) GetLastUpdated() uint64 { } func init() { - proto.RegisterType((*GetMarketMapRequest)(nil), "slinky.marketmap.v1.GetMarketMapRequest") - proto.RegisterType((*GetMarketMapResponse)(nil), "slinky.marketmap.v1.GetMarketMapResponse") + proto.RegisterType((*MarketMapRequest)(nil), "slinky.marketmap.v1.MarketMapRequest") + proto.RegisterType((*MarketMapResponse)(nil), "slinky.marketmap.v1.MarketMapResponse") + proto.RegisterType((*MarketRequest)(nil), "slinky.marketmap.v1.MarketRequest") + proto.RegisterType((*MarketResponse)(nil), "slinky.marketmap.v1.MarketResponse") proto.RegisterType((*ParamsRequest)(nil), "slinky.marketmap.v1.ParamsRequest") proto.RegisterType((*ParamsResponse)(nil), "slinky.marketmap.v1.ParamsResponse") - proto.RegisterType((*GetLastUpdatedRequest)(nil), "slinky.marketmap.v1.GetLastUpdatedRequest") - proto.RegisterType((*GetLastUpdatedResponse)(nil), "slinky.marketmap.v1.GetLastUpdatedResponse") + proto.RegisterType((*LastUpdatedRequest)(nil), "slinky.marketmap.v1.LastUpdatedRequest") + proto.RegisterType((*LastUpdatedResponse)(nil), "slinky.marketmap.v1.LastUpdatedResponse") } func init() { proto.RegisterFile("slinky/marketmap/v1/query.proto", fileDescriptor_b5d6ff68f3c474a0) } var fileDescriptor_b5d6ff68f3c474a0 = []byte{ - // 483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0xb6, 0x21, 0x25, 0x13, 0x3e, 0xa4, 0x6d, 0x0b, 0x26, 0x05, 0xd7, 0x75, 0x24, 0x94, - 0xf2, 0xe1, 0x55, 0xcb, 0x09, 0x71, 0x2b, 0x12, 0x15, 0x82, 0x4a, 0x10, 0x89, 0x0b, 0x97, 0x68, - 0xdb, 0xac, 0x5c, 0x2b, 0xb1, 0x77, 0xeb, 0x5d, 0x5b, 0xe4, 0xca, 0x89, 0x23, 0x88, 0x3b, 0x7f, - 0x82, 0x3f, 0xd1, 0x63, 0x25, 0x2e, 0x9c, 0x10, 0x4a, 0xf8, 0x21, 0x28, 0xbb, 0xeb, 0x10, 0x5a, - 0x27, 0xea, 0xcd, 0x33, 0xf3, 0x66, 0xde, 0x7b, 0x33, 0x5e, 0xd8, 0x94, 0x83, 0x28, 0xe9, 0x0f, - 0x49, 0x4c, 0xd3, 0x3e, 0x53, 0x31, 0x15, 0x24, 0xdf, 0x21, 0x27, 0x19, 0x4b, 0x87, 0x81, 0x48, - 0xb9, 0xe2, 0x78, 0xd5, 0x00, 0x82, 0x29, 0x20, 0xc8, 0x77, 0x9a, 0x6b, 0x21, 0x0f, 0xb9, 0xae, - 0x93, 0xc9, 0x97, 0x81, 0x36, 0xef, 0x86, 0x9c, 0x87, 0x03, 0x46, 0xa8, 0x88, 0x08, 0x4d, 0x12, - 0xae, 0xa8, 0x8a, 0x78, 0x22, 0x6d, 0xd5, 0x2b, 0x63, 0x32, 0xc1, 0x22, 0x84, 0xa0, 0x29, 0x8d, - 0xed, 0x0c, 0x7f, 0x1d, 0x56, 0xf7, 0x99, 0x3a, 0xd0, 0xf5, 0x03, 0x2a, 0x3a, 0xec, 0x24, 0x63, - 0x52, 0xf9, 0xdf, 0x11, 0xac, 0xfd, 0x9f, 0x97, 0x82, 0x27, 0x92, 0xe1, 0xe7, 0x00, 0x66, 0x58, - 0x37, 0xa6, 0xc2, 0x41, 0x1e, 0x6a, 0x37, 0x76, 0xdd, 0xa0, 0xc4, 0x51, 0x30, 0xed, 0xdd, 0xab, - 0x9e, 0xfe, 0xda, 0xac, 0x74, 0xea, 0x71, 0x91, 0xc0, 0x5b, 0x70, 0x6d, 0x40, 0xa5, 0xea, 0x66, - 0xa2, 0x47, 0x15, 0xeb, 0x39, 0x4b, 0x1e, 0x6a, 0x57, 0x3b, 0x8d, 0x49, 0xee, 0x9d, 0x49, 0x61, - 0x07, 0x56, 0x72, 0x96, 0xca, 0x88, 0x27, 0xce, 0xb2, 0xae, 0x16, 0x21, 0xbe, 0x03, 0x57, 0x8f, - 0x8e, 0x69, 0x94, 0x74, 0xa3, 0x9e, 0x53, 0xf5, 0x50, 0xbb, 0xde, 0x59, 0xd1, 0xf1, 0xcb, 0x9e, - 0x7f, 0x13, 0xae, 0xbf, 0xd1, 0xe6, 0x0a, 0x1b, 0xaf, 0xe0, 0x46, 0x91, 0xb0, 0xfa, 0x9f, 0x42, - 0xcd, 0xf8, 0xb7, 0xda, 0x37, 0x4a, 0xb5, 0x9b, 0x26, 0x2b, 0xdc, 0x36, 0xf8, 0xb7, 0x61, 0x7d, - 0x9f, 0xa9, 0xd7, 0xff, 0x44, 0x16, 0x2c, 0xcf, 0xe0, 0xd6, 0xf9, 0x82, 0x65, 0x3b, 0x6f, 0x14, - 0x5d, 0x30, 0xba, 0xfb, 0x6d, 0x19, 0xae, 0xbc, 0x9d, 0xfc, 0x1d, 0xf8, 0x13, 0x82, 0xfa, 0x74, - 0x69, 0xb8, 0x5d, 0x2a, 0xac, 0xe4, 0x56, 0xcd, 0xed, 0x4b, 0x20, 0x8d, 0x1e, 0xff, 0xfe, 0xc7, - 0x1f, 0x7f, 0xbe, 0x2e, 0x79, 0xd8, 0x25, 0xf3, 0x7f, 0x9d, 0x98, 0x0a, 0xfc, 0x05, 0x41, 0x63, - 0xc6, 0x0f, 0x7e, 0x30, 0x8f, 0xe2, 0xe2, 0x36, 0x9a, 0x0f, 0x2f, 0x85, 0xb5, 0x82, 0xb6, 0xb5, - 0xa0, 0x16, 0xde, 0x2a, 0x15, 0x34, 0xbb, 0x3b, 0x9c, 0x43, 0xcd, 0x9c, 0x05, 0xfb, 0x0b, 0x6e, - 0x56, 0xa8, 0x68, 0x2d, 0xc4, 0x58, 0xf6, 0x96, 0x66, 0xbf, 0x87, 0x37, 0xc8, 0xfc, 0x77, 0xb2, - 0xf7, 0xe2, 0x74, 0xe4, 0xa2, 0xb3, 0x91, 0x8b, 0x7e, 0x8f, 0x5c, 0xf4, 0x79, 0xec, 0x56, 0xce, - 0xc6, 0x6e, 0xe5, 0xe7, 0xd8, 0xad, 0xbc, 0x7f, 0x14, 0x46, 0xea, 0x38, 0x3b, 0x0c, 0x8e, 0x78, - 0x4c, 0x64, 0x3f, 0x12, 0x8f, 0x63, 0x96, 0x17, 0x93, 0x3e, 0xcc, 0xcc, 0x52, 0x43, 0xc1, 0xe4, - 0x61, 0x4d, 0x3f, 0xb8, 0x27, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x96, 0x38, 0x94, 0x38, 0x20, - 0x04, 0x00, 0x00, + // 545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xcd, 0x96, 0x12, 0xc8, 0xa4, 0x29, 0xb0, 0xed, 0x21, 0xa4, 0xd4, 0x75, 0x1d, 0x51, 0x82, + 0x04, 0xb6, 0x1a, 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, 0x9d, 0x78, 0xe0, 0x87, 0xfd, 0x91, 0x13, 0x90, + 0xa8, 0x4f, 0x93, 0x80, 0x70, 0x67, 0xb8, 0xef, 0x9c, 0xa7, 0x34, 0x1a, 0xd9, 0x3c, 0x62, 0x09, + 0xc3, 0x1b, 0x12, 0x60, 0x4f, 0x01, 0xf6, 0x70, 0xbf, 0xb1, 0xe9, 0x31, 0x8f, 0x89, 0x7b, 0x27, + 0xfb, 0x25, 0xa1, 0x8d, 0x47, 0x1e, 0x63, 0xde, 0x80, 0x3a, 0x84, 0xfb, 0x0e, 0x09, 0x43, 0x96, + 0x90, 0xc4, 0x67, 0x61, 0xac, 0x6e, 0x9b, 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, 0x3a, 0x32, 0x51, 0xab, 0xda, 0x36, 0xec, 0x39, 0x0f, 0xb6, 0xa7, 0xbd, 0x07, + 0xab, 0x97, 0xbf, 0x77, 0x4a, 0x9d, 0x4a, 0xa0, 0x0b, 0x78, 0x17, 0xd6, 0x06, 0x24, 0x4e, 0xba, + 0x29, 0xef, 0x91, 0x84, 0xf6, 0xea, 0x2b, 0x26, 0x6a, 0xad, 0x76, 0xaa, 0x59, 0xed, 0x83, 0x2c, + 0xe1, 0x87, 0x70, 0xd7, 0x3d, 0x23, 0x7e, 0xd8, 0xf5, 0x7b, 0xf5, 0x5b, 0x26, 0x6a, 0x55, 0x3a, + 0x77, 0xc4, 0xf9, 0x6d, 0xcf, 0xfa, 0x08, 0x35, 0xc9, 0xad, 0x9c, 0xe2, 0x37, 0x50, 0x9b, 0x09, + 0x46, 0x34, 0x54, 0xdb, 0xdb, 0xda, 0x96, 0x88, 0x2f, 0xb3, 0x74, 0xa8, 0x50, 0x27, 0xc4, 0x8f, + 0x94, 0xab, 0x35, 0x37, 0x57, 0xb3, 0x8e, 0x60, 0x5d, 0x53, 0xab, 0xf7, 0xbe, 0x82, 0xb2, 0xf4, + 0xad, 0xde, 0xba, 0x55, 0xf0, 0x56, 0x45, 0xa9, 0x1a, 0xac, 0x7b, 0x50, 0x3b, 0x11, 0x21, 0xeb, + 0x44, 0x8f, 0x60, 0x5d, 0x17, 0xae, 0xd9, 0xe5, 0x1c, 0x0a, 0xd9, 0x65, 0x93, 0x66, 0x97, 0x0d, + 0xd6, 0x26, 0xe0, 0x77, 0xd7, 0x79, 0x69, 0x89, 0x97, 0xb0, 0x31, 0x53, 0x55, 0x3a, 0xff, 0x07, + 0x8e, 0x6e, 0x04, 0xde, 0xfe, 0xb2, 0x0a, 0xb7, 0xdf, 0x67, 0x4b, 0x8c, 0x2f, 0x10, 0x54, 0xa6, + 0xc3, 0xc3, 0x8f, 0x8b, 0x87, 0xab, 0x84, 0x1b, 0x7b, 0xcb, 0x60, 0xd2, 0x89, 0xb5, 0x77, 0xf1, + 0xf3, 0xef, 0xf7, 0x15, 0x13, 0x1b, 0xce, 0xe2, 0xb5, 0x0d, 0x08, 0xc7, 0x43, 0x28, 0xcb, 0x66, + 0x6c, 0x15, 0x30, 0x6b, 0xf5, 0x66, 0x21, 0x46, 0x49, 0x37, 0x85, 0xf4, 0x36, 0xde, 0x2a, 0x90, + 0xc6, 0x5f, 0x11, 0x54, 0x73, 0x09, 0xe2, 0x27, 0x73, 0x99, 0x6f, 0x26, 0xdf, 0x68, 0x2d, 0x07, + 0x2a, 0x1f, 0x4f, 0x85, 0x8f, 0x26, 0xde, 0x9d, 0xeb, 0x23, 0x3f, 0xa7, 0x2c, 0x05, 0x39, 0xfc, + 0x05, 0x29, 0xcc, 0xec, 0xd7, 0x82, 0x14, 0x66, 0x57, 0x6e, 0x49, 0x0a, 0x72, 0xb9, 0x0e, 0x5e, + 0x5f, 0x8e, 0x0d, 0x74, 0x35, 0x36, 0xd0, 0x9f, 0xb1, 0x81, 0xbe, 0x4d, 0x8c, 0xd2, 0xd5, 0xc4, + 0x28, 0xfd, 0x9a, 0x18, 0xa5, 0x4f, 0xcf, 0x3c, 0x3f, 0x39, 0x4b, 0x4f, 0x6d, 0x97, 0x05, 0x4e, + 0xdc, 0xf7, 0xf9, 0xf3, 0x80, 0x0e, 0x35, 0xd3, 0xe7, 0x1c, 0x97, 0xf8, 0xcf, 0x9d, 0x96, 0xc5, + 0xe7, 0xe5, 0xc5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xdd, 0xa3, 0x27, 0x33, 0x05, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -370,9 +461,12 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // MarketMap returns the full market map stored in the x/marketmap // module. - MarketMap(ctx context.Context, in *GetMarketMapRequest, opts ...grpc.CallOption) (*GetMarketMapResponse, error) + MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) + // Market returns a market stored in the x/marketmap + // module. + Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) // LastUpdated returns the last height the market map was updated at. - LastUpdated(ctx context.Context, in *GetLastUpdatedRequest, opts ...grpc.CallOption) (*GetLastUpdatedResponse, error) + LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) // Params returns the current x/marketmap module parameters. Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) } @@ -385,8 +479,8 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) MarketMap(ctx context.Context, in *GetMarketMapRequest, opts ...grpc.CallOption) (*GetMarketMapResponse, error) { - out := new(GetMarketMapResponse) +func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) { + out := new(MarketMapResponse) err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Query/MarketMap", in, out, opts...) if err != nil { return nil, err @@ -394,8 +488,17 @@ func (c *queryClient) MarketMap(ctx context.Context, in *GetMarketMapRequest, op return out, nil } -func (c *queryClient) LastUpdated(ctx context.Context, in *GetLastUpdatedRequest, opts ...grpc.CallOption) (*GetLastUpdatedResponse, error) { - out := new(GetLastUpdatedResponse) +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...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) { + out := new(LastUpdatedResponse) err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Query/LastUpdated", in, out, opts...) if err != nil { return nil, err @@ -416,9 +519,12 @@ func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grp type QueryServer interface { // MarketMap returns the full market map stored in the x/marketmap // module. - MarketMap(context.Context, *GetMarketMapRequest) (*GetMarketMapResponse, error) + MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) + // Market returns a market stored in the x/marketmap + // module. + Market(context.Context, *MarketRequest) (*MarketResponse, error) // LastUpdated returns the last height the market map was updated at. - LastUpdated(context.Context, *GetLastUpdatedRequest) (*GetLastUpdatedResponse, error) + LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) // Params returns the current x/marketmap module parameters. Params(context.Context, *ParamsRequest) (*ParamsResponse, error) } @@ -427,10 +533,13 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) MarketMap(ctx context.Context, req *GetMarketMapRequest) (*GetMarketMapResponse, error) { +func (*UnimplementedQueryServer) MarketMap(ctx context.Context, req *MarketMapRequest) (*MarketMapResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketMap not implemented") } -func (*UnimplementedQueryServer) LastUpdated(ctx context.Context, req *GetLastUpdatedRequest) (*GetLastUpdatedResponse, error) { +func (*UnimplementedQueryServer) Market(ctx context.Context, req *MarketRequest) (*MarketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") +} +func (*UnimplementedQueryServer) LastUpdated(ctx context.Context, req *LastUpdatedRequest) (*LastUpdatedResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LastUpdated not implemented") } func (*UnimplementedQueryServer) Params(ctx context.Context, req *ParamsRequest) (*ParamsResponse, error) { @@ -442,7 +551,7 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { } func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMarketMapRequest) + in := new(MarketMapRequest) if err := dec(in); err != nil { return nil, err } @@ -454,13 +563,31 @@ func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(int FullMethod: "/slinky.marketmap.v1.Query/MarketMap", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MarketMap(ctx, req.(*GetMarketMapRequest)) + return srv.(QueryServer).MarketMap(ctx, req.(*MarketMapRequest)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Market(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slinky.marketmap.v1.Query/Market", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Market(ctx, req.(*MarketRequest)) } return interceptor(ctx, in, info, handler) } func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLastUpdatedRequest) + in := new(LastUpdatedRequest) if err := dec(in); err != nil { return nil, err } @@ -472,7 +599,7 @@ func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(i FullMethod: "/slinky.marketmap.v1.Query/LastUpdated", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LastUpdated(ctx, req.(*GetLastUpdatedRequest)) + return srv.(QueryServer).LastUpdated(ctx, req.(*LastUpdatedRequest)) } return interceptor(ctx, in, info, handler) } @@ -503,6 +630,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "MarketMap", Handler: _Query_MarketMap_Handler, }, + { + MethodName: "Market", + Handler: _Query_Market_Handler, + }, { MethodName: "LastUpdated", Handler: _Query_LastUpdated_Handler, @@ -516,7 +647,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "slinky/marketmap/v1/query.proto", } -func (m *GetMarketMapRequest) Marshal() (dAtA []byte, err error) { +func (m *MarketMapRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -526,12 +657,12 @@ func (m *GetMarketMapRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetMarketMapRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *MarketMapRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetMarketMapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MarketMapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -539,7 +670,7 @@ func (m *GetMarketMapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetMarketMapResponse) Marshal() (dAtA []byte, err error) { +func (m *MarketMapResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -549,12 +680,12 @@ func (m *GetMarketMapResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetMarketMapResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MarketMapResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetMarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -564,12 +695,7 @@ func (m *GetMarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ChainId) i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) i-- - dAtA[i] = 0x22 - } - if m.Version != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x18 + dAtA[i] = 0x1a } if m.LastUpdated != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.LastUpdated)) @@ -589,6 +715,72 @@ func (m *GetMarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MarketRequest) 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 *MarketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MarketRequest) 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] = 0x1a + return len(dAtA) - i, nil +} + +func (m *MarketResponse) 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 *MarketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MarketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Market.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 *ParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -645,7 +837,7 @@ func (m *ParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetLastUpdatedRequest) Marshal() (dAtA []byte, err error) { +func (m *LastUpdatedRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -655,12 +847,12 @@ func (m *GetLastUpdatedRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetLastUpdatedRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *LastUpdatedRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetLastUpdatedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LastUpdatedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -668,7 +860,7 @@ func (m *GetLastUpdatedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetLastUpdatedResponse) Marshal() (dAtA []byte, err error) { +func (m *LastUpdatedResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -678,12 +870,12 @@ func (m *GetLastUpdatedResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetLastUpdatedResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *LastUpdatedResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetLastUpdatedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LastUpdatedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -707,7 +899,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *GetMarketMapRequest) Size() (n int) { +func (m *MarketMapRequest) Size() (n int) { if m == nil { return 0 } @@ -716,7 +908,7 @@ func (m *GetMarketMapRequest) Size() (n int) { return n } -func (m *GetMarketMapResponse) Size() (n int) { +func (m *MarketMapResponse) Size() (n int) { if m == nil { return 0 } @@ -727,9 +919,6 @@ func (m *GetMarketMapResponse) Size() (n int) { if m.LastUpdated != 0 { n += 1 + sovQuery(uint64(m.LastUpdated)) } - if m.Version != 0 { - n += 1 + sovQuery(uint64(m.Version)) - } l = len(m.ChainId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -737,6 +926,28 @@ func (m *GetMarketMapResponse) Size() (n int) { return n } +func (m *MarketRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CurrencyPair.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *MarketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Market.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *ParamsRequest) Size() (n int) { if m == nil { return 0 @@ -757,7 +968,7 @@ func (m *ParamsResponse) Size() (n int) { return n } -func (m *GetLastUpdatedRequest) Size() (n int) { +func (m *LastUpdatedRequest) Size() (n int) { if m == nil { return 0 } @@ -766,7 +977,7 @@ func (m *GetLastUpdatedRequest) Size() (n int) { return n } -func (m *GetLastUpdatedResponse) Size() (n int) { +func (m *LastUpdatedResponse) Size() (n int) { if m == nil { return 0 } @@ -784,7 +995,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *GetMarketMapRequest) Unmarshal(dAtA []byte) error { +func (m *MarketMapRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -807,10 +1018,10 @@ func (m *GetMarketMapRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetMarketMapRequest: wiretype end group for non-group") + return fmt.Errorf("proto: MarketMapRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetMarketMapRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MarketMapRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -834,7 +1045,7 @@ func (m *GetMarketMapRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetMarketMapResponse) Unmarshal(dAtA []byte) error { +func (m *MarketMapResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -857,10 +1068,10 @@ func (m *GetMarketMapResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetMarketMapResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MarketMapResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetMarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -916,10 +1127,10 @@ func (m *GetMarketMapResponse) Unmarshal(dAtA []byte) error { } } case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) } - m.Version = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -929,16 +1140,79 @@ func (m *GetMarketMapResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Version |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + 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 + 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: MarketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CurrencyPair", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -948,23 +1222,107 @@ func (m *GetMarketMapResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + 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 *MarketResponse) 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: MarketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MarketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Market", 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.Market.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1120,7 +1478,7 @@ func (m *ParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetLastUpdatedRequest) Unmarshal(dAtA []byte) error { +func (m *LastUpdatedRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1143,10 +1501,10 @@ func (m *GetLastUpdatedRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetLastUpdatedRequest: wiretype end group for non-group") + return fmt.Errorf("proto: LastUpdatedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetLastUpdatedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LastUpdatedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1170,7 +1528,7 @@ func (m *GetLastUpdatedRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetLastUpdatedResponse) Unmarshal(dAtA []byte) error { +func (m *LastUpdatedResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1193,10 +1551,10 @@ func (m *GetLastUpdatedResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetLastUpdatedResponse: wiretype end group for non-group") + return fmt.Errorf("proto: LastUpdatedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetLastUpdatedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LastUpdatedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/marketmap/types/query.pb.gw.go b/x/marketmap/types/query.pb.gw.go index 0e00a1e6d..94675c023 100644 --- a/x/marketmap/types/query.pb.gw.go +++ b/x/marketmap/types/query.pb.gw.go @@ -34,7 +34,7 @@ var _ = descriptor.ForMessage var _ = metadata.Join func request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMarketMapRequest + var protoReq MarketMapRequest var metadata runtime.ServerMetadata msg, err := client.MarketMap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -43,7 +43,7 @@ func request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Marshaler, } func local_request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMarketMapRequest + var protoReq MarketMapRequest var metadata runtime.ServerMetadata msg, err := server.MarketMap(ctx, &protoReq) @@ -51,8 +51,44 @@ func local_request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Mars } +var ( + filter_Query_Market_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Market_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Market_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Market(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Market_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MarketRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Market_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Market(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_LastUpdated_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLastUpdatedRequest + var protoReq LastUpdatedRequest var metadata runtime.ServerMetadata msg, err := client.LastUpdated(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -61,7 +97,7 @@ func request_Query_LastUpdated_0(ctx context.Context, marshaler runtime.Marshale } func local_request_Query_LastUpdated_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLastUpdatedRequest + var protoReq LastUpdatedRequest var metadata runtime.ServerMetadata msg, err := server.LastUpdated(ctx, &protoReq) @@ -116,6 +152,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + 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() + 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_Market_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_Market_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_LastUpdated_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -223,6 +282,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + 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() + 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_Market_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_Market_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_LastUpdated_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -269,6 +348,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_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))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "marketmap", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) @@ -277,6 +358,8 @@ var ( var ( forward_Query_MarketMap_0 = runtime.ForwardResponseMessage + forward_Query_Market_0 = runtime.ForwardResponseMessage + forward_Query_LastUpdated_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage diff --git a/x/marketmap/types/ticker.go b/x/marketmap/types/ticker.go index 7c3be4c8a..f3cfcf64a 100644 --- a/x/marketmap/types/ticker.go +++ b/x/marketmap/types/ticker.go @@ -15,8 +15,6 @@ const ( // DefaultMinProviderCount is the minimum number of providers required for a // ticker to be considered valid. DefaultMinProviderCount = 1 - // MaxPathLength is the maximum length of a path for a ticker conversion. - MaxPathLength = 3 // MaxMetadataJSONFieldLength is the maximum length of the MetadataJSON field. MaxMetadataJSONFieldLength = 16384 ) @@ -58,7 +56,7 @@ func (t *Ticker) ValidateBasic() error { } if err := json.IsValid([]byte(t.Metadata_JSON)); err != nil { - return fmt.Errorf("invalid JSON metadata; %w", err) + return fmt.Errorf("invalid ticker metadata json: %w", err) } return nil diff --git a/x/marketmap/types/ticker_test.go b/x/marketmap/types/ticker_test.go index 1716a8e48..3a7f0fe6a 100644 --- a/x/marketmap/types/ticker_test.go +++ b/x/marketmap/types/ticker_test.go @@ -26,22 +26,10 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: false, }, - { - name: "invalid metadata length", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: testutil.RandomString(types.MaxMetadataJSONFieldLength + 1), - }, - expErr: true, - }, { name: "empty base", ticker: types.Ticker{ @@ -51,6 +39,7 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: true, }, @@ -63,6 +52,7 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: true, }, @@ -75,6 +65,7 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: true, }, @@ -87,6 +78,7 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: true, }, @@ -99,6 +91,7 @@ func TestTicker(t *testing.T) { }, Decimals: 0, MinProviderCount: 1, + Metadata_JSON: "", }, expErr: true, }, @@ -111,6 +104,33 @@ func TestTicker(t *testing.T) { }, Decimals: 8, MinProviderCount: 0, + Metadata_JSON: "", + }, + expErr: true, + }, + { + name: "invalid json len", + ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USDT", + }, + Decimals: 8, + MinProviderCount: 0, + Metadata_JSON: testutil.RandomString(types.MaxMetadataJSONFieldLength + 1), + }, + expErr: true, + }, + { + name: "invalid json", + ticker: types.Ticker{ + CurrencyPair: slinkytypes.CurrencyPair{ + Base: "BITCOIN", + Quote: "USDT", + }, + Decimals: 8, + MinProviderCount: 0, + Metadata_JSON: "invalid", }, expErr: true, }, diff --git a/x/marketmap/types/tx.pb.go b/x/marketmap/types/tx.pb.go index 111db8858..5b8fa68d3 100644 --- a/x/marketmap/types/tx.pb.go +++ b/x/marketmap/types/tx.pb.go @@ -31,31 +31,29 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// CreateMarket contains all information needed to create a new market. -type CreateMarket struct { - // Ticker is the on-chain representation of the ticker. This is the target - // ticker that the prices of the set of tickers will be converted to. - Ticker Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker"` - // Providers maps provider names to their off-chain - // representations for the given ticker of the message. - Providers Providers `protobuf:"bytes,2,opt,name=providers,proto3" json:"providers"` - // Paths is the list of convertable markets that will be used to convert the - // prices of a set of tickers to a common ticker. - Paths Paths `protobuf:"bytes,3,opt,name=paths,proto3" json:"paths"` -} - -func (m *CreateMarket) Reset() { *m = CreateMarket{} } -func (m *CreateMarket) String() string { return proto.CompactTextString(m) } -func (*CreateMarket) ProtoMessage() {} -func (*CreateMarket) Descriptor() ([]byte, []int) { +// MsgCreateMarkets defines a message carrying a payload for creating markets in +// the x/marketmap module. +type MsgCreateMarkets struct { + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // CreateMarkets is the list of all markets to be created for the given + // transaction. + CreateMarkets []Market `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets"` +} + +func (m *MsgCreateMarkets) Reset() { *m = MsgCreateMarkets{} } +func (m *MsgCreateMarkets) String() string { return proto.CompactTextString(m) } +func (*MsgCreateMarkets) ProtoMessage() {} +func (*MsgCreateMarkets) Descriptor() ([]byte, []int) { return fileDescriptor_e9adadfc18297083, []int{0} } -func (m *CreateMarket) XXX_Unmarshal(b []byte) error { +func (m *MsgCreateMarkets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CreateMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgCreateMarkets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CreateMarket.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgCreateMarkets.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -65,61 +63,92 @@ func (m *CreateMarket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *CreateMarket) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateMarket.Merge(m, src) +func (m *MsgCreateMarkets) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateMarkets.Merge(m, src) } -func (m *CreateMarket) XXX_Size() int { +func (m *MsgCreateMarkets) XXX_Size() int { return m.Size() } -func (m *CreateMarket) XXX_DiscardUnknown() { - xxx_messageInfo_CreateMarket.DiscardUnknown(m) +func (m *MsgCreateMarkets) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateMarkets.DiscardUnknown(m) } -var xxx_messageInfo_CreateMarket proto.InternalMessageInfo +var xxx_messageInfo_MsgCreateMarkets proto.InternalMessageInfo -func (m *CreateMarket) GetTicker() Ticker { +func (m *MsgCreateMarkets) GetAuthority() string { if m != nil { - return m.Ticker + return m.Authority } - return Ticker{} + return "" } -func (m *CreateMarket) GetProviders() Providers { +func (m *MsgCreateMarkets) GetCreateMarkets() []Market { if m != nil { - return m.Providers + return m.CreateMarkets } - return Providers{} + return nil } -func (m *CreateMarket) GetPaths() Paths { - if m != nil { - return m.Paths +// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. +type MsgCreateMarketsResponse struct { +} + +func (m *MsgCreateMarketsResponse) Reset() { *m = MsgCreateMarketsResponse{} } +func (m *MsgCreateMarketsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateMarketsResponse) ProtoMessage() {} +func (*MsgCreateMarketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e9adadfc18297083, []int{1} +} +func (m *MsgCreateMarketsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateMarketsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return Paths{} +} +func (m *MsgCreateMarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateMarketsResponse.Merge(m, src) +} +func (m *MsgCreateMarketsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateMarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateMarketsResponse.DiscardUnknown(m) } -// MsgUpdateMarketMap defines a message carrying a payload for updating the +var xxx_messageInfo_MsgCreateMarketsResponse proto.InternalMessageInfo + +// MsgUpdateMarkets defines a message carrying a payload for updating the // x/marketmap module. -type MsgUpdateMarketMap struct { - // Signer is the signer of this transaction. - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - // CreateMarkets is the list of all markets to be created for the given +type MsgUpdateMarkets struct { + // Authority is the signer of this transaction. This authority must be + // authorized by the module to execute the message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // UpdateMarkets is the list of all markets to be updated for the given // transaction. - CreateMarkets []CreateMarket `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets"` + UpdateMarkets []Market `protobuf:"bytes,2,rep,name=update_markets,json=updateMarkets,proto3" json:"update_markets"` } -func (m *MsgUpdateMarketMap) Reset() { *m = MsgUpdateMarketMap{} } -func (m *MsgUpdateMarketMap) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateMarketMap) ProtoMessage() {} -func (*MsgUpdateMarketMap) Descriptor() ([]byte, []int) { - return fileDescriptor_e9adadfc18297083, []int{1} +func (m *MsgUpdateMarkets) Reset() { *m = MsgUpdateMarkets{} } +func (m *MsgUpdateMarkets) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateMarkets) ProtoMessage() {} +func (*MsgUpdateMarkets) Descriptor() ([]byte, []int) { + return fileDescriptor_e9adadfc18297083, []int{2} } -func (m *MsgUpdateMarketMap) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateMarkets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateMarketMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateMarkets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateMarketMap.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateMarkets.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -129,48 +158,48 @@ func (m *MsgUpdateMarketMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgUpdateMarketMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateMarketMap.Merge(m, src) +func (m *MsgUpdateMarkets) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateMarkets.Merge(m, src) } -func (m *MsgUpdateMarketMap) XXX_Size() int { +func (m *MsgUpdateMarkets) XXX_Size() int { return m.Size() } -func (m *MsgUpdateMarketMap) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateMarketMap.DiscardUnknown(m) +func (m *MsgUpdateMarkets) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateMarkets.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateMarketMap proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateMarkets proto.InternalMessageInfo -func (m *MsgUpdateMarketMap) GetSigner() string { +func (m *MsgUpdateMarkets) GetAuthority() string { if m != nil { - return m.Signer + return m.Authority } return "" } -func (m *MsgUpdateMarketMap) GetCreateMarkets() []CreateMarket { +func (m *MsgUpdateMarkets) GetUpdateMarkets() []Market { if m != nil { - return m.CreateMarkets + return m.UpdateMarkets } return nil } -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -type MsgUpdateMarketMapResponse struct { +// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. +type MsgUpdateMarketsResponse struct { } -func (m *MsgUpdateMarketMapResponse) Reset() { *m = MsgUpdateMarketMapResponse{} } -func (m *MsgUpdateMarketMapResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateMarketMapResponse) ProtoMessage() {} -func (*MsgUpdateMarketMapResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e9adadfc18297083, []int{2} +func (m *MsgUpdateMarketsResponse) Reset() { *m = MsgUpdateMarketsResponse{} } +func (m *MsgUpdateMarketsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateMarketsResponse) ProtoMessage() {} +func (*MsgUpdateMarketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e9adadfc18297083, []int{3} } -func (m *MsgUpdateMarketMapResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateMarketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateMarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateMarketMapResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateMarketsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -180,17 +209,17 @@ func (m *MsgUpdateMarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgUpdateMarketMapResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateMarketMapResponse.Merge(m, src) +func (m *MsgUpdateMarketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateMarketsResponse.Merge(m, src) } -func (m *MsgUpdateMarketMapResponse) XXX_Size() int { +func (m *MsgUpdateMarketsResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpdateMarketMapResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateMarketMapResponse.DiscardUnknown(m) +func (m *MsgUpdateMarketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateMarketsResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateMarketMapResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateMarketsResponse proto.InternalMessageInfo // MsgParams defines the Msg/Params request type. It contains the // new parameters for the x/marketmap module. @@ -206,7 +235,7 @@ func (m *MsgParams) Reset() { *m = MsgParams{} } func (m *MsgParams) String() string { return proto.CompactTextString(m) } func (*MsgParams) ProtoMessage() {} func (*MsgParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e9adadfc18297083, []int{3} + return fileDescriptor_e9adadfc18297083, []int{4} } func (m *MsgParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -257,7 +286,7 @@ func (m *MsgParamsResponse) Reset() { *m = MsgParamsResponse{} } func (m *MsgParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgParamsResponse) ProtoMessage() {} func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e9adadfc18297083, []int{4} + return fileDescriptor_e9adadfc18297083, []int{5} } func (m *MsgParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -286,51 +315,152 @@ func (m *MsgParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgParamsResponse proto.InternalMessageInfo +// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse +// request type. It contains the new addresses to remove from the list of +// authorities +type MsgRemoveMarketAuthorities struct { + // RemoveAddresses is the list of addresses to remove. + RemoveAddresses []string `protobuf:"bytes,1,rep,name=remove_addresses,json=removeAddresses,proto3" json:"remove_addresses,omitempty"` + // Admin defines the authority that is the x/marketmap + // Admin account. This account is set in the module parameters. + Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` +} + +func (m *MsgRemoveMarketAuthorities) Reset() { *m = MsgRemoveMarketAuthorities{} } +func (m *MsgRemoveMarketAuthorities) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMarketAuthorities) ProtoMessage() {} +func (*MsgRemoveMarketAuthorities) Descriptor() ([]byte, []int) { + return fileDescriptor_e9adadfc18297083, []int{6} +} +func (m *MsgRemoveMarketAuthorities) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMarketAuthorities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMarketAuthorities.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 *MsgRemoveMarketAuthorities) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMarketAuthorities.Merge(m, src) +} +func (m *MsgRemoveMarketAuthorities) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMarketAuthorities) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMarketAuthorities.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMarketAuthorities proto.InternalMessageInfo + +func (m *MsgRemoveMarketAuthorities) GetRemoveAddresses() []string { + if m != nil { + return m.RemoveAddresses + } + return nil +} + +func (m *MsgRemoveMarketAuthorities) GetAdmin() string { + if m != nil { + return m.Admin + } + return "" +} + +// MsgRemoveMarketAuthoritiesResponse defines the +// Msg/RemoveMarketAuthoritiesResponse response type. +type MsgRemoveMarketAuthoritiesResponse struct { +} + +func (m *MsgRemoveMarketAuthoritiesResponse) Reset() { *m = MsgRemoveMarketAuthoritiesResponse{} } +func (m *MsgRemoveMarketAuthoritiesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveMarketAuthoritiesResponse) ProtoMessage() {} +func (*MsgRemoveMarketAuthoritiesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e9adadfc18297083, []int{7} +} +func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.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 *MsgRemoveMarketAuthoritiesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.Merge(m, src) +} +func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveMarketAuthoritiesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse proto.InternalMessageInfo + func init() { - proto.RegisterType((*CreateMarket)(nil), "slinky.marketmap.v1.CreateMarket") - proto.RegisterType((*MsgUpdateMarketMap)(nil), "slinky.marketmap.v1.MsgUpdateMarketMap") - proto.RegisterType((*MsgUpdateMarketMapResponse)(nil), "slinky.marketmap.v1.MsgUpdateMarketMapResponse") + proto.RegisterType((*MsgCreateMarkets)(nil), "slinky.marketmap.v1.MsgCreateMarkets") + proto.RegisterType((*MsgCreateMarketsResponse)(nil), "slinky.marketmap.v1.MsgCreateMarketsResponse") + proto.RegisterType((*MsgUpdateMarkets)(nil), "slinky.marketmap.v1.MsgUpdateMarkets") + proto.RegisterType((*MsgUpdateMarketsResponse)(nil), "slinky.marketmap.v1.MsgUpdateMarketsResponse") proto.RegisterType((*MsgParams)(nil), "slinky.marketmap.v1.MsgParams") proto.RegisterType((*MsgParamsResponse)(nil), "slinky.marketmap.v1.MsgParamsResponse") + proto.RegisterType((*MsgRemoveMarketAuthorities)(nil), "slinky.marketmap.v1.MsgRemoveMarketAuthorities") + proto.RegisterType((*MsgRemoveMarketAuthoritiesResponse)(nil), "slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse") } func init() { proto.RegisterFile("slinky/marketmap/v1/tx.proto", fileDescriptor_e9adadfc18297083) } var fileDescriptor_e9adadfc18297083 = []byte{ - // 515 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6a, 0x13, 0x41, - 0x18, 0xc7, 0x77, 0x8c, 0x0d, 0x64, 0xaa, 0x95, 0x4e, 0x0b, 0xc6, 0xb5, 0x6c, 0xeb, 0x82, 0x5a, - 0x82, 0xdd, 0xb5, 0x11, 0x0a, 0xed, 0xcd, 0x08, 0xde, 0x56, 0x42, 0xd4, 0x8b, 0x97, 0xb2, 0xdd, - 0x0c, 0x93, 0x65, 0xdd, 0x9d, 0x61, 0x66, 0x1a, 0x9a, 0x9b, 0x78, 0xf4, 0x20, 0x3e, 0x82, 0x8f, - 0x90, 0x83, 0xaf, 0x20, 0x14, 0xbc, 0x44, 0x4f, 0x9e, 0x44, 0x92, 0x43, 0x7c, 0x0c, 0xd9, 0x99, - 0xd9, 0x24, 0x98, 0x35, 0xf4, 0x12, 0x76, 0xbe, 0xef, 0xf7, 0x9f, 0xf9, 0x7f, 0xdf, 0x9f, 0xc0, - 0x1d, 0xf1, 0x36, 0xce, 0x92, 0x81, 0x9f, 0x86, 0x3c, 0xc1, 0x32, 0x0d, 0x99, 0xdf, 0x3f, 0xf4, - 0xe5, 0x85, 0xc7, 0x38, 0x95, 0x14, 0x6d, 0xe9, 0xae, 0x37, 0xeb, 0x7a, 0xfd, 0x43, 0xfb, 0x76, - 0x44, 0x45, 0x4a, 0x85, 0x9f, 0x0a, 0x92, 0xc3, 0xa9, 0x20, 0x9a, 0xb6, 0xb7, 0x09, 0x25, 0x54, - 0x7d, 0xfa, 0xf9, 0x97, 0xa9, 0xde, 0xd1, 0xf8, 0xa9, 0x6e, 0xe8, 0x83, 0x69, 0x6d, 0x86, 0x69, - 0x9c, 0x51, 0x5f, 0xfd, 0x9a, 0xd2, 0x5e, 0x99, 0x1f, 0x7d, 0x58, 0x45, 0xb0, 0x90, 0x87, 0xa9, - 0xb9, 0xd6, 0xfd, 0x0a, 0xe0, 0x8d, 0x67, 0x1c, 0x87, 0x12, 0x07, 0x8a, 0x41, 0xc7, 0xb0, 0x2a, - 0xe3, 0x28, 0xc1, 0xbc, 0x0e, 0xf6, 0xc0, 0xfe, 0x7a, 0xf3, 0xae, 0x57, 0x32, 0x97, 0xf7, 0x4a, - 0x21, 0xad, 0xeb, 0x97, 0xbf, 0x76, 0xad, 0x8e, 0x11, 0xa0, 0x16, 0xac, 0x31, 0x4e, 0xfb, 0x71, - 0x17, 0x73, 0x51, 0xbf, 0xa6, 0xd4, 0x4e, 0xa9, 0xba, 0x5d, 0x50, 0xe6, 0x82, 0xb9, 0x0c, 0x1d, - 0xc1, 0x35, 0x16, 0xca, 0x9e, 0xa8, 0x57, 0x94, 0xde, 0x2e, 0xd7, 0xe7, 0x84, 0xd1, 0x6a, 0xdc, - 0xfd, 0x0e, 0x20, 0x0a, 0x04, 0x79, 0xcd, 0xba, 0xb3, 0x51, 0x82, 0x90, 0xa1, 0xc7, 0xb0, 0x2a, - 0x62, 0x92, 0x99, 0x69, 0x6a, 0xad, 0xfa, 0x8f, 0x2f, 0x07, 0xdb, 0x66, 0xaf, 0x4f, 0xbb, 0x5d, - 0x8e, 0x85, 0x78, 0x29, 0x79, 0x9c, 0x91, 0x8e, 0xe1, 0xd0, 0x0b, 0xb8, 0x11, 0xa9, 0x7d, 0x9c, - 0xea, 0x27, 0xf3, 0x49, 0x2a, 0xfb, 0xeb, 0xcd, 0x7b, 0xa5, 0x4e, 0x16, 0x57, 0x67, 0x0c, 0xdd, - 0x8c, 0x16, 0x6a, 0xe2, 0xe4, 0xf8, 0xcf, 0xe7, 0x5d, 0xeb, 0xfd, 0x74, 0xd8, 0x30, 0x0f, 0x7c, - 0x98, 0x0e, 0x1b, 0xf7, 0x4d, 0x2c, 0x17, 0x0b, 0xc1, 0x2c, 0x9b, 0x77, 0x77, 0xa0, 0xbd, 0x5c, - 0xed, 0x60, 0xc1, 0x68, 0x26, 0xb0, 0xfb, 0x11, 0xc0, 0x5a, 0x20, 0x48, 0x5b, 0xa5, 0x99, 0xc7, - 0xa6, 0x73, 0x5d, 0x19, 0x9b, 0x86, 0x8b, 0xd8, 0xb4, 0x00, 0x1d, 0xc1, 0x5a, 0x78, 0x2e, 0x7b, - 0x94, 0xc7, 0x72, 0xa0, 0x62, 0x5b, 0xb5, 0xa6, 0x39, 0x7a, 0xb2, 0x91, 0x4f, 0x35, 0x3f, 0xbb, - 0x5b, 0x70, 0x73, 0xe6, 0xa7, 0x70, 0xd9, 0xfc, 0x06, 0x60, 0x25, 0x10, 0x04, 0x25, 0xf0, 0xd6, - 0xbf, 0xd9, 0x3c, 0x2c, 0xb5, 0xb8, 0x3c, 0xb1, 0xed, 0x5f, 0x11, 0x2c, 0x1e, 0x45, 0x6d, 0x58, - 0x35, 0x6b, 0x71, 0xfe, 0x27, 0xd5, 0x7d, 0xfb, 0xc1, 0xea, 0x7e, 0x71, 0xa3, 0xbd, 0xf6, 0x6e, - 0x3a, 0x6c, 0x80, 0xd6, 0xf3, 0xcb, 0xb1, 0x03, 0x46, 0x63, 0x07, 0xfc, 0x1e, 0x3b, 0xe0, 0xd3, - 0xc4, 0xb1, 0x46, 0x13, 0xc7, 0xfa, 0x39, 0x71, 0xac, 0x37, 0x8f, 0x48, 0x2c, 0x7b, 0xe7, 0x67, - 0x5e, 0x44, 0x53, 0x5f, 0x24, 0x31, 0x3b, 0x48, 0x71, 0xdf, 0x2f, 0x89, 0x59, 0x0e, 0x18, 0x16, - 0x67, 0x55, 0xf5, 0xe7, 0x7b, 0xf2, 0x37, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x70, 0x1d, 0x7a, 0x52, - 0x04, 0x00, 0x00, + // 559 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x77, 0x1a, 0x1b, 0xc8, 0x48, 0x6b, 0xbb, 0x2d, 0x34, 0xae, 0xb2, 0x0d, 0xeb, 0x0b, + 0x31, 0x98, 0x5d, 0x5a, 0x41, 0x31, 0xb7, 0x44, 0x10, 0x2f, 0x0b, 0x65, 0xc5, 0x8b, 0x97, 0xb0, + 0x4d, 0x86, 0xe9, 0x12, 0x67, 0x67, 0xd9, 0xd9, 0x84, 0xe6, 0x26, 0xf6, 0xe6, 0x41, 0xfc, 0x08, + 0x7e, 0x84, 0x20, 0x7e, 0x88, 0x1e, 0x83, 0x27, 0x4f, 0x22, 0xc9, 0x21, 0x7e, 0x0c, 0xd9, 0x99, + 0xd9, 0x6d, 0x36, 0xec, 0xd6, 0x56, 0xbc, 0x84, 0xd9, 0xe7, 0xf9, 0x3f, 0xcf, 0xf3, 0xfb, 0xcf, + 0x4b, 0xe0, 0x5d, 0xf6, 0xce, 0xf3, 0x07, 0x63, 0x8b, 0xb8, 0xe1, 0x00, 0x45, 0xc4, 0x0d, 0xac, + 0xd1, 0x81, 0x15, 0x9d, 0x9a, 0x41, 0x48, 0x23, 0xaa, 0xee, 0x88, 0xac, 0x99, 0x66, 0xcd, 0xd1, + 0x81, 0xb6, 0xd7, 0xa3, 0x8c, 0x50, 0x66, 0x11, 0x86, 0x63, 0x31, 0x61, 0x58, 0xa8, 0xb5, 0x5d, + 0x4c, 0x31, 0xe5, 0x4b, 0x2b, 0x5e, 0xc9, 0xe8, 0x6d, 0x21, 0xef, 0x8a, 0x84, 0xf8, 0x90, 0xa9, + 0x6d, 0x97, 0x78, 0x3e, 0xb5, 0xf8, 0xaf, 0x0c, 0xd5, 0xf2, 0x78, 0xc4, 0xc7, 0x65, 0x8a, 0xc0, + 0x0d, 0x5d, 0x22, 0xdb, 0x1a, 0x53, 0x00, 0xb7, 0x6c, 0x86, 0x5f, 0x84, 0xc8, 0x8d, 0x90, 0xcd, + 0x65, 0x4c, 0x7d, 0x0a, 0x2b, 0xee, 0x30, 0x3a, 0xa1, 0xa1, 0x17, 0x8d, 0xab, 0xa0, 0x06, 0xea, + 0x95, 0x4e, 0xf5, 0xfb, 0xb7, 0xe6, 0xae, 0x04, 0x6a, 0xf7, 0xfb, 0x21, 0x62, 0xec, 0x75, 0x14, + 0x7a, 0x3e, 0x76, 0x2e, 0xa4, 0xea, 0x2b, 0xb8, 0xd9, 0xe3, 0x8d, 0xba, 0x62, 0x20, 0xab, 0xae, + 0xd5, 0x4a, 0xf5, 0x9b, 0x87, 0x77, 0xcc, 0x9c, 0xbd, 0x31, 0xc5, 0xb4, 0xce, 0x8d, 0xf3, 0x9f, + 0xfb, 0x8a, 0xb3, 0xd1, 0x5b, 0x26, 0x68, 0xb5, 0x7e, 0x7f, 0xd9, 0x57, 0x3e, 0x2c, 0x26, 0x8d, + 0x8b, 0xee, 0x1f, 0x17, 0x93, 0xc6, 0x3d, 0xe9, 0xe7, 0x74, 0xc9, 0xd1, 0x2a, 0xbd, 0xa1, 0xc1, + 0xea, 0x6a, 0xcc, 0x41, 0x2c, 0xa0, 0x3e, 0x43, 0x89, 0xdd, 0x37, 0x41, 0xff, 0xff, 0xd8, 0x1d, + 0xf2, 0x46, 0xff, 0x60, 0x77, 0xb8, 0x4c, 0x70, 0x4d, 0xbb, 0x19, 0x7a, 0x69, 0x37, 0x13, 0x4b, + 0xed, 0x7e, 0x02, 0xb0, 0x62, 0x33, 0x7c, 0xc4, 0x4f, 0x5c, 0x7d, 0x0e, 0xcb, 0xe2, 0xec, 0xb9, + 0xc9, 0x22, 0x4e, 0x21, 0x96, 0x9c, 0xb2, 0x20, 0xbb, 0x45, 0x6b, 0x57, 0xde, 0xa2, 0xd6, 0x66, + 0xd6, 0x94, 0xb1, 0x03, 0xb7, 0x53, 0x9e, 0x94, 0xf2, 0x0c, 0x40, 0xcd, 0x66, 0xd8, 0x41, 0x84, + 0x8e, 0xa4, 0x85, 0xb6, 0xac, 0xf0, 0x10, 0x53, 0x1f, 0xc1, 0xad, 0x90, 0xa7, 0xba, 0xae, 0x18, + 0x83, 0x62, 0x03, 0xa5, 0x7a, 0xc5, 0xb9, 0x25, 0xe2, 0xed, 0x24, 0xac, 0x9a, 0x70, 0xdd, 0xed, + 0x13, 0xcf, 0xff, 0x2b, 0xa2, 0x90, 0xb5, 0x60, 0x8c, 0x27, 0xd6, 0xc6, 0x7d, 0x68, 0x14, 0x43, + 0x24, 0xac, 0x87, 0x5f, 0x4b, 0xb0, 0x64, 0x33, 0xac, 0x22, 0xb8, 0x91, 0x7d, 0x33, 0x0f, 0xf2, + 0x0f, 0x7d, 0xe5, 0x22, 0x6a, 0xcd, 0x2b, 0xc9, 0x92, 0x71, 0xf1, 0x98, 0xec, 0x5d, 0x2d, 0x1c, + 0x93, 0x91, 0x15, 0x8f, 0xc9, 0xbd, 0x27, 0xea, 0x11, 0x2c, 0xcb, 0x3b, 0xa2, 0x17, 0x15, 0x8a, + 0xbc, 0xf6, 0xf0, 0xf2, 0x7c, 0xda, 0xf1, 0x0c, 0xc0, 0xbd, 0xa2, 0x03, 0xb5, 0x8a, 0x7a, 0x14, + 0x14, 0x68, 0xcf, 0xae, 0x59, 0x90, 0x50, 0x68, 0xeb, 0xef, 0x17, 0x93, 0x06, 0xe8, 0xbc, 0x3c, + 0x9f, 0xe9, 0x60, 0x3a, 0xd3, 0xc1, 0xaf, 0x99, 0x0e, 0x3e, 0xcf, 0x75, 0x65, 0x3a, 0xd7, 0x95, + 0x1f, 0x73, 0x5d, 0x79, 0xfb, 0x18, 0x7b, 0xd1, 0xc9, 0xf0, 0xd8, 0xec, 0x51, 0x62, 0xb1, 0x81, + 0x17, 0x34, 0x09, 0x1a, 0x59, 0x39, 0xaf, 0x2e, 0x1a, 0x07, 0x88, 0x1d, 0x97, 0xf9, 0x7f, 0xe6, + 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x17, 0x47, 0xc7, 0xa9, 0x09, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -345,10 +475,15 @@ 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 MsgClient interface { - // UpdateMarketMap creates markets from the given message. - UpdateMarketMap(ctx context.Context, in *MsgUpdateMarketMap, opts ...grpc.CallOption) (*MsgUpdateMarketMapResponse, error) + // CreateMarkets creates markets from the given message. + CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) + // UpdateMarkets updates markets from the given message. + UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) // Params defines a method for updating the x/marketmap module parameters. Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) } type msgClient struct { @@ -359,9 +494,18 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) UpdateMarketMap(ctx context.Context, in *MsgUpdateMarketMap, opts ...grpc.CallOption) (*MsgUpdateMarketMapResponse, error) { - out := new(MsgUpdateMarketMapResponse) - err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Msg/UpdateMarketMap", in, out, opts...) +func (c *msgClient) CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) { + out := new(MsgCreateMarketsResponse) + err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Msg/CreateMarkets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) { + out := new(MsgUpdateMarketsResponse) + err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Msg/UpdateMarkets", in, out, opts...) if err != nil { return nil, err } @@ -377,43 +521,81 @@ func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.Call return out, nil } +func (c *msgClient) RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) { + out := new(MsgRemoveMarketAuthoritiesResponse) + err := c.cc.Invoke(ctx, "/slinky.marketmap.v1.Msg/RemoveMarketAuthorities", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { - // UpdateMarketMap creates markets from the given message. - UpdateMarketMap(context.Context, *MsgUpdateMarketMap) (*MsgUpdateMarketMapResponse, error) + // CreateMarkets creates markets from the given message. + CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) + // UpdateMarkets updates markets from the given message. + UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) // Params defines a method for updating the x/marketmap module parameters. Params(context.Context, *MsgParams) (*MsgParamsResponse, error) + // RemoveMarketAuthorities defines a method for removing market authorities + // from the x/marketmap module. the signer must be the admin. + RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) UpdateMarketMap(ctx context.Context, req *MsgUpdateMarketMap) (*MsgUpdateMarketMapResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMarketMap not implemented") +func (*UnimplementedMsgServer) CreateMarkets(ctx context.Context, req *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateMarkets not implemented") +} +func (*UnimplementedMsgServer) UpdateMarkets(ctx context.Context, req *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMarkets not implemented") } func (*UnimplementedMsgServer) Params(ctx context.Context, req *MsgParams) (*MsgParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedMsgServer) RemoveMarketAuthorities(ctx context.Context, req *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveMarketAuthorities not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_UpdateMarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateMarketMap) +func _Msg_CreateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateMarkets) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).UpdateMarketMap(ctx, in) + return srv.(MsgServer).CreateMarkets(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/slinky.marketmap.v1.Msg/UpdateMarketMap", + FullMethod: "/slinky.marketmap.v1.Msg/CreateMarkets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateMarketMap(ctx, req.(*MsgUpdateMarketMap)) + return srv.(MsgServer).CreateMarkets(ctx, req.(*MsgCreateMarkets)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateMarkets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateMarkets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slinky.marketmap.v1.Msg/UpdateMarkets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateMarkets(ctx, req.(*MsgUpdateMarkets)) } return interceptor(ctx, in, info, handler) } @@ -436,24 +618,50 @@ func _Msg_Params_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_RemoveMarketAuthorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveMarketAuthorities) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveMarketAuthorities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/slinky.marketmap.v1.Msg/RemoveMarketAuthorities", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveMarketAuthorities(ctx, req.(*MsgRemoveMarketAuthorities)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "slinky.marketmap.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "UpdateMarketMap", - Handler: _Msg_UpdateMarketMap_Handler, + MethodName: "CreateMarkets", + Handler: _Msg_CreateMarkets_Handler, + }, + { + MethodName: "UpdateMarkets", + Handler: _Msg_UpdateMarkets_Handler, }, { MethodName: "Params", Handler: _Msg_Params_Handler, }, + { + MethodName: "RemoveMarketAuthorities", + Handler: _Msg_RemoveMarketAuthorities_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "slinky/marketmap/v1/tx.proto", } -func (m *CreateMarket) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateMarkets) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -463,50 +671,64 @@ func (m *CreateMarket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateMarket) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateMarkets) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CreateMarket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateMarkets) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Paths.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.CreateMarkets) > 0 { + for iNdEx := len(m.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CreateMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x1a - { - size, err := m.Providers.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x12 - { - size, err := m.Ticker.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + return len(dAtA) - i, nil +} + +func (m *MsgCreateMarketsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - i-- - dAtA[i] = 0xa + return dAtA[:n], nil +} + +func (m *MsgCreateMarketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l return len(dAtA) - i, nil } -func (m *MsgUpdateMarketMap) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateMarkets) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -516,20 +738,20 @@ func (m *MsgUpdateMarketMap) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateMarketMap) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateMarkets) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateMarketMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateMarkets) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.CreateMarkets) > 0 { - for iNdEx := len(m.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { + if len(m.UpdateMarkets) > 0 { + for iNdEx := len(m.UpdateMarkets) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.CreateMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.UpdateMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -540,17 +762,17 @@ func (m *MsgUpdateMarketMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgUpdateMarketMapResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateMarketsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -560,12 +782,12 @@ func (m *MsgUpdateMarketMapResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateMarketMapResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateMarketsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateMarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -636,6 +858,68 @@ func (m *MsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgRemoveMarketAuthorities) 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 *MsgRemoveMarketAuthorities) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMarketAuthorities) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x12 + } + if len(m.RemoveAddresses) > 0 { + for iNdEx := len(m.RemoveAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RemoveAddresses[iNdEx]) + copy(dAtA[i:], m.RemoveAddresses[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.RemoveAddresses[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgRemoveMarketAuthoritiesResponse) 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 *MsgRemoveMarketAuthoritiesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveMarketAuthoritiesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -647,41 +931,78 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *CreateMarket) Size() (n int) { +func (m *MsgCreateMarkets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.CreateMarkets) > 0 { + for _, e := range m.CreateMarkets { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgCreateMarketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateMarkets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.UpdateMarkets) > 0 { + for _, e := range m.UpdateMarkets { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateMarketsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Ticker.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Providers.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Paths.Size() - n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgUpdateMarketMap) Size() (n int) { +func (m *MsgParams) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Signer) + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Authority) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.CreateMarkets) > 0 { - for _, e := range m.CreateMarkets { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } return n } -func (m *MsgUpdateMarketMapResponse) Size() (n int) { +func (m *MsgParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -690,22 +1011,26 @@ func (m *MsgUpdateMarketMapResponse) Size() (n int) { return n } -func (m *MsgParams) Size() (n int) { +func (m *MsgRemoveMarketAuthorities) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) + if len(m.RemoveAddresses) > 0 { + for _, s := range m.RemoveAddresses { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Admin) if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgParamsResponse) Size() (n int) { +func (m *MsgRemoveMarketAuthoritiesResponse) Size() (n int) { if m == nil { return 0 } @@ -720,7 +1045,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *CreateMarket) Unmarshal(dAtA []byte) error { +func (m *MsgCreateMarkets) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -743,17 +1068,17 @@ func (m *CreateMarket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateMarket: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateMarkets: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateMarket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateMarkets: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -763,28 +1088,27 @@ func (m *CreateMarket) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Ticker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Providers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -811,43 +1135,61 @@ func (m *CreateMarket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Providers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.CreateMarkets = append(m.CreateMarkets, Market{}) + if err := m.CreateMarkets[len(m.CreateMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Paths", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateMarketsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := m.Paths.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateMarketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -869,7 +1211,7 @@ func (m *CreateMarket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateMarketMap) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateMarkets) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -892,15 +1234,15 @@ func (m *MsgUpdateMarketMap) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateMarketMap: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateMarkets: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateMarketMap: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateMarkets: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -928,11 +1270,11 @@ func (m *MsgUpdateMarketMap) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpdateMarkets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -959,8 +1301,8 @@ func (m *MsgUpdateMarketMap) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CreateMarkets = append(m.CreateMarkets, CreateMarket{}) - if err := m.CreateMarkets[len(m.CreateMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.UpdateMarkets = append(m.UpdateMarkets, Market{}) + if err := m.UpdateMarkets[len(m.UpdateMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -985,7 +1327,7 @@ func (m *MsgUpdateMarketMap) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateMarketMapResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateMarketsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1008,10 +1350,10 @@ func (m *MsgUpdateMarketMapResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateMarketMapResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateMarketsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateMarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1200,6 +1542,170 @@ func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRemoveMarketAuthorities) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveMarketAuthorities: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMarketAuthorities: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemoveAddresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RemoveAddresses = append(m.RemoveAddresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRemoveMarketAuthoritiesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/mm2/types/utils.go b/x/marketmap/types/utils.go similarity index 100% rename from x/mm2/types/utils.go rename to x/marketmap/types/utils.go diff --git a/x/mm2/client/cli/query.go b/x/mm2/client/cli/query.go deleted file mode 100644 index 3918baf43..000000000 --- a/x/mm2/client/cli/query.go +++ /dev/null @@ -1,138 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/types" -) - -// GetQueryCmd returns the parent command for all x/marketmap cli query commands. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the marketmap module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - CmdQueryParams(), - CmdQueryMarketMap(), - CmdQueryLastUpdated(), - CmdQueryMarket(), - ) - - return cmd -} - -// CmdQueryParams returns the command for querying the module's parameters. -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Query the current marketmap module parameters", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(clientCtx.CmdContext, &types.ParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&res.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func CmdQueryMarketMap() *cobra.Command { - cmd := &cobra.Command{ - Use: "market-map", - Short: "Query the current market map", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.MarketMap(clientCtx.CmdContext, &types.MarketMapRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func CmdQueryMarket() *cobra.Command { - cmd := &cobra.Command{ - Use: "market", - Short: "Query the a market using the given currency pair", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - cp, err := slinkytypes.CurrencyPairFromString(args[0]) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Market(clientCtx.CmdContext, &types.MarketRequest{ - CurrencyPair: cp, - }) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func CmdQueryLastUpdated() *cobra.Command { - cmd := &cobra.Command{ - Use: "last-updated", - Short: "Query the last height the market map was updated at", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.LastUpdated(clientCtx.CmdContext, &types.LastUpdatedRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - return cmd -} diff --git a/x/mm2/keeper/genesis.go b/x/mm2/keeper/genesis.go deleted file mode 100644 index 210de0cb1..000000000 --- a/x/mm2/keeper/genesis.go +++ /dev/null @@ -1,62 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/slinky/x/mm2/types" -) - -// InitGenesis initializes the genesis state. Panics if there is an error. -// Any modules that integrate with x/marketmap must set their InitGenesis to occur before the x/marketmap -// module's InitGenesis. This is so that logic any consuming modules may want to implement in AfterMarketGenesis -// will be run properly. -func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) { - // validate the genesis - if err := gs.ValidateBasic(); err != nil { - panic(err) - } - - for _, market := range gs.MarketMap.Markets { - if err := k.CreateMarket(ctx, market); err != nil { - panic(err) - } - } - - if err := k.SetLastUpdated(ctx, gs.LastUpdated); err != nil { - panic(err) - } - - if err := k.SetParams(ctx, gs.Params); err != nil { - panic(err) - } - - if err := k.hooks.AfterMarketGenesis(ctx, gs.MarketMap.Markets); err != nil { - panic(err) - } -} - -// ExportGenesis retrieves the genesis from state. -func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - markets, err := k.GetAllMarkets(ctx) - if err != nil { - panic(err) - } - - lastUpdated, err := k.GetLastUpdated(ctx) - if err != nil { - panic(err) - } - - params, err := k.GetParams(ctx) - if err != nil { - panic(err) - } - - return &types.GenesisState{ - MarketMap: types.MarketMap{ - Markets: markets, - }, - LastUpdated: lastUpdated, - Params: params, - } -} diff --git a/x/mm2/keeper/genesis_test.go b/x/mm2/keeper/genesis_test.go deleted file mode 100644 index eb4a55a97..000000000 --- a/x/mm2/keeper/genesis_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package keeper_test - -import ( - sdkmath "cosmossdk.io/math" - - "github.com/skip-mev/slinky/x/mm2/types" - oracletypes "github.com/skip-mev/slinky/x/oracle/types" -) - -func (s *KeeperTestSuite) TestInitGenesisInvalidGenesis() { - s.Run("test that init genesis with invalid genesis params - fails", func() { - // create a fake genesis state with invalid params - gs := types.GenesisState{ - MarketMap: types.DefaultGenesisState().MarketMap, - Params: types.Params{ - MarketAuthorities: []string{"invalid"}, - }, - } - - // assert that InitGenesis panics - s.Require().Panics(func() { - s.keeper.InitGenesis(s.ctx, gs) - }) - }) - - s.Run("test that init genesis with invalid duplicate runs - fails", func() { - // create a valid genesis - gs := types.DefaultGenesisState() - - gs.MarketMap = types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): ethusdt, - btcusdt.Ticker.String(): btcusdt, - usdcusd.Ticker.String(): usdcusd, - }, - } - - // assert that InitGenesis panics - s.Require().Panics(func() { - s.keeper.InitGenesis(s.ctx, *gs) - s.keeper.InitGenesis(s.ctx, *gs) - }) - }) -} - -func (s *KeeperTestSuite) TestInitExportGenesisValid() { - s.Run("init valid default genesis and export", func() { - gs := types.DefaultGenesisState() - - s.Require().NotPanics(func() { - s.keeper.InitGenesis(s.ctx, *gs) - }) - - var gotState *types.GenesisState - s.Require().NotPanics(func() { - gotState = s.keeper.ExportGenesis(s.ctx) - }) - - s.Require().Equal(gs, gotState) - }) - - s.Run("init valid genesis with fields", func() { - // first register x/oracle genesis - ogs := oracletypes.DefaultGenesisState() - ogs.NextId = 4 - ogs.CurrencyPairGenesis = []oracletypes.CurrencyPairGenesis{ - { - CurrencyPair: ethusdt.Ticker.CurrencyPair, - CurrencyPairPrice: &oracletypes.QuotePrice{Price: sdkmath.NewInt(19)}, - Nonce: 0, - Id: 0, - }, - { - CurrencyPair: btcusdt.Ticker.CurrencyPair, - CurrencyPairPrice: &oracletypes.QuotePrice{Price: sdkmath.NewInt(19)}, - Nonce: 0, - Id: 1, - }, - { - CurrencyPair: usdcusd.Ticker.CurrencyPair, - CurrencyPairPrice: nil, - Nonce: 0, - Id: 2, - }, - { - CurrencyPair: usdtusd.Ticker.CurrencyPair, - CurrencyPairPrice: nil, - Nonce: 0, - Id: 3, - }, - } - - s.Require().NotPanics(func() { - s.oracleKeeper.InitGenesis(s.ctx, *ogs) - }) - - gs := types.DefaultGenesisState() - gs.MarketMap = types.MarketMap{ - Markets: marketsMap, - } - - s.Require().NotPanics(func() { - s.keeper.InitGenesis(s.ctx, *gs) - }) - - gotMarkets, err := s.keeper.GetAllMarkets(s.ctx) - s.Require().NoError(err) - s.Require().Equal(gs.MarketMap.Markets, gotMarkets) - - var gotState *types.GenesisState - s.Require().NotPanics(func() { - gotState = s.keeper.ExportGenesis(s.ctx) - }) - - s.Require().Equal(gs, gotState) - }) -} diff --git a/x/mm2/keeper/hooks.go b/x/mm2/keeper/hooks.go deleted file mode 100644 index 9c42baf24..000000000 --- a/x/mm2/keeper/hooks.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "github.com/skip-mev/slinky/x/mm2/types" -) - -// Hooks gets the hooks for x/marketmap keeper. -func (k *Keeper) Hooks() types.MarketMapHooks { - if k.hooks == nil { - // return a no-op implementation if no hooks are set - return types.MultiMarketMapHooks{} - } - - return k.hooks -} - -// SetHooks sets the x/marketmap hooks. In contrast to other receivers, this method must take a pointer due to nature -// of the hooks interface and SDK start up sequence. -func (k *Keeper) SetHooks(mmh types.MarketMapHooks) { - if k.hooks != nil { - panic("cannot set marketmap hooks twice") - } - - k.hooks = mmh -} diff --git a/x/mm2/keeper/keeper.go b/x/mm2/keeper/keeper.go deleted file mode 100644 index d743235f4..000000000 --- a/x/mm2/keeper/keeper.go +++ /dev/null @@ -1,161 +0,0 @@ -package keeper - -import ( - "fmt" - - "cosmossdk.io/collections" - "cosmossdk.io/core/store" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/slinky/x/mm2/types" -) - -// Keeper is the module's keeper implementation. -type Keeper struct { - cdc codec.BinaryCodec - - // module authority - authority sdk.AccAddress - - // registered hooks - hooks types.MarketMapHooks - - // markets is keyed by CurrencyPair string (BASE/QUOTE) and contains - // the list of all Markets. - markets collections.Map[types.TickerString, types.Market] - - // lastUpdated is the last block height the marketmap was updated. - lastUpdated collections.Item[uint64] - - // params is the module's parameters. - params collections.Item[types.Params] -} - -// NewKeeper initializes the keeper and its backing stores. -func NewKeeper(ss store.KVStoreService, cdc codec.BinaryCodec, authority sdk.AccAddress) *Keeper { - sb := collections.NewSchemaBuilder(ss) - - // Create the collections item that will track the module parameters. - params := collections.NewItem[types.Params]( - sb, - types.ParamsPrefix, - "params", - codec.CollValue[types.Params](cdc), - ) - - return &Keeper{ - cdc: cdc, - authority: authority, - markets: collections.NewMap(sb, types.MarketsPrefix, "markets", types.TickersCodec, codec.CollValue[types.Market](cdc)), - lastUpdated: collections.NewItem[uint64](sb, types.LastUpdatedPrefix, "last_updated", types.LastUpdatedCodec), - params: params, - } -} - -// SetLastUpdated sets the lastUpdated field to the current block height. -func (k *Keeper) SetLastUpdated(ctx sdk.Context, height uint64) error { - return k.lastUpdated.Set(ctx, height) -} - -// GetLastUpdated gets the last block-height the market map was updated. -func (k *Keeper) GetLastUpdated(ctx sdk.Context) (uint64, error) { - return k.lastUpdated.Get(ctx) -} - -// GetMarket returns a market from the store by its currency pair string ID. -func (k *Keeper) GetMarket(ctx sdk.Context, tickerStr string) (types.Market, error) { - return k.markets.Get(ctx, types.TickerString(tickerStr)) -} - -// GetAllMarkets returns the set of Market objects currently stored in state -// as a map[TickerString] -> Markets. -func (k *Keeper) GetAllMarkets(ctx sdk.Context) (map[string]types.Market, error) { - iter, err := k.markets.Iterate(ctx, nil) - if err != nil { - return nil, err - } - keyValues, err := iter.KeyValues() - if err != nil { - return nil, err - } - - m := make(map[string]types.Market, len(keyValues)) - for _, keyValue := range keyValues { - m[string(keyValue.Key)] = keyValue.Value - } - - return m, 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 { - // Check if Ticker already exists for the provider - alreadyExists, err := k.markets.Has(ctx, types.TickerString(market.Ticker.String())) - if err != nil { - return err - } - if alreadyExists { - return types.NewMarketAlreadyExistsError(types.TickerString(market.Ticker.String())) - } - // Create the config - return k.markets.Set(ctx, types.TickerString(market.Ticker.String()), market) -} - -// UpdateMarket updates a Market. -// The Ticker.String corresponds to a market, and exist unique. -func (k *Keeper) UpdateMarket(ctx sdk.Context, market types.Market) error { - // Check if Ticker already exists for the provider - alreadyExists, err := k.markets.Has(ctx, types.TickerString(market.Ticker.String())) - if err != nil { - return err - } - if !alreadyExists { - return types.NewMarketDoesNotExistsError(types.TickerString(market.Ticker.String())) - } - // Create the config - return k.markets.Set(ctx, types.TickerString(market.Ticker.String()), market) -} - -// SetParams sets the x/marketmap module's parameters. -func (k *Keeper) SetParams(ctx sdk.Context, params types.Params) error { - return k.params.Set(ctx, params) -} - -// GetParams returns the x/marketmap module's parameters. -func (k *Keeper) GetParams(ctx sdk.Context) (types.Params, error) { - return k.params.Get(ctx) -} - -// ValidateState is called after keeper modifications have been made to the market map to verify that -// the aggregate of all updates has led to a valid state. -func (k *Keeper) ValidateState(ctx sdk.Context, updates []types.Market) error { - for _, market := range updates { - if err := k.IsMarketValid(ctx, market); err != nil { - return err - } - } - - return nil -} - -// IsMarketValid checks if a market is valid by statefully checking if each of the currency pairs -// specified by its provider configs are valid and in state. -func (k *Keeper) IsMarketValid(ctx sdk.Context, market types.Market) error { - // check that all markets already exist in the keeper store: - for _, providerConfig := range market.ProviderConfigs { - if providerConfig.NormalizeByPair != nil { - has, err := k.markets.Has(ctx, types.TickerString(providerConfig.NormalizeByPair.String())) - if err != nil { - return err - } - - if !has { - return fmt.Errorf("currency pair %s in provider config does not exist", providerConfig.NormalizeByPair.String()) - } - } - } - - return nil -} diff --git a/x/mm2/keeper/keeper_test.go b/x/mm2/keeper/keeper_test.go deleted file mode 100644 index 4750719be..000000000 --- a/x/mm2/keeper/keeper_test.go +++ /dev/null @@ -1,274 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/skip-mev/chaintestutil/sample" - - oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper" - oracletypes "github.com/skip-mev/slinky/x/oracle/types" - - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/stretchr/testify/suite" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/keeper" - "github.com/skip-mev/slinky/x/mm2/types" -) - -var r = sample.Rand() - -type KeeperTestSuite struct { - suite.Suite - - ctx sdk.Context - - // Keeper variables - authority sdk.AccAddress - marketAuthorities []string - admin string - - keeper *keeper.Keeper - oracleKeeper oraclekeeper.Keeper -} - -func (s *KeeperTestSuite) initKeeper() *keeper.Keeper { - mmKey := storetypes.NewKVStoreKey(types.StoreKey) - oracleKey := storetypes.NewKVStoreKey(oracletypes.StoreKey) - mmSS := runtime.NewKVStoreService(mmKey) - oracleSS := runtime.NewKVStoreService(oracleKey) - encCfg := moduletestutil.MakeTestEncodingConfig() - - keys := map[string]*storetypes.KVStoreKey{ - types.StoreKey: mmKey, - oracletypes.StoreKey: oracleKey, - } - - transientKeys := map[string]*storetypes.TransientStoreKey{ - types.StoreKey: storetypes.NewTransientStoreKey("transient_mm"), - oracletypes.StoreKey: storetypes.NewTransientStoreKey("transient_oracle"), - } - - s.authority = sdk.AccAddress("authority") - s.ctx = testutil.DefaultContextWithKeys(keys, transientKeys, nil).WithBlockHeight(10) - - k := keeper.NewKeeper(mmSS, encCfg.Codec, s.authority) - s.Require().NoError(k.SetLastUpdated(s.ctx, uint64(s.ctx.BlockHeight()))) - - s.admin = sample.Address(r) - s.marketAuthorities = []string{sample.Address(r), sample.Address(r), sample.Address(r)} - - params := types.Params{ - MarketAuthorities: s.marketAuthorities, - Admin: s.admin, - } - s.Require().NoError(k.SetParams(s.ctx, params)) - - s.oracleKeeper = oraclekeeper.NewKeeper(oracleSS, encCfg.Codec, k, s.authority) - hooks := types.MultiMarketMapHooks{ - s.oracleKeeper.Hooks(), - } - k.SetHooks(hooks) - - s.Require().NotPanics(func() { - s.oracleKeeper.InitGenesis(s.ctx, *oracletypes.DefaultGenesisState()) - }) - - return k -} - -func (s *KeeperTestSuite) SetupTest() { - s.keeper = s.initKeeper() -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} - -var ( - btcusdt = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdt", - }, - }, - } - - usdtusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdt-usd", - }, - }, - } - - usdcusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdc-usd", - }, - }, - } - - ethusdt = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "eth-usdt", - }, - }, - } - - markets = []types.Market{ - btcusdt, - usdcusd, - usdtusd, - ethusdt, - } - - marketsMap = map[string]types.Market{ - btcusdt.Ticker.String(): btcusdt, - usdcusd.Ticker.String(): usdcusd, - usdtusd.Ticker.String(): usdtusd, - ethusdt.Ticker.String(): ethusdt, - } -) - -func (s *KeeperTestSuite) TestGets() { - s.Run("get empty market map", func() { - got, err := s.keeper.GetAllMarkets(s.ctx) - s.Require().NoError(err) - s.Require().Equal(map[string]types.Market{}, got) - }) - - s.Run("setup initial markets", func() { - for _, market := range markets { - s.Require().NoError(s.keeper.CreateMarket(s.ctx, market)) - } - - s.Run("unable to set markets again", func() { - for _, market := range markets { - s.Require().ErrorIs(s.keeper.CreateMarket(s.ctx, market), types.NewMarketAlreadyExistsError(types.TickerString(market.Ticker.String()))) - } - }) - - s.Require().NoError(s.keeper.ValidateState(s.ctx, markets)) - }) - - s.Run("get all tickers", func() { - got, err := s.keeper.GetAllMarkets(s.ctx) - s.Require().NoError(err) - - s.Require().Equal(len(markets), len(got)) - s.Require().Equal(marketsMap, got) - }) -} - -func (s *KeeperTestSuite) TestSetParams() { - params := types.DefaultParams() - - s.Run("can set and get params", func() { - err := s.keeper.SetParams(s.ctx, params) - s.Require().NoError(err) - - params2, err := s.keeper.GetParams(s.ctx) - s.Require().NoError(err) - s.Require().Equal(params, params2) - }) -} - -func (s *KeeperTestSuite) TestInvalidCreate() { - // invalid market with a normalize pair not in state - invalidMarket := types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdt", - NormalizeByPair: &slinkytypes.CurrencyPair{Base: "invalid", Quote: "pair"}, - }, - }, - } - - s.Require().NoError(s.keeper.CreateMarket(s.ctx, invalidMarket)) - s.Require().Error(s.keeper.ValidateState(s.ctx, []types.Market{invalidMarket})) -} - -func (s *KeeperTestSuite) TestInvalidUpdate() { - // create a valid market - s.Require().NoError(s.keeper.CreateMarket(s.ctx, btcusdt)) - - // invalid market with a normalize pair not in state - invalidMarket := btcusdt - invalidMarket.ProviderConfigs = append(invalidMarket.ProviderConfigs, types.ProviderConfig{ - Name: "huobi", - OffChainTicker: "btc-usdt", - NormalizeByPair: &slinkytypes.CurrencyPair{Base: "invalid", Quote: "pair"}, - }) - - s.Require().NoError(s.keeper.UpdateMarket(s.ctx, invalidMarket)) - s.Require().Error(s.keeper.ValidateState(s.ctx, []types.Market{invalidMarket})) -} - -func (s *KeeperTestSuite) TestValidUpdate() { - // create a valid markets - s.Require().NoError(s.keeper.CreateMarket(s.ctx, btcusdt)) - s.Require().NoError(s.keeper.CreateMarket(s.ctx, ethusdt)) - - // valid market with a normalize pair that is in state - validMarket := btcusdt - validMarket.ProviderConfigs = append(validMarket.ProviderConfigs, types.ProviderConfig{ - Name: "huobi", - OffChainTicker: "btc-usdt", - NormalizeByPair: ðusdt.Ticker.CurrencyPair, - }) - - s.Require().NoError(s.keeper.UpdateMarket(s.ctx, validMarket)) - s.Require().NoError(s.keeper.ValidateState(s.ctx, []types.Market{validMarket})) -} diff --git a/x/mm2/keeper/msg_server.go b/x/mm2/keeper/msg_server.go deleted file mode 100644 index e128cf35d..000000000 --- a/x/mm2/keeper/msg_server.go +++ /dev/null @@ -1,196 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - "slices" - "strconv" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/slinky/x/mm2/types" -) - -// msgServer is the default implementation of the x/marketmap MsgService. -type msgServer struct { - k *Keeper -} - -// NewMsgServer returns the default implementation of the x/marketmap message service. -func NewMsgServer(k *Keeper) types.MsgServer { - return &msgServer{k} -} - -var _ types.MsgServer = (*msgServer)(nil) - -// CreateMarkets updates the marketmap by creating markets from the given message. All updates are made to the market -// map and then the resulting final state is checked to verify that the end state is valid. -func (ms msgServer) CreateMarkets(goCtx context.Context, msg *types.MsgCreateMarkets) (*types.MsgCreateMarketsResponse, error) { - if msg == nil { - return nil, fmt.Errorf("unable to process nil msg") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - params, err := ms.k.GetParams(ctx) - if err != nil { - return nil, fmt.Errorf("unable to get marketmap params: %w", err) - } - - found := checkMarketAuthority(msg.Authority, params) - if !found { - return nil, fmt.Errorf("request signer %s does not match module market authorities", msg.Authority) - } - - // create markets - for _, market := range msg.CreateMarkets { - err = ms.k.CreateMarket(ctx, market) - if err != nil { - return nil, err - } - - err = ms.k.hooks.AfterMarketCreated(ctx, market) - if err != nil { - return nil, fmt.Errorf("unable to run create market hook: %w", err) - } - - event := sdk.NewEvent( - types.EventTypeCreateMarket, - sdk.NewAttribute(types.AttributeKeyCurrencyPair, market.Ticker.String()), - sdk.NewAttribute(types.AttributeKeyDecimals, strconv.FormatUint(market.Ticker.Decimals, 10)), - sdk.NewAttribute(types.AttributeKeyMinProviderCount, strconv.FormatUint(market.Ticker.MinProviderCount, 10)), - sdk.NewAttribute(types.AttributeKeyMetadata, market.Ticker.Metadata_JSON), - ) - ctx.EventManager().EmitEvent(event) - } - - // validate that the new state of the marketmap is valid - err = ms.k.ValidateState(ctx, msg.CreateMarkets) - if err != nil { - return nil, fmt.Errorf("invalid state resulting from update: %w", err) - } - - return &types.MsgCreateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) -} - -// UpdateMarkets updates the marketmap by updating markets from the given message. All updates are made to the market -// map and then the resulting final state is checked to verify that the end state is valid. -func (ms msgServer) UpdateMarkets(goCtx context.Context, msg *types.MsgUpdateMarkets) (*types.MsgUpdateMarketsResponse, error) { - if msg == nil { - return nil, fmt.Errorf("unable to process nil msg") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - params, err := ms.k.GetParams(ctx) - if err != nil { - return nil, fmt.Errorf("unable to get marketmap params: %w", err) - } - - found := checkMarketAuthority(msg.Authority, params) - if !found { - return nil, fmt.Errorf("request signer %s does not match module market authorities", msg.Authority) - } - - for _, market := range msg.UpdateMarkets { - err = ms.k.UpdateMarket(ctx, market) - if err != nil { - return nil, fmt.Errorf("unable to update market: %w", err) - } - - err = ms.k.hooks.AfterMarketUpdated(ctx, market) - if err != nil { - return nil, fmt.Errorf("unable to run update market hook: %w", err) - } - - event := sdk.NewEvent( - types.EventTypeUpdateMarket, - sdk.NewAttribute(types.AttributeKeyCurrencyPair, market.Ticker.String()), - sdk.NewAttribute(types.AttributeKeyDecimals, strconv.FormatUint(market.Ticker.Decimals, 10)), - sdk.NewAttribute(types.AttributeKeyMinProviderCount, strconv.FormatUint(market.Ticker.MinProviderCount, 10)), - sdk.NewAttribute(types.AttributeKeyMetadata, market.Ticker.Metadata_JSON), - ) - ctx.EventManager().EmitEvent(event) - - } - - // validate that the new state of the marketmap is valid - err = ms.k.ValidateState(ctx, msg.UpdateMarkets) - if err != nil { - return nil, fmt.Errorf("invalid state resulting from update: %w", err) - } - - return &types.MsgUpdateMarketsResponse{}, ms.k.SetLastUpdated(ctx, uint64(ctx.BlockHeight())) -} - -// Params updates the x/marketmap module's Params. -func (ms msgServer) Params(goCtx context.Context, msg *types.MsgParams) (*types.MsgParamsResponse, error) { - if msg == nil { - return nil, fmt.Errorf("unable to process nil msg") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - if msg.Authority != ms.k.authority.String() { - return nil, fmt.Errorf("request authority %s does not match module keeper authority %s", msg.Authority, ms.k.authority.String()) - } - - if err := ms.k.SetParams(ctx, msg.Params); err != nil { - return nil, err - } - - return &types.MsgParamsResponse{}, nil -} - -func (ms msgServer) RemoveMarketAuthorities(goCtx context.Context, msg *types.MsgRemoveMarketAuthorities) (*types.MsgRemoveMarketAuthoritiesResponse, error) { - if msg == nil { - return nil, fmt.Errorf("unable to process nil msg") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - - params, err := ms.k.GetParams(ctx) - if err != nil { - return nil, err - } - - if msg.Admin != params.Admin { - return nil, fmt.Errorf("request admin %s does not match module admin %s", msg.Admin, params.Admin) - } - - if len(msg.RemoveAddresses) > len(params.MarketAuthorities) { - return nil, fmt.Errorf("remove addresses must be a subset of the current market authorities") - } - - removeAddresses := make(map[string]struct{}, len(msg.RemoveAddresses)) - for _, remove := range msg.RemoveAddresses { - removeAddresses[remove] = struct{}{} - } - - for i, address := range params.MarketAuthorities { - if _, found := removeAddresses[address]; found { - params.MarketAuthorities = slices.Delete(params.MarketAuthorities, i, i+1) - } - } - - if err := ms.k.SetParams(ctx, params); err != nil { - return nil, err - } - - return &types.MsgRemoveMarketAuthoritiesResponse{}, nil -} - -// checkMarketAuthority checks if the given authority is the x/marketmap's list of MarketAuthorities. -func checkMarketAuthority(authority string, params types.Params) bool { - if len(params.MarketAuthorities) == 0 { - return false - } - - for _, auth := range params.MarketAuthorities { - if authority == auth { - return true - } - } - - return false -} diff --git a/x/mm2/keeper/msg_server_test.go b/x/mm2/keeper/msg_server_test.go deleted file mode 100644 index 088a498c2..000000000 --- a/x/mm2/keeper/msg_server_test.go +++ /dev/null @@ -1,328 +0,0 @@ -package keeper_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/chaintestutil/sample" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/keeper" - "github.com/skip-mev/slinky/x/mm2/types" -) - -func (s *KeeperTestSuite) TestMsgServerCreateMarkets() { - msgServer := keeper.NewMsgServer(s.keeper) - - // create initial markets - msg := &types.MsgCreateMarkets{ - Authority: s.marketAuthorities[1], - CreateMarkets: []types.Market{ - btcusdt, - usdtusd, - }, - } - resp, err := msgServer.CreateMarkets(s.ctx, msg) - s.Require().NoError(err) - s.Require().NotNil(resp) - - // query the market map - mm, err := s.keeper.GetAllMarkets(s.ctx) - s.Require().NoError(err) - s.Require().Equal(types.MarketMap{Markets: mm}, types.MarketMap{ - Markets: map[string]types.Market{ - btcusdt.Ticker.String(): btcusdt, - usdtusd.Ticker.String(): usdtusd, - }, - }) - - // query the oracle module to see if they were created via hooks - cps := s.oracleKeeper.GetAllCurrencyPairs(s.ctx) - s.Require().Equal([]slinkytypes.CurrencyPair{btcusdt.Ticker.CurrencyPair, usdtusd.Ticker.CurrencyPair}, cps) - - s.Run("unable to process for invalid authority", func() { - msg = &types.MsgCreateMarkets{ - Authority: "invalid", - } - resp, err = msgServer.CreateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to process for invalid authority (valid bech32)", func() { - msg = &types.MsgCreateMarkets{ - Authority: sdk.AccAddress("invalid").String(), - } - resp, err = msgServer.CreateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - // set a market in the map - s.Run("unable to process nil request", func() { - resp, err = msgServer.CreateMarkets(s.ctx, nil) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to create market that already exists", func() { - msg = &types.MsgCreateMarkets{ - Authority: s.authority.String(), - CreateMarkets: []types.Market{ - btcusdt, - }, - } - resp, err = msgServer.CreateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to create market with normalize by that is not on chain tickers", func() { - msg = &types.MsgCreateMarkets{ - Authority: s.authority.String(), - CreateMarkets: []types.Market{ - { - Ticker: ethusdt.Ticker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "eth-usdt", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "INVALID", - Quote: "PAIR", - }, - }, - }, - }, - }, - } - resp, err = msgServer.CreateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) -} - -func (s *KeeperTestSuite) TestMsgServerUpdateMarkets() { - msgServer := keeper.NewMsgServer(s.keeper) - - // create initial markets - createMsg := &types.MsgCreateMarkets{ - Authority: s.marketAuthorities[0], - CreateMarkets: []types.Market{ - btcusdt, - usdtusd, - }, - } - createResp, err := msgServer.CreateMarkets(s.ctx, createMsg) - s.Require().NoError(err) - s.Require().NotNil(createResp) - - // query the market map - mm, err := s.keeper.GetAllMarkets(s.ctx) - s.Require().NoError(err) - s.Require().Equal(types.MarketMap{Markets: mm}, types.MarketMap{ - Markets: map[string]types.Market{ - btcusdt.Ticker.String(): btcusdt, - usdtusd.Ticker.String(): usdtusd, - }, - }) - - // TODO: test hooks - - s.Run("unable to process for invalid authority", func() { - msg := &types.MsgUpdateMarkets{ - Authority: "invalid", - } - resp, err := msgServer.UpdateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to process for invalid authority (valid bech32)", func() { - msg := &types.MsgUpdateMarkets{ - Authority: sdk.AccAddress("invalid").String(), - } - resp, err := msgServer.UpdateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - // set a market in the map - s.Run("unable to process nil request", func() { - resp, err := msgServer.UpdateMarkets(s.ctx, nil) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("able to update market that already exists", func() { - tickerUpdate := btcusdt - tickerUpdate.Ticker.Decimals = 1 - - msg := &types.MsgUpdateMarkets{ - Authority: s.marketAuthorities[2], - UpdateMarkets: []types.Market{ - tickerUpdate, - }, - } - resp, err := msgServer.UpdateMarkets(s.ctx, msg) - s.Require().NoError(err) - s.Require().NotNil(resp) - }) - - s.Run("unable to update when paths refers to non-existent ticker", func() { - tickerUpdate := btcusdt - tickerUpdate.Ticker.Decimals = 1 - tickerUpdate.ProviderConfigs = []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdc", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "INVALID", - Quote: "PAIR", - }, - }, - } - - msg := &types.MsgUpdateMarkets{ - Authority: s.authority.String(), - UpdateMarkets: []types.Market{ - tickerUpdate, - }, - } - resp, err := msgServer.UpdateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to update market if it does not already exist", func() { - msg := &types.MsgUpdateMarkets{ - Authority: s.authority.String(), - UpdateMarkets: []types.Market{ - ethusdt, - }, - } - resp, err := msgServer.UpdateMarkets(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) -} - -func (s *KeeperTestSuite) TestMsgServerParams() { - msgServer := keeper.NewMsgServer(s.keeper) - - s.Run("unable to process nil request", func() { - resp, err := msgServer.Params(s.ctx, nil) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to process for invalid authority", func() { - msg := &types.MsgParams{ - Authority: "invalid", - } - resp, err := msgServer.Params(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to process for invalid authority (valid bech32)", func() { - msg := &types.MsgParams{ - Authority: sdk.AccAddress("invalid").String(), - } - resp, err := msgServer.Params(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("accepts a req with valid params", func() { - msg := &types.MsgParams{ - Authority: s.authority.String(), - Params: types.Params{ - MarketAuthorities: []string{types.DefaultMarketAuthority, sample.Address(r)}, - Admin: sample.Address(r), - }, - } - resp, err := msgServer.Params(s.ctx, msg) - s.Require().NoError(err) - s.Require().NotNil(resp) - - params, err := s.keeper.GetParams(s.ctx) - s.Require().NoError(err) - s.Require().Equal(msg.Params, params) - }) -} - -func (s *KeeperTestSuite) TestMsgServerRemoveMarketAuthorities() { - msgServer := keeper.NewMsgServer(s.keeper) - - s.Run("unable to process nil request", func() { - resp, err := msgServer.RemoveMarketAuthorities(s.ctx, nil) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("unable to process for invalid authority", func() { - msg := &types.MsgRemoveMarketAuthorities{ - Admin: "invalid", - } - resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - }) - - s.Run("accepts a req that removes one authority", func() { - msg := &types.MsgRemoveMarketAuthorities{ - Admin: s.admin, - RemoveAddresses: []string{s.marketAuthorities[0]}, - } - resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) - s.Require().NoError(err) - s.Require().NotNil(resp) - - // check new authorities - params, err := s.keeper.GetParams(s.ctx) - s.Require().NoError(err) - s.Require().Equal(s.marketAuthorities[1:], params.MarketAuthorities) - - // reset - s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ - MarketAuthorities: s.marketAuthorities, - Admin: s.admin, - })) - }) - - s.Run("accepts a req that removes multiple authorities", func() { - msg := &types.MsgRemoveMarketAuthorities{ - Admin: s.admin, - RemoveAddresses: []string{s.marketAuthorities[0], s.marketAuthorities[2]}, - } - resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) - s.Require().NoError(err) - s.Require().NotNil(resp) - - // check new authorities - params, err := s.keeper.GetParams(s.ctx) - s.Require().NoError(err) - s.Require().Equal([]string{s.marketAuthorities[1]}, params.MarketAuthorities) - - // reset - s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ - MarketAuthorities: s.marketAuthorities, - Admin: s.admin, - })) - }) - - s.Run("unable to accept a req that removes more authorities than exist in state", func() { - msg := &types.MsgRemoveMarketAuthorities{ - Admin: s.admin, - RemoveAddresses: []string{sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r), sample.Address(r)}, - } - resp, err := msgServer.RemoveMarketAuthorities(s.ctx, msg) - s.Require().Error(err) - s.Require().Nil(resp) - - // reset - s.Require().NoError(s.keeper.SetParams(s.ctx, types.Params{ - MarketAuthorities: s.marketAuthorities, - Admin: s.admin, - })) - }) -} diff --git a/x/mm2/types/codec.go b/x/mm2/types/codec.go deleted file mode 100644 index 7e90eef60..000000000 --- a/x/mm2/types/codec.go +++ /dev/null @@ -1,30 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/legacy" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -// RegisterLegacyAminoCodec registers the necessary x/marketmap interfaces (messages) on the -// cdc. These types are used for amino serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - // register the msg-types - legacy.RegisterAminoMsg(cdc, &MsgCreateMarkets{}, "slinky/x/marketmap/MsgCreateMarkets") - legacy.RegisterAminoMsg(cdc, &MsgUpdateMarkets{}, "slinky/x/marketmap/MsgUpdateMarkets") - legacy.RegisterAminoMsg(cdc, &MsgParams{}, "slinky/x/marketmap/MsgParams") -} - -// RegisterInterfaces registers the x/marketmap messages + message service w/ the InterfaceRegistry (registry). -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - // register the implementations of Msg-type - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgCreateMarkets{}, - &MsgUpdateMarkets{}, - &MsgParams{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} diff --git a/x/mm2/types/errors.go b/x/mm2/types/errors.go deleted file mode 100644 index effcebcf3..000000000 --- a/x/mm2/types/errors.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import "fmt" - -// MarketAlreadyExistsError is an error indicating the given Market exists in state. -type MarketAlreadyExistsError struct { - ticker TickerString -} - -func NewMarketAlreadyExistsError(ticker TickerString) MarketAlreadyExistsError { - return MarketAlreadyExistsError{ticker: ticker} -} - -// Error returns the error string for MarketAlreadyExistsError. -func (e MarketAlreadyExistsError) Error() string { - return fmt.Sprintf("market already exists for ticker %s", e.ticker) -} - -// MarketDoesNotExistsError is an error indicating the given Market does not exist in state. -type MarketDoesNotExistsError struct { - ticker TickerString -} - -func NewMarketDoesNotExistsError(ticker TickerString) MarketDoesNotExistsError { - return MarketDoesNotExistsError{ticker: ticker} -} - -// Error returns the error string for MarketDoesNotExistsError. -func (e MarketDoesNotExistsError) Error() string { - return fmt.Sprintf("market does not exist for ticker %s", e.ticker) -} diff --git a/x/mm2/types/events.go b/x/mm2/types/events.go deleted file mode 100644 index 74e0ee560..000000000 --- a/x/mm2/types/events.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -// market map module event types - -const ( - EventTypeCreateMarket = "create_market" - EventTypeUpdateMarket = "update_market" - - AttributeKeyCurrencyPair = "currency_pair" - AttributeKeyDecimals = "decimals" - AttributeKeyMinProviderCount = "min_provider_count" - AttributeKeyMetadata = "metadata" -) diff --git a/x/mm2/types/genesis.go b/x/mm2/types/genesis.go deleted file mode 100644 index 2b073dd5b..000000000 --- a/x/mm2/types/genesis.go +++ /dev/null @@ -1,34 +0,0 @@ -package types - -// NewGenesisState returns an instance of GenesisState. -func NewGenesisState( - marketMap MarketMap, - lastUpdated uint64, - params Params, -) GenesisState { - return GenesisState{ - MarketMap: marketMap, - LastUpdated: lastUpdated, - Params: params, - } -} - -// ValidateBasic performs basic validation on the GenesisState. -func (gs *GenesisState) ValidateBasic() error { - if err := gs.MarketMap.ValidateBasic(); err != nil { - return err - } - - return gs.Params.ValidateBasic() -} - -// DefaultGenesisState returns the default genesis of the marketmap module. -func DefaultGenesisState() *GenesisState { - return &GenesisState{ - MarketMap: MarketMap{ - Markets: make(map[string]Market), - }, - LastUpdated: 0, - Params: DefaultParams(), - } -} diff --git a/x/mm2/types/genesis.pb.go b/x/mm2/types/genesis.pb.go deleted file mode 100644 index d9797d065..000000000 --- a/x/mm2/types/genesis.pb.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: slinky/mm2/v1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the x/marketmap module's genesis state. -type GenesisState struct { - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap MarketMap `protobuf:"bytes,1,opt,name=market_map,json=marketMap,proto3" json:"market_map"` - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // Params are the parameters for the x/marketmap module. - Params Params `protobuf:"bytes,3,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_fe64ae6b5a69dcd9, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetMarketMap() MarketMap { - if m != nil { - return m.MarketMap - } - return MarketMap{} -} - -func (m *GenesisState) GetLastUpdated() uint64 { - if m != nil { - return m.LastUpdated - } - return 0 -} - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "slinky.mm2.v1.GenesisState") -} - -func init() { proto.RegisterFile("slinky/mm2/v1/genesis.proto", fileDescriptor_fe64ae6b5a69dcd9) } - -var fileDescriptor_fe64ae6b5a69dcd9 = []byte{ - // 263 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xce, 0xc9, 0xcc, - 0xcb, 0xae, 0xd4, 0xcf, 0xcd, 0x35, 0xd2, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, - 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0x48, 0xea, 0xe5, 0xe6, 0x1a, 0xe9, - 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf4, 0x41, 0x2c, 0x88, 0x22, 0x29, - 0x29, 0x54, 0x13, 0x72, 0x13, 0x8b, 0xb2, 0x53, 0x4b, 0xb0, 0xcb, 0x15, 0x24, 0x16, 0x25, 0xe6, - 0x42, 0x0d, 0x57, 0x5a, 0xca, 0xc8, 0xc5, 0xe3, 0x0e, 0xb1, 0x2e, 0xb8, 0x24, 0xb1, 0x24, 0x55, - 0xc8, 0x96, 0x8b, 0x0b, 0xa2, 0x39, 0x3e, 0x37, 0xb1, 0x40, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, - 0x48, 0x42, 0x0f, 0xc5, 0x09, 0x7a, 0xbe, 0x60, 0x05, 0xbe, 0x89, 0x05, 0x4e, 0x2c, 0x27, 0xee, - 0xc9, 0x33, 0x04, 0x71, 0xe6, 0xc2, 0x04, 0x84, 0x14, 0xb9, 0x78, 0x72, 0x12, 0x8b, 0x4b, 0xe2, - 0x4b, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x53, 0x24, 0x98, 0x14, 0x18, 0x35, 0x58, 0x82, 0xb8, 0x41, - 0x62, 0xa1, 0x10, 0x21, 0x21, 0x63, 0x2e, 0x36, 0x88, 0x13, 0x24, 0x98, 0xc1, 0xa6, 0x8b, 0xa2, - 0x99, 0x1e, 0x00, 0x96, 0x84, 0x1a, 0x0d, 0x55, 0xea, 0xe4, 0x70, 0xe2, 0x91, 0x1c, 0xe3, 0x85, - 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, - 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x6a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, - 0xfa, 0xc5, 0xd9, 0x99, 0x05, 0xba, 0xb9, 0xa9, 0x65, 0xfa, 0x50, 0x1f, 0x57, 0x80, 0xfd, 0x5c, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xb0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x19, - 0x7a, 0x59, 0x1d, 0x6c, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.LastUpdated != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.LastUpdated)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.MarketMap.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.MarketMap.Size() - n += 1 + l + sovGenesis(uint64(l)) - if m.LastUpdated != 0 { - n += 1 + sovGenesis(uint64(m.LastUpdated)) - } - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MarketMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - m.LastUpdated = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mm2/types/genesis_test.go b/x/mm2/types/genesis_test.go deleted file mode 100644 index 7e3fb0232..000000000 --- a/x/mm2/types/genesis_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/skip-mev/slinky/x/mm2/types" -) - -func TestGenesisState(t *testing.T) { - t.Run("invalid empty genesis state - fail", func(t *testing.T) { - gs := types.GenesisState{} - require.Error(t, gs.ValidateBasic()) - }) - - t.Run("invalid params - fail", func(t *testing.T) { - gs := types.DefaultGenesisState() - - gs.Params.MarketAuthorities = []string{"invalid"} - require.Error(t, gs.ValidateBasic()) - }) - - t.Run("good populated genesis state", func(t *testing.T) { - gs := types.GenesisState{ - MarketMap: types.MarketMap{ - Markets: markets, - }, - Params: types.DefaultParams(), - } - require.NoError(t, gs.ValidateBasic()) - }) -} diff --git a/x/mm2/types/hooks.go b/x/mm2/types/hooks.go deleted file mode 100644 index 401d3b65e..000000000 --- a/x/mm2/types/hooks.go +++ /dev/null @@ -1,56 +0,0 @@ -package types - -import sdk "github.com/cosmos/cosmos-sdk/types" - -// MarketMapHooks is the interface that defines the hooks that can be integrated by other modules. -type MarketMapHooks interface { - // AfterMarketCreated is called after CreateMarket is called. - AfterMarketCreated(ctx sdk.Context, market Market) error - - // AfterMarketUpdated is called after UpdateMarket is called. - AfterMarketUpdated(ctx sdk.Context, market Market) error - - // AfterMarketGenesis is called after x/marketmap init genesis. - AfterMarketGenesis(ctx sdk.Context, tickers map[string]Market) error -} - -var _ MarketMapHooks = &MultiMarketMapHooks{} - -// MultiMarketMapHooks defines an array of MarketMapHooks which can be executed in sequence. -type MultiMarketMapHooks []MarketMapHooks - -// AfterMarketCreated calls all AfterMarketCreated hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) AfterMarketCreated(ctx sdk.Context, market Market) error { - for i := range mh { - if err := mh[i].AfterMarketCreated(ctx, market); err != nil { - return err - } - } - - return nil -} - -// AfterMarketUpdated calls all AfterMarketUpdated hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) AfterMarketUpdated(ctx sdk.Context, market Market) error { - for i := range mh { - if err := mh[i].AfterMarketUpdated(ctx, market); err != nil { - return err - } - } - - return nil -} - -// AfterMarketGenesis calls all AfterMarketGenesis hooks registered to the MultiMarketMapHooks. -func (mh MultiMarketMapHooks) AfterMarketGenesis(ctx sdk.Context, markets map[string]Market) error { - for i := range mh { - if err := mh[i].AfterMarketGenesis(ctx, markets); err != nil { - return err - } - } - - return nil -} - -// MarketMapHooksWrapper is a wrapper for modules to inject MarketMapHooks using depinject. -type MarketMapHooksWrapper struct{ MarketMapHooks } diff --git a/x/mm2/types/keys.go b/x/mm2/types/keys.go deleted file mode 100644 index 85700ed5b..000000000 --- a/x/mm2/types/keys.go +++ /dev/null @@ -1,34 +0,0 @@ -package types - -import ( - "cosmossdk.io/collections" - "cosmossdk.io/collections/codec" -) - -const ( - // ModuleName defines the canonical name identifying the module. - ModuleName = "marketmap" - // StoreKey holds the unique key used to access the module keeper's KVStore. - StoreKey = ModuleName -) - -var ( - // LastUpdatedPrefix is the key prefix for the lastUpdated height. - LastUpdatedPrefix = collections.NewPrefix(1) - - // MarketsPrefix is the key prefix for Markets. - MarketsPrefix = collections.NewPrefix(2) - - // ParamsPrefix is the key prefix of the module Params. - ParamsPrefix = collections.NewPrefix(3) - - // TickersCodec is the collections.KeyCodec value used for the markets map. - TickersCodec = codec.NewStringKeyCodec[TickerString]() - - // LastUpdatedCodec is the collections.KeyCodec value used for the lastUpdated value. - LastUpdatedCodec = codec.KeyToValueCodec[uint64](codec.NewUint64Key[uint64]()) -) - -// TickerString is the key used to identify unique pairs of Base/Quote with corresponding PathsConfig objects--or in other words AggregationConfigs. -// The TickerString is identical to Slinky's CurrencyPair.String() output in that it is `Base` and `Quote` joined by `/` i.e. `$BASE/$QUOTE`. -type TickerString string diff --git a/x/mm2/types/market.go b/x/mm2/types/market.go deleted file mode 100644 index 6937e9548..000000000 --- a/x/mm2/types/market.go +++ /dev/null @@ -1,126 +0,0 @@ -package types - -import ( - "fmt" -) - -// ValidateBasic validates the market map configuration and its expected configuration. -// -// In particular, this will -// -// 1. Ensure that the market map is valid (ValidateBasic). This ensures that each of the provider's -// markets are supported by the market map. -// 2. Ensure that each provider config has a valid corresponding ticker. -func (mm *MarketMap) ValidateBasic() error { - uniqueOffChainTickers := make(map[string]string) - for _, market := range mm.Markets { - if err := market.ValidateBasic(); err != nil { - return err - } - - for _, providerConfig := range market.ProviderConfigs { - if providerConfig.NormalizeByPair != nil { - if _, found := mm.Markets[providerConfig.NormalizeByPair.String()]; !found { - return fmt.Errorf("provider's (%s) pair for normalization (%s) was not found in the marketmap", providerConfig.Name, providerConfig.NormalizeByPair.String()) - } - } - - // Each off-chain ticker should have a unique json representation if it is not empty. - key := providerConfig.Name + providerConfig.OffChainTicker - if metadata, found := uniqueOffChainTickers[key]; found { - if metadata != providerConfig.Metadata_JSON { - return fmt.Errorf("duplicate off-chain ticker for a provider was found with different metadata: %s", key) - } - } else { - uniqueOffChainTickers[key] = providerConfig.Metadata_JSON - } - } - } - - return nil -} - -// String returns the string representation of the market map. -func (mm *MarketMap) String() string { - return fmt.Sprintf( - "MarketMap: {Markets %v}", - mm.Markets, - ) -} - -// ValidateBasic performs stateless validation of a Market. -func (m *Market) ValidateBasic() error { - if err := m.Ticker.ValidateBasic(); err != nil { - return err - } - - if uint64(len(m.ProviderConfigs)) < m.Ticker.MinProviderCount { - return fmt.Errorf("this ticker must have at least %d providers; got %d", - m.Ticker.MinProviderCount, - len(m.ProviderConfigs), - ) - } - - seenProviders := make(map[string]struct{}) - for _, providerConfig := range m.ProviderConfigs { - if err := providerConfig.ValidateBasic(); err != nil { - return err - } - - // check for duplicate providers - key := providerConfig.Name + providerConfig.OffChainTicker - if _, seen := seenProviders[key]; seen { - return fmt.Errorf("duplicate (provider, off-chain-ticker) found: %s", key) - } - seenProviders[key] = struct{}{} - - } - - return nil -} - -// String returns the string representation of the market. -func (m *Market) String() string { - return fmt.Sprintf( - "Market: {Ticker %v Providers: %v}", m.Ticker, m.ProviderConfigs, - ) -} - -// Equal returns true if the MarketMap is equal to the given MarketMap. -func (mm *MarketMap) Equal(other MarketMap) bool { - if len(mm.Markets) != len(other.Markets) { - return false - } - - for tickerStr, market := range mm.Markets { - otherMarket, found := other.Markets[tickerStr] - if !found { - return false - } - - if !market.Equal(otherMarket) { - return false - } - } - - return true -} - -// Equal returns true if the Market is equal to the given Market. -func (m *Market) Equal(other Market) bool { - if !m.Ticker.Equal(other.Ticker) { - return false - } - - if len(m.ProviderConfigs) != len(other.ProviderConfigs) { - return false - } - - for i, providerConfig := range m.ProviderConfigs { - if !providerConfig.Equal(other.ProviderConfigs[i]) { - return false - } - } - - return true -} diff --git a/x/mm2/types/market.pb.go b/x/mm2/types/market.pb.go deleted file mode 100644 index b1968ad04..000000000 --- a/x/mm2/types/market.pb.go +++ /dev/null @@ -1,1431 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: slinky/mm2/v1/market.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/skip-mev/slinky/pkg/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Market encapsulates a Ticker and its provider-specific configuration. -type Market struct { - // Ticker represents a price feed for a given asset pair i.e. BTC/USD. The - // price feed is scaled to a number of decimal places and has a minimum number - // of providers required to consider the ticker valid. - Ticker Ticker `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker"` - // ProviderConfigs is the list of provider-specific configs for this Market. - ProviderConfigs []ProviderConfig `protobuf:"bytes,2,rep,name=provider_configs,json=providerConfigs,proto3" json:"provider_configs"` -} - -func (m *Market) Reset() { *m = Market{} } -func (*Market) ProtoMessage() {} -func (*Market) Descriptor() ([]byte, []int) { - return fileDescriptor_446157c095b24f63, []int{0} -} -func (m *Market) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Market) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Market.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Market) XXX_Merge(src proto.Message) { - xxx_messageInfo_Market.Merge(m, src) -} -func (m *Market) XXX_Size() int { - return m.Size() -} -func (m *Market) XXX_DiscardUnknown() { - xxx_messageInfo_Market.DiscardUnknown(m) -} - -var xxx_messageInfo_Market proto.InternalMessageInfo - -func (m *Market) GetTicker() Ticker { - if m != nil { - return m.Ticker - } - return Ticker{} -} - -func (m *Market) GetProviderConfigs() []ProviderConfig { - if m != nil { - return m.ProviderConfigs - } - return nil -} - -// Ticker represents a price feed for a given asset pair i.e. BTC/USD. The price -// feed is scaled to a number of decimal places and has a minimum number of -// providers required to consider the ticker valid. -type Ticker struct { - // CurrencyPair is the currency pair for this ticker. - CurrencyPair types.CurrencyPair `protobuf:"bytes,1,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` - // Decimals is the number of decimal places for the ticker. The number of - // decimal places is used to convert the price to a human-readable format. - Decimals uint64 `protobuf:"varint,2,opt,name=decimals,proto3" json:"decimals,omitempty"` - // MinProviderCount is the minimum number of providers required to consider - // the ticker valid. - MinProviderCount uint64 `protobuf:"varint,3,opt,name=min_provider_count,json=minProviderCount,proto3" json:"min_provider_count,omitempty"` - // Enabled is the flag that denotes if the Ticker is enabled for price - // fetching by an oracle. - Enabled bool `protobuf:"varint,14,opt,name=enabled,proto3" json:"enabled,omitempty"` - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given ticker. - Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` -} - -func (m *Ticker) Reset() { *m = Ticker{} } -func (*Ticker) ProtoMessage() {} -func (*Ticker) Descriptor() ([]byte, []int) { - return fileDescriptor_446157c095b24f63, []int{1} -} -func (m *Ticker) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Ticker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Ticker.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 *Ticker) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ticker.Merge(m, src) -} -func (m *Ticker) XXX_Size() int { - return m.Size() -} -func (m *Ticker) XXX_DiscardUnknown() { - xxx_messageInfo_Ticker.DiscardUnknown(m) -} - -var xxx_messageInfo_Ticker proto.InternalMessageInfo - -func (m *Ticker) GetCurrencyPair() types.CurrencyPair { - if m != nil { - return m.CurrencyPair - } - return types.CurrencyPair{} -} - -func (m *Ticker) GetDecimals() uint64 { - if m != nil { - return m.Decimals - } - return 0 -} - -func (m *Ticker) GetMinProviderCount() uint64 { - if m != nil { - return m.MinProviderCount - } - return 0 -} - -func (m *Ticker) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Ticker) GetMetadata_JSON() string { - if m != nil { - return m.Metadata_JSON - } - return "" -} - -type ProviderConfig struct { - // Name corresponds to the name of the provider for which the configuration is - // being set. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // OffChainTicker is the off-chain representation of the ticker i.e. BTC/USD. - // The off-chain ticker is unique to a given provider and is used to fetch the - // price of the ticker from the provider. - OffChainTicker string `protobuf:"bytes,2,opt,name=off_chain_ticker,json=offChainTicker,proto3" json:"off_chain_ticker,omitempty"` - // NormalizeByPair is the currency pair for this ticker to be normalized by. - // For example, if the desired Ticker is BTD/USD, this market could be reached - // using: OffChainTicker = BTC/USDT NormalizeByPair = USDT/USD This field is - // optional and nullable. - NormalizeByPair *types.CurrencyPair `protobuf:"bytes,3,opt,name=normalize_by_pair,json=normalizeByPair,proto3" json:"normalize_by_pair,omitempty"` - // Invert is a boolean indicating if the BASE and QUOTE of the market should - // be inverted. i.e. BASE -> QUOTE, QUOTE -> BASE - Invert bool `protobuf:"varint,4,opt,name=invert,proto3" json:"invert,omitempty"` - // MetadataJSON is a string of JSON that encodes any extra configuration - // for the given provider config. - Metadata_JSON string `protobuf:"bytes,15,opt,name=metadata_JSON,json=metadataJSON,proto3" json:"metadata_JSON,omitempty"` -} - -func (m *ProviderConfig) Reset() { *m = ProviderConfig{} } -func (m *ProviderConfig) String() string { return proto.CompactTextString(m) } -func (*ProviderConfig) ProtoMessage() {} -func (*ProviderConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_446157c095b24f63, []int{2} -} -func (m *ProviderConfig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProviderConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProviderConfig.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 *ProviderConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProviderConfig.Merge(m, src) -} -func (m *ProviderConfig) XXX_Size() int { - return m.Size() -} -func (m *ProviderConfig) XXX_DiscardUnknown() { - xxx_messageInfo_ProviderConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_ProviderConfig proto.InternalMessageInfo - -func (m *ProviderConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProviderConfig) GetOffChainTicker() string { - if m != nil { - return m.OffChainTicker - } - return "" -} - -func (m *ProviderConfig) GetNormalizeByPair() *types.CurrencyPair { - if m != nil { - return m.NormalizeByPair - } - return nil -} - -func (m *ProviderConfig) GetInvert() bool { - if m != nil { - return m.Invert - } - return false -} - -func (m *ProviderConfig) GetMetadata_JSON() string { - if m != nil { - return m.Metadata_JSON - } - return "" -} - -// MarketMap maps ticker strings to their Markets. -type MarketMap struct { - // Markets is the full list of tickers and their associated configurations - // to be stored on-chain. - Markets map[string]Market `protobuf:"bytes,1,rep,name=markets,proto3" json:"markets" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *MarketMap) Reset() { *m = MarketMap{} } -func (*MarketMap) ProtoMessage() {} -func (*MarketMap) Descriptor() ([]byte, []int) { - return fileDescriptor_446157c095b24f63, []int{3} -} -func (m *MarketMap) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MarketMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MarketMap.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 *MarketMap) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketMap.Merge(m, src) -} -func (m *MarketMap) XXX_Size() int { - return m.Size() -} -func (m *MarketMap) XXX_DiscardUnknown() { - xxx_messageInfo_MarketMap.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketMap proto.InternalMessageInfo - -func (m *MarketMap) GetMarkets() map[string]Market { - if m != nil { - return m.Markets - } - return nil -} - -func init() { - proto.RegisterType((*Market)(nil), "slinky.mm2.v1.Market") - proto.RegisterType((*Ticker)(nil), "slinky.mm2.v1.Ticker") - proto.RegisterType((*ProviderConfig)(nil), "slinky.mm2.v1.ProviderConfig") - proto.RegisterType((*MarketMap)(nil), "slinky.mm2.v1.MarketMap") - proto.RegisterMapType((map[string]Market)(nil), "slinky.mm2.v1.MarketMap.MarketsEntry") -} - -func init() { proto.RegisterFile("slinky/mm2/v1/market.proto", fileDescriptor_446157c095b24f63) } - -var fileDescriptor_446157c095b24f63 = []byte{ - // 544 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xf6, 0x26, 0x21, 0x4d, 0xb6, 0xf9, 0x63, 0x05, 0xc8, 0x8a, 0x84, 0x1b, 0xa5, 0x02, 0x59, - 0x02, 0x6c, 0x35, 0xbd, 0xa0, 0x9e, 0x50, 0xa2, 0x4a, 0x80, 0xd4, 0x52, 0x0c, 0x27, 0x2e, 0xd6, - 0xc6, 0xd9, 0xa4, 0xab, 0x64, 0xd7, 0xd6, 0x7a, 0x63, 0x61, 0x4e, 0x3c, 0x02, 0x37, 0x38, 0xf2, - 0x06, 0xbc, 0x46, 0x8f, 0x3d, 0x21, 0x0e, 0x08, 0xa1, 0x44, 0xbc, 0x07, 0xf2, 0x7a, 0x93, 0x26, - 0xed, 0xa5, 0xb7, 0xd9, 0x99, 0x6f, 0x7e, 0xbe, 0x6f, 0x67, 0x60, 0x3b, 0x9e, 0x51, 0x3e, 0x4d, - 0x5d, 0xc6, 0x7a, 0x6e, 0x72, 0xe0, 0x32, 0x2c, 0xa6, 0x44, 0x3a, 0x91, 0x08, 0x65, 0x88, 0xea, - 0x79, 0xcc, 0x61, 0xac, 0xe7, 0x24, 0x07, 0xed, 0x7b, 0x93, 0x70, 0x12, 0xaa, 0x88, 0x9b, 0x59, - 0x39, 0xa8, 0xbd, 0xaf, 0x0b, 0xc8, 0x34, 0x22, 0x71, 0x56, 0x22, 0x98, 0x0b, 0x41, 0x78, 0x90, - 0xfa, 0x11, 0xa6, 0x22, 0x07, 0x75, 0xbf, 0x02, 0x58, 0x3e, 0x51, 0xa5, 0xd1, 0x21, 0x2c, 0x4b, - 0x1a, 0x4c, 0x89, 0x30, 0x41, 0x07, 0xd8, 0xbb, 0xbd, 0xfb, 0xce, 0x56, 0x17, 0xe7, 0xbd, 0x0a, - 0xf6, 0x4b, 0x17, 0x7f, 0xf6, 0x0c, 0x4f, 0x43, 0xd1, 0x29, 0x6c, 0x45, 0x22, 0x4c, 0xe8, 0x88, - 0x08, 0x3f, 0x08, 0xf9, 0x98, 0x4e, 0x62, 0xb3, 0xd0, 0x29, 0xda, 0xbb, 0xbd, 0x87, 0xd7, 0xd2, - 0xcf, 0x34, 0x6c, 0xa0, 0x50, 0xba, 0x4c, 0x33, 0xda, 0xf2, 0xc6, 0x47, 0x95, 0x6f, 0xdf, 0xf7, - 0x8c, 0xcf, 0xbf, 0x3b, 0x46, 0xf7, 0x1f, 0x80, 0xe5, 0xbc, 0x25, 0x7a, 0x09, 0xeb, 0x5b, 0xb3, - 0xeb, 0x01, 0xd7, 0x1d, 0x14, 0xc3, 0xac, 0xc7, 0x40, 0xa3, 0xce, 0x30, 0x5d, 0x0d, 0x5a, 0x0b, - 0x36, 0x7c, 0xa8, 0x0d, 0x2b, 0x23, 0x12, 0x50, 0x86, 0x67, 0xd9, 0x98, 0xc0, 0x2e, 0x79, 0xeb, - 0x37, 0x7a, 0x0a, 0x11, 0xa3, 0xdc, 0xdf, 0xa0, 0x33, 0xe7, 0xd2, 0x2c, 0x2a, 0x54, 0x8b, 0x51, - 0x7e, 0x45, 0x60, 0xce, 0x25, 0x32, 0xe1, 0x0e, 0xe1, 0x78, 0x38, 0x23, 0x23, 0xb3, 0xd1, 0x01, - 0x76, 0xc5, 0x5b, 0x3d, 0xd1, 0x3e, 0xac, 0x33, 0x22, 0xf1, 0x08, 0x4b, 0xec, 0xbf, 0x7e, 0xf7, - 0xe6, 0xd4, 0x6c, 0x76, 0x80, 0x5d, 0xf5, 0x6a, 0x2b, 0x67, 0xe6, 0xdb, 0xe0, 0xf9, 0x13, 0xc0, - 0xc6, 0xb6, 0x36, 0x08, 0xc1, 0x12, 0xc7, 0x8c, 0x28, 0x9a, 0x55, 0x4f, 0xd9, 0xc8, 0x86, 0xad, - 0x70, 0x3c, 0xf6, 0x83, 0x73, 0x4c, 0xb9, 0xaf, 0xff, 0xa9, 0xa0, 0xe2, 0x8d, 0x70, 0x3c, 0x1e, - 0x64, 0x6e, 0xad, 0xd6, 0x2b, 0x78, 0x97, 0x87, 0x82, 0xe1, 0x19, 0xfd, 0x44, 0xfc, 0xa1, 0x56, - 0xac, 0x78, 0x0b, 0xc5, 0xbc, 0xe6, 0x3a, 0xaf, 0x9f, 0xcb, 0xf5, 0x00, 0x96, 0x29, 0x4f, 0x88, - 0x90, 0x66, 0x49, 0x71, 0xd4, 0xaf, 0x5b, 0x51, 0xec, 0xfe, 0x00, 0xb0, 0x9a, 0xaf, 0xd6, 0x09, - 0x8e, 0xd0, 0x31, 0xdc, 0xc9, 0x57, 0x38, 0x36, 0x81, 0xda, 0x8f, 0x47, 0xd7, 0xf6, 0x63, 0x0d, - 0xd5, 0x56, 0x7c, 0xcc, 0xa5, 0x48, 0xf5, 0x2f, 0xae, 0x72, 0xdb, 0x6f, 0x61, 0x6d, 0x33, 0x8c, - 0x5a, 0xb0, 0x38, 0x25, 0xa9, 0x56, 0x2a, 0x33, 0xd1, 0x13, 0x78, 0x27, 0xc1, 0xb3, 0x39, 0x51, - 0xea, 0xdc, 0xdc, 0xe2, 0x3c, 0xdb, 0xcb, 0x31, 0x47, 0x85, 0xe7, 0xe0, 0xea, 0x2b, 0xfa, 0x2f, - 0x2e, 0x16, 0x16, 0xb8, 0x5c, 0x58, 0xe0, 0xef, 0xc2, 0x02, 0x5f, 0x96, 0x96, 0x71, 0xb9, 0xb4, - 0x8c, 0x5f, 0x4b, 0xcb, 0xf8, 0xf0, 0x78, 0x42, 0xe5, 0xf9, 0x7c, 0xe8, 0x04, 0x21, 0x73, 0xe3, - 0x29, 0x8d, 0x9e, 0x31, 0x92, 0xb8, 0xfa, 0xbe, 0x3e, 0xaa, 0x13, 0x55, 0x8a, 0x0e, 0xcb, 0xea, - 0xaa, 0x0e, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x2d, 0xdf, 0x25, 0xbd, 0x03, 0x00, 0x00, -} - -func (m *Market) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Market) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Market) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProviderConfigs) > 0 { - for iNdEx := len(m.ProviderConfigs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProviderConfigs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Ticker.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Ticker) 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 *Ticker) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Ticker) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata_JSON) > 0 { - i -= len(m.Metadata_JSON) - copy(dAtA[i:], m.Metadata_JSON) - i = encodeVarintMarket(dAtA, i, uint64(len(m.Metadata_JSON))) - i-- - dAtA[i] = 0x7a - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if m.MinProviderCount != 0 { - i = encodeVarintMarket(dAtA, i, uint64(m.MinProviderCount)) - i-- - dAtA[i] = 0x18 - } - if m.Decimals != 0 { - i = encodeVarintMarket(dAtA, i, uint64(m.Decimals)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.CurrencyPair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ProviderConfig) 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 *ProviderConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProviderConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata_JSON) > 0 { - i -= len(m.Metadata_JSON) - copy(dAtA[i:], m.Metadata_JSON) - i = encodeVarintMarket(dAtA, i, uint64(len(m.Metadata_JSON))) - i-- - dAtA[i] = 0x7a - } - if m.Invert { - i-- - if m.Invert { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.NormalizeByPair != nil { - { - size, err := m.NormalizeByPair.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.OffChainTicker) > 0 { - i -= len(m.OffChainTicker) - copy(dAtA[i:], m.OffChainTicker) - i = encodeVarintMarket(dAtA, i, uint64(len(m.OffChainTicker))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMarket(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MarketMap) 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 *MarketMap) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Markets) > 0 { - for k := range m.Markets { - v := m.Markets[k] - baseI := i - { - size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMarket(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintMarket(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintMarket(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintMarket(dAtA []byte, offset int, v uint64) int { - offset -= sovMarket(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Market) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Ticker.Size() - n += 1 + l + sovMarket(uint64(l)) - if len(m.ProviderConfigs) > 0 { - for _, e := range m.ProviderConfigs { - l = e.Size() - n += 1 + l + sovMarket(uint64(l)) - } - } - return n -} - -func (m *Ticker) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.CurrencyPair.Size() - n += 1 + l + sovMarket(uint64(l)) - if m.Decimals != 0 { - n += 1 + sovMarket(uint64(m.Decimals)) - } - if m.MinProviderCount != 0 { - n += 1 + sovMarket(uint64(m.MinProviderCount)) - } - if m.Enabled { - n += 2 - } - l = len(m.Metadata_JSON) - if l > 0 { - n += 1 + l + sovMarket(uint64(l)) - } - return n -} - -func (m *ProviderConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMarket(uint64(l)) - } - l = len(m.OffChainTicker) - if l > 0 { - n += 1 + l + sovMarket(uint64(l)) - } - if m.NormalizeByPair != nil { - l = m.NormalizeByPair.Size() - n += 1 + l + sovMarket(uint64(l)) - } - if m.Invert { - n += 2 - } - l = len(m.Metadata_JSON) - if l > 0 { - n += 1 + l + sovMarket(uint64(l)) - } - return n -} - -func (m *MarketMap) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Markets) > 0 { - for k, v := range m.Markets { - _ = k - _ = v - l = v.Size() - mapEntrySize := 1 + len(k) + sovMarket(uint64(len(k))) + 1 + l + sovMarket(uint64(l)) - n += mapEntrySize + 1 + sovMarket(uint64(mapEntrySize)) - } - } - return n -} - -func sovMarket(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMarket(x uint64) (n int) { - return sovMarket(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Market) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Market: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Market: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ticker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Ticker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProviderConfigs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProviderConfigs = append(m.ProviderConfigs, ProviderConfig{}) - if err := m.ProviderConfigs[len(m.ProviderConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Ticker) 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 ErrIntOverflowMarket - } - 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: Ticker: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ticker: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CurrencyPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) - } - m.Decimals = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Decimals |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinProviderCount", wireType) - } - m.MinProviderCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinProviderCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata_JSON = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProviderConfig) 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 ErrIntOverflowMarket - } - 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: ProviderConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProviderConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OffChainTicker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OffChainTicker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NormalizeByPair", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NormalizeByPair == nil { - m.NormalizeByPair = &types.CurrencyPair{} - } - if err := m.NormalizeByPair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Invert", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Invert = bool(v != 0) - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata_JSON", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata_JSON = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MarketMap) 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 ErrIntOverflowMarket - } - 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: MarketMap: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarketMap: 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 ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMarket - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMarket - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Markets == nil { - m.Markets = make(map[string]Market) - } - var mapkey string - mapvalue := &Market{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthMarket - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthMarket - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMarket - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthMarket - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthMarket - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &Market{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Markets[mapkey] = *mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMarket(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMarket - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMarket(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMarket - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMarket - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMarket - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMarket - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMarket - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMarket - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMarket = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMarket = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMarket = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mm2/types/market_test.go b/x/mm2/types/market_test.go deleted file mode 100644 index 767bcf904..000000000 --- a/x/mm2/types/market_test.go +++ /dev/null @@ -1,419 +0,0 @@ -package types_test - -import ( - "testing" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - - "github.com/stretchr/testify/require" - - "github.com/skip-mev/slinky/oracle/constants" - "github.com/skip-mev/slinky/providers/apis/coinbase" - "github.com/skip-mev/slinky/x/mm2/types" -) - -var ( - btcusdt = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdt", - }, - }, - } - - btcusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-usdt", - NormalizeByPair: &usdtusd.Ticker.CurrencyPair, - }, - }, - } - - usdtusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDT", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdt-usd", - }, - }, - } - - usdcusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "USDC", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "usdc-usd", - }, - }, - } - - ethusdt = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "eth-usdt", - }, - }, - } - - ethusd = types.Market{ - Ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USD", - }, - Decimals: 8, - MinProviderCount: 3, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "eth-usdt", - NormalizeByPair: &usdtusd.Ticker.CurrencyPair, - }, - { - Name: "binance", - OffChainTicker: "eth-usdt", - NormalizeByPair: &usdtusd.Ticker.CurrencyPair, - }, - { - Name: "mexc", - OffChainTicker: "eth-usdt", - NormalizeByPair: &usdtusd.Ticker.CurrencyPair, - }, - }, - } - - markets = map[string]types.Market{ - btcusdt.Ticker.String(): btcusdt, - btcusd.Ticker.String(): btcusd, - usdtusd.Ticker.String(): usdtusd, - usdcusd.Ticker.String(): usdcusd, - ethusdt.Ticker.String(): ethusdt, - ethusd.Ticker.String(): ethusd, - } -) - -func TestMarketMapValidateBasic(t *testing.T) { - testCases := []struct { - name string - marketMap types.MarketMap - expectErr bool - }{ - { - name: "valid empty", - marketMap: types.MarketMap{}, - expectErr: false, - }, - { - name: "valid map", - marketMap: types.MarketMap{ - Markets: markets, - }, - expectErr: false, - }, - { - name: "market with no ticker", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - }, - }, - }, - }, - }, - expectErr: true, - }, - { - name: "empty market", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): {}, - }, - }, - expectErr: true, - }, - { - name: "provider config includes a ticker that is not supported", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "btc-usd", - NormalizeByPair: &slinkytypes.CurrencyPair{Base: "not", Quote: "real"}, - Invert: false, - Metadata_JSON: "", - }, - }, - }, - }, - }, - expectErr: true, - }, - { - name: "empty provider name", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "", - OffChainTicker: "btc-usd", - Invert: false, - Metadata_JSON: "", - }, - }, - }, - }, - }, - expectErr: true, - }, - { - name: "no provider configs", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{}, - }, - }, - }, - expectErr: true, - }, - { - name: "valid single provider", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - }, - }, - }, - }, - }, - expectErr: false, - }, - { - name: "duplicate tickers seen across markets, same provider is valid", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - }, - }, - }, - constants.USDT_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.USDT_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - Invert: true, - NormalizeByPair: &constants.BITCOIN_USD, - }, - }, - }, - }, - }, - expectErr: false, - }, - { - name: "duplicate tickers seen across markets with different metadata, same provider is not valid", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - constants.BITCOIN_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.BITCOIN_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - }, - }, - }, - constants.USDT_USD.String(): { - Ticker: types.Ticker{ - CurrencyPair: constants.USDT_USD, - Decimals: 8, - MinProviderCount: 1, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: coinbase.Name, - OffChainTicker: "BTC-USD", - Invert: true, - NormalizeByPair: &constants.BITCOIN_USD, - Metadata_JSON: `{"key": "value"}`, - }, - }, - }, - }, - }, - expectErr: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.marketMap.ValidateBasic() - if tc.expectErr { - require.Error(t, err) - } else { - require.NoError(t, err) - } - }) - } -} - -func TestMarketMapEqual(t *testing.T) { - cases := []struct { - name string - marketMap types.MarketMap - other types.MarketMap - expect bool - }{ - { - name: "empty market map", - marketMap: types.MarketMap{}, - other: types.MarketMap{}, - expect: true, - }, - { - name: "same market map", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): ethusdt, - }, - }, - other: types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): ethusdt, - }, - }, - expect: true, - }, - { - name: "different tickers", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): ethusdt, - }, - }, - other: types.MarketMap{ - Markets: map[string]types.Market{ - btcusdt.Ticker.String(): btcusdt, - }, - }, - expect: false, - }, - { - name: "different providers", - marketMap: types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): ethusdt, - }, - }, - other: types.MarketMap{ - Markets: map[string]types.Market{ - ethusdt.Ticker.String(): { - Ticker: ethusdt.Ticker, - ProviderConfigs: btcusdt.ProviderConfigs, - }, - }, - }, - expect: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.expect, tc.marketMap.Equal(tc.other)) - }) - } -} diff --git a/x/mm2/types/msg.go b/x/mm2/types/msg.go deleted file mode 100644 index b68120334..000000000 --- a/x/mm2/types/msg.go +++ /dev/null @@ -1,95 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ sdk.Msg = &MsgCreateMarkets{} - _ sdk.Msg = &MsgUpdateMarkets{} - _ sdk.Msg = &MsgParams{} - _ sdk.Msg = &MsgRemoveMarketAuthorities{} -) - -// ValidateBasic determines whether the information in the message is formatted correctly, specifically -// whether the signer is a valid acc-address. -func (m *MsgCreateMarkets) ValidateBasic() error { - // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return err - } - - if len(m.CreateMarkets) == 0 { - return fmt.Errorf("no markets to create") - } - - for _, market := range m.CreateMarkets { - if err := market.ValidateBasic(); err != nil { - return err - } - } - - return nil -} - -// ValidateBasic determines whether the information in the message is formatted correctly, specifically -// whether the signer is a valid acc-address. -func (m *MsgUpdateMarkets) ValidateBasic() error { - // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return err - } - - if len(m.UpdateMarkets) == 0 { - return fmt.Errorf("no markets to update") - } - - for _, market := range m.UpdateMarkets { - if err := market.ValidateBasic(); err != nil { - return err - } - } - - return nil -} - -// ValidateBasic determines whether the information in the message is formatted correctly, specifically -// whether the signer is a valid acc-address. -func (m *MsgParams) ValidateBasic() error { - // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return err - } - - return m.Params.ValidateBasic() -} - -// ValidateBasic determines whether the information in the message is formatted correctly, specifically -// whether the signer is a valid acc-address. -func (m *MsgRemoveMarketAuthorities) ValidateBasic() error { - // validate signer address - if _, err := sdk.AccAddressFromBech32(m.Admin); err != nil { - return err - } - - if len(m.RemoveAddresses) == 0 { - return fmt.Errorf("addresses to remove cannot be nil") - } - - seenAuthorities := make(map[string]struct{}, len(m.RemoveAddresses)) - for _, authority := range m.RemoveAddresses { - if _, seen := seenAuthorities[authority]; seen { - return fmt.Errorf("duplicate address %s found", authority) - } - - if _, err := sdk.AccAddressFromBech32(authority); err != nil { - return fmt.Errorf("invalid market authority string: %w", err) - } - - seenAuthorities[authority] = struct{}{} - } - - return nil -} diff --git a/x/mm2/types/msg_test.go b/x/mm2/types/msg_test.go deleted file mode 100644 index d4b368e9a..000000000 --- a/x/mm2/types/msg_test.go +++ /dev/null @@ -1,382 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/skip-mev/chaintestutil/sample" - "github.com/stretchr/testify/require" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/types" -) - -func TestValidateBasicMsgCreateMarket(t *testing.T) { - validCurrencyPair := slinkytypes.CurrencyPair{ - Base: "BTC", - Quote: "ETH", - } - - validTicker := types.Ticker{ - CurrencyPair: validCurrencyPair, - Decimals: 8, - MinProviderCount: 2, - } - - tcs := []struct { - name string - msg types.MsgCreateMarkets - expectPass bool - }{ - { - "if the authority is not an acc-address - fail", - types.MsgCreateMarkets{ - Authority: "invalid", - }, - false, - }, - { - "if there are no creates - fail", - types.MsgCreateMarkets{ - Authority: sample.Address(sample.Rand()), - }, - false, - }, - { - "invalid ticker (0 decimals) - fail", - types.MsgCreateMarkets{ - Authority: sample.Address(sample.Rand()), - CreateMarkets: []types.Market{ - { - Ticker: types.Ticker{ - CurrencyPair: validCurrencyPair, - Decimals: 0, - MinProviderCount: 0, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, - }, - }, - }, - }, - false, - }, - { - "invalid num providers (need more than 1) - fail", - types.MsgCreateMarkets{ - Authority: sample.Address(sample.Rand()), - CreateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - }, - }, - }, - }, - false, - }, - { - "invalid empty off-chain ticker - fail", - types.MsgCreateMarkets{ - Authority: sample.Address(sample.Rand()), - CreateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "", - }, - }, - }, - }, - }, - false, - }, - { - "valid message", - types.MsgCreateMarkets{ - Authority: sample.Address(sample.Rand()), - CreateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, - }, - }, - }, - }, - true, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if !tc.expectPass { - require.NotNil(t, err) - } else { - require.Nil(t, err) - } - }) - } -} - -func TestValidateBasicMsgUpdateMarket(t *testing.T) { - validCurrencyPair := slinkytypes.CurrencyPair{ - Base: "BTC", - Quote: "ETH", - } - - validTicker := types.Ticker{ - CurrencyPair: validCurrencyPair, - Decimals: 8, - MinProviderCount: 2, - } - - tcs := []struct { - name string - msg types.MsgUpdateMarkets - expectPass bool - }{ - { - "if the Authority is not an acc-address - fail", - types.MsgUpdateMarkets{ - Authority: "invalid", - }, - false, - }, - { - "if there are no creates - fail", - types.MsgUpdateMarkets{ - Authority: sample.Address(sample.Rand()), - }, - false, - }, - { - "invalid ticker (decimals) - fail", - types.MsgUpdateMarkets{ - Authority: sample.Address(sample.Rand()), - UpdateMarkets: []types.Market{ - { - Ticker: types.Ticker{ - CurrencyPair: validCurrencyPair, - Decimals: 0, - MinProviderCount: 0, - }, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, - }, - }, - }, - }, - false, - }, - { - "invalid num providers (need more than 1) - fail", - types.MsgUpdateMarkets{ - Authority: sample.Address(sample.Rand()), - UpdateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - }, - }, - }, - }, - false, - }, - { - "invalid empty offchain ticker - fail", - types.MsgUpdateMarkets{ - Authority: sample.Address(sample.Rand()), - UpdateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "", - }, - }, - }, - }, - }, - false, - }, - { - "valid message", - types.MsgUpdateMarkets{ - Authority: sample.Address(sample.Rand()), - UpdateMarkets: []types.Market{ - { - Ticker: validTicker, - ProviderConfigs: []types.ProviderConfig{ - { - Name: "kucoin", - OffChainTicker: "btc-eth", - }, - { - Name: "mexc", - OffChainTicker: "btceth", - }, - }, - }, - }, - }, - true, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if !tc.expectPass { - require.NotNil(t, err) - } else { - require.Nil(t, err) - } - }) - } -} - -func TestValidateBasicMsgParams(t *testing.T) { - rng := sample.Rand() - - tcs := []struct { - name string - msg types.MsgParams - expectPass bool - }{ - { - "if the Authority is not an acc-address - fail", - types.MsgParams{ - Authority: "invalid", - }, - false, - }, - { - name: "invalid params (no authorities) - fail", - msg: types.MsgParams{ - Params: types.Params{ - MarketAuthorities: nil, - }, - Authority: sample.Address(rng), - }, - expectPass: false, - }, - { - name: "valid params", - msg: types.MsgParams{ - Params: types.Params{ - MarketAuthorities: []string{sample.Address(rng)}, - Admin: sample.Address(rng), - }, - Authority: sample.Address(rng), - }, - expectPass: true, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if !tc.expectPass { - require.NotNil(t, err) - } else { - require.Nil(t, err) - } - }) - } -} - -func TestValidateBasicMsgRemoveMarketAuthorities(t *testing.T) { - rng := sample.Rand() - - sampleAuth := sample.Address(rng) - - tcs := []struct { - name string - msg types.MsgRemoveMarketAuthorities - expectPass bool - }{ - { - "if the Admin is not an acc-address - fail", - types.MsgRemoveMarketAuthorities{ - Admin: "invalid", - }, - false, - }, - { - name: "invalid message (no authorities) - fail", - msg: types.MsgRemoveMarketAuthorities{ - RemoveAddresses: nil, - Admin: sample.Address(rng), - }, - expectPass: false, - }, - { - name: "valid message", - msg: types.MsgRemoveMarketAuthorities{ - RemoveAddresses: []string{sample.Address(rng)}, - Admin: sample.Address(rng), - }, - expectPass: true, - }, - { - name: "invalid message (duplicate authorities", - msg: types.MsgRemoveMarketAuthorities{ - RemoveAddresses: []string{sampleAuth, sampleAuth}, - Admin: sample.Address(rng), - }, - expectPass: false, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.ValidateBasic() - if !tc.expectPass { - require.NotNil(t, err) - } else { - require.Nil(t, err) - } - }) - } -} diff --git a/x/mm2/types/params.go b/x/mm2/types/params.go deleted file mode 100644 index adcc93bcc..000000000 --- a/x/mm2/types/params.go +++ /dev/null @@ -1,62 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -var ( - // DefaultMarketAuthority is the default value for the market authority Param. - DefaultMarketAuthority = authtypes.NewModuleAddress(govtypes.ModuleName).String() - // DefaultAdmin is the default value for the market admin Param. - DefaultAdmin = authtypes.NewModuleAddress(govtypes.ModuleName).String() -) - -// DefaultParams returns default marketmap parameters. -func DefaultParams() Params { - return Params{ - MarketAuthorities: []string{DefaultMarketAuthority}, - Admin: DefaultAdmin, - } -} - -// NewParams returns a new Params instance. -func NewParams(authorities []string, admin string) (Params, error) { - if authorities == nil { - return Params{}, fmt.Errorf("cannot create Params with nil authority") - } - - return Params{ - MarketAuthorities: authorities, - Admin: admin, - }, nil -} - -// ValidateBasic performs stateless validation of the Params. -func (p *Params) ValidateBasic() error { - if p.MarketAuthorities == nil { - return fmt.Errorf("cannot create Params with empty market authorities") - } - - seenAuthorities := make(map[string]struct{}, len(p.MarketAuthorities)) - for _, authority := range p.MarketAuthorities { - if _, seen := seenAuthorities[authority]; seen { - return fmt.Errorf("duplicate authority %s found", authority) - } - - if _, err := sdk.AccAddressFromBech32(authority); err != nil { - return fmt.Errorf("invalid market authority string: %w", err) - } - - seenAuthorities[authority] = struct{}{} - } - - if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { - return fmt.Errorf("invalid marketmap admin string: %w", err) - } - - return nil -} diff --git a/x/mm2/types/params.pb.go b/x/mm2/types/params.pb.go deleted file mode 100644 index b8102ac13..000000000 --- a/x/mm2/types/params.pb.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: slinky/mm2/v1/params.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the x/marketmap module. -type Params struct { - // MarketAuthorities is the list of authority accounts that are able to - // control updating the marketmap. - MarketAuthorities []string `protobuf:"bytes,1,rep,name=market_authorities,json=marketAuthorities,proto3" json:"market_authorities,omitempty"` - // Admin is an address that can remove addresses from the MarketAuthorities - // list. Only governance can add to the MarketAuthorities or change the Admin. - Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_e6f076fe60563dd2, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetMarketAuthorities() []string { - if m != nil { - return m.MarketAuthorities - } - return nil -} - -func (m *Params) GetAdmin() string { - if m != nil { - return m.Admin - } - return "" -} - -func init() { - proto.RegisterType((*Params)(nil), "slinky.mm2.v1.Params") -} - -func init() { proto.RegisterFile("slinky/mm2/v1/params.proto", fileDescriptor_e6f076fe60563dd2) } - -var fileDescriptor_e6f076fe60563dd2 = []byte{ - // 188 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xce, 0xc9, 0xcc, - 0xcb, 0xae, 0xd4, 0xcf, 0xcd, 0x35, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, - 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0xc8, 0xe9, 0xe5, 0xe6, 0x1a, 0xe9, 0x95, - 0x19, 0x2a, 0xf9, 0x72, 0xb1, 0x05, 0x80, 0xa5, 0x85, 0x74, 0xb9, 0x84, 0x72, 0x13, 0x8b, 0xb2, - 0x53, 0x4b, 0xe2, 0x13, 0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x32, 0x53, 0x8b, 0x25, 0x18, - 0x15, 0x98, 0x35, 0x38, 0x83, 0x04, 0x21, 0x32, 0x8e, 0x08, 0x09, 0x21, 0x11, 0x2e, 0xd6, 0xc4, - 0x94, 0xdc, 0xcc, 0x3c, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x08, 0xc7, 0xc9, 0xe1, 0xc4, - 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, - 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, - 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x8b, 0xb3, 0x33, 0x0b, 0x74, 0x73, 0x53, 0xcb, 0xf4, 0xa1, 0xee, - 0xac, 0x00, 0xbb, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x4c, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x96, 0x08, 0xba, 0x00, 0xc4, 0x00, 0x00, 0x00, -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintParams(dAtA, i, uint64(len(m.Admin))) - i-- - dAtA[i] = 0x12 - } - if len(m.MarketAuthorities) > 0 { - for iNdEx := len(m.MarketAuthorities) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MarketAuthorities[iNdEx]) - copy(dAtA[i:], m.MarketAuthorities[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.MarketAuthorities[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MarketAuthorities) > 0 { - for _, s := range m.MarketAuthorities { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketAuthorities", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MarketAuthorities = append(m.MarketAuthorities, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mm2/types/params_test.go b/x/mm2/types/params_test.go deleted file mode 100644 index 31ad9b616..000000000 --- a/x/mm2/types/params_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package types_test - -import ( - "testing" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/stretchr/testify/require" - - "github.com/skip-mev/slinky/x/mm2/types" -) - -func TestValidateBasic(t *testing.T) { - type testCase struct { - name string - params types.Params - expectErr bool - } - - testCases := []testCase{ - { - name: "valid default params", - params: types.DefaultParams(), - expectErr: false, - }, - { - name: "valid multiple authorities", - params: types.Params{ - MarketAuthorities: []string{authtypes.NewModuleAddress(authtypes.ModuleName).String(), types.DefaultMarketAuthority}, - Admin: types.DefaultAdmin, - }, - expectErr: false, - }, - { - name: "invalid admin", - params: types.Params{ - MarketAuthorities: []string{authtypes.NewModuleAddress(authtypes.ModuleName).String(), types.DefaultMarketAuthority}, - Admin: "invalid", - }, - expectErr: true, - }, - { - name: "invalid duplicate authority", - params: types.Params{ - MarketAuthorities: []string{types.DefaultMarketAuthority, types.DefaultMarketAuthority}, - Admin: types.DefaultAdmin, - }, - expectErr: true, - }, - { - name: "invalid authority string", - params: types.Params{ - MarketAuthorities: []string{"incorrect"}, - Admin: types.DefaultAdmin, - }, - expectErr: true, - }, - { - name: "invalid nil authority", - params: types.Params{ - MarketAuthorities: nil, - Admin: types.DefaultAdmin, - }, - expectErr: true, - }, - { - name: "invalid empty params", - params: types.Params{}, - expectErr: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.params.ValidateBasic() - if tc.expectErr { - require.Error(t, err) - return - } - - require.NoError(t, err) - }) - } -} diff --git a/x/mm2/types/provider.go b/x/mm2/types/provider.go deleted file mode 100644 index ab1fb7e3c..000000000 --- a/x/mm2/types/provider.go +++ /dev/null @@ -1,66 +0,0 @@ -package types - -import ( - "fmt" - - "github.com/skip-mev/slinky/pkg/json" -) - -// ValidateBasic performs basic validation on a ProviderConfig. -func (pc *ProviderConfig) ValidateBasic() error { - if len(pc.Name) == 0 { - return fmt.Errorf("provider name must not be empty") - } - - if len(pc.OffChainTicker) == 0 { - return fmt.Errorf("provider offchain ticker must not be empty") - } - - // NormalizeByPair is allowed to be empty - if pc.NormalizeByPair != nil { - if err := pc.NormalizeByPair.ValidateBasic(); err != nil { - return err - } - } - - if len(pc.Metadata_JSON) > MaxMetadataJSONFieldLength { - return fmt.Errorf("metadata json field is longer than maximum length of %d", MaxMetadataJSONFieldLength) - } - - if err := json.IsValid([]byte(pc.Metadata_JSON)); err != nil { - return fmt.Errorf("invalid provider config metadata json: %w", err) - } - - return nil -} - -// Equal returns true iff the ProviderConfig is equal to the given ProviderConfig. -func (pc *ProviderConfig) Equal(other ProviderConfig) bool { - if pc.Name != other.Name { - return false - } - - if pc.OffChainTicker != other.OffChainTicker { - return false - } - - if pc.Invert != other.Invert { - return false - } - - if pc.NormalizeByPair == nil { - if other.NormalizeByPair != nil { - return false - } - } else { - if other.NormalizeByPair == nil { - return false - } - - if !pc.NormalizeByPair.Equal(*other.NormalizeByPair) { - return false - } - } - - return pc.Metadata_JSON == other.Metadata_JSON -} diff --git a/x/mm2/types/provider_test.go b/x/mm2/types/provider_test.go deleted file mode 100644 index 62bd8e617..000000000 --- a/x/mm2/types/provider_test.go +++ /dev/null @@ -1,233 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/testutil" - "github.com/skip-mev/slinky/x/mm2/types" -) - -func TestProviderConfigValidateBasic(t *testing.T) { - t.Run("valid config - pass", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "", - } - require.NoError(t, pc.ValidateBasic()) - }) - t.Run("valid config inverted - pass", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Invert: true, - Metadata_JSON: "", - } - require.NoError(t, pc.ValidateBasic()) - }) - t.Run("valid config with normalize by - pass", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "BASE", - Quote: "QUOTE", - }, - Metadata_JSON: "", - } - require.NoError(t, pc.ValidateBasic()) - }) - t.Run("invalid config with normalize by - fail", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "BASE", - Quote: "", - }, - Metadata_JSON: "", - } - require.Error(t, pc.ValidateBasic()) - }) - t.Run("invalid name - fail", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "", - OffChainTicker: "ticker", - Metadata_JSON: "", - } - require.Error(t, pc.ValidateBasic()) - }) - t.Run("invalid offchain ticker - fail", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "", - Metadata_JSON: "", - } - require.Error(t, pc.ValidateBasic()) - }) - t.Run("invalid json - fail", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "invalid", - } - require.Error(t, pc.ValidateBasic()) - }) - t.Run("invalid json length - fail", func(t *testing.T) { - pc := types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: testutil.RandomString(types.MaxMetadataJSONFieldLength + 1), - } - require.Error(t, pc.ValidateBasic()) - }) -} - -func TestProviderConfigEqual(t *testing.T) { - cases := []struct { - name string - pc types.ProviderConfig - other types.ProviderConfig - exp bool - }{ - { - name: "equal - basic", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "", - }, - exp: true, - }, - { - name: "equal - inverted with normalize by", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "BASE", - Quote: "QUOTE", - }, - Invert: true, - Metadata_JSON: "", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "BASE", - Quote: "QUOTE", - }, - Invert: true, - Metadata_JSON: "", - }, - exp: true, - }, - { - name: "equal - same metadata", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "{data: 1}", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "{data: 1}", - }, - exp: true, - }, - { - name: "different name", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - }, - other: types.ProviderConfig{ - Name: "binance", - OffChainTicker: "ticker", - }, - exp: false, - }, - { - name: "different offchain ticker", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker2", - }, - exp: false, - }, - { - name: "different invert", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Invert: true, - Metadata_JSON: "", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Invert: false, - Metadata_JSON: "", - }, - exp: false, - }, - { - name: "different normalize by", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Invert: true, - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "BASE", - Quote: "QUOTE", - }, - Metadata_JSON: "", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Invert: true, - NormalizeByPair: &slinkytypes.CurrencyPair{ - Base: "QUOTE", - Quote: "QUOTE", - }, - Metadata_JSON: "", - }, - exp: false, - }, - { - name: "different metadata", - pc: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "{data: 1}", - }, - other: types.ProviderConfig{ - Name: "mexc", - OffChainTicker: "ticker", - Metadata_JSON: "", - }, - exp: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.exp, tc.pc.Equal(tc.other)) - }) - } -} diff --git a/x/mm2/types/query.pb.go b/x/mm2/types/query.pb.go deleted file mode 100644 index 29977fbfe..000000000 --- a/x/mm2/types/query.pb.go +++ /dev/null @@ -1,1682 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: slinky/mm2/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/skip-mev/slinky/pkg/types" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MarketMapRequest is the query request for the MarketMap query. -// It takes no arguments. -type MarketMapRequest struct { -} - -func (m *MarketMapRequest) Reset() { *m = MarketMapRequest{} } -func (m *MarketMapRequest) String() string { return proto.CompactTextString(m) } -func (*MarketMapRequest) ProtoMessage() {} -func (*MarketMapRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a112ce7368e99f97, []int{0} -} -func (m *MarketMapRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MarketMapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MarketMapRequest.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 *MarketMapRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketMapRequest.Merge(m, src) -} -func (m *MarketMapRequest) XXX_Size() int { - return m.Size() -} -func (m *MarketMapRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MarketMapRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketMapRequest proto.InternalMessageInfo - -// MarketMapResponse is the query response for the MarketMap query. -type MarketMapResponse struct { - // MarketMap defines the global set of market configurations for all providers - // and markets. - MarketMap MarketMap `protobuf:"bytes,1,opt,name=market_map,json=marketMap,proto3" json:"market_map"` - // LastUpdated is the last block height that the market map was updated. - // This field can be used as an optimization for clients checking if there - // is a new update to the map. - LastUpdated uint64 `protobuf:"varint,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` - // ChainId is the chain identifier for the market map. - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *MarketMapResponse) Reset() { *m = MarketMapResponse{} } -func (m *MarketMapResponse) String() string { return proto.CompactTextString(m) } -func (*MarketMapResponse) ProtoMessage() {} -func (*MarketMapResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a112ce7368e99f97, []int{1} -} -func (m *MarketMapResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MarketMapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MarketMapResponse.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 *MarketMapResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketMapResponse.Merge(m, src) -} -func (m *MarketMapResponse) XXX_Size() int { - return m.Size() -} -func (m *MarketMapResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MarketMapResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketMapResponse proto.InternalMessageInfo - -func (m *MarketMapResponse) GetMarketMap() MarketMap { - if m != nil { - return m.MarketMap - } - return MarketMap{} -} - -func (m *MarketMapResponse) GetLastUpdated() uint64 { - if m != nil { - return m.LastUpdated - } - return 0 -} - -func (m *MarketMapResponse) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// MarketRequest is the query request for the Market query. -// It takes the currency pair of the market as an argument. -type MarketRequest struct { - // CurrencyPair is the currency pair associated with the market being - // requested. - CurrencyPair types.CurrencyPair `protobuf:"bytes,3,opt,name=currency_pair,json=currencyPair,proto3" json:"currency_pair"` -} - -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_a112ce7368e99f97, []int{2} -} -func (m *MarketRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MarketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MarketRequest.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 *MarketRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketRequest.Merge(m, src) -} -func (m *MarketRequest) XXX_Size() int { - return m.Size() -} -func (m *MarketRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MarketRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketRequest proto.InternalMessageInfo - -func (m *MarketRequest) GetCurrencyPair() types.CurrencyPair { - if m != nil { - return m.CurrencyPair - } - return types.CurrencyPair{} -} - -// MarketResponse is the query response for the Market query. -type MarketResponse struct { - // Market is the configuration of a single market to be price-fetched for. - Market Market `protobuf:"bytes,1,opt,name=market,proto3" json:"market"` -} - -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_a112ce7368e99f97, []int{3} -} -func (m *MarketResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MarketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MarketResponse.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 *MarketResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarketResponse.Merge(m, src) -} -func (m *MarketResponse) XXX_Size() int { - return m.Size() -} -func (m *MarketResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MarketResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MarketResponse proto.InternalMessageInfo - -func (m *MarketResponse) GetMarket() Market { - if m != nil { - return m.Market - } - return Market{} -} - -// ParamsRequest is the request type for the Query/Params RPC method. -type ParamsRequest struct { -} - -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_a112ce7368e99f97, []int{4} -} -func (m *ParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParamsRequest.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 *ParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParamsRequest.Merge(m, src) -} -func (m *ParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *ParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ParamsRequest proto.InternalMessageInfo - -// ParamsResponse is the response type for the Query/Params RPC method. -type ParamsResponse struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -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_a112ce7368e99f97, []int{5} -} -func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParamsResponse.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 *ParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParamsResponse.Merge(m, src) -} -func (m *ParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *ParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ParamsResponse proto.InternalMessageInfo - -func (m *ParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// LastUpdatedRequest is the request type for the Query/LastUpdated RPC -// method. -type LastUpdatedRequest struct { -} - -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_a112ce7368e99f97, []int{6} -} -func (m *LastUpdatedRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LastUpdatedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LastUpdatedRequest.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 *LastUpdatedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastUpdatedRequest.Merge(m, src) -} -func (m *LastUpdatedRequest) XXX_Size() int { - return m.Size() -} -func (m *LastUpdatedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_LastUpdatedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_LastUpdatedRequest proto.InternalMessageInfo - -// LastUpdatedResponse is the response type for the Query/LastUpdated RPC -// method. -type LastUpdatedResponse struct { - LastUpdated uint64 `protobuf:"varint,1,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` -} - -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_a112ce7368e99f97, []int{7} -} -func (m *LastUpdatedResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LastUpdatedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LastUpdatedResponse.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 *LastUpdatedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastUpdatedResponse.Merge(m, src) -} -func (m *LastUpdatedResponse) XXX_Size() int { - return m.Size() -} -func (m *LastUpdatedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LastUpdatedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LastUpdatedResponse proto.InternalMessageInfo - -func (m *LastUpdatedResponse) GetLastUpdated() uint64 { - if m != nil { - return m.LastUpdated - } - return 0 -} - -func init() { - proto.RegisterType((*MarketMapRequest)(nil), "slinky.mm2.v1.MarketMapRequest") - proto.RegisterType((*MarketMapResponse)(nil), "slinky.mm2.v1.MarketMapResponse") - proto.RegisterType((*MarketRequest)(nil), "slinky.mm2.v1.MarketRequest") - proto.RegisterType((*MarketResponse)(nil), "slinky.mm2.v1.MarketResponse") - proto.RegisterType((*ParamsRequest)(nil), "slinky.mm2.v1.ParamsRequest") - proto.RegisterType((*ParamsResponse)(nil), "slinky.mm2.v1.ParamsResponse") - proto.RegisterType((*LastUpdatedRequest)(nil), "slinky.mm2.v1.LastUpdatedRequest") - proto.RegisterType((*LastUpdatedResponse)(nil), "slinky.mm2.v1.LastUpdatedResponse") -} - -func init() { proto.RegisterFile("slinky/mm2/v1/query.proto", fileDescriptor_a112ce7368e99f97) } - -var fileDescriptor_a112ce7368e99f97 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0x7e, 0xf9, 0xc8, 0x4d, 0x53, 0x60, 0x68, 0x45, 0x6a, 0x1a, 0x37, 0x75, 0x25, - 0x94, 0x0d, 0xb6, 0xea, 0x6e, 0xd8, 0x20, 0xa1, 0xa2, 0x4a, 0x20, 0x51, 0xa9, 0x44, 0x62, 0x01, - 0x9b, 0x68, 0x6a, 0x8f, 0x5c, 0x2b, 0x19, 0xcf, 0xd4, 0x3f, 0x11, 0xde, 0xf2, 0x04, 0x95, 0x78, - 0x21, 0x96, 0x5d, 0x56, 0x62, 0xc3, 0x0a, 0xa1, 0x84, 0x07, 0x41, 0x9e, 0x19, 0xb7, 0x71, 0x62, - 0xb3, 0xb3, 0xef, 0x3d, 0x73, 0xce, 0x3d, 0x67, 0xee, 0xc0, 0x6e, 0x3c, 0x09, 0xc2, 0x71, 0x66, - 0x53, 0xea, 0xd8, 0xd3, 0x23, 0xfb, 0x2a, 0x25, 0x51, 0x66, 0xf1, 0x88, 0x25, 0x0c, 0x75, 0x64, - 0xcb, 0xa2, 0xd4, 0xb1, 0xa6, 0x47, 0xfa, 0xb6, 0xcf, 0x7c, 0x26, 0x3a, 0x76, 0xfe, 0x25, 0x41, - 0xfa, 0x9e, 0xcf, 0x98, 0x3f, 0x21, 0x36, 0xe6, 0x81, 0x8d, 0xc3, 0x90, 0x25, 0x38, 0x09, 0x58, - 0x18, 0xab, 0xee, 0xa1, 0x62, 0x4f, 0x32, 0x4e, 0xe2, 0x9c, 0xdf, 0x4d, 0xa3, 0x88, 0x84, 0x6e, - 0x36, 0xe2, 0x38, 0x88, 0x14, 0x48, 0x2f, 0x8f, 0x40, 0x71, 0x34, 0x26, 0x49, 0x75, 0x8f, 0xe3, - 0x08, 0x53, 0x45, 0x6e, 0x22, 0x78, 0x74, 0x26, 0xb0, 0x67, 0x98, 0x0f, 0xc9, 0x55, 0x4a, 0xe2, - 0xc4, 0xbc, 0xd6, 0xe0, 0xf1, 0x42, 0x31, 0xe6, 0x2c, 0x8c, 0x09, 0x7a, 0x05, 0x20, 0x59, 0x47, - 0x14, 0xf3, 0xae, 0xd6, 0xd7, 0x06, 0x6d, 0xa7, 0x6b, 0x95, 0xec, 0x59, 0x77, 0xa7, 0x4e, 0x36, - 0x6e, 0x7e, 0xed, 0x37, 0x86, 0x2d, 0x5a, 0x14, 0xd0, 0x01, 0x6c, 0x4e, 0x70, 0x9c, 0x8c, 0x52, - 0xee, 0xe1, 0x84, 0x78, 0xdd, 0xb5, 0xbe, 0x36, 0xd8, 0x18, 0xb6, 0xf3, 0xda, 0x47, 0x59, 0x42, - 0xbb, 0xf0, 0xc0, 0xbd, 0xc4, 0x41, 0x38, 0x0a, 0xbc, 0xee, 0x7a, 0x5f, 0x1b, 0xb4, 0x86, 0xff, - 0x8b, 0xff, 0x77, 0x9e, 0xf9, 0x09, 0x3a, 0x92, 0x5b, 0xcd, 0x88, 0xde, 0x42, 0xa7, 0x14, 0x83, - 0x38, 0xd0, 0x76, 0x7a, 0xc5, 0x40, 0x22, 0xac, 0x7c, 0xa4, 0x37, 0x0a, 0x75, 0x8e, 0x83, 0x48, - 0x4d, 0xb5, 0xe9, 0x2e, 0xd4, 0xcc, 0x53, 0xd8, 0x2a, 0xa8, 0x95, 0xd3, 0x63, 0x68, 0xca, 0xb9, - 0x95, 0xcb, 0x9d, 0x4a, 0x97, 0x8a, 0x4c, 0x41, 0xcd, 0x87, 0xd0, 0x39, 0x17, 0xc1, 0x16, 0x29, - 0x9e, 0xc2, 0x56, 0x51, 0xb8, 0xe7, 0x95, 0xd9, 0xd7, 0xf0, 0x4a, 0x78, 0xc1, 0x2b, 0xa1, 0xe6, - 0x36, 0xa0, 0xf7, 0xf7, 0x19, 0x15, 0xe4, 0x2f, 0xe1, 0x49, 0xa9, 0xaa, 0x14, 0x96, 0x43, 0xd6, - 0x56, 0x42, 0x76, 0xbe, 0xaf, 0xc3, 0x7f, 0x1f, 0xf2, 0x05, 0x45, 0x1c, 0x5a, 0x77, 0xf7, 0x85, - 0xf6, 0xeb, 0x6e, 0x52, 0x29, 0xea, 0xfd, 0x7a, 0x80, 0x14, 0x37, 0xfb, 0x5f, 0x7f, 0xfc, 0xf9, - 0xb6, 0xa6, 0xa3, 0xae, 0x5d, 0xb5, 0x8b, 0x14, 0x73, 0xe4, 0x41, 0x53, 0x1e, 0x43, 0x7b, 0x95, - 0x6c, 0x85, 0x56, 0xaf, 0xa6, 0xab, 0x84, 0x7a, 0x42, 0xe8, 0x29, 0xda, 0xa9, 0x14, 0x42, 0x19, - 0xb4, 0x17, 0xb2, 0x41, 0x07, 0x4b, 0x64, 0xab, 0x69, 0xea, 0xe6, 0xbf, 0x20, 0x4a, 0xf4, 0x50, - 0x88, 0xf6, 0xd0, 0xb3, 0x25, 0xd1, 0xc5, 0xbc, 0x73, 0x83, 0xf2, 0x12, 0x57, 0x0c, 0x96, 0x76, - 0x63, 0xc5, 0x60, 0x79, 0x51, 0x6a, 0x0d, 0xca, 0x95, 0x38, 0x79, 0x7d, 0x33, 0x33, 0xb4, 0xdb, - 0x99, 0xa1, 0xfd, 0x9e, 0x19, 0xda, 0xf5, 0xdc, 0x68, 0xdc, 0xce, 0x8d, 0xc6, 0xcf, 0xb9, 0xd1, - 0xf8, 0xfc, 0xdc, 0x0f, 0x92, 0xcb, 0xf4, 0xc2, 0x72, 0x19, 0xb5, 0xe3, 0x71, 0xc0, 0x5f, 0x50, - 0x32, 0x2d, 0x38, 0xbe, 0x08, 0x16, 0xf1, 0x2e, 0x2e, 0x9a, 0xe2, 0xf1, 0x1f, 0xff, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x67, 0x15, 0x9f, 0x3d, 0xb9, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // MarketMap returns the full market map stored in the x/marketmap - // module. - MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) - // Market returns a market stored in the x/marketmap - // module. - Market(ctx context.Context, in *MarketRequest, opts ...grpc.CallOption) (*MarketResponse, error) - // LastUpdated returns the last height the market map was updated at. - LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) - // Params returns the current x/marketmap module parameters. - Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) MarketMap(ctx context.Context, in *MarketMapRequest, opts ...grpc.CallOption) (*MarketMapResponse, error) { - out := new(MarketMapResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Query/MarketMap", 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.mm2.v1.Query/Market", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) LastUpdated(ctx context.Context, in *LastUpdatedRequest, opts ...grpc.CallOption) (*LastUpdatedResponse, error) { - out := new(LastUpdatedResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Query/LastUpdated", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { - out := new(ParamsResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // MarketMap returns the full market map stored in the x/marketmap - // module. - MarketMap(context.Context, *MarketMapRequest) (*MarketMapResponse, error) - // Market returns a market stored in the x/marketmap - // module. - Market(context.Context, *MarketRequest) (*MarketResponse, error) - // LastUpdated returns the last height the market map was updated at. - LastUpdated(context.Context, *LastUpdatedRequest) (*LastUpdatedResponse, error) - // Params returns the current x/marketmap module parameters. - Params(context.Context, *ParamsRequest) (*ParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -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) Market(ctx context.Context, req *MarketRequest) (*MarketResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Market not implemented") -} -func (*UnimplementedQueryServer) LastUpdated(ctx context.Context, req *LastUpdatedRequest) (*LastUpdatedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LastUpdated not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *ParamsRequest) (*ParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_MarketMap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MarketMapRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).MarketMap(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Query/MarketMap", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).MarketMap(ctx, req.(*MarketMapRequest)) - } - 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 { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Market(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Query/Market", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Market(ctx, req.(*MarketRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_LastUpdated_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LastUpdatedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).LastUpdated(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Query/LastUpdated", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LastUpdated(ctx, req.(*LastUpdatedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*ParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "slinky.mm2.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MarketMap", - Handler: _Query_MarketMap_Handler, - }, - { - MethodName: "Market", - Handler: _Query_Market_Handler, - }, - { - MethodName: "LastUpdated", - Handler: _Query_LastUpdated_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "slinky/mm2/v1/query.proto", -} - -func (m *MarketMapRequest) 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 *MarketMapRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketMapRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MarketMapResponse) 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 *MarketMapResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketMapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x1a - } - if m.LastUpdated != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LastUpdated)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.MarketMap.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) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MarketRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketRequest) 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] = 0x1a - return len(dAtA) - i, nil -} - -func (m *MarketResponse) 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 *MarketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MarketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Market.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 *ParamsRequest) 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 *ParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ParamsResponse) 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 *ParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.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 *LastUpdatedRequest) 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 *LastUpdatedRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LastUpdatedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *LastUpdatedResponse) 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 *LastUpdatedResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LastUpdatedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastUpdated != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.LastUpdated)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MarketMapRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MarketMapResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.MarketMap.Size() - n += 1 + l + sovQuery(uint64(l)) - if m.LastUpdated != 0 { - n += 1 + sovQuery(uint64(m.LastUpdated)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *MarketRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.CurrencyPair.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *MarketResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Market.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *ParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *LastUpdatedRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *LastUpdatedResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LastUpdated != 0 { - n += 1 + sovQuery(uint64(m.LastUpdated)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MarketMapRequest) 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: MarketMapRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarketMapRequest: 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 *MarketMapResponse) 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: MarketMapResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarketMapResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketMap", 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.MarketMap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - m.LastUpdated = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - 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 - 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: MarketRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarketRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 3: - 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 *MarketResponse) 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: MarketResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MarketResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Market", 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.Market.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 *ParamsRequest) 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: ParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParamsRequest: 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 *ParamsResponse) 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: ParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params.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 *LastUpdatedRequest) 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: LastUpdatedRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LastUpdatedRequest: 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 *LastUpdatedResponse) 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: LastUpdatedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LastUpdatedResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) - } - m.LastUpdated = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastUpdated |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/mm2/types/query.pb.gw.go b/x/mm2/types/query.pb.gw.go deleted file mode 100644 index 9dd204916..000000000 --- a/x/mm2/types/query.pb.gw.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: slinky/mm2/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MarketMapRequest - var metadata runtime.ServerMetadata - - msg, err := client.MarketMap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_MarketMap_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MarketMapRequest - var metadata runtime.ServerMetadata - - msg, err := server.MarketMap(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Market_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Market_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MarketRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Market_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Market(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Market_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MarketRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Market_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Market(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_LastUpdated_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LastUpdatedRequest - var metadata runtime.ServerMetadata - - msg, err := client.LastUpdated(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_LastUpdated_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq LastUpdatedRequest - var metadata runtime.ServerMetadata - - msg, err := server.LastUpdated(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_MarketMap_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_MarketMap_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_MarketMap_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() - 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_Market_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_Market_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LastUpdated_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_LastUpdated_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_LastUpdated_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_MarketMap_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_MarketMap_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_MarketMap_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() - 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_Market_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_Market_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_LastUpdated_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_LastUpdated_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_LastUpdated_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - 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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_MarketMap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "mm2", "v1", "marketmap"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Market_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "mm2", "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", "mm2", "v1", "last_updated"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"slinky", "mm2", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_MarketMap_0 = runtime.ForwardResponseMessage - - forward_Query_Market_0 = runtime.ForwardResponseMessage - - forward_Query_LastUpdated_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/x/mm2/types/ticker.go b/x/mm2/types/ticker.go deleted file mode 100644 index f3cfcf64a..000000000 --- a/x/mm2/types/ticker.go +++ /dev/null @@ -1,72 +0,0 @@ -package types - -import ( - "fmt" - "strings" - - "github.com/skip-mev/slinky/pkg/json" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" -) - -const ( - // DefaultMaxDecimals is the maximum number of decimals allowed for a ticker. - DefaultMaxDecimals = 36 - // DefaultMinProviderCount is the minimum number of providers required for a - // ticker to be considered valid. - DefaultMinProviderCount = 1 - // MaxMetadataJSONFieldLength is the maximum length of the MetadataJSON field. - MaxMetadataJSONFieldLength = 16384 -) - -// NewTicker returns a new Ticker instance. A Ticker represents a price feed for -// a given asset pair i.e. BTC/USD. The price feed is scaled to a number of decimal -// places and has a minimum number of providers required to consider the ticker valid. -func NewTicker(base, quote string, decimals, minProviderCount uint64) Ticker { - return Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: strings.ToUpper(base), - Quote: strings.ToUpper(quote), - }, - Decimals: decimals, - MinProviderCount: minProviderCount, - } -} - -// String returns a string representation of the Ticker. -func (t Ticker) String() string { - return t.CurrencyPair.String() -} - -// ValidateBasic performs basic validation on the Ticker. -func (t *Ticker) ValidateBasic() error { - if t.Decimals > DefaultMaxDecimals || t.Decimals == 0 { - return fmt.Errorf("decimals must be between 1 and %d; got %d for %s", DefaultMaxDecimals, t.Decimals, t.CurrencyPair.String()) - } - if t.MinProviderCount < DefaultMinProviderCount { - return fmt.Errorf("min provider count must be at least %d; got %d for %s", DefaultMinProviderCount, t.MinProviderCount, t.CurrencyPair.String()) - } - - if err := t.CurrencyPair.ValidateBasic(); err != nil { - return err - } - - if len(t.Metadata_JSON) > MaxMetadataJSONFieldLength { - return fmt.Errorf("metadata json field is longer than maximum length of %d", MaxMetadataJSONFieldLength) - } - - if err := json.IsValid([]byte(t.Metadata_JSON)); err != nil { - return fmt.Errorf("invalid ticker metadata json: %w", err) - } - - return nil -} - -// Equal returns true iff the Ticker is equal to the given Ticker. -func (t *Ticker) Equal(other Ticker) bool { - return t.CurrencyPair.Equal(other.CurrencyPair) && - t.Decimals == other.Decimals && - t.MinProviderCount == other.MinProviderCount && - t.Metadata_JSON == other.Metadata_JSON && - t.Enabled == other.Enabled -} diff --git a/x/mm2/types/ticker_test.go b/x/mm2/types/ticker_test.go deleted file mode 100644 index 8e79d902a..000000000 --- a/x/mm2/types/ticker_test.go +++ /dev/null @@ -1,312 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/skip-mev/slinky/testutil" - - "github.com/stretchr/testify/require" - - slinkytypes "github.com/skip-mev/slinky/pkg/types" - "github.com/skip-mev/slinky/x/mm2/types" -) - -func TestTicker(t *testing.T) { - testCases := []struct { - name string - ticker types.Ticker - expErr bool - }{ - { - name: "valid ticker", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: false, - }, - { - name: "empty base", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "empty quote", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "invalid base", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "bitcoin", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "invalid quote", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "usdt", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "invalid decimals", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 0, - MinProviderCount: 1, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "invalid min provider count", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 0, - Metadata_JSON: "", - }, - expErr: true, - }, - { - name: "invalid json len", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 0, - Metadata_JSON: testutil.RandomString(types.MaxMetadataJSONFieldLength + 1), - }, - expErr: true, - }, - { - name: "invalid json", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 0, - Metadata_JSON: "invalid", - }, - expErr: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := tc.ticker.ValidateBasic() - if tc.expErr { - require.Error(t, err) - return - } - - require.NoError(t, err) - }) - } -} - -func TestTickerEqual(t *testing.T) { - cases := []struct { - name string - ticker types.Ticker - other types.Ticker - exp bool - }{ - { - name: "equal tickers", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - exp: true, - }, - { - name: "different base", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "ETHEREUM", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - exp: false, - }, - { - name: "different quote", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "BTC", - }, - Decimals: 8, - MinProviderCount: 1, - }, - exp: false, - }, - { - name: "different decimals", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 18, - MinProviderCount: 1, - }, - exp: false, - }, - { - name: "different min provider count", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 2, - }, - exp: false, - }, - - { - name: "different metadata", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: `{"key": "value"}`, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Metadata_JSON: `{"key": "value2"}`, - }, - exp: false, - }, - - { - name: "different enabled", - ticker: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Enabled: true, - }, - other: types.Ticker{ - CurrencyPair: slinkytypes.CurrencyPair{ - Base: "BITCOIN", - Quote: "USDT", - }, - Decimals: 8, - MinProviderCount: 1, - Enabled: false, - }, - exp: false, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.ticker.Equal(tc.other), tc.exp) - }) - } -} diff --git a/x/mm2/types/tx.pb.go b/x/mm2/types/tx.pb.go deleted file mode 100644 index 0bff8ced9..000000000 --- a/x/mm2/types/tx.pb.go +++ /dev/null @@ -1,1792 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: slinky/mm2/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgCreateMarkets defines a message carrying a payload for creating markets in -// the x/marketmap module. -type MsgCreateMarkets struct { - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // CreateMarkets is the list of all markets to be created for the given - // transaction. - CreateMarkets []Market `protobuf:"bytes,2,rep,name=create_markets,json=createMarkets,proto3" json:"create_markets"` -} - -func (m *MsgCreateMarkets) Reset() { *m = MsgCreateMarkets{} } -func (m *MsgCreateMarkets) String() string { return proto.CompactTextString(m) } -func (*MsgCreateMarkets) ProtoMessage() {} -func (*MsgCreateMarkets) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{0} -} -func (m *MsgCreateMarkets) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateMarkets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateMarkets.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 *MsgCreateMarkets) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateMarkets.Merge(m, src) -} -func (m *MsgCreateMarkets) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateMarkets) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateMarkets.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateMarkets proto.InternalMessageInfo - -func (m *MsgCreateMarkets) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgCreateMarkets) GetCreateMarkets() []Market { - if m != nil { - return m.CreateMarkets - } - return nil -} - -// MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. -type MsgCreateMarketsResponse struct { -} - -func (m *MsgCreateMarketsResponse) Reset() { *m = MsgCreateMarketsResponse{} } -func (m *MsgCreateMarketsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateMarketsResponse) ProtoMessage() {} -func (*MsgCreateMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{1} -} -func (m *MsgCreateMarketsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateMarketsResponse.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 *MsgCreateMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateMarketsResponse.Merge(m, src) -} -func (m *MsgCreateMarketsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateMarketsResponse proto.InternalMessageInfo - -// MsgUpdateMarkets defines a message carrying a payload for updating the -// x/marketmap module. -type MsgUpdateMarkets struct { - // Authority is the signer of this transaction. This authority must be - // authorized by the module to execute the message. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // UpdateMarkets is the list of all markets to be updated for the given - // transaction. - UpdateMarkets []Market `protobuf:"bytes,2,rep,name=update_markets,json=updateMarkets,proto3" json:"update_markets"` -} - -func (m *MsgUpdateMarkets) Reset() { *m = MsgUpdateMarkets{} } -func (m *MsgUpdateMarkets) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateMarkets) ProtoMessage() {} -func (*MsgUpdateMarkets) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{2} -} -func (m *MsgUpdateMarkets) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateMarkets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateMarkets.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 *MsgUpdateMarkets) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateMarkets.Merge(m, src) -} -func (m *MsgUpdateMarkets) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateMarkets) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateMarkets.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateMarkets proto.InternalMessageInfo - -func (m *MsgUpdateMarkets) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateMarkets) GetUpdateMarkets() []Market { - if m != nil { - return m.UpdateMarkets - } - return nil -} - -// MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. -type MsgUpdateMarketsResponse struct { -} - -func (m *MsgUpdateMarketsResponse) Reset() { *m = MsgUpdateMarketsResponse{} } -func (m *MsgUpdateMarketsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateMarketsResponse) ProtoMessage() {} -func (*MsgUpdateMarketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{3} -} -func (m *MsgUpdateMarketsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateMarketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateMarketsResponse.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 *MsgUpdateMarketsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateMarketsResponse.Merge(m, src) -} -func (m *MsgUpdateMarketsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateMarketsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateMarketsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateMarketsResponse proto.InternalMessageInfo - -// MsgParams defines the Msg/Params request type. It contains the -// new parameters for the x/marketmap module. -type MsgParams struct { - // Params defines the new parameters for the x/marketmap module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // Authority defines the authority that is updating the x/marketmap module - // parameters. - Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (m *MsgParams) Reset() { *m = MsgParams{} } -func (m *MsgParams) String() string { return proto.CompactTextString(m) } -func (*MsgParams) ProtoMessage() {} -func (*MsgParams) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{4} -} -func (m *MsgParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgParams.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 *MsgParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgParams.Merge(m, src) -} -func (m *MsgParams) XXX_Size() int { - return m.Size() -} -func (m *MsgParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgParams proto.InternalMessageInfo - -func (m *MsgParams) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *MsgParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -// MsgParamsResponse defines the Msg/Params response type. -type MsgParamsResponse struct { -} - -func (m *MsgParamsResponse) Reset() { *m = MsgParamsResponse{} } -func (m *MsgParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgParamsResponse) ProtoMessage() {} -func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{5} -} -func (m *MsgParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgParamsResponse.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 *MsgParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgParamsResponse.Merge(m, src) -} -func (m *MsgParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgParamsResponse proto.InternalMessageInfo - -// MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse -// request type. It contains the new addresses to remove from the list of -// authorities -type MsgRemoveMarketAuthorities struct { - // RemoveAddresses is the list of addresses to remove. - RemoveAddresses []string `protobuf:"bytes,1,rep,name=remove_addresses,json=removeAddresses,proto3" json:"remove_addresses,omitempty"` - // Admin defines the authority that is the x/marketmap - // Admin account. This account is set in the module parameters. - Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` -} - -func (m *MsgRemoveMarketAuthorities) Reset() { *m = MsgRemoveMarketAuthorities{} } -func (m *MsgRemoveMarketAuthorities) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveMarketAuthorities) ProtoMessage() {} -func (*MsgRemoveMarketAuthorities) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{6} -} -func (m *MsgRemoveMarketAuthorities) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRemoveMarketAuthorities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRemoveMarketAuthorities.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 *MsgRemoveMarketAuthorities) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveMarketAuthorities.Merge(m, src) -} -func (m *MsgRemoveMarketAuthorities) XXX_Size() int { - return m.Size() -} -func (m *MsgRemoveMarketAuthorities) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveMarketAuthorities.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRemoveMarketAuthorities proto.InternalMessageInfo - -func (m *MsgRemoveMarketAuthorities) GetRemoveAddresses() []string { - if m != nil { - return m.RemoveAddresses - } - return nil -} - -func (m *MsgRemoveMarketAuthorities) GetAdmin() string { - if m != nil { - return m.Admin - } - return "" -} - -// MsgRemoveMarketAuthoritiesResponse defines the -// Msg/RemoveMarketAuthoritiesResponse response type. -type MsgRemoveMarketAuthoritiesResponse struct { -} - -func (m *MsgRemoveMarketAuthoritiesResponse) Reset() { *m = MsgRemoveMarketAuthoritiesResponse{} } -func (m *MsgRemoveMarketAuthoritiesResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRemoveMarketAuthoritiesResponse) ProtoMessage() {} -func (*MsgRemoveMarketAuthoritiesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1a86eaac7c34565b, []int{7} -} -func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.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 *MsgRemoveMarketAuthoritiesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.Merge(m, src) -} -func (m *MsgRemoveMarketAuthoritiesResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRemoveMarketAuthoritiesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRemoveMarketAuthoritiesResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgCreateMarkets)(nil), "slinky.mm2.v1.MsgCreateMarkets") - proto.RegisterType((*MsgCreateMarketsResponse)(nil), "slinky.mm2.v1.MsgCreateMarketsResponse") - proto.RegisterType((*MsgUpdateMarkets)(nil), "slinky.mm2.v1.MsgUpdateMarkets") - proto.RegisterType((*MsgUpdateMarketsResponse)(nil), "slinky.mm2.v1.MsgUpdateMarketsResponse") - proto.RegisterType((*MsgParams)(nil), "slinky.mm2.v1.MsgParams") - proto.RegisterType((*MsgParamsResponse)(nil), "slinky.mm2.v1.MsgParamsResponse") - proto.RegisterType((*MsgRemoveMarketAuthorities)(nil), "slinky.mm2.v1.MsgRemoveMarketAuthorities") - proto.RegisterType((*MsgRemoveMarketAuthoritiesResponse)(nil), "slinky.mm2.v1.MsgRemoveMarketAuthoritiesResponse") -} - -func init() { proto.RegisterFile("slinky/mm2/v1/tx.proto", fileDescriptor_1a86eaac7c34565b) } - -var fileDescriptor_1a86eaac7c34565b = []byte{ - // 558 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xb6, 0x1b, 0x1a, 0x29, 0x8b, 0x52, 0x5a, 0x53, 0xa8, 0xf1, 0xc1, 0x89, 0x0c, 0x82, 0x10, - 0xa9, 0x5e, 0xc5, 0x95, 0x38, 0xe4, 0x44, 0x02, 0x57, 0x4b, 0xc8, 0x88, 0x03, 0x5c, 0x22, 0x37, - 0x59, 0x6d, 0xad, 0xb0, 0x5e, 0xcb, 0xeb, 0x84, 0xe6, 0xc6, 0xcf, 0x05, 0x71, 0xe2, 0x11, 0x78, - 0x84, 0x1c, 0x78, 0x88, 0x8a, 0x53, 0xc5, 0x89, 0x13, 0x42, 0xc9, 0x21, 0x3c, 0x06, 0xb2, 0x77, - 0x9d, 0x74, 0xf3, 0xa3, 0xb6, 0x12, 0x97, 0x68, 0x33, 0xf3, 0xcd, 0x37, 0xdf, 0xb7, 0x33, 0x6b, - 0x70, 0x97, 0xbd, 0x0d, 0xc2, 0xfe, 0x08, 0x12, 0xe2, 0xc0, 0x61, 0x03, 0x26, 0xa7, 0x76, 0x14, - 0xd3, 0x84, 0x6a, 0x65, 0x1e, 0xb7, 0x09, 0x71, 0xec, 0x61, 0xc3, 0x38, 0xe8, 0x52, 0x46, 0x28, - 0x83, 0x84, 0xe1, 0x14, 0x46, 0x18, 0xe6, 0x38, 0x63, 0x1f, 0x53, 0x4c, 0xb3, 0x23, 0x4c, 0x4f, - 0x22, 0x7a, 0x8f, 0xc3, 0x3b, 0x3c, 0xc1, 0xff, 0x88, 0xd4, 0x9e, 0x4f, 0x82, 0x90, 0xc2, 0xec, - 0x57, 0x84, 0x0c, 0x59, 0x03, 0xf1, 0xe3, 0x3e, 0x4a, 0xd6, 0xe7, 0x22, 0x3f, 0xf6, 0x89, 0xa0, - 0xb2, 0x7e, 0xa8, 0x60, 0xd7, 0x65, 0xf8, 0x59, 0x8c, 0xfc, 0x04, 0xb9, 0x59, 0x15, 0xd3, 0x9e, - 0x80, 0x92, 0x3f, 0x48, 0x4e, 0x68, 0x1c, 0x24, 0x23, 0x5d, 0xad, 0xaa, 0xb5, 0x52, 0x5b, 0xff, - 0xf9, 0xfd, 0x70, 0x5f, 0x88, 0x68, 0xf5, 0x7a, 0x31, 0x62, 0xec, 0x65, 0x12, 0x07, 0x21, 0xf6, - 0x16, 0x50, 0xad, 0x0d, 0x76, 0xba, 0x19, 0x51, 0x87, 0xf7, 0x67, 0xfa, 0x56, 0xb5, 0x50, 0xbb, - 0xe9, 0xdc, 0xb1, 0xa5, 0x9b, 0xb0, 0x79, 0x9f, 0xf6, 0x8d, 0xb3, 0xdf, 0x15, 0xc5, 0x2b, 0x77, - 0x2f, 0xf6, 0x6e, 0x36, 0xff, 0x7e, 0xab, 0x28, 0x1f, 0x67, 0xe3, 0xfa, 0x82, 0xf7, 0xcb, 0x6c, - 0x5c, 0xbf, 0x2f, 0x3c, 0x9c, 0x0a, 0x6b, 0xc4, 0x8f, 0xe0, 0xb2, 0x6e, 0xcb, 0x00, 0xfa, 0x72, - 0xcc, 0x43, 0x2c, 0xa2, 0x21, 0x43, 0xb9, 0xd1, 0x57, 0x51, 0xef, 0xff, 0x18, 0x1d, 0x64, 0x44, - 0xd7, 0x32, 0x3a, 0xb8, 0xd8, 0xfb, 0x9a, 0x46, 0x25, 0xdd, 0xc2, 0xa8, 0x14, 0x9b, 0x1b, 0xfd, - 0xac, 0x82, 0x92, 0xcb, 0xf0, 0x8b, 0x6c, 0xca, 0xda, 0x11, 0x28, 0xf2, 0x79, 0x67, 0xf6, 0x56, - 0x15, 0x72, 0x98, 0x50, 0x28, 0xa0, 0xf2, 0xb5, 0x6c, 0x5d, 0xf9, 0x5a, 0x9a, 0x3b, 0xb2, 0x1d, - 0xeb, 0x36, 0xd8, 0x9b, 0x2b, 0x99, 0xeb, 0xfb, 0xa4, 0x02, 0xc3, 0x65, 0xd8, 0x43, 0x84, 0x0e, - 0x85, 0xf8, 0x96, 0xa8, 0x08, 0x10, 0xd3, 0x1e, 0x83, 0xdd, 0x38, 0x4b, 0x75, 0x7c, 0xde, 0x06, - 0xa5, 0xd2, 0x0b, 0xb5, 0x92, 0x77, 0x8b, 0xc7, 0x5b, 0x79, 0x58, 0xb3, 0xc1, 0xb6, 0xdf, 0x23, - 0x41, 0x78, 0xa9, 0x44, 0x0e, 0x6b, 0x82, 0x54, 0x1e, 0x3f, 0x5b, 0x0f, 0x80, 0xb5, 0x59, 0x44, - 0xae, 0xd5, 0xf9, 0x50, 0x00, 0x05, 0x97, 0x61, 0xed, 0x35, 0x28, 0xcb, 0x2f, 0xa4, 0xb2, 0x3c, - 0xe8, 0xa5, 0xb5, 0x33, 0x1e, 0x5d, 0x02, 0xc8, 0x5b, 0xa4, 0xd4, 0xf2, 0x4e, 0xae, 0xa1, 0x96, - 0x00, 0xeb, 0xa8, 0xd7, 0x6e, 0x82, 0xf6, 0x1c, 0x14, 0xc5, 0x16, 0xe8, 0xab, 0x25, 0x3c, 0x63, - 0x54, 0x37, 0x65, 0xe6, 0x2c, 0xef, 0xc0, 0xc1, 0xc6, 0x59, 0xad, 0x16, 0x6f, 0x80, 0x1a, 0x8d, - 0x2b, 0x43, 0xf3, 0xc6, 0xc6, 0xf6, 0xfb, 0xd9, 0xb8, 0xae, 0xb6, 0x9f, 0x9e, 0x4d, 0x4c, 0xf5, - 0x7c, 0x62, 0xaa, 0x7f, 0x26, 0xa6, 0xfa, 0x75, 0x6a, 0x2a, 0xe7, 0x53, 0x53, 0xf9, 0x35, 0x35, - 0x95, 0x37, 0x0f, 0x71, 0x90, 0x9c, 0x0c, 0x8e, 0xed, 0x2e, 0x25, 0x90, 0xf5, 0x83, 0xe8, 0x90, - 0xa0, 0x21, 0x5c, 0x3c, 0x1f, 0xe2, 0xc0, 0x64, 0x14, 0x21, 0x76, 0x5c, 0xcc, 0x3e, 0x75, 0x47, - 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x68, 0xff, 0x08, 0xa8, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // CreateMarkets creates markets from the given message. - CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) - // UpdateMarkets updates markets from the given message. - UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) - // Params defines a method for updating the x/marketmap module parameters. - Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) - // RemoveMarketAuthorities defines a method for removing market authorities - // from the x/marketmap module. the signer must be the admin. - RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateMarkets(ctx context.Context, in *MsgCreateMarkets, opts ...grpc.CallOption) (*MsgCreateMarketsResponse, error) { - out := new(MsgCreateMarketsResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Msg/CreateMarkets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateMarkets(ctx context.Context, in *MsgUpdateMarkets, opts ...grpc.CallOption) (*MsgUpdateMarketsResponse, error) { - out := new(MsgUpdateMarketsResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Msg/UpdateMarkets", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.CallOption) (*MsgParamsResponse, error) { - out := new(MsgParamsResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Msg/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RemoveMarketAuthorities(ctx context.Context, in *MsgRemoveMarketAuthorities, opts ...grpc.CallOption) (*MsgRemoveMarketAuthoritiesResponse, error) { - out := new(MsgRemoveMarketAuthoritiesResponse) - err := c.cc.Invoke(ctx, "/slinky.mm2.v1.Msg/RemoveMarketAuthorities", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // CreateMarkets creates markets from the given message. - CreateMarkets(context.Context, *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) - // UpdateMarkets updates markets from the given message. - UpdateMarkets(context.Context, *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) - // Params defines a method for updating the x/marketmap module parameters. - Params(context.Context, *MsgParams) (*MsgParamsResponse, error) - // RemoveMarketAuthorities defines a method for removing market authorities - // from the x/marketmap module. the signer must be the admin. - RemoveMarketAuthorities(context.Context, *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) CreateMarkets(ctx context.Context, req *MsgCreateMarkets) (*MsgCreateMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateMarkets not implemented") -} -func (*UnimplementedMsgServer) UpdateMarkets(ctx context.Context, req *MsgUpdateMarkets) (*MsgUpdateMarketsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMarkets not implemented") -} -func (*UnimplementedMsgServer) Params(ctx context.Context, req *MsgParams) (*MsgParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedMsgServer) RemoveMarketAuthorities(ctx context.Context, req *MsgRemoveMarketAuthorities) (*MsgRemoveMarketAuthoritiesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveMarketAuthorities not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_CreateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateMarkets) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Msg/CreateMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateMarkets(ctx, req.(*MsgCreateMarkets)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateMarkets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateMarkets) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateMarkets(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Msg/UpdateMarkets", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateMarkets(ctx, req.(*MsgUpdateMarkets)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Msg/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Params(ctx, req.(*MsgParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RemoveMarketAuthorities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRemoveMarketAuthorities) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RemoveMarketAuthorities(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/slinky.mm2.v1.Msg/RemoveMarketAuthorities", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RemoveMarketAuthorities(ctx, req.(*MsgRemoveMarketAuthorities)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "slinky.mm2.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateMarkets", - Handler: _Msg_CreateMarkets_Handler, - }, - { - MethodName: "UpdateMarkets", - Handler: _Msg_UpdateMarkets_Handler, - }, - { - MethodName: "Params", - Handler: _Msg_Params_Handler, - }, - { - MethodName: "RemoveMarketAuthorities", - Handler: _Msg_RemoveMarketAuthorities_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "slinky/mm2/v1/tx.proto", -} - -func (m *MsgCreateMarkets) 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 *MsgCreateMarkets) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateMarkets) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CreateMarkets) > 0 { - for iNdEx := len(m.CreateMarkets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CreateMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateMarketsResponse) 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 *MsgCreateMarketsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateMarkets) 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 *MsgUpdateMarkets) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateMarkets) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.UpdateMarkets) > 0 { - for iNdEx := len(m.UpdateMarkets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.UpdateMarkets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateMarketsResponse) 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 *MsgUpdateMarketsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateMarketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgParams) 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 *MsgParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgParamsResponse) 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 *MsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRemoveMarketAuthorities) 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 *MsgRemoveMarketAuthorities) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRemoveMarketAuthorities) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) - i-- - dAtA[i] = 0x12 - } - if len(m.RemoveAddresses) > 0 { - for iNdEx := len(m.RemoveAddresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RemoveAddresses[iNdEx]) - copy(dAtA[i:], m.RemoveAddresses[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.RemoveAddresses[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgRemoveMarketAuthoritiesResponse) 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 *MsgRemoveMarketAuthoritiesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRemoveMarketAuthoritiesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgCreateMarkets) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.CreateMarkets) > 0 { - for _, e := range m.CreateMarkets { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgCreateMarketsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateMarkets) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.UpdateMarkets) > 0 { - for _, e := range m.UpdateMarkets { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgUpdateMarketsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRemoveMarketAuthorities) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RemoveAddresses) > 0 { - for _, s := range m.RemoveAddresses { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRemoveMarketAuthoritiesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgCreateMarkets) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateMarkets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateMarkets: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreateMarkets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CreateMarkets = append(m.CreateMarkets, Market{}) - if err := m.CreateMarkets[len(m.CreateMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateMarketsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateMarketsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateMarkets) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateMarkets: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateMarkets: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateMarkets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.UpdateMarkets = append(m.UpdateMarkets, Market{}) - if err := m.UpdateMarkets[len(m.UpdateMarkets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateMarketsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateMarketsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateMarketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRemoveMarketAuthorities) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveMarketAuthorities: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveMarketAuthorities: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemoveAddresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RemoveAddresses = append(m.RemoveAddresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Admin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRemoveMarketAuthoritiesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRemoveMarketAuthoritiesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/oracle/keeper/grpc_query_test.go b/x/oracle/keeper/grpc_query_test.go index ba45f5f22..358339b74 100644 --- a/x/oracle/keeper/grpc_query_test.go +++ b/x/oracle/keeper/grpc_query_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/mock" slinkytypes "github.com/skip-mev/slinky/pkg/types" - marketmaptypes "github.com/skip-mev/slinky/x/mm2/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/skip-mev/slinky/x/oracle/keeper" "github.com/skip-mev/slinky/x/oracle/types" ) diff --git a/x/oracle/keeper/hooks.go b/x/oracle/keeper/hooks.go index 1c1f03f50..70423405d 100644 --- a/x/oracle/keeper/hooks.go +++ b/x/oracle/keeper/hooks.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" - mm2types "github.com/skip-mev/slinky/x/mm2/types" ) // Hooks is a wrapper struct around Keeper. @@ -14,58 +13,30 @@ type Hooks struct { k *Keeper } -var ( - _ marketmaptypes.MarketMapHooks = Hooks{} - _ mm2types.MarketMapHooks = Hooks{} -) +var _ marketmaptypes.MarketMapHooks = Hooks{} // Hooks returns registered hooks for x/oracle. func (k *Keeper) Hooks() Hooks { return Hooks{k} } -// LegacyAfterMarketCreated is the marketmap hook for x/oracle that is run after a market is created in -// the marketmap. After the market is created, a currency pair and its state are initialized in the -// oracle module. -func (h Hooks) LegacyAfterMarketCreated(ctx sdk.Context, ticker marketmaptypes.Ticker) error { - return h.k.CreateCurrencyPair(ctx, ticker.CurrencyPair) -} - -func (h Hooks) LegacyAfterMarketUpdated(_ sdk.Context, _ marketmaptypes.Ticker) error { - // TODO finish - - return nil -} - -// LegacyAfterMarketGenesis verifies that all tickers set in the x/marketmap genesis are registered in -// the x/oracle module. -func (h Hooks) LegacyAfterMarketGenesis(ctx sdk.Context, tickers map[string]marketmaptypes.Ticker) error { - for _, ticker := range tickers { - if !h.k.HasCurrencyPair(ctx, ticker.CurrencyPair) { - return fmt.Errorf("currency pair %s is registered in x/marketmap but not in x/oracle", ticker.String()) - } - } - - return nil -} - // AfterMarketCreated is the marketmap hook for x/oracle that is run after a market is created in // the marketmap. After the market is created, a currency pair and its state are initialized in the // oracle module. -func (h Hooks) AfterMarketCreated(ctx sdk.Context, market mm2types.Market) error { +func (h Hooks) AfterMarketCreated(ctx sdk.Context, market marketmaptypes.Market) error { return h.k.CreateCurrencyPair(ctx, market.Ticker.CurrencyPair) } // AfterMarketUpdated is the marketmap hook for x/oracle that is run after a market is updated in // the marketmap. -func (h Hooks) AfterMarketUpdated(_ sdk.Context, _ mm2types.Market) error { +func (h Hooks) AfterMarketUpdated(_ sdk.Context, _ marketmaptypes.Market) error { // TODO return nil } // AfterMarketGenesis verifies that all markets set in the x/marketmap genesis are registered in // the x/oracle module. -func (h Hooks) AfterMarketGenesis(ctx sdk.Context, markets map[string]mm2types.Market) error { +func (h Hooks) AfterMarketGenesis(ctx sdk.Context, markets map[string]marketmaptypes.Market) error { for _, market := range markets { if !h.k.HasCurrencyPair(ctx, market.Ticker.CurrencyPair) { return fmt.Errorf("currency pair %s is registered in x/marketmap but not in x/oracle", market.Ticker.String()) diff --git a/x/oracle/module.go b/x/oracle/module.go index f03bbe8f0..1b65da94e 100644 --- a/x/oracle/module.go +++ b/x/oracle/module.go @@ -18,7 +18,7 @@ import ( "github.com/spf13/cobra" oraclemodulev1 "github.com/skip-mev/slinky/api/slinky/oracle/module/v1" - marketmaptypes "github.com/skip-mev/slinky/x/mm2/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/skip-mev/slinky/x/oracle/client/cli" "github.com/skip-mev/slinky/x/oracle/keeper" "github.com/skip-mev/slinky/x/oracle/types" diff --git a/x/oracle/types/expected_keepers.go b/x/oracle/types/expected_keepers.go index 5508f2a19..63f99b46c 100644 --- a/x/oracle/types/expected_keepers.go +++ b/x/oracle/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/slinky/x/mm2/types" + "github.com/skip-mev/slinky/x/marketmap/types" ) // MarketMapKeeper is the expected keeper interface for the market map keeper. diff --git a/x/oracle/types/mocks/market_map_keeper.go b/x/oracle/types/mocks/market_map_keeper.go index 6cf95738c..0a32d0941 100644 --- a/x/oracle/types/mocks/market_map_keeper.go +++ b/x/oracle/types/mocks/market_map_keeper.go @@ -5,7 +5,7 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - mm2types "github.com/skip-mev/slinky/x/mm2/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" types "github.com/cosmos/cosmos-sdk/types" ) @@ -16,22 +16,22 @@ type MarketMapKeeper struct { } // GetMarket provides a mock function with given fields: ctx, tickerStr -func (_m *MarketMapKeeper) GetMarket(ctx types.Context, tickerStr string) (mm2types.Market, error) { +func (_m *MarketMapKeeper) GetMarket(ctx types.Context, tickerStr string) (marketmaptypes.Market, error) { ret := _m.Called(ctx, tickerStr) if len(ret) == 0 { panic("no return value specified for GetMarket") } - var r0 mm2types.Market + var r0 marketmaptypes.Market var r1 error - if rf, ok := ret.Get(0).(func(types.Context, string) (mm2types.Market, error)); ok { + if rf, ok := ret.Get(0).(func(types.Context, string) (marketmaptypes.Market, error)); ok { return rf(ctx, tickerStr) } - if rf, ok := ret.Get(0).(func(types.Context, string) mm2types.Market); ok { + if rf, ok := ret.Get(0).(func(types.Context, string) marketmaptypes.Market); ok { r0 = rf(ctx, tickerStr) } else { - r0 = ret.Get(0).(mm2types.Market) + r0 = ret.Get(0).(marketmaptypes.Market) } if rf, ok := ret.Get(1).(func(types.Context, string) error); ok {