diff --git a/api/sunrise/liquiditypool/pool.pulsar.go b/api/sunrise/liquiditypool/pool.pulsar.go index 6fd8c8ab..fc8bfc78 100644 --- a/api/sunrise/liquiditypool/pool.pulsar.go +++ b/api/sunrise/liquiditypool/pool.pulsar.go @@ -868,12 +868,16 @@ func (x *fastReflection_Pool) ProtoMethods() *protoiface.Methods { } var ( - md_TickParams protoreflect.MessageDescriptor + md_TickParams protoreflect.MessageDescriptor + fd_TickParams_price_ratio protoreflect.FieldDescriptor + fd_TickParams_base_offset protoreflect.FieldDescriptor ) func init() { file_sunrise_liquiditypool_pool_proto_init() md_TickParams = File_sunrise_liquiditypool_pool_proto.Messages().ByName("TickParams") + fd_TickParams_price_ratio = md_TickParams.Fields().ByName("price_ratio") + fd_TickParams_base_offset = md_TickParams.Fields().ByName("base_offset") } var _ protoreflect.Message = (*fastReflection_TickParams)(nil) @@ -941,6 +945,18 @@ func (x *fastReflection_TickParams) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_TickParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PriceRatio != "" { + value := protoreflect.ValueOfString(x.PriceRatio) + if !f(fd_TickParams_price_ratio, value) { + return + } + } + if x.BaseOffset != "" { + value := protoreflect.ValueOfString(x.BaseOffset) + if !f(fd_TickParams_base_offset, value) { + return + } + } } // Has reports whether a field is populated. @@ -956,6 +972,10 @@ func (x *fastReflection_TickParams) Range(f func(protoreflect.FieldDescriptor, p // a repeated field is populated if it is non-empty. func (x *fastReflection_TickParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + return x.PriceRatio != "" + case "sunrise.liquiditypool.TickParams.base_offset": + return x.BaseOffset != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -972,6 +992,10 @@ func (x *fastReflection_TickParams) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TickParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + x.PriceRatio = "" + case "sunrise.liquiditypool.TickParams.base_offset": + x.BaseOffset = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -988,6 +1012,12 @@ func (x *fastReflection_TickParams) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_TickParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + value := x.PriceRatio + return protoreflect.ValueOfString(value) + case "sunrise.liquiditypool.TickParams.base_offset": + value := x.BaseOffset + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -1008,6 +1038,10 @@ func (x *fastReflection_TickParams) Get(descriptor protoreflect.FieldDescriptor) // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TickParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + x.PriceRatio = value.Interface().(string) + case "sunrise.liquiditypool.TickParams.base_offset": + x.BaseOffset = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -1028,6 +1062,10 @@ func (x *fastReflection_TickParams) Set(fd protoreflect.FieldDescriptor, value p // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TickParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + panic(fmt.Errorf("field price_ratio of message sunrise.liquiditypool.TickParams is not mutable")) + case "sunrise.liquiditypool.TickParams.base_offset": + panic(fmt.Errorf("field base_offset of message sunrise.liquiditypool.TickParams is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -1041,6 +1079,10 @@ func (x *fastReflection_TickParams) Mutable(fd protoreflect.FieldDescriptor) pro // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_TickParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "sunrise.liquiditypool.TickParams.price_ratio": + return protoreflect.ValueOfString("") + case "sunrise.liquiditypool.TickParams.base_offset": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: sunrise.liquiditypool.TickParams")) @@ -1110,6 +1152,14 @@ func (x *fastReflection_TickParams) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.PriceRatio) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BaseOffset) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1139,6 +1189,20 @@ func (x *fastReflection_TickParams) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.BaseOffset) > 0 { + i -= len(x.BaseOffset) + copy(dAtA[i:], x.BaseOffset) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BaseOffset))) + i-- + dAtA[i] = 0x12 + } + if len(x.PriceRatio) > 0 { + i -= len(x.PriceRatio) + copy(dAtA[i:], x.PriceRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PriceRatio))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1188,6 +1252,70 @@ func (x *fastReflection_TickParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TickParams: 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 PriceRatio", 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.PriceRatio = 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 BaseOffset", 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.BaseOffset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1327,10 +1455,14 @@ func (x *Pool) GetCurrentSqrtPrice() string { return "" } +// PriceRatio^(Tick - BaseOffSet) type TickParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + PriceRatio string `protobuf:"bytes,1,opt,name=price_ratio,json=priceRatio,proto3" json:"price_ratio,omitempty"` + BaseOffset string `protobuf:"bytes,2,opt,name=base_offset,json=baseOffset,proto3" json:"base_offset,omitempty"` } func (x *TickParams) Reset() { @@ -1353,6 +1485,20 @@ func (*TickParams) Descriptor() ([]byte, []int) { return file_sunrise_liquiditypool_pool_proto_rawDescGZIP(), []int{1} } +func (x *TickParams) GetPriceRatio() string { + if x != nil { + return x.PriceRatio + } + return "" +} + +func (x *TickParams) GetBaseOffset() string { + if x != nil { + return x.BaseOffset + } + return "" +} + var File_sunrise_liquiditypool_pool_proto protoreflect.FileDescriptor var file_sunrise_liquiditypool_pool_proto_rawDesc = []byte{ @@ -1397,20 +1543,31 @@ var file_sunrise_liquiditypool_pool_proto_rawDesc = []byte{ 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x71, 0x72, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, - 0x0c, 0x0a, 0x0a, 0x54, 0x69, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc3, 0x01, - 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, 0x2e, 0x6c, 0x69, - 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0x09, 0x50, 0x6f, 0x6f, - 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x6e, 0x72, 0x69, - 0x73, 0x65, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, - 0xa2, 0x02, 0x03, 0x53, 0x4c, 0x58, 0xaa, 0x02, 0x15, 0x53, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, - 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0xca, 0x02, - 0x15, 0x53, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, 0x5c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, - 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0xe2, 0x02, 0x21, 0x53, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, - 0x5c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x53, 0x75, 0x6e, - 0x72, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, - 0x6f, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xbe, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x57, + 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, + 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x57, 0x0a, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x5f, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, + 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x42, 0xc3, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, + 0x2e, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0x42, 0x09, + 0x50, 0x6f, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, + 0x6e, 0x72, 0x69, 0x73, 0x65, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, + 0x6f, 0x6f, 0x6c, 0xa2, 0x02, 0x03, 0x53, 0x4c, 0x58, 0xaa, 0x02, 0x15, 0x53, 0x75, 0x6e, 0x72, + 0x69, 0x73, 0x65, 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, + 0x6c, 0xca, 0x02, 0x15, 0x53, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, 0x5c, 0x4c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0xe2, 0x02, 0x21, 0x53, 0x75, 0x6e, 0x72, + 0x69, 0x73, 0x65, 0x5c, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x70, 0x6f, 0x6f, + 0x6c, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, + 0x53, 0x75, 0x6e, 0x72, 0x69, 0x73, 0x65, 0x3a, 0x3a, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, + 0x74, 0x79, 0x70, 0x6f, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/sunrise/liquiditypool/pool.proto b/proto/sunrise/liquiditypool/pool.proto index b5702827..2fd2d05e 100644 --- a/proto/sunrise/liquiditypool/pool.proto +++ b/proto/sunrise/liquiditypool/pool.proto @@ -13,30 +13,40 @@ message Pool { string denom_base = 2; string denom_quote = 3; string fee_rate = 4 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - TickParams tick_params = 5 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + TickParams tick_params = 5 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; int64 current_tick = 6; string current_tick_liquidity = 7 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; string current_sqrt_price = 8 [ - (cosmos_proto.scalar) = "cosmos.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } +// PriceRatio^(Tick - BaseOffSet) message TickParams { - -} \ No newline at end of file + string price_ratio = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + string base_offset = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/x/liquiditypool/types/errors.go b/x/liquiditypool/types/errors.go index 0982fe0e..fd2cbcb4 100644 --- a/x/liquiditypool/types/errors.go +++ b/x/liquiditypool/types/errors.go @@ -8,6 +8,8 @@ import ( // x/liquiditypool module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrPoolNotFound = sdkerrors.Register(ModuleName, 1101, "pool not found") + ErrInvalidBaseDenom = sdkerrors.Register(ModuleName, 1102, "invalid base denom") + ErrInvalidQuoteDenom = sdkerrors.Register(ModuleName, 1103, "invalid quote denom") ) diff --git a/x/liquiditypool/types/pool.pb.go b/x/liquiditypool/types/pool.pb.go index b3c89ea3..ccc59788 100644 --- a/x/liquiditypool/types/pool.pb.go +++ b/x/liquiditypool/types/pool.pb.go @@ -106,7 +106,10 @@ func (m *Pool) GetCurrentTick() int64 { return 0 } +// PriceRatio^(Tick - BaseOffSet) type TickParams struct { + PriceRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=price_ratio,json=priceRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price_ratio"` + BaseOffset cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=base_offset,json=baseOffset,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_offset"` } func (m *TickParams) Reset() { *m = TickParams{} } @@ -150,35 +153,38 @@ func init() { func init() { proto.RegisterFile("sunrise/liquiditypool/pool.proto", fileDescriptor_b5e900f89b7804df) } var fileDescriptor_b5e900f89b7804df = []byte{ - // 441 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0x26, 0xa1, 0x6d, 0x36, 0x15, 0x82, 0x55, 0x41, 0x4b, 0x11, 0x8e, 0xdb, 0x53, 0x84, - 0x84, 0x57, 0x05, 0xc1, 0x07, 0x44, 0x3d, 0x16, 0x91, 0x1a, 0x4e, 0x5c, 0xac, 0xcd, 0x7a, 0x9a, - 0xae, 0x62, 0x7b, 0x9d, 0xdd, 0x35, 0x22, 0x7f, 0xc1, 0x67, 0x70, 0xe4, 0xc0, 0x47, 0xf4, 0x58, - 0x71, 0x42, 0x1c, 0x2a, 0x94, 0x1c, 0x38, 0xf2, 0x0b, 0x68, 0xbd, 0x4e, 0x15, 0x10, 0xb7, 0x5c, - 0x56, 0x9e, 0xf7, 0xde, 0xbc, 0xe7, 0x19, 0x0d, 0x0e, 0x4d, 0x55, 0x68, 0x69, 0x80, 0x65, 0x72, - 0x5e, 0xc9, 0x54, 0xda, 0x45, 0xa9, 0x54, 0xc6, 0xdc, 0x13, 0x95, 0x5a, 0x59, 0x45, 0x1e, 0x34, - 0x8a, 0xe8, 0x2f, 0xc5, 0xe1, 0x7d, 0x9e, 0xcb, 0x42, 0xb1, 0xfa, 0xf5, 0xca, 0xc3, 0x47, 0x42, - 0x99, 0x5c, 0x99, 0xa4, 0xae, 0x98, 0x2f, 0x1a, 0xea, 0x60, 0xaa, 0xa6, 0xca, 0xe3, 0xee, 0xab, - 0x41, 0x03, 0xa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c3, 0x0f, 0x37, 0x25, 0xc9, 0x6d, 0x04, - 0xdd, 0xdd, 0x6a, 0xa4, 0x83, 0x8d, 0x90, 0xb3, 0xb5, 0x27, 0x49, 0x31, 0x59, 0xa7, 0x99, 0xb9, - 0xb6, 0x49, 0xa9, 0xa5, 0x00, 0xba, 0xb7, 0x55, 0xd2, 0xbd, 0xc6, 0xf1, 0xed, 0x5c, 0xdb, 0xb1, - 0xf3, 0x3b, 0xde, 0xc7, 0x78, 0x63, 0x37, 0x6f, 0xae, 0x96, 0x01, 0xba, 0x5e, 0x06, 0xe8, 0xe7, - 0x32, 0x40, 0x9f, 0x56, 0x41, 0xeb, 0x7a, 0x15, 0xb4, 0xbe, 0xaf, 0x82, 0xd6, 0xfb, 0x97, 0x53, - 0x69, 0x2f, 0xab, 0x49, 0x24, 0x54, 0xce, 0x9a, 0x15, 0x67, 0x7c, 0x01, 0x7a, 0x5d, 0xb0, 0x8f, - 0xff, 0x1c, 0xb4, 0x5d, 0x94, 0x60, 0x26, 0x3b, 0xf5, 0x5d, 0xbd, 0xf8, 0x13, 0x00, 0x00, 0xff, - 0xff, 0x2e, 0x09, 0x11, 0xcb, 0xf6, 0x02, 0x00, 0x00, + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x31, 0x6f, 0x13, 0x31, + 0x18, 0x8d, 0x93, 0xd0, 0x36, 0x0e, 0x42, 0x60, 0x15, 0x74, 0x14, 0x71, 0x49, 0x3b, 0x45, 0x48, + 0x9c, 0x55, 0x10, 0xfc, 0x80, 0xa8, 0x63, 0x51, 0xd3, 0x03, 0x09, 0x89, 0xe5, 0xe4, 0xf8, 0xbe, + 0xa4, 0x56, 0xee, 0xce, 0x17, 0xdb, 0x87, 0xc8, 0xbf, 0xe0, 0x67, 0x30, 0x32, 0x30, 0x33, 0x77, + 0xac, 0x98, 0x10, 0x43, 0x85, 0x92, 0x81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 0x55, 0xd8, 0x78, 0xf7, 0x62, 0x2a, 0xcc, 0x49, 0x35, 0x8e, 0xb8, 0xcc, 0x69, 0x3d, + 0x15, 0x19, 0x5b, 0x80, 0x5a, 0x17, 0xf4, 0xc3, 0x7f, 0x6f, 0xd0, 0x2c, 0x4a, 0xd0, 0xe3, 0x0d, + 0xf7, 0x14, 0x9e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x27, 0xd9, 0x6f, 0xf6, 0xa9, 0x03, 0x00, + 0x00, } func (m *Pool) Marshal() (dAtA []byte, err error) { @@ -288,6 +294,26 @@ func (m *TickParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.BaseOffset.Size() + i -= size + if _, err := m.BaseOffset.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.PriceRatio.Size() + i -= size + if _, err := m.PriceRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintPool(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -339,6 +365,10 @@ func (m *TickParams) Size() (n int) { } var l int _ = l + l = m.PriceRatio.Size() + n += 1 + l + sovPool(uint64(l)) + l = m.BaseOffset.Size() + n += 1 + l + sovPool(uint64(l)) return n } @@ -664,6 +694,74 @@ func (m *TickParams) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: TickParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PriceRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPool + } + 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 ErrInvalidLengthPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PriceRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseOffset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPool + } + 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 ErrInvalidLengthPool + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPool + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BaseOffset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPool(dAtA[iNdEx:])