diff --git a/api/gluon/contract/lazy_contract.pulsar.go b/api/gluon/contract/lazy_contract.pulsar.go index dffd74e..ec508eb 100644 --- a/api/gluon/contract/lazy_contract.pulsar.go +++ b/api/gluon/contract/lazy_contract.pulsar.go @@ -23,10 +23,10 @@ var ( fd_LazyContract_seller protoreflect.FieldDescriptor fd_LazyContract_denom_base protoreflect.FieldDescriptor fd_LazyContract_denom_quote protoreflect.FieldDescriptor - fd_LazyContract_amount_pending_buyer protoreflect.FieldDescriptor - fd_LazyContract_amount_pending_seller protoreflect.FieldDescriptor fd_LazyContract_amount_escrow_buyer protoreflect.FieldDescriptor fd_LazyContract_amount_escrow_seller protoreflect.FieldDescriptor + fd_LazyContract_amount_pending_buyer protoreflect.FieldDescriptor + fd_LazyContract_amount_pending_seller protoreflect.FieldDescriptor fd_LazyContract_expiry protoreflect.FieldDescriptor ) @@ -38,10 +38,10 @@ func init() { fd_LazyContract_seller = md_LazyContract.Fields().ByName("seller") fd_LazyContract_denom_base = md_LazyContract.Fields().ByName("denom_base") fd_LazyContract_denom_quote = md_LazyContract.Fields().ByName("denom_quote") - fd_LazyContract_amount_pending_buyer = md_LazyContract.Fields().ByName("amount_pending_buyer") - fd_LazyContract_amount_pending_seller = md_LazyContract.Fields().ByName("amount_pending_seller") fd_LazyContract_amount_escrow_buyer = md_LazyContract.Fields().ByName("amount_escrow_buyer") fd_LazyContract_amount_escrow_seller = md_LazyContract.Fields().ByName("amount_escrow_seller") + fd_LazyContract_amount_pending_buyer = md_LazyContract.Fields().ByName("amount_pending_buyer") + fd_LazyContract_amount_pending_seller = md_LazyContract.Fields().ByName("amount_pending_seller") fd_LazyContract_expiry = md_LazyContract.Fields().ByName("expiry") } @@ -140,18 +140,6 @@ func (x *fastReflection_LazyContract) Range(f func(protoreflect.FieldDescriptor, return } } - if x.AmountPendingBuyer != "" { - value := protoreflect.ValueOfString(x.AmountPendingBuyer) - if !f(fd_LazyContract_amount_pending_buyer, value) { - return - } - } - if x.AmountPendingSeller != "" { - value := protoreflect.ValueOfString(x.AmountPendingSeller) - if !f(fd_LazyContract_amount_pending_seller, value) { - return - } - } if x.AmountEscrowBuyer != "" { value := protoreflect.ValueOfString(x.AmountEscrowBuyer) if !f(fd_LazyContract_amount_escrow_buyer, value) { @@ -164,6 +152,18 @@ func (x *fastReflection_LazyContract) Range(f func(protoreflect.FieldDescriptor, return } } + if x.AmountPendingBuyer != "" { + value := protoreflect.ValueOfString(x.AmountPendingBuyer) + if !f(fd_LazyContract_amount_pending_buyer, value) { + return + } + } + if x.AmountPendingSeller != "" { + value := protoreflect.ValueOfString(x.AmountPendingSeller) + if !f(fd_LazyContract_amount_pending_seller, value) { + return + } + } if x.Expiry != nil { value := protoreflect.ValueOfMessage(x.Expiry.ProtoReflect()) if !f(fd_LazyContract_expiry, value) { @@ -195,14 +195,14 @@ func (x *fastReflection_LazyContract) Has(fd protoreflect.FieldDescriptor) bool return x.DenomBase != "" case "gluon.contract.LazyContract.denom_quote": return x.DenomQuote != "" - case "gluon.contract.LazyContract.amount_pending_buyer": - return x.AmountPendingBuyer != "" - case "gluon.contract.LazyContract.amount_pending_seller": - return x.AmountPendingSeller != "" case "gluon.contract.LazyContract.amount_escrow_buyer": return x.AmountEscrowBuyer != "" case "gluon.contract.LazyContract.amount_escrow_seller": return x.AmountEscrowSeller != "" + case "gluon.contract.LazyContract.amount_pending_buyer": + return x.AmountPendingBuyer != "" + case "gluon.contract.LazyContract.amount_pending_seller": + return x.AmountPendingSeller != "" case "gluon.contract.LazyContract.expiry": return x.Expiry != nil default: @@ -231,14 +231,14 @@ func (x *fastReflection_LazyContract) Clear(fd protoreflect.FieldDescriptor) { x.DenomBase = "" case "gluon.contract.LazyContract.denom_quote": x.DenomQuote = "" - case "gluon.contract.LazyContract.amount_pending_buyer": - x.AmountPendingBuyer = "" - case "gluon.contract.LazyContract.amount_pending_seller": - x.AmountPendingSeller = "" case "gluon.contract.LazyContract.amount_escrow_buyer": x.AmountEscrowBuyer = "" case "gluon.contract.LazyContract.amount_escrow_seller": x.AmountEscrowSeller = "" + case "gluon.contract.LazyContract.amount_pending_buyer": + x.AmountPendingBuyer = "" + case "gluon.contract.LazyContract.amount_pending_seller": + x.AmountPendingSeller = "" case "gluon.contract.LazyContract.expiry": x.Expiry = nil default: @@ -272,18 +272,18 @@ func (x *fastReflection_LazyContract) Get(descriptor protoreflect.FieldDescripto case "gluon.contract.LazyContract.denom_quote": value := x.DenomQuote return protoreflect.ValueOfString(value) - case "gluon.contract.LazyContract.amount_pending_buyer": - value := x.AmountPendingBuyer - return protoreflect.ValueOfString(value) - case "gluon.contract.LazyContract.amount_pending_seller": - value := x.AmountPendingSeller - return protoreflect.ValueOfString(value) case "gluon.contract.LazyContract.amount_escrow_buyer": value := x.AmountEscrowBuyer return protoreflect.ValueOfString(value) case "gluon.contract.LazyContract.amount_escrow_seller": value := x.AmountEscrowSeller return protoreflect.ValueOfString(value) + case "gluon.contract.LazyContract.amount_pending_buyer": + value := x.AmountPendingBuyer + return protoreflect.ValueOfString(value) + case "gluon.contract.LazyContract.amount_pending_seller": + value := x.AmountPendingSeller + return protoreflect.ValueOfString(value) case "gluon.contract.LazyContract.expiry": value := x.Expiry return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -317,14 +317,14 @@ func (x *fastReflection_LazyContract) Set(fd protoreflect.FieldDescriptor, value x.DenomBase = value.Interface().(string) case "gluon.contract.LazyContract.denom_quote": x.DenomQuote = value.Interface().(string) - case "gluon.contract.LazyContract.amount_pending_buyer": - x.AmountPendingBuyer = value.Interface().(string) - case "gluon.contract.LazyContract.amount_pending_seller": - x.AmountPendingSeller = value.Interface().(string) case "gluon.contract.LazyContract.amount_escrow_buyer": x.AmountEscrowBuyer = value.Interface().(string) case "gluon.contract.LazyContract.amount_escrow_seller": x.AmountEscrowSeller = value.Interface().(string) + case "gluon.contract.LazyContract.amount_pending_buyer": + x.AmountPendingBuyer = value.Interface().(string) + case "gluon.contract.LazyContract.amount_pending_seller": + x.AmountPendingSeller = value.Interface().(string) case "gluon.contract.LazyContract.expiry": x.Expiry = value.Message().Interface().(*timestamppb.Timestamp) default: @@ -362,14 +362,14 @@ func (x *fastReflection_LazyContract) Mutable(fd protoreflect.FieldDescriptor) p panic(fmt.Errorf("field denom_base of message gluon.contract.LazyContract is not mutable")) case "gluon.contract.LazyContract.denom_quote": panic(fmt.Errorf("field denom_quote of message gluon.contract.LazyContract is not mutable")) - case "gluon.contract.LazyContract.amount_pending_buyer": - panic(fmt.Errorf("field amount_pending_buyer of message gluon.contract.LazyContract is not mutable")) - case "gluon.contract.LazyContract.amount_pending_seller": - panic(fmt.Errorf("field amount_pending_seller of message gluon.contract.LazyContract is not mutable")) case "gluon.contract.LazyContract.amount_escrow_buyer": panic(fmt.Errorf("field amount_escrow_buyer of message gluon.contract.LazyContract is not mutable")) case "gluon.contract.LazyContract.amount_escrow_seller": panic(fmt.Errorf("field amount_escrow_seller of message gluon.contract.LazyContract is not mutable")) + case "gluon.contract.LazyContract.amount_pending_buyer": + panic(fmt.Errorf("field amount_pending_buyer of message gluon.contract.LazyContract is not mutable")) + case "gluon.contract.LazyContract.amount_pending_seller": + panic(fmt.Errorf("field amount_pending_seller of message gluon.contract.LazyContract is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.LazyContract")) @@ -393,14 +393,14 @@ func (x *fastReflection_LazyContract) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfString("") case "gluon.contract.LazyContract.denom_quote": return protoreflect.ValueOfString("") - case "gluon.contract.LazyContract.amount_pending_buyer": - return protoreflect.ValueOfString("") - case "gluon.contract.LazyContract.amount_pending_seller": - return protoreflect.ValueOfString("") case "gluon.contract.LazyContract.amount_escrow_buyer": return protoreflect.ValueOfString("") case "gluon.contract.LazyContract.amount_escrow_seller": return protoreflect.ValueOfString("") + case "gluon.contract.LazyContract.amount_pending_buyer": + return protoreflect.ValueOfString("") + case "gluon.contract.LazyContract.amount_pending_seller": + return protoreflect.ValueOfString("") case "gluon.contract.LazyContract.expiry": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -492,19 +492,19 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AmountPendingBuyer) + l = len(x.AmountEscrowBuyer) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AmountPendingSeller) + l = len(x.AmountEscrowSeller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AmountEscrowBuyer) + l = len(x.AmountPendingBuyer) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AmountEscrowSeller) + l = len(x.AmountPendingSeller) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -555,32 +555,32 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x52 } - if len(x.AmountEscrowSeller) > 0 { - i -= len(x.AmountEscrowSeller) - copy(dAtA[i:], x.AmountEscrowSeller) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountEscrowSeller))) - i-- - dAtA[i] = 0x4a - } - if len(x.AmountEscrowBuyer) > 0 { - i -= len(x.AmountEscrowBuyer) - copy(dAtA[i:], x.AmountEscrowBuyer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountEscrowBuyer))) - i-- - dAtA[i] = 0x42 - } if len(x.AmountPendingSeller) > 0 { i -= len(x.AmountPendingSeller) copy(dAtA[i:], x.AmountPendingSeller) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountPendingSeller))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x4a } if len(x.AmountPendingBuyer) > 0 { i -= len(x.AmountPendingBuyer) copy(dAtA[i:], x.AmountPendingBuyer) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountPendingBuyer))) i-- + dAtA[i] = 0x42 + } + if len(x.AmountEscrowSeller) > 0 { + i -= len(x.AmountEscrowSeller) + copy(dAtA[i:], x.AmountEscrowSeller) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountEscrowSeller))) + i-- + dAtA[i] = 0x3a + } + if len(x.AmountEscrowBuyer) > 0 { + i -= len(x.AmountEscrowBuyer) + copy(dAtA[i:], x.AmountEscrowBuyer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AmountEscrowBuyer))) + i-- dAtA[i] = 0x32 } if len(x.DenomQuote) > 0 { @@ -814,7 +814,7 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountPendingBuyer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowBuyer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -842,11 +842,11 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AmountPendingBuyer = string(dAtA[iNdEx:postIndex]) + x.AmountEscrowBuyer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountPendingSeller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowSeller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -874,11 +874,11 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AmountPendingSeller = string(dAtA[iNdEx:postIndex]) + x.AmountEscrowSeller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowBuyer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountPendingBuyer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -906,11 +906,11 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AmountEscrowBuyer = string(dAtA[iNdEx:postIndex]) + x.AmountPendingBuyer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowSeller", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AmountPendingSeller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -938,7 +938,7 @@ func (x *fastReflection_LazyContract) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.AmountEscrowSeller = string(dAtA[iNdEx:postIndex]) + x.AmountPendingSeller = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { @@ -1034,10 +1034,10 @@ type LazyContract struct { Seller string `protobuf:"bytes,3,opt,name=seller,proto3" json:"seller,omitempty"` DenomBase string `protobuf:"bytes,4,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` DenomQuote string `protobuf:"bytes,5,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` - AmountPendingBuyer string `protobuf:"bytes,6,opt,name=amount_pending_buyer,json=amountPendingBuyer,proto3" json:"amount_pending_buyer,omitempty"` - AmountPendingSeller string `protobuf:"bytes,7,opt,name=amount_pending_seller,json=amountPendingSeller,proto3" json:"amount_pending_seller,omitempty"` - AmountEscrowBuyer string `protobuf:"bytes,8,opt,name=amount_escrow_buyer,json=amountEscrowBuyer,proto3" json:"amount_escrow_buyer,omitempty"` - AmountEscrowSeller string `protobuf:"bytes,9,opt,name=amount_escrow_seller,json=amountEscrowSeller,proto3" json:"amount_escrow_seller,omitempty"` + AmountEscrowBuyer string `protobuf:"bytes,6,opt,name=amount_escrow_buyer,json=amountEscrowBuyer,proto3" json:"amount_escrow_buyer,omitempty"` + AmountEscrowSeller string `protobuf:"bytes,7,opt,name=amount_escrow_seller,json=amountEscrowSeller,proto3" json:"amount_escrow_seller,omitempty"` + AmountPendingBuyer string `protobuf:"bytes,8,opt,name=amount_pending_buyer,json=amountPendingBuyer,proto3" json:"amount_pending_buyer,omitempty"` + AmountPendingSeller string `protobuf:"bytes,9,opt,name=amount_pending_seller,json=amountPendingSeller,proto3" json:"amount_pending_seller,omitempty"` Expiry *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=expiry,proto3" json:"expiry,omitempty"` } @@ -1096,30 +1096,30 @@ func (x *LazyContract) GetDenomQuote() string { return "" } -func (x *LazyContract) GetAmountPendingBuyer() string { +func (x *LazyContract) GetAmountEscrowBuyer() string { if x != nil { - return x.AmountPendingBuyer + return x.AmountEscrowBuyer } return "" } -func (x *LazyContract) GetAmountPendingSeller() string { +func (x *LazyContract) GetAmountEscrowSeller() string { if x != nil { - return x.AmountPendingSeller + return x.AmountEscrowSeller } return "" } -func (x *LazyContract) GetAmountEscrowBuyer() string { +func (x *LazyContract) GetAmountPendingBuyer() string { if x != nil { - return x.AmountEscrowBuyer + return x.AmountPendingBuyer } return "" } -func (x *LazyContract) GetAmountEscrowSeller() string { +func (x *LazyContract) GetAmountPendingSeller() string { if x != nil { - return x.AmountEscrowSeller + return x.AmountPendingSeller } return "" } @@ -1152,32 +1152,32 @@ var file_gluon_contract_lazy_contract_proto_rawDesc = []byte{ 0x6d, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x61, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x62, 0x0a, 0x14, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x75, 0x79, 0x65, 0x72, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, - 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x65, 0x72, 0x12, 0x64, 0x0a, 0x15, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x73, - 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x6c, - 0x65, 0x72, 0x12, 0x60, 0x0a, 0x13, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x65, 0x73, 0x63, - 0x72, 0x6f, 0x77, 0x5f, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x11, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x73, 0x63, 0x72, 0x6f, 0x77, 0x42, - 0x75, 0x79, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x14, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x65, - 0x73, 0x63, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, - 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x73, 0x63, 0x72, - 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, + 0x6e, 0x6f, 0x6d, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x60, 0x0a, 0x13, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x65, 0x73, 0x63, 0x72, 0x6f, 0x77, 0x5f, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x45, + 0x73, 0x63, 0x72, 0x6f, 0x77, 0x42, 0x75, 0x79, 0x65, 0x72, 0x12, 0x62, 0x0a, 0x14, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x65, 0x73, 0x63, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x65, 0x6c, 0x6c, + 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x45, 0x73, 0x63, 0x72, 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x62, + 0x0a, 0x14, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x5f, 0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, + 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x12, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, + 0x65, 0x72, 0x12, 0x64, 0x0a, 0x15, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x53, 0x65, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x06, diff --git a/api/gluon/contract/order.pulsar.go b/api/gluon/contract/order.pulsar.go index f6b41da..3f5f920 100644 --- a/api/gluon/contract/order.pulsar.go +++ b/api/gluon/contract/order.pulsar.go @@ -17,17 +17,18 @@ import ( ) var ( - md_Order protoreflect.MessageDescriptor - fd_Order_id protoreflect.FieldDescriptor - fd_Order_address protoreflect.FieldDescriptor - fd_Order_denom_base protoreflect.FieldDescriptor - fd_Order_denom_quote protoreflect.FieldDescriptor - fd_Order_direction protoreflect.FieldDescriptor - fd_Order_type protoreflect.FieldDescriptor - fd_Order_amount protoreflect.FieldDescriptor - fd_Order_limit_price protoreflect.FieldDescriptor - fd_Order_stop_price protoreflect.FieldDescriptor - fd_Order_expiry protoreflect.FieldDescriptor + md_Order protoreflect.MessageDescriptor + fd_Order_id protoreflect.FieldDescriptor + fd_Order_address protoreflect.FieldDescriptor + fd_Order_denom_base protoreflect.FieldDescriptor + fd_Order_denom_quote protoreflect.FieldDescriptor + fd_Order_direction protoreflect.FieldDescriptor + fd_Order_amount protoreflect.FieldDescriptor + fd_Order_limit_price protoreflect.FieldDescriptor + fd_Order_stop_price protoreflect.FieldDescriptor + fd_Order_expiry protoreflect.FieldDescriptor + fd_Order_lazy_contract protoreflect.FieldDescriptor + fd_Order_allow_lazy_counterparty protoreflect.FieldDescriptor ) func init() { @@ -38,11 +39,12 @@ func init() { fd_Order_denom_base = md_Order.Fields().ByName("denom_base") fd_Order_denom_quote = md_Order.Fields().ByName("denom_quote") fd_Order_direction = md_Order.Fields().ByName("direction") - fd_Order_type = md_Order.Fields().ByName("type") fd_Order_amount = md_Order.Fields().ByName("amount") fd_Order_limit_price = md_Order.Fields().ByName("limit_price") fd_Order_stop_price = md_Order.Fields().ByName("stop_price") fd_Order_expiry = md_Order.Fields().ByName("expiry") + fd_Order_lazy_contract = md_Order.Fields().ByName("lazy_contract") + fd_Order_allow_lazy_counterparty = md_Order.Fields().ByName("allow_lazy_counterparty") } var _ protoreflect.Message = (*fastReflection_Order)(nil) @@ -140,12 +142,6 @@ func (x *fastReflection_Order) Range(f func(protoreflect.FieldDescriptor, protor return } } - if x.Type_ != 0 { - value := protoreflect.ValueOfEnum((protoreflect.EnumNumber)(x.Type_)) - if !f(fd_Order_type, value) { - return - } - } if x.Amount != "" { value := protoreflect.ValueOfString(x.Amount) if !f(fd_Order_amount, value) { @@ -170,6 +166,18 @@ func (x *fastReflection_Order) Range(f func(protoreflect.FieldDescriptor, protor return } } + if x.LazyContract != false { + value := protoreflect.ValueOfBool(x.LazyContract) + if !f(fd_Order_lazy_contract, value) { + return + } + } + if x.AllowLazyCounterparty != false { + value := protoreflect.ValueOfBool(x.AllowLazyCounterparty) + if !f(fd_Order_allow_lazy_counterparty, value) { + return + } + } } // Has reports whether a field is populated. @@ -195,8 +203,6 @@ func (x *fastReflection_Order) Has(fd protoreflect.FieldDescriptor) bool { return x.DenomQuote != "" case "gluon.contract.Order.direction": return x.Direction != 0 - case "gluon.contract.Order.type": - return x.Type_ != 0 case "gluon.contract.Order.amount": return x.Amount != "" case "gluon.contract.Order.limit_price": @@ -205,6 +211,10 @@ func (x *fastReflection_Order) Has(fd protoreflect.FieldDescriptor) bool { return x.StopPrice != "" case "gluon.contract.Order.expiry": return x.Expiry != nil + case "gluon.contract.Order.lazy_contract": + return x.LazyContract != false + case "gluon.contract.Order.allow_lazy_counterparty": + return x.AllowLazyCounterparty != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -231,8 +241,6 @@ func (x *fastReflection_Order) Clear(fd protoreflect.FieldDescriptor) { x.DenomQuote = "" case "gluon.contract.Order.direction": x.Direction = 0 - case "gluon.contract.Order.type": - x.Type_ = 0 case "gluon.contract.Order.amount": x.Amount = "" case "gluon.contract.Order.limit_price": @@ -241,6 +249,10 @@ func (x *fastReflection_Order) Clear(fd protoreflect.FieldDescriptor) { x.StopPrice = "" case "gluon.contract.Order.expiry": x.Expiry = nil + case "gluon.contract.Order.lazy_contract": + x.LazyContract = false + case "gluon.contract.Order.allow_lazy_counterparty": + x.AllowLazyCounterparty = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -272,9 +284,6 @@ func (x *fastReflection_Order) Get(descriptor protoreflect.FieldDescriptor) prot case "gluon.contract.Order.direction": value := x.Direction return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "gluon.contract.Order.type": - value := x.Type_ - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) case "gluon.contract.Order.amount": value := x.Amount return protoreflect.ValueOfString(value) @@ -287,6 +296,12 @@ func (x *fastReflection_Order) Get(descriptor protoreflect.FieldDescriptor) prot case "gluon.contract.Order.expiry": value := x.Expiry return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "gluon.contract.Order.lazy_contract": + value := x.LazyContract + return protoreflect.ValueOfBool(value) + case "gluon.contract.Order.allow_lazy_counterparty": + value := x.AllowLazyCounterparty + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -317,8 +332,6 @@ func (x *fastReflection_Order) Set(fd protoreflect.FieldDescriptor, value protor x.DenomQuote = value.Interface().(string) case "gluon.contract.Order.direction": x.Direction = (OrderDirection)(value.Enum()) - case "gluon.contract.Order.type": - x.Type_ = (OrderType)(value.Enum()) case "gluon.contract.Order.amount": x.Amount = value.Interface().(string) case "gluon.contract.Order.limit_price": @@ -327,6 +340,10 @@ func (x *fastReflection_Order) Set(fd protoreflect.FieldDescriptor, value protor x.StopPrice = value.Interface().(string) case "gluon.contract.Order.expiry": x.Expiry = value.Message().Interface().(*timestamppb.Timestamp) + case "gluon.contract.Order.lazy_contract": + x.LazyContract = value.Bool() + case "gluon.contract.Order.allow_lazy_counterparty": + x.AllowLazyCounterparty = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -362,14 +379,16 @@ func (x *fastReflection_Order) Mutable(fd protoreflect.FieldDescriptor) protoref panic(fmt.Errorf("field denom_quote of message gluon.contract.Order is not mutable")) case "gluon.contract.Order.direction": panic(fmt.Errorf("field direction of message gluon.contract.Order is not mutable")) - case "gluon.contract.Order.type": - panic(fmt.Errorf("field type of message gluon.contract.Order is not mutable")) case "gluon.contract.Order.amount": panic(fmt.Errorf("field amount of message gluon.contract.Order is not mutable")) case "gluon.contract.Order.limit_price": panic(fmt.Errorf("field limit_price of message gluon.contract.Order is not mutable")) case "gluon.contract.Order.stop_price": panic(fmt.Errorf("field stop_price of message gluon.contract.Order is not mutable")) + case "gluon.contract.Order.lazy_contract": + panic(fmt.Errorf("field lazy_contract of message gluon.contract.Order is not mutable")) + case "gluon.contract.Order.allow_lazy_counterparty": + panic(fmt.Errorf("field allow_lazy_counterparty of message gluon.contract.Order is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -393,8 +412,6 @@ func (x *fastReflection_Order) NewField(fd protoreflect.FieldDescriptor) protore return protoreflect.ValueOfString("") case "gluon.contract.Order.direction": return protoreflect.ValueOfEnum(0) - case "gluon.contract.Order.type": - return protoreflect.ValueOfEnum(0) case "gluon.contract.Order.amount": return protoreflect.ValueOfString("") case "gluon.contract.Order.limit_price": @@ -404,6 +421,10 @@ func (x *fastReflection_Order) NewField(fd protoreflect.FieldDescriptor) protore case "gluon.contract.Order.expiry": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "gluon.contract.Order.lazy_contract": + return protoreflect.ValueOfBool(false) + case "gluon.contract.Order.allow_lazy_counterparty": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Order")) @@ -492,9 +513,6 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { if x.Direction != 0 { n += 1 + runtime.Sov(uint64(x.Direction)) } - if x.Type_ != 0 { - n += 1 + runtime.Sov(uint64(x.Type_)) - } l = len(x.Amount) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -511,6 +529,12 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { l = options.Size(x.Expiry) n += 1 + l + runtime.Sov(uint64(l)) } + if x.LazyContract { + n += 2 + } + if x.AllowLazyCounterparty { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -540,6 +564,26 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.AllowLazyCounterparty { + i-- + if x.AllowLazyCounterparty { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if x.LazyContract { + i-- + if x.LazyContract { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } if x.Expiry != nil { encoded, err := options.Marshal(x.Expiry) if err != nil { @@ -552,33 +596,28 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x4a } if len(x.StopPrice) > 0 { i -= len(x.StopPrice) copy(dAtA[i:], x.StopPrice) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StopPrice))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x42 } if len(x.LimitPrice) > 0 { i -= len(x.LimitPrice) copy(dAtA[i:], x.LimitPrice) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LimitPrice))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x3a } if len(x.Amount) > 0 { i -= len(x.Amount) copy(dAtA[i:], x.Amount) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) i-- - dAtA[i] = 0x3a - } - if x.Type_ != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Type_)) - i-- - dAtA[i] = 0x30 + dAtA[i] = 0x32 } if x.Direction != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Direction)) @@ -810,25 +849,6 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { } } case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) - } - x.Type_ = 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.Type_ |= OrderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -860,7 +880,7 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { } x.Amount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LimitPrice", wireType) } @@ -892,7 +912,7 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { } x.LimitPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StopPrice", wireType) } @@ -924,7 +944,7 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { } x.StopPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 9: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) } @@ -960,6 +980,46 @@ func (x *fastReflection_Order) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LazyContract", 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.LazyContract = bool(v != 0) + case 11: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AllowLazyCounterparty", 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.AllowLazyCounterparty = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1057,67 +1117,22 @@ func (OrderDirection) EnumDescriptor() ([]byte, []int) { return file_gluon_contract_order_proto_rawDescGZIP(), []int{0} } -type OrderType int32 - -const ( - OrderType_NORMAL OrderType = 0 - OrderType_LAZY OrderType = 1 -) - -// Enum value maps for OrderType. -var ( - OrderType_name = map[int32]string{ - 0: "NORMAL", - 1: "LAZY", - } - OrderType_value = map[string]int32{ - "NORMAL": 0, - "LAZY": 1, - } -) - -func (x OrderType) Enum() *OrderType { - p := new(OrderType) - *p = x - return p -} - -func (x OrderType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OrderType) Descriptor() protoreflect.EnumDescriptor { - return file_gluon_contract_order_proto_enumTypes[1].Descriptor() -} - -func (OrderType) Type() protoreflect.EnumType { - return &file_gluon_contract_order_proto_enumTypes[1] -} - -func (x OrderType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OrderType.Descriptor instead. -func (OrderType) EnumDescriptor() ([]byte, []int) { - return file_gluon_contract_order_proto_rawDescGZIP(), []int{1} -} - type Order struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - DenomBase string `protobuf:"bytes,3,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` - DenomQuote string `protobuf:"bytes,4,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` - Direction OrderDirection `protobuf:"varint,5,opt,name=direction,proto3,enum=gluon.contract.OrderDirection" json:"direction,omitempty"` - Type_ OrderType `protobuf:"varint,6,opt,name=type,proto3,enum=gluon.contract.OrderType" json:"type,omitempty"` - Amount string `protobuf:"bytes,7,opt,name=amount,proto3" json:"amount,omitempty"` - LimitPrice string `protobuf:"bytes,8,opt,name=limit_price,json=limitPrice,proto3" json:"limit_price,omitempty"` - StopPrice string `protobuf:"bytes,9,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` - Expiry *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=expiry,proto3" json:"expiry,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + DenomBase string `protobuf:"bytes,3,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` + DenomQuote string `protobuf:"bytes,4,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` + Direction OrderDirection `protobuf:"varint,5,opt,name=direction,proto3,enum=gluon.contract.OrderDirection" json:"direction,omitempty"` + Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` + LimitPrice string `protobuf:"bytes,7,opt,name=limit_price,json=limitPrice,proto3" json:"limit_price,omitempty"` + StopPrice string `protobuf:"bytes,8,opt,name=stop_price,json=stopPrice,proto3" json:"stop_price,omitempty"` + Expiry *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=expiry,proto3" json:"expiry,omitempty"` + LazyContract bool `protobuf:"varint,10,opt,name=lazy_contract,json=lazyContract,proto3" json:"lazy_contract,omitempty"` + AllowLazyCounterparty bool `protobuf:"varint,11,opt,name=allow_lazy_counterparty,json=allowLazyCounterparty,proto3" json:"allow_lazy_counterparty,omitempty"` } func (x *Order) Reset() { @@ -1175,13 +1190,6 @@ func (x *Order) GetDirection() OrderDirection { return OrderDirection_UNKNOWN } -func (x *Order) GetType_() OrderType { - if x != nil { - return x.Type_ - } - return OrderType_NORMAL -} - func (x *Order) GetAmount() string { if x != nil { return x.Amount @@ -1210,6 +1218,20 @@ func (x *Order) GetExpiry() *timestamppb.Timestamp { return nil } +func (x *Order) GetLazyContract() bool { + if x != nil { + return x.LazyContract + } + return false +} + +func (x *Order) GetAllowLazyCounterparty() bool { + if x != nil { + return x.AllowLazyCounterparty + } + return false +} + var File_gluon_contract_order_proto protoreflect.FileDescriptor var file_gluon_contract_order_proto_rawDesc = []byte{ @@ -1222,7 +1244,7 @@ var file_gluon_contract_order_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xb0, 0x04, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x6f, 0x22, 0xde, 0x04, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, @@ -1234,45 +1256,46 @@ var file_gluon_contract_order_proto_rawDesc = []byte{ 0x3c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6c, - 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x48, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, - 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, - 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, - 0x01, 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, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, - 0x55, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x01, 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, 0x09, 0x73, 0x74, 0x6f, - 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x06, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x79, 0x2a, 0x30, 0x0a, 0x0e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x55, 0x59, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x53, 0x45, 0x4c, 0x4c, 0x10, 0x02, 0x2a, 0x21, 0x0a, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x5a, 0x59, 0x10, 0x01, 0x42, 0x93, 0x01, 0x0a, 0x12, 0x63, 0x6f, - 0x6d, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x42, 0x0a, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x18, - 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xa2, 0x02, 0x03, 0x47, 0x43, 0x58, 0xaa, 0x02, - 0x0e, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xca, - 0x02, 0x0e, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0xe2, 0x02, 0x1a, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, - 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x57, 0x0a, 0x0b, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, + 0x1f, 0x01, 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, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x55, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x01, 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, 0x09, 0x73, 0x74, + 0x6f, 0x70, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x06, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x61, + 0x7a, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x61, 0x72, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x4c, 0x61, 0x7a, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x61, 0x72, + 0x74, 0x79, 0x2a, 0x30, 0x0a, 0x0e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x42, 0x55, 0x59, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, + 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x93, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6c, 0x75, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x0a, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x18, 0x67, 0x6c, 0x75, 0x6f, 0x6e, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0xa2, 0x02, 0x03, 0x47, 0x43, 0x58, 0xaa, 0x02, 0x0e, 0x47, 0x6c, 0x75, 0x6f, + 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xca, 0x02, 0x0e, 0x47, 0x6c, 0x75, + 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xe2, 0x02, 0x1a, 0x47, 0x6c, + 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x47, 0x6c, 0x75, 0x6f, 0x6e, + 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1287,23 +1310,21 @@ func file_gluon_contract_order_proto_rawDescGZIP() []byte { return file_gluon_contract_order_proto_rawDescData } -var file_gluon_contract_order_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_gluon_contract_order_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_gluon_contract_order_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_gluon_contract_order_proto_goTypes = []interface{}{ (OrderDirection)(0), // 0: gluon.contract.OrderDirection - (OrderType)(0), // 1: gluon.contract.OrderType - (*Order)(nil), // 2: gluon.contract.Order - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp + (*Order)(nil), // 1: gluon.contract.Order + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp } var file_gluon_contract_order_proto_depIdxs = []int32{ 0, // 0: gluon.contract.Order.direction:type_name -> gluon.contract.OrderDirection - 1, // 1: gluon.contract.Order.type:type_name -> gluon.contract.OrderType - 3, // 2: gluon.contract.Order.expiry:type_name -> google.protobuf.Timestamp - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 1: gluon.contract.Order.expiry:type_name -> google.protobuf.Timestamp + 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_gluon_contract_order_proto_init() } @@ -1330,7 +1351,7 @@ func file_gluon_contract_order_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gluon_contract_order_proto_rawDesc, - NumEnums: 2, + NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, diff --git a/api/gluon/contract/params.pulsar.go b/api/gluon/contract/params.pulsar.go index 9122c4a..a97139d 100644 --- a/api/gluon/contract/params.pulsar.go +++ b/api/gluon/contract/params.pulsar.go @@ -4,6 +4,7 @@ package contract import ( _ "cosmossdk.io/api/amino" 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" @@ -16,14 +17,16 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_lazy_contract_period protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_lazy_contract_period protoreflect.FieldDescriptor + fd_Params_lazy_contract_margin_ratio protoreflect.FieldDescriptor ) func init() { file_gluon_contract_params_proto_init() md_Params = File_gluon_contract_params_proto.Messages().ByName("Params") fd_Params_lazy_contract_period = md_Params.Fields().ByName("lazy_contract_period") + fd_Params_lazy_contract_margin_ratio = md_Params.Fields().ByName("lazy_contract_margin_ratio") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -97,6 +100,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.LazyContractMarginRatio != "" { + value := protoreflect.ValueOfString(x.LazyContractMarginRatio) + if !f(fd_Params_lazy_contract_margin_ratio, value) { + return + } + } } // Has reports whether a field is populated. @@ -114,6 +123,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "gluon.contract.Params.lazy_contract_period": return x.LazyContractPeriod != nil + case "gluon.contract.Params.lazy_contract_margin_ratio": + return x.LazyContractMarginRatio != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -132,6 +143,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "gluon.contract.Params.lazy_contract_period": x.LazyContractPeriod = nil + case "gluon.contract.Params.lazy_contract_margin_ratio": + x.LazyContractMarginRatio = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -151,6 +164,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "gluon.contract.Params.lazy_contract_period": value := x.LazyContractPeriod return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "gluon.contract.Params.lazy_contract_margin_ratio": + value := x.LazyContractMarginRatio + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -173,6 +189,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "gluon.contract.Params.lazy_contract_period": x.LazyContractPeriod = value.Message().Interface().(*durationpb.Duration) + case "gluon.contract.Params.lazy_contract_margin_ratio": + x.LazyContractMarginRatio = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -198,6 +216,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.LazyContractPeriod = new(durationpb.Duration) } return protoreflect.ValueOfMessage(x.LazyContractPeriod.ProtoReflect()) + case "gluon.contract.Params.lazy_contract_margin_ratio": + panic(fmt.Errorf("field lazy_contract_margin_ratio of message gluon.contract.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -214,6 +234,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "gluon.contract.Params.lazy_contract_period": m := new(durationpb.Duration) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "gluon.contract.Params.lazy_contract_margin_ratio": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.Params")) @@ -287,6 +309,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { l = options.Size(x.LazyContractPeriod) n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.LazyContractMarginRatio) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -316,6 +342,13 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.LazyContractMarginRatio) > 0 { + i -= len(x.LazyContractMarginRatio) + copy(dAtA[i:], x.LazyContractMarginRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LazyContractMarginRatio))) + i-- + dAtA[i] = 0x12 + } if x.LazyContractPeriod != nil { encoded, err := options.Marshal(x.LazyContractPeriod) if err != nil { @@ -415,6 +448,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { 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 LazyContractMarginRatio", 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.LazyContractMarginRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -469,7 +534,8 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - LazyContractPeriod *durationpb.Duration `protobuf:"bytes,1,opt,name=lazy_contract_period,json=lazyContractPeriod,proto3" json:"lazy_contract_period,omitempty"` + LazyContractPeriod *durationpb.Duration `protobuf:"bytes,1,opt,name=lazy_contract_period,json=lazyContractPeriod,proto3" json:"lazy_contract_period,omitempty"` + LazyContractMarginRatio string `protobuf:"bytes,2,opt,name=lazy_contract_margin_ratio,json=lazyContractMarginRatio,proto3" json:"lazy_contract_margin_ratio,omitempty"` } func (x *Params) Reset() { @@ -499,6 +565,13 @@ func (x *Params) GetLazyContractPeriod() *durationpb.Duration { return nil } +func (x *Params) GetLazyContractMarginRatio() string { + if x != nil { + return x.LazyContractMarginRatio + } + return "" +} + var File_gluon_contract_params_proto protoreflect.FileDescriptor var file_gluon_contract_params_proto_rawDesc = []byte{ @@ -506,16 +579,25 @@ var file_gluon_contract_params_proto_rawDesc = []byte{ 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 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, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x55, 0x0a, 0x14, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, - 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x12, 0x6c, 0x61, 0x7a, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x20, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, + 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, 0x14, 0x67, 0x6f, 0x67, + 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xf6, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x55, 0x0a, 0x14, + 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, + 0x12, 0x6c, 0x61, 0x7a, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x12, 0x73, 0x0a, 0x1a, 0x6c, 0x61, 0x7a, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x01, 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, + 0x17, 0x6c, 0x61, 0x7a, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4d, 0x61, 0x72, + 0x67, 0x69, 0x6e, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x3a, 0x20, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x94, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, diff --git a/api/gluon/contract/tx.pulsar.go b/api/gluon/contract/tx.pulsar.go index c489882..d891922 100644 --- a/api/gluon/contract/tx.pulsar.go +++ b/api/gluon/contract/tx.pulsar.go @@ -3776,1102 +3776,6 @@ func (x *fastReflection_MsgMatchOrderResponse) ProtoMethods() *protoiface.Method } } -var ( - md_MsgMatchLazyOrder protoreflect.MessageDescriptor - fd_MsgMatchLazyOrder_address_buy protoreflect.FieldDescriptor - fd_MsgMatchLazyOrder_address_sell protoreflect.FieldDescriptor - fd_MsgMatchLazyOrder_order_id_buy protoreflect.FieldDescriptor - fd_MsgMatchLazyOrder_order_id_sell protoreflect.FieldDescriptor - fd_MsgMatchLazyOrder_amount protoreflect.FieldDescriptor - fd_MsgMatchLazyOrder_price protoreflect.FieldDescriptor -) - -func init() { - file_gluon_contract_tx_proto_init() - md_MsgMatchLazyOrder = File_gluon_contract_tx_proto.Messages().ByName("MsgMatchLazyOrder") - fd_MsgMatchLazyOrder_address_buy = md_MsgMatchLazyOrder.Fields().ByName("address_buy") - fd_MsgMatchLazyOrder_address_sell = md_MsgMatchLazyOrder.Fields().ByName("address_sell") - fd_MsgMatchLazyOrder_order_id_buy = md_MsgMatchLazyOrder.Fields().ByName("order_id_buy") - fd_MsgMatchLazyOrder_order_id_sell = md_MsgMatchLazyOrder.Fields().ByName("order_id_sell") - fd_MsgMatchLazyOrder_amount = md_MsgMatchLazyOrder.Fields().ByName("amount") - fd_MsgMatchLazyOrder_price = md_MsgMatchLazyOrder.Fields().ByName("price") -} - -var _ protoreflect.Message = (*fastReflection_MsgMatchLazyOrder)(nil) - -type fastReflection_MsgMatchLazyOrder MsgMatchLazyOrder - -func (x *MsgMatchLazyOrder) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgMatchLazyOrder)(x) -} - -func (x *MsgMatchLazyOrder) slowProtoReflect() protoreflect.Message { - mi := &file_gluon_contract_tx_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgMatchLazyOrder_messageType fastReflection_MsgMatchLazyOrder_messageType -var _ protoreflect.MessageType = fastReflection_MsgMatchLazyOrder_messageType{} - -type fastReflection_MsgMatchLazyOrder_messageType struct{} - -func (x fastReflection_MsgMatchLazyOrder_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgMatchLazyOrder)(nil) -} -func (x fastReflection_MsgMatchLazyOrder_messageType) New() protoreflect.Message { - return new(fastReflection_MsgMatchLazyOrder) -} -func (x fastReflection_MsgMatchLazyOrder_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgMatchLazyOrder -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgMatchLazyOrder) Descriptor() protoreflect.MessageDescriptor { - return md_MsgMatchLazyOrder -} - -// 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_MsgMatchLazyOrder) Type() protoreflect.MessageType { - return _fastReflection_MsgMatchLazyOrder_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgMatchLazyOrder) New() protoreflect.Message { - return new(fastReflection_MsgMatchLazyOrder) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgMatchLazyOrder) Interface() protoreflect.ProtoMessage { - return (*MsgMatchLazyOrder)(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_MsgMatchLazyOrder) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.AddressBuy != "" { - value := protoreflect.ValueOfString(x.AddressBuy) - if !f(fd_MsgMatchLazyOrder_address_buy, value) { - return - } - } - if x.AddressSell != "" { - value := protoreflect.ValueOfString(x.AddressSell) - if !f(fd_MsgMatchLazyOrder_address_sell, value) { - return - } - } - if x.OrderIdBuy != "" { - value := protoreflect.ValueOfString(x.OrderIdBuy) - if !f(fd_MsgMatchLazyOrder_order_id_buy, value) { - return - } - } - if x.OrderIdSell != "" { - value := protoreflect.ValueOfString(x.OrderIdSell) - if !f(fd_MsgMatchLazyOrder_order_id_sell, value) { - return - } - } - if x.Amount != "" { - value := protoreflect.ValueOfString(x.Amount) - if !f(fd_MsgMatchLazyOrder_amount, value) { - return - } - } - if x.Price != "" { - value := protoreflect.ValueOfString(x.Price) - if !f(fd_MsgMatchLazyOrder_price, 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_MsgMatchLazyOrder) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - return x.AddressBuy != "" - case "gluon.contract.MsgMatchLazyOrder.address_sell": - return x.AddressSell != "" - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - return x.OrderIdBuy != "" - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - return x.OrderIdSell != "" - case "gluon.contract.MsgMatchLazyOrder.amount": - return x.Amount != "" - case "gluon.contract.MsgMatchLazyOrder.price": - return x.Price != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - x.AddressBuy = "" - case "gluon.contract.MsgMatchLazyOrder.address_sell": - x.AddressSell = "" - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - x.OrderIdBuy = "" - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - x.OrderIdSell = "" - case "gluon.contract.MsgMatchLazyOrder.amount": - x.Amount = "" - case "gluon.contract.MsgMatchLazyOrder.price": - x.Price = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - value := x.AddressBuy - return protoreflect.ValueOfString(value) - case "gluon.contract.MsgMatchLazyOrder.address_sell": - value := x.AddressSell - return protoreflect.ValueOfString(value) - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - value := x.OrderIdBuy - return protoreflect.ValueOfString(value) - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - value := x.OrderIdSell - return protoreflect.ValueOfString(value) - case "gluon.contract.MsgMatchLazyOrder.amount": - value := x.Amount - return protoreflect.ValueOfString(value) - case "gluon.contract.MsgMatchLazyOrder.price": - value := x.Price - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - x.AddressBuy = value.Interface().(string) - case "gluon.contract.MsgMatchLazyOrder.address_sell": - x.AddressSell = value.Interface().(string) - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - x.OrderIdBuy = value.Interface().(string) - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - x.OrderIdSell = value.Interface().(string) - case "gluon.contract.MsgMatchLazyOrder.amount": - x.Amount = value.Interface().(string) - case "gluon.contract.MsgMatchLazyOrder.price": - x.Price = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - panic(fmt.Errorf("field address_buy of message gluon.contract.MsgMatchLazyOrder is not mutable")) - case "gluon.contract.MsgMatchLazyOrder.address_sell": - panic(fmt.Errorf("field address_sell of message gluon.contract.MsgMatchLazyOrder is not mutable")) - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - panic(fmt.Errorf("field order_id_buy of message gluon.contract.MsgMatchLazyOrder is not mutable")) - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - panic(fmt.Errorf("field order_id_sell of message gluon.contract.MsgMatchLazyOrder is not mutable")) - case "gluon.contract.MsgMatchLazyOrder.amount": - panic(fmt.Errorf("field amount of message gluon.contract.MsgMatchLazyOrder is not mutable")) - case "gluon.contract.MsgMatchLazyOrder.price": - panic(fmt.Errorf("field price of message gluon.contract.MsgMatchLazyOrder is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "gluon.contract.MsgMatchLazyOrder.address_buy": - return protoreflect.ValueOfString("") - case "gluon.contract.MsgMatchLazyOrder.address_sell": - return protoreflect.ValueOfString("") - case "gluon.contract.MsgMatchLazyOrder.order_id_buy": - return protoreflect.ValueOfString("") - case "gluon.contract.MsgMatchLazyOrder.order_id_sell": - return protoreflect.ValueOfString("") - case "gluon.contract.MsgMatchLazyOrder.amount": - return protoreflect.ValueOfString("") - case "gluon.contract.MsgMatchLazyOrder.price": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrder")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrder 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_MsgMatchLazyOrder) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in gluon.contract.MsgMatchLazyOrder", 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_MsgMatchLazyOrder) 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_MsgMatchLazyOrder) 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_MsgMatchLazyOrder) 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_MsgMatchLazyOrder) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgMatchLazyOrder) - 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.AddressBuy) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.AddressSell) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.OrderIdBuy) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.OrderIdSell) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Amount) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Price) - 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().(*MsgMatchLazyOrder) - 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.Price) > 0 { - i -= len(x.Price) - copy(dAtA[i:], x.Price) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Price))) - i-- - dAtA[i] = 0x32 - } - if len(x.Amount) > 0 { - i -= len(x.Amount) - copy(dAtA[i:], x.Amount) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) - i-- - dAtA[i] = 0x2a - } - if len(x.OrderIdSell) > 0 { - i -= len(x.OrderIdSell) - copy(dAtA[i:], x.OrderIdSell) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OrderIdSell))) - i-- - dAtA[i] = 0x22 - } - if len(x.OrderIdBuy) > 0 { - i -= len(x.OrderIdBuy) - copy(dAtA[i:], x.OrderIdBuy) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OrderIdBuy))) - i-- - dAtA[i] = 0x1a - } - if len(x.AddressSell) > 0 { - i -= len(x.AddressSell) - copy(dAtA[i:], x.AddressSell) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AddressSell))) - i-- - dAtA[i] = 0x12 - } - if len(x.AddressBuy) > 0 { - i -= len(x.AddressBuy) - copy(dAtA[i:], x.AddressBuy) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AddressBuy))) - 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().(*MsgMatchLazyOrder) - 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: MsgMatchLazyOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgMatchLazyOrder: 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 AddressBuy", 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.AddressBuy = 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 AddressSell", 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.AddressSell = 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 OrderIdBuy", 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.OrderIdBuy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OrderIdSell", 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.OrderIdSell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Price", 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.Price = 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_MsgMatchLazyOrderResponse protoreflect.MessageDescriptor -) - -func init() { - file_gluon_contract_tx_proto_init() - md_MsgMatchLazyOrderResponse = File_gluon_contract_tx_proto.Messages().ByName("MsgMatchLazyOrderResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgMatchLazyOrderResponse)(nil) - -type fastReflection_MsgMatchLazyOrderResponse MsgMatchLazyOrderResponse - -func (x *MsgMatchLazyOrderResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgMatchLazyOrderResponse)(x) -} - -func (x *MsgMatchLazyOrderResponse) slowProtoReflect() protoreflect.Message { - mi := &file_gluon_contract_tx_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgMatchLazyOrderResponse_messageType fastReflection_MsgMatchLazyOrderResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgMatchLazyOrderResponse_messageType{} - -type fastReflection_MsgMatchLazyOrderResponse_messageType struct{} - -func (x fastReflection_MsgMatchLazyOrderResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgMatchLazyOrderResponse)(nil) -} -func (x fastReflection_MsgMatchLazyOrderResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgMatchLazyOrderResponse) -} -func (x fastReflection_MsgMatchLazyOrderResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgMatchLazyOrderResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgMatchLazyOrderResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgMatchLazyOrderResponse -} - -// 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_MsgMatchLazyOrderResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgMatchLazyOrderResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgMatchLazyOrderResponse) New() protoreflect.Message { - return new(fastReflection_MsgMatchLazyOrderResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgMatchLazyOrderResponse) Interface() protoreflect.ProtoMessage { - return (*MsgMatchLazyOrderResponse)(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_MsgMatchLazyOrderResponse) 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_MsgMatchLazyOrderResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: gluon.contract.MsgMatchLazyOrderResponse")) - } - panic(fmt.Errorf("message gluon.contract.MsgMatchLazyOrderResponse 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_MsgMatchLazyOrderResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in gluon.contract.MsgMatchLazyOrderResponse", 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_MsgMatchLazyOrderResponse) 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_MsgMatchLazyOrderResponse) 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_MsgMatchLazyOrderResponse) 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_MsgMatchLazyOrderResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgMatchLazyOrderResponse) - 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().(*MsgMatchLazyOrderResponse) - 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().(*MsgMatchLazyOrderResponse) - 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: MsgMatchLazyOrderResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgMatchLazyOrderResponse: 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 @@ -5214,107 +4118,6 @@ func (*MsgMatchOrderResponse) Descriptor() ([]byte, []int) { return file_gluon_contract_tx_proto_rawDescGZIP(), []int{7} } -type MsgMatchLazyOrder struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AddressBuy string `protobuf:"bytes,1,opt,name=address_buy,json=addressBuy,proto3" json:"address_buy,omitempty"` - AddressSell string `protobuf:"bytes,2,opt,name=address_sell,json=addressSell,proto3" json:"address_sell,omitempty"` - OrderIdBuy string `protobuf:"bytes,3,opt,name=order_id_buy,json=orderIdBuy,proto3" json:"order_id_buy,omitempty"` - OrderIdSell string `protobuf:"bytes,4,opt,name=order_id_sell,json=orderIdSell,proto3" json:"order_id_sell,omitempty"` - Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` - Price string `protobuf:"bytes,6,opt,name=price,proto3" json:"price,omitempty"` -} - -func (x *MsgMatchLazyOrder) Reset() { - *x = MsgMatchLazyOrder{} - if protoimpl.UnsafeEnabled { - mi := &file_gluon_contract_tx_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgMatchLazyOrder) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgMatchLazyOrder) ProtoMessage() {} - -// Deprecated: Use MsgMatchLazyOrder.ProtoReflect.Descriptor instead. -func (*MsgMatchLazyOrder) Descriptor() ([]byte, []int) { - return file_gluon_contract_tx_proto_rawDescGZIP(), []int{8} -} - -func (x *MsgMatchLazyOrder) GetAddressBuy() string { - if x != nil { - return x.AddressBuy - } - return "" -} - -func (x *MsgMatchLazyOrder) GetAddressSell() string { - if x != nil { - return x.AddressSell - } - return "" -} - -func (x *MsgMatchLazyOrder) GetOrderIdBuy() string { - if x != nil { - return x.OrderIdBuy - } - return "" -} - -func (x *MsgMatchLazyOrder) GetOrderIdSell() string { - if x != nil { - return x.OrderIdSell - } - return "" -} - -func (x *MsgMatchLazyOrder) GetAmount() string { - if x != nil { - return x.Amount - } - return "" -} - -func (x *MsgMatchLazyOrder) GetPrice() string { - if x != nil { - return x.Price - } - return "" -} - -type MsgMatchLazyOrderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgMatchLazyOrderResponse) Reset() { - *x = MsgMatchLazyOrderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gluon_contract_tx_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgMatchLazyOrderResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgMatchLazyOrderResponse) ProtoMessage() {} - -// Deprecated: Use MsgMatchLazyOrderResponse.ProtoReflect.Descriptor instead. -func (*MsgMatchLazyOrderResponse) Descriptor() ([]byte, []int) { - return file_gluon_contract_tx_proto_rawDescGZIP(), []int{9} -} - var File_gluon_contract_tx_proto protoreflect.FileDescriptor var file_gluon_contract_tx_proto_rawDesc = []byte{ @@ -5385,70 +4188,40 @@ var file_gluon_contract_tx_proto_rawDesc = []byte{ 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x75, 0x79, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xd8, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x4c, 0x61, 0x7a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x75, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x75, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x65, 0x6c, 0x6c, 0x12, 0x20, 0x0a, - 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x5f, 0x62, 0x75, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x42, 0x75, 0x79, 0x12, - 0x22, 0x0a, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x53, - 0x65, 0x6c, 0x6c, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, - 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4c, 0x0a, - 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 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, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x3a, 0x21, 0x82, 0xe7, 0xb0, - 0x2a, 0x0b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x75, 0x79, 0x82, 0xe7, 0xb0, - 0x2a, 0x0c, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x6c, 0x6c, 0x22, 0x1b, - 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x7a, 0x79, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xda, 0x03, 0x0a, 0x03, - 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, - 0x11, 0x4c, 0x61, 0x7a, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x64, - 0x65, 0x72, 0x12, 0x24, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x61, 0x7a, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x2c, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x61, 0x7a, - 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x26, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, - 0x0a, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6c, + 0x6e, 0x73, 0x65, 0x32, 0xfa, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x67, 0x6c, 0x75, - 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5e, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x7a, 0x79, 0x4f, 0x72, - 0x64, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x7a, - 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x29, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x4c, 0x61, 0x7a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x90, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x18, 0x67, 0x6c, 0x75, 0x6f, - 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0xa2, 0x02, 0x03, 0x47, 0x43, 0x58, 0xaa, 0x02, 0x0e, 0x47, 0x6c, 0x75, - 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xca, 0x02, 0x0e, 0x47, 0x6c, - 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xe2, 0x02, 0x1a, 0x47, - 0x6c, 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x47, 0x6c, 0x75, 0x6f, - 0x6e, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x67, + 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x11, 0x4c, 0x61, 0x7a, 0x79, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x67, 0x6c, 0x75, + 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4c, + 0x61, 0x7a, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x1a, 0x2c, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4c, 0x61, 0x7a, 0x79, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, + 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x2e, + 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x26, 0x2e, + 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x1a, 0x25, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x2e, 0x4d, 0x73, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, + 0x42, 0x90, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x18, 0x67, 0x6c, 0x75, 0x6f, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6c, + 0x75, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0xa2, 0x02, 0x03, 0x47, + 0x43, 0x58, 0xaa, 0x02, 0x0e, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0xca, 0x02, 0x0e, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0xe2, 0x02, 0x1a, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x5c, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0f, 0x47, 0x6c, 0x75, 0x6f, 0x6e, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5463,7 +4236,7 @@ func file_gluon_contract_tx_proto_rawDescGZIP() []byte { return file_gluon_contract_tx_proto_rawDescData } -var file_gluon_contract_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_gluon_contract_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_gluon_contract_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: gluon.contract.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: gluon.contract.MsgUpdateParamsResponse @@ -5473,29 +4246,25 @@ var file_gluon_contract_tx_proto_goTypes = []interface{}{ (*MsgCancelOrderResponse)(nil), // 5: gluon.contract.MsgCancelOrderResponse (*MsgMatchOrder)(nil), // 6: gluon.contract.MsgMatchOrder (*MsgMatchOrderResponse)(nil), // 7: gluon.contract.MsgMatchOrderResponse - (*MsgMatchLazyOrder)(nil), // 8: gluon.contract.MsgMatchLazyOrder - (*MsgMatchLazyOrderResponse)(nil), // 9: gluon.contract.MsgMatchLazyOrderResponse - (*Params)(nil), // 10: gluon.contract.Params - (*Order)(nil), // 11: gluon.contract.Order + (*Params)(nil), // 8: gluon.contract.Params + (*Order)(nil), // 9: gluon.contract.Order } var file_gluon_contract_tx_proto_depIdxs = []int32{ - 10, // 0: gluon.contract.MsgUpdateParams.params:type_name -> gluon.contract.Params - 11, // 1: gluon.contract.MsgLazyRegisterOrder.order:type_name -> gluon.contract.Order - 0, // 2: gluon.contract.Msg.UpdateParams:input_type -> gluon.contract.MsgUpdateParams - 2, // 3: gluon.contract.Msg.LazyRegisterOrder:input_type -> gluon.contract.MsgLazyRegisterOrder - 4, // 4: gluon.contract.Msg.CancelOrder:input_type -> gluon.contract.MsgCancelOrder - 6, // 5: gluon.contract.Msg.MatchOrder:input_type -> gluon.contract.MsgMatchOrder - 8, // 6: gluon.contract.Msg.MatchLazyOrder:input_type -> gluon.contract.MsgMatchLazyOrder - 1, // 7: gluon.contract.Msg.UpdateParams:output_type -> gluon.contract.MsgUpdateParamsResponse - 3, // 8: gluon.contract.Msg.LazyRegisterOrder:output_type -> gluon.contract.MsgLazyRegisterOrderResponse - 5, // 9: gluon.contract.Msg.CancelOrder:output_type -> gluon.contract.MsgCancelOrderResponse - 7, // 10: gluon.contract.Msg.MatchOrder:output_type -> gluon.contract.MsgMatchOrderResponse - 9, // 11: gluon.contract.Msg.MatchLazyOrder:output_type -> gluon.contract.MsgMatchLazyOrderResponse - 7, // [7:12] is the sub-list for method output_type - 2, // [2:7] 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: gluon.contract.MsgUpdateParams.params:type_name -> gluon.contract.Params + 9, // 1: gluon.contract.MsgLazyRegisterOrder.order:type_name -> gluon.contract.Order + 0, // 2: gluon.contract.Msg.UpdateParams:input_type -> gluon.contract.MsgUpdateParams + 2, // 3: gluon.contract.Msg.LazyRegisterOrder:input_type -> gluon.contract.MsgLazyRegisterOrder + 4, // 4: gluon.contract.Msg.CancelOrder:input_type -> gluon.contract.MsgCancelOrder + 6, // 5: gluon.contract.Msg.MatchOrder:input_type -> gluon.contract.MsgMatchOrder + 1, // 6: gluon.contract.Msg.UpdateParams:output_type -> gluon.contract.MsgUpdateParamsResponse + 3, // 7: gluon.contract.Msg.LazyRegisterOrder:output_type -> gluon.contract.MsgLazyRegisterOrderResponse + 5, // 8: gluon.contract.Msg.CancelOrder:output_type -> gluon.contract.MsgCancelOrderResponse + 7, // 9: gluon.contract.Msg.MatchOrder:output_type -> gluon.contract.MsgMatchOrderResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] 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_gluon_contract_tx_proto_init() } @@ -5602,30 +4371,6 @@ func file_gluon_contract_tx_proto_init() { return nil } } - file_gluon_contract_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgMatchLazyOrder); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gluon_contract_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgMatchLazyOrderResponse); 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{ @@ -5633,7 +4378,7 @@ func file_gluon_contract_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gluon_contract_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/gluon/contract/tx_grpc.pb.go b/api/gluon/contract/tx_grpc.pb.go index 38671a8..3a325b1 100644 --- a/api/gluon/contract/tx_grpc.pb.go +++ b/api/gluon/contract/tx_grpc.pb.go @@ -23,7 +23,6 @@ const ( Msg_LazyRegisterOrder_FullMethodName = "/gluon.contract.Msg/LazyRegisterOrder" Msg_CancelOrder_FullMethodName = "/gluon.contract.Msg/CancelOrder" Msg_MatchOrder_FullMethodName = "/gluon.contract.Msg/MatchOrder" - Msg_MatchLazyOrder_FullMethodName = "/gluon.contract.Msg/MatchLazyOrder" ) // MsgClient is the client API for Msg service. @@ -36,7 +35,6 @@ type MsgClient interface { LazyRegisterOrder(ctx context.Context, in *MsgLazyRegisterOrder, opts ...grpc.CallOption) (*MsgLazyRegisterOrderResponse, error) CancelOrder(ctx context.Context, in *MsgCancelOrder, opts ...grpc.CallOption) (*MsgCancelOrderResponse, error) MatchOrder(ctx context.Context, in *MsgMatchOrder, opts ...grpc.CallOption) (*MsgMatchOrderResponse, error) - MatchLazyOrder(ctx context.Context, in *MsgMatchLazyOrder, opts ...grpc.CallOption) (*MsgMatchLazyOrderResponse, error) } type msgClient struct { @@ -83,15 +81,6 @@ func (c *msgClient) MatchOrder(ctx context.Context, in *MsgMatchOrder, opts ...g return out, nil } -func (c *msgClient) MatchLazyOrder(ctx context.Context, in *MsgMatchLazyOrder, opts ...grpc.CallOption) (*MsgMatchLazyOrderResponse, error) { - out := new(MsgMatchLazyOrderResponse) - err := c.cc.Invoke(ctx, Msg_MatchLazyOrder_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 @@ -102,7 +91,6 @@ type MsgServer interface { LazyRegisterOrder(context.Context, *MsgLazyRegisterOrder) (*MsgLazyRegisterOrderResponse, error) CancelOrder(context.Context, *MsgCancelOrder) (*MsgCancelOrderResponse, error) MatchOrder(context.Context, *MsgMatchOrder) (*MsgMatchOrderResponse, error) - MatchLazyOrder(context.Context, *MsgMatchLazyOrder) (*MsgMatchLazyOrderResponse, error) mustEmbedUnimplementedMsgServer() } @@ -122,9 +110,6 @@ func (UnimplementedMsgServer) CancelOrder(context.Context, *MsgCancelOrder) (*Ms func (UnimplementedMsgServer) MatchOrder(context.Context, *MsgMatchOrder) (*MsgMatchOrderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MatchOrder not implemented") } -func (UnimplementedMsgServer) MatchLazyOrder(context.Context, *MsgMatchLazyOrder) (*MsgMatchLazyOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MatchLazyOrder not implemented") -} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -210,24 +195,6 @@ func _Msg_MatchOrder_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_MatchLazyOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgMatchLazyOrder) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MatchLazyOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_MatchLazyOrder_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MatchLazyOrder(ctx, req.(*MsgMatchLazyOrder)) - } - 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) @@ -251,10 +218,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "MatchOrder", Handler: _Msg_MatchOrder_Handler, }, - { - MethodName: "MatchLazyOrder", - Handler: _Msg_MatchLazyOrder_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "gluon/contract/tx.proto", diff --git a/proto/gluon/contract/lazy_contract.proto b/proto/gluon/contract/lazy_contract.proto index dcfa296..3f6c972 100644 --- a/proto/gluon/contract/lazy_contract.proto +++ b/proto/gluon/contract/lazy_contract.proto @@ -14,25 +14,25 @@ message LazyContract { string seller = 3; string denom_base = 4; string denom_quote = 5; - string amount_pending_buyer = 6 [ + string amount_escrow_buyer = 6 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - string amount_pending_seller = 7 [ + string amount_escrow_seller = 7 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - string amount_escrow_buyer = 8 [ + string amount_pending_buyer = 8 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - string amount_escrow_seller = 9 [ + string amount_pending_seller = 9 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, diff --git a/proto/gluon/contract/order.proto b/proto/gluon/contract/order.proto index 48f8fa6..f53a3db 100644 --- a/proto/gluon/contract/order.proto +++ b/proto/gluon/contract/order.proto @@ -14,38 +14,34 @@ enum OrderDirection { SELL = 2; } -enum OrderType { - NORMAL = 0; - LAZY = 1; -} - message Order { string id = 1; string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string denom_base = 3; string denom_quote = 4; OrderDirection direction = 5; - OrderType type = 6; - string amount = 7 [ + string amount = 6 [ (cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; - string limit_price = 8 [ + string limit_price = 7 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true, (amino.dont_omitempty) = true ]; - string stop_price = 9 [ + string stop_price = 8 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = true, (amino.dont_omitempty) = true ]; - google.protobuf.Timestamp expiry = 10 [ + google.protobuf.Timestamp expiry = 9 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + bool lazy_contract = 10; + bool allow_lazy_counterparty = 11; } diff --git a/proto/gluon/contract/params.proto b/proto/gluon/contract/params.proto index 07eeb5a..5c8be5d 100644 --- a/proto/gluon/contract/params.proto +++ b/proto/gluon/contract/params.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package gluon.contract; import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; @@ -12,6 +13,14 @@ message Params { option (amino.name) = "gluon/x/contract/Params"; option (gogoproto.equal) = true; - google.protobuf.Duration lazy_contract_period = 1 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + google.protobuf.Duration lazy_contract_period = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + string lazy_contract_margin_ratio = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = true, + (amino.dont_omitempty) = true + ]; } \ No newline at end of file diff --git a/proto/gluon/contract/tx.proto b/proto/gluon/contract/tx.proto index b099313..34edf52 100644 --- a/proto/gluon/contract/tx.proto +++ b/proto/gluon/contract/tx.proto @@ -21,7 +21,6 @@ service Msg { rpc LazyRegisterOrder (MsgLazyRegisterOrder ) returns (MsgLazyRegisterOrderResponse ); rpc CancelOrder (MsgCancelOrder ) returns (MsgCancelOrderResponse ); rpc MatchOrder (MsgMatchOrder ) returns (MsgMatchOrderResponse ); - rpc MatchLazyOrder (MsgMatchLazyOrder) returns (MsgMatchLazyOrderResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. message MsgUpdateParams { @@ -83,27 +82,3 @@ message MsgMatchOrder { } message MsgMatchOrderResponse {} - -message MsgMatchLazyOrder { - option (cosmos.msg.v1.signer) = "address_buy"; - option (cosmos.msg.v1.signer) = "address_sell"; - - string address_buy = 1; - string address_sell = 2; - string order_id_buy = 3; - string order_id_sell = 4; - string amount = 5 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; - string price = 6 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -message MsgMatchLazyOrderResponse {} diff --git a/x/contract/keeper/keeper_settlement.go b/x/contract/keeper/keeper_settlement.go index 668913a..18d7e8d 100644 --- a/x/contract/keeper/keeper_settlement.go +++ b/x/contract/keeper/keeper_settlement.go @@ -9,63 +9,23 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (k Keeper) Settle( - ctx sdk.Context, - buy types.Order, - sell types.Order, - amount sdkmath.Int, - price sdkmath.LegacyDec, -) error { - denomBase := buy.DenomBase - denomQuote := buy.DenomQuote - - addressBuy, err := sdk.AccAddressFromBech32(buy.Address) - if err != nil { - return err - } - addressSell, err := sdk.AccAddressFromBech32(sell.Address) - if err != nil { - return err - } - - err = k.bankKeeper.SendCoins( - ctx, - addressBuy, - addressSell, - sdk.NewCoins( - sdk.NewCoin(denomQuote, price.MulInt(amount).RoundInt()), - ), - ) - if err != nil { - return err +func transferAmount(params types.Params, amount sdkmath.Int, lazyContract bool) sdkmath.Int { + if lazyContract { + return params.LazyContractMarginRatio.MulInt(amount).RoundInt() } - err = k.bankKeeper.SendCoins( - ctx, - addressSell, - addressBuy, - sdk.NewCoins( - sdk.NewCoin(denomBase, amount), - ), - ) - if err != nil { - return err - } + return amount +} - err = k.AddContractedAmount(ctx, buy.Expiry, buy.Id, amount) - if err != nil { - return err - } - err = k.AddContractedAmount(ctx, sell.Expiry, sell.Id, amount) - if err != nil { - return err +func (k Keeper) transferRecipientAddress(defaultTarget sdk.AccAddress, atLeastOneLazyContract bool) sdk.AccAddress { + if atLeastOneLazyContract { + return k.accountKeeper.GetModuleAddress(types.ModuleName) } - return nil + return defaultTarget } -// TODO -func (k Keeper) SettleLazy( +func (k Keeper) Settle( ctx sdk.Context, buy types.Order, sell types.Order, @@ -84,28 +44,43 @@ func (k Keeper) SettleLazy( return err } - _ = denomBase - _ = denomQuote - _ = addressBuy - _ = addressSell - _ = price - params := k.GetParams(ctx) - expiry := ctx.BlockTime().Add(params.LazyContractPeriod) - - // TODO: Check order expiry and contract expiry - - // TODO - lazyContractId := k.AppendLazyContract(ctx, types.LazyContract{ - Buyer: buy.Address, - Seller: sell.Address, + amountBase := amount + amountQuote := price.MulInt(amount).RoundInt() + amountBaseTransfer := transferAmount(params, amountBase, sell.LazyContract) + amountQuoteTransfer := transferAmount(params, amountQuote, buy.LazyContract) + + atLeastOneLazyContract := buy.LazyContract || sell.LazyContract + + if amountQuoteTransfer.IsPositive() { + recipient := k.transferRecipientAddress(addressSell, atLeastOneLazyContract) + err = k.bankKeeper.SendCoins( + ctx, + addressBuy, + recipient, + sdk.NewCoins( + sdk.NewCoin(denomQuote, amountQuoteTransfer), + ), + ) + if err != nil { + return err + } + } - Expiry: expiry, - }) - k.SetSortedLazyContract(ctx, types.SortedLazyContract{ - Expiry: uint64(expiry.UnixMilli()), - Index: lazyContractId, - }) + if amountBaseTransfer.IsPositive() { + recipient := k.transferRecipientAddress(addressBuy, atLeastOneLazyContract) + err = k.bankKeeper.SendCoins( + ctx, + addressSell, + recipient, + sdk.NewCoins( + sdk.NewCoin(denomBase, amountBaseTransfer), + ), + ) + if err != nil { + return err + } + } err = k.AddContractedAmount(ctx, buy.Expiry, buy.Id, amount) if err != nil { @@ -116,6 +91,31 @@ func (k Keeper) SettleLazy( return err } + if atLeastOneLazyContract { + expiry := ctx.BlockTime().Add(params.LazyContractPeriod) + + // Check order expiry and contract expiry to prevent from order info garbage collected before the settlement + if buy.Expiry.Before(expiry) || sell.Expiry.Before(expiry) { + return types.ErrOrderExpireBeforeLazyContract + } + + lazyContractId := k.AppendLazyContract(ctx, types.LazyContract{ + Buyer: buy.Address, + Seller: sell.Address, + DenomBase: denomBase, + DenomQuote: denomQuote, + AmountEscrowBuyer: amountQuoteTransfer, + AmountEscrowSeller: amountBaseTransfer, + AmountPendingBuyer: amountQuote.Sub(amountQuoteTransfer), + AmountPendingSeller: amountBase.Sub(amountBaseTransfer), + Expiry: expiry, + }) + k.SetSortedLazyContract(ctx, types.SortedLazyContract{ + Expiry: uint64(expiry.UnixMilli()), + Index: lazyContractId, + }) + } + return nil } diff --git a/x/contract/keeper/msg_server_match_lazy_order.go b/x/contract/keeper/msg_server_match_lazy_order.go deleted file mode 100644 index a4759d7..0000000 --- a/x/contract/keeper/msg_server_match_lazy_order.go +++ /dev/null @@ -1,45 +0,0 @@ -package keeper - -import ( - "context" - - "gluon/x/contract/types" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (k msgServer) MatchLazyOrder(goCtx context.Context, msg *types.MsgMatchLazyOrder) (*types.MsgMatchLazyOrderResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - buy, found := k.GetOrder(ctx, msg.OrderIdBuy) - if !found { - return nil, types.ErrOrderNotFound - } - - sell, found := k.GetOrder(ctx, msg.OrderIdSell) - if !found { - return nil, types.ErrOrderNotFound - } - - err := buy.CrossValidate(sell, msg.Price, ctx.BlockTime()) - if err != nil { - return nil, err - } - - err = k.ValidateContractAmount(ctx, buy, msg.Amount) - if err != nil { - return nil, err - } - - err = k.ValidateContractAmount(ctx, sell, msg.Amount) - if err != nil { - return nil, err - } - - err = k.SettleLazy(ctx, buy, sell, msg.Amount, msg.Price) - if err != nil { - return nil, err - } - - return &types.MsgMatchLazyOrderResponse{}, nil -} diff --git a/x/contract/module/simulation.go b/x/contract/module/simulation.go index c225ba7..1a40437 100644 --- a/x/contract/module/simulation.go +++ b/x/contract/module/simulation.go @@ -27,10 +27,6 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgMatchOrder int = 100 - opWeightMsgMatchLazyOrder = "op_weight_msg_match_lazy_order" - // TODO: Determine the simulation weight value - defaultWeightMsgMatchLazyOrder int = 100 - opWeightMsgLazyRegisterOrder = "op_weight_msg_order" // TODO: Determine the simulation weight value defaultWeightMsgLazyRegisterOrder int = 100 @@ -84,17 +80,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp contractsimulation.SimulateMsgMatchOrder(am.accountKeeper, am.bankKeeper, am.keeper), )) - var weightMsgMatchLazyOrder int - simState.AppParams.GetOrGenerate(opWeightMsgMatchLazyOrder, &weightMsgMatchLazyOrder, nil, - func(_ *rand.Rand) { - weightMsgMatchLazyOrder = defaultWeightMsgMatchLazyOrder - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgMatchLazyOrder, - contractsimulation.SimulateMsgMatchLazyOrder(am.accountKeeper, am.bankKeeper, am.keeper), - )) - var weightMsgLazyRegisterOrder int simState.AppParams.GetOrGenerate(opWeightMsgLazyRegisterOrder, &weightMsgLazyRegisterOrder, nil, func(_ *rand.Rand) { @@ -133,14 +118,6 @@ func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.Wei return nil }, ), - simulation.NewWeightedProposalMsg( - opWeightMsgMatchLazyOrder, - defaultWeightMsgMatchLazyOrder, - func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - contractsimulation.SimulateMsgMatchLazyOrder(am.accountKeeper, am.bankKeeper, am.keeper) - return nil - }, - ), simulation.NewWeightedProposalMsg( opWeightMsgLazyRegisterOrder, defaultWeightMsgLazyRegisterOrder, diff --git a/x/contract/simulation/match_lazy_order.go b/x/contract/simulation/match_lazy_order.go deleted file mode 100644 index 464f771..0000000 --- a/x/contract/simulation/match_lazy_order.go +++ /dev/null @@ -1,31 +0,0 @@ -package simulation - -import ( - "math/rand" - - "gluon/x/contract/keeper" - "gluon/x/contract/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -func SimulateMsgMatchLazyOrder( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgMatchLazyOrder{ - AddressBuy: simAccount.Address.String(), - AddressSell: simAccount.Address.String(), - } - - // TODO: Handling the MatchLazyOrder simulation - - return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "MatchLazyOrder simulation not implemented"), nil, nil - } -} diff --git a/x/contract/types/codec.go b/x/contract/types/codec.go index b63f06b..6c111cd 100644 --- a/x/contract/types/codec.go +++ b/x/contract/types/codec.go @@ -16,9 +16,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgMatchOrder{}, ) - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgMatchLazyOrder{}, - ) // this line is used by starport scaffolding # 3 registry.RegisterImplementations((*sdk.Msg)(nil), diff --git a/x/contract/types/errors.go b/x/contract/types/errors.go index 99adb6e..f062566 100644 --- a/x/contract/types/errors.go +++ b/x/contract/types/errors.go @@ -8,19 +8,21 @@ import ( // x/contract module sentinel errors var ( - ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrNotPositiveAmount = sdkerrors.Register(ModuleName, 1101, "amount must be positive") - ErrEmptyOrderId = sdkerrors.Register(ModuleName, 1102, "order id must not be empty") - ErrEmptySignature = sdkerrors.Register(ModuleName, 1103, "signature must not be empty") - ErrInvalidSignature = sdkerrors.Register(ModuleName, 1104, "invalid signature") - ErrPairingNotFound = sdkerrors.Register(ModuleName, 1105, "pairing not found") - ErrOrderNotFound = sdkerrors.Register(ModuleName, 1106, "order not found") - ErrDenomMismatch = sdkerrors.Register(ModuleName, 1107, "denom mismatch") - ErrInvalidOrderDirection = sdkerrors.Register(ModuleName, 1108, "invalid order direction") - ErrBothMarketPriceOrder = sdkerrors.Register(ModuleName, 1109, "both market price order") - ErrPriceMismatch = sdkerrors.Register(ModuleName, 1110, "price mismatch") - ErrOrderExpired = sdkerrors.Register(ModuleName, 1111, "order expired") - ErrContractAmountExceed = sdkerrors.Register(ModuleName, 1112, "contract amount exceed") - ErrInvalidPacketTimeout = sdkerrors.Register(ModuleName, 1500, "invalid packet timeout") - ErrInvalidVersion = sdkerrors.Register(ModuleName, 1501, "invalid version") + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrNotPositiveAmount = sdkerrors.Register(ModuleName, 1101, "amount must be positive") + ErrEmptyOrderId = sdkerrors.Register(ModuleName, 1102, "order id must not be empty") + ErrEmptySignature = sdkerrors.Register(ModuleName, 1103, "signature must not be empty") + ErrInvalidSignature = sdkerrors.Register(ModuleName, 1104, "invalid signature") + ErrPairingNotFound = sdkerrors.Register(ModuleName, 1105, "pairing not found") + ErrOrderNotFound = sdkerrors.Register(ModuleName, 1106, "order not found") + ErrDenomMismatch = sdkerrors.Register(ModuleName, 1107, "denom mismatch") + ErrInvalidOrderDirection = sdkerrors.Register(ModuleName, 1108, "invalid order direction") + ErrBothMarketPriceOrder = sdkerrors.Register(ModuleName, 1109, "both market price order") + ErrPriceMismatch = sdkerrors.Register(ModuleName, 1110, "price mismatch") + ErrOrderExpired = sdkerrors.Register(ModuleName, 1111, "order expired") + ErrContractAmountExceed = sdkerrors.Register(ModuleName, 1112, "contract amount exceed") + ErrLazyContractNotAllowed = sdkerrors.Register(ModuleName, 1113, "lazy contract not allowed") + ErrOrderExpireBeforeLazyContract = sdkerrors.Register(ModuleName, 1114, "order expire before lazy contract") + ErrInvalidPacketTimeout = sdkerrors.Register(ModuleName, 1500, "invalid packet timeout") + ErrInvalidVersion = sdkerrors.Register(ModuleName, 1501, "invalid version") ) diff --git a/x/contract/types/expected_keepers.go b/x/contract/types/expected_keepers.go index 52c39c4..51b8a2c 100644 --- a/x/contract/types/expected_keepers.go +++ b/x/contract/types/expected_keepers.go @@ -14,6 +14,7 @@ import ( type AccountKeeper interface { GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation // Methods imported from account should be defined here + GetModuleAddress(moduleName string) sdk.AccAddress } // BankKeeper defines the expected interface for the Bank module. diff --git a/x/contract/types/lazy_contract.pb.go b/x/contract/types/lazy_contract.pb.go index 239b5ba..ff62a9c 100644 --- a/x/contract/types/lazy_contract.pb.go +++ b/x/contract/types/lazy_contract.pb.go @@ -36,10 +36,10 @@ type LazyContract struct { Seller string `protobuf:"bytes,3,opt,name=seller,proto3" json:"seller,omitempty"` DenomBase string `protobuf:"bytes,4,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` DenomQuote string `protobuf:"bytes,5,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` - AmountPendingBuyer cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=amount_pending_buyer,json=amountPendingBuyer,proto3,customtype=cosmossdk.io/math.Int" json:"amount_pending_buyer"` - AmountPendingSeller cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=amount_pending_seller,json=amountPendingSeller,proto3,customtype=cosmossdk.io/math.Int" json:"amount_pending_seller"` - AmountEscrowBuyer cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=amount_escrow_buyer,json=amountEscrowBuyer,proto3,customtype=cosmossdk.io/math.Int" json:"amount_escrow_buyer"` - AmountEscrowSeller cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=amount_escrow_seller,json=amountEscrowSeller,proto3,customtype=cosmossdk.io/math.Int" json:"amount_escrow_seller"` + AmountEscrowBuyer cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=amount_escrow_buyer,json=amountEscrowBuyer,proto3,customtype=cosmossdk.io/math.Int" json:"amount_escrow_buyer"` + AmountEscrowSeller cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=amount_escrow_seller,json=amountEscrowSeller,proto3,customtype=cosmossdk.io/math.Int" json:"amount_escrow_seller"` + AmountPendingBuyer cosmossdk_io_math.Int `protobuf:"bytes,8,opt,name=amount_pending_buyer,json=amountPendingBuyer,proto3,customtype=cosmossdk.io/math.Int" json:"amount_pending_buyer"` + AmountPendingSeller cosmossdk_io_math.Int `protobuf:"bytes,9,opt,name=amount_pending_seller,json=amountPendingSeller,proto3,customtype=cosmossdk.io/math.Int" json:"amount_pending_seller"` Expiry time.Time `protobuf:"bytes,10,opt,name=expiry,proto3,stdtime" json:"expiry"` } @@ -127,35 +127,35 @@ func init() { } var fileDescriptor_df50d0b8489692fb = []byte{ - // 436 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xb1, 0x6e, 0xd4, 0x40, - 0x10, 0xbd, 0x3d, 0x2e, 0x47, 0x6e, 0x83, 0x22, 0x65, 0xb9, 0x44, 0xe6, 0x24, 0xec, 0x53, 0xaa, - 0x13, 0x12, 0x76, 0x04, 0x2d, 0x95, 0x11, 0x45, 0x24, 0x0a, 0x30, 0x54, 0x34, 0x66, 0x6d, 0x2f, - 0xc6, 0xc2, 0xde, 0x31, 0xde, 0xb5, 0x88, 0xf3, 0x15, 0xf9, 0x0c, 0x4a, 0x0a, 0x3e, 0x22, 0x65, - 0x44, 0x85, 0x52, 0x04, 0x74, 0x57, 0xf0, 0x1b, 0xc8, 0x3b, 0x6b, 0x45, 0x50, 0x26, 0x8d, 0xb5, - 0xf3, 0xde, 0xec, 0x7b, 0x7e, 0xa3, 0x59, 0x7a, 0x98, 0x97, 0x2d, 0xc8, 0x20, 0x05, 0xa9, 0x1b, - 0x9e, 0xea, 0xa0, 0xe4, 0xa7, 0x5d, 0x3c, 0x54, 0x7e, 0xdd, 0x80, 0x06, 0xb6, 0x6b, 0x7a, 0xfc, - 0x01, 0x5d, 0xec, 0xf1, 0xaa, 0x90, 0x10, 0x98, 0x2f, 0xb6, 0x2c, 0xe6, 0x39, 0xe4, 0x60, 0x8e, - 0x41, 0x7f, 0xb2, 0xe8, 0x83, 0x14, 0x54, 0x05, 0x2a, 0x46, 0x02, 0x0b, 0x4b, 0x79, 0x39, 0x40, - 0x5e, 0x8a, 0xc0, 0x54, 0x49, 0xfb, 0x21, 0xd0, 0x45, 0x25, 0x94, 0xe6, 0x55, 0x8d, 0x0d, 0x87, - 0x97, 0x13, 0x7a, 0xef, 0x25, 0x3f, 0xed, 0x9e, 0x5b, 0x57, 0xb6, 0x4b, 0xc7, 0x45, 0xe6, 0x90, - 0x25, 0x59, 0x4d, 0xa2, 0x71, 0x91, 0xb1, 0x39, 0xdd, 0x4a, 0xda, 0x4e, 0x34, 0xce, 0x78, 0x49, - 0x56, 0xb3, 0x08, 0x0b, 0x76, 0x40, 0xa7, 0x4a, 0x94, 0xa5, 0x68, 0x9c, 0x3b, 0x06, 0xb6, 0x15, - 0x7b, 0x48, 0x69, 0x26, 0x24, 0x54, 0x71, 0xc2, 0x95, 0x70, 0x26, 0x86, 0x9b, 0x19, 0x24, 0xe4, - 0x4a, 0x30, 0x8f, 0xee, 0x20, 0xfd, 0xb9, 0x05, 0x2d, 0x9c, 0x2d, 0xc3, 0xe3, 0x8d, 0xd7, 0x3d, - 0xc2, 0x12, 0x3a, 0xe7, 0x15, 0xb4, 0x52, 0xc7, 0xb5, 0x90, 0x59, 0x21, 0xf3, 0x18, 0xcd, 0xa7, - 0x7d, 0x67, 0x78, 0x74, 0x7e, 0xe5, 0x8d, 0x2e, 0xaf, 0xbc, 0x7d, 0xcc, 0xa8, 0xb2, 0x4f, 0x7e, - 0x01, 0x41, 0xc5, 0xf5, 0x47, 0xff, 0x58, 0xea, 0x1f, 0xdf, 0x1f, 0x53, 0x1b, 0xfe, 0x58, 0xea, - 0xaf, 0x7f, 0xbe, 0x3d, 0x22, 0x11, 0x43, 0xb5, 0x57, 0x28, 0x16, 0x9a, 0x7f, 0xcf, 0xe8, 0xfe, - 0x7f, 0x1e, 0x36, 0xca, 0xdd, 0x1b, 0x9a, 0xdc, 0xff, 0xc7, 0xe4, 0x0d, 0x4e, 0xe2, 0x3d, 0xb5, - 0x70, 0x2c, 0x54, 0xda, 0xc0, 0x17, 0x1b, 0x64, 0xfb, 0x86, 0x1e, 0x7b, 0x28, 0xf6, 0xc2, 0x68, - 0x61, 0x8e, 0xeb, 0x59, 0x59, 0x07, 0x1b, 0x63, 0x76, 0xbb, 0x59, 0xa1, 0x85, 0x4d, 0xf1, 0x8c, - 0x4e, 0xc5, 0x49, 0x5d, 0x34, 0x9d, 0x43, 0x97, 0x64, 0xb5, 0xf3, 0x64, 0xe1, 0xe3, 0x42, 0xf9, - 0xc3, 0x42, 0xf9, 0x6f, 0x87, 0x85, 0x0a, 0xb7, 0x7b, 0xc7, 0xb3, 0x5f, 0x1e, 0x89, 0xec, 0x9d, - 0xf0, 0xe8, 0x7c, 0xed, 0x92, 0x8b, 0xb5, 0x4b, 0x7e, 0xaf, 0x5d, 0x72, 0xb6, 0x71, 0x47, 0x17, - 0x1b, 0x77, 0xf4, 0x73, 0xe3, 0x8e, 0xde, 0x1d, 0xe0, 0x7b, 0x38, 0xb9, 0x7e, 0x11, 0xba, 0xab, - 0x85, 0x4a, 0xa6, 0x46, 0xf7, 0xe9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x1e, 0xf5, 0x20, - 0x30, 0x03, 0x00, 0x00, + // 434 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x7d, 0x21, 0x35, 0xcd, 0x15, 0x55, 0xea, 0x35, 0xad, 0x4c, 0x24, 0xec, 0xa8, 0x53, + 0x84, 0x84, 0x5d, 0xc1, 0xca, 0x64, 0xc4, 0x50, 0x89, 0x01, 0x0c, 0x13, 0x8b, 0x39, 0xdb, 0x87, + 0xb1, 0xb0, 0xef, 0x19, 0xdf, 0x59, 0xd4, 0xfd, 0x14, 0xfd, 0x18, 0x8c, 0x0c, 0x7c, 0x88, 0x8e, + 0x15, 0x13, 0xea, 0x50, 0x50, 0x32, 0xf0, 0x35, 0x90, 0xef, 0xce, 0x0a, 0x61, 0x0c, 0x4b, 0x74, + 0xef, 0xff, 0x7f, 0xf7, 0x7e, 0xf9, 0x5b, 0xef, 0xf0, 0x49, 0x5e, 0xb6, 0xc0, 0x83, 0x14, 0xb8, + 0x6c, 0x68, 0x2a, 0x83, 0x92, 0x5e, 0x74, 0xf1, 0x50, 0xf9, 0x75, 0x03, 0x12, 0xc8, 0xbe, 0xea, + 0xf1, 0x07, 0x75, 0x76, 0x40, 0xab, 0x82, 0x43, 0xa0, 0x7e, 0x75, 0xcb, 0x6c, 0x9a, 0x43, 0x0e, + 0xea, 0x18, 0xf4, 0x27, 0xa3, 0xde, 0x4f, 0x41, 0x54, 0x20, 0x62, 0x6d, 0xe8, 0xc2, 0x58, 0x5e, + 0x0e, 0x90, 0x97, 0x2c, 0x50, 0x55, 0xd2, 0xbe, 0x0f, 0x64, 0x51, 0x31, 0x21, 0x69, 0x55, 0xeb, + 0x86, 0x93, 0x9b, 0x31, 0xbe, 0xf7, 0x82, 0x5e, 0x74, 0xcf, 0x0c, 0x95, 0xec, 0xe3, 0x51, 0x91, + 0x39, 0x68, 0x8e, 0x16, 0xe3, 0x68, 0x54, 0x64, 0x64, 0x8a, 0x77, 0x92, 0xb6, 0x63, 0x8d, 0x33, + 0x9a, 0xa3, 0xc5, 0x24, 0xd2, 0x05, 0x39, 0xc6, 0xb6, 0x60, 0x65, 0xc9, 0x1a, 0xe7, 0x8e, 0x92, + 0x4d, 0x45, 0x1e, 0x60, 0x9c, 0x31, 0x0e, 0x55, 0x9c, 0x50, 0xc1, 0x9c, 0xb1, 0xf2, 0x26, 0x4a, + 0x09, 0xa9, 0x60, 0xc4, 0xc3, 0x7b, 0xda, 0xfe, 0xd4, 0x82, 0x64, 0xce, 0x8e, 0xf2, 0xf5, 0x8d, + 0x57, 0xbd, 0x42, 0xde, 0xe1, 0x43, 0x5a, 0x41, 0xcb, 0x65, 0xcc, 0x44, 0xda, 0xc0, 0xe7, 0x58, + 0xb3, 0xed, 0xbe, 0x31, 0x3c, 0xbd, 0xba, 0xf5, 0xac, 0x9b, 0x5b, 0xef, 0x48, 0x47, 0x14, 0xd9, + 0x47, 0xbf, 0x80, 0xa0, 0xa2, 0xf2, 0x83, 0x7f, 0xc6, 0xe5, 0xf7, 0x6f, 0x8f, 0xb0, 0xc9, 0x7e, + 0xc6, 0xe5, 0x97, 0xdf, 0x5f, 0x1f, 0xa2, 0xe8, 0x40, 0x0f, 0x7b, 0xae, 0x66, 0x85, 0xea, 0x9f, + 0x27, 0x78, 0xba, 0x49, 0x30, 0x39, 0xee, 0x6e, 0x89, 0x20, 0x7f, 0x23, 0x5e, 0xeb, 0xaf, 0xb0, + 0x66, 0xd4, 0x8c, 0x67, 0x05, 0xcf, 0x4d, 0x8c, 0xdd, 0xff, 0x63, 0xbc, 0xd4, 0xc3, 0x74, 0x8e, + 0x0c, 0x1f, 0xfd, 0xc3, 0x30, 0x41, 0x26, 0x5b, 0x42, 0x0e, 0x37, 0x20, 0x26, 0xc9, 0x53, 0x6c, + 0xb3, 0xf3, 0xba, 0x68, 0x3a, 0x07, 0xcf, 0xd1, 0x62, 0xef, 0xf1, 0xcc, 0xd7, 0x0b, 0xe5, 0x0f, + 0x0b, 0xe5, 0xbf, 0x19, 0x16, 0x2a, 0xdc, 0xed, 0x91, 0x97, 0x3f, 0x3d, 0x14, 0x99, 0x3b, 0xe1, + 0xe9, 0xd5, 0xd2, 0x45, 0xd7, 0x4b, 0x17, 0xfd, 0x5a, 0xba, 0xe8, 0x72, 0xe5, 0x5a, 0xd7, 0x2b, + 0xd7, 0xfa, 0xb1, 0x72, 0xad, 0xb7, 0xc7, 0xfa, 0x3d, 0x9c, 0xaf, 0x5f, 0x84, 0xec, 0x6a, 0x26, + 0x12, 0x5b, 0xcd, 0x7d, 0xf2, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x7e, 0xae, 0xf6, 0x30, 0x03, + 0x00, 0x00, } func (m *LazyContract) Marshal() (dAtA []byte, err error) { @@ -187,9 +187,9 @@ func (m *LazyContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 { - size := m.AmountEscrowSeller.Size() + size := m.AmountPendingSeller.Size() i -= size - if _, err := m.AmountEscrowSeller.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.AmountPendingSeller.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLazyContract(dAtA, i, uint64(size)) @@ -197,9 +197,9 @@ func (m *LazyContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x4a { - size := m.AmountEscrowBuyer.Size() + size := m.AmountPendingBuyer.Size() i -= size - if _, err := m.AmountEscrowBuyer.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.AmountPendingBuyer.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLazyContract(dAtA, i, uint64(size)) @@ -207,9 +207,9 @@ func (m *LazyContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x42 { - size := m.AmountPendingSeller.Size() + size := m.AmountEscrowSeller.Size() i -= size - if _, err := m.AmountPendingSeller.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.AmountEscrowSeller.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLazyContract(dAtA, i, uint64(size)) @@ -217,9 +217,9 @@ func (m *LazyContract) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a { - size := m.AmountPendingBuyer.Size() + size := m.AmountEscrowBuyer.Size() i -= size - if _, err := m.AmountPendingBuyer.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.AmountEscrowBuyer.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLazyContract(dAtA, i, uint64(size)) @@ -298,14 +298,14 @@ func (m *LazyContract) Size() (n int) { if l > 0 { n += 1 + l + sovLazyContract(uint64(l)) } - l = m.AmountPendingBuyer.Size() - n += 1 + l + sovLazyContract(uint64(l)) - l = m.AmountPendingSeller.Size() - n += 1 + l + sovLazyContract(uint64(l)) l = m.AmountEscrowBuyer.Size() n += 1 + l + sovLazyContract(uint64(l)) l = m.AmountEscrowSeller.Size() n += 1 + l + sovLazyContract(uint64(l)) + l = m.AmountPendingBuyer.Size() + n += 1 + l + sovLazyContract(uint64(l)) + l = m.AmountPendingSeller.Size() + n += 1 + l + sovLazyContract(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry) n += 1 + l + sovLazyContract(uint64(l)) return n @@ -495,7 +495,7 @@ func (m *LazyContract) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountPendingBuyer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowBuyer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -523,13 +523,13 @@ func (m *LazyContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountPendingBuyer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountEscrowBuyer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountPendingSeller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowSeller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -557,13 +557,13 @@ func (m *LazyContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountPendingSeller.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountEscrowSeller.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowBuyer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountPendingBuyer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -591,13 +591,13 @@ func (m *LazyContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountEscrowBuyer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountPendingBuyer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountEscrowSeller", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountPendingSeller", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -625,7 +625,7 @@ func (m *LazyContract) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountEscrowSeller.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountPendingSeller.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/contract/types/message_match_lazy_order.go b/x/contract/types/message_match_lazy_order.go deleted file mode 100644 index 2b38608..0000000 --- a/x/contract/types/message_match_lazy_order.go +++ /dev/null @@ -1,43 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgMatchLazyOrder{} - -func NewMsgMatchLazyOrder( - addressBuy string, - orderIdBuy string, - addressSell string, - orderIdSell string, -) *MsgMatchLazyOrder { - return &MsgMatchLazyOrder{ - AddressBuy: addressBuy, - OrderIdBuy: orderIdBuy, - AddressSell: addressSell, - OrderIdSell: orderIdSell, - } -} - -func (msg *MsgMatchLazyOrder) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.AddressBuy) - if err != nil { - return err - } - - if len(msg.OrderIdBuy) == 0 { - return ErrEmptyOrderId - } - - _, err = sdk.AccAddressFromBech32(msg.AddressSell) - if err != nil { - return err - } - - if len(msg.OrderIdSell) == 0 { - return ErrEmptyOrderId - } - - return nil -} diff --git a/x/contract/types/message_match_lazy_order_test.go b/x/contract/types/message_match_lazy_order_test.go deleted file mode 100644 index bc89d0e..0000000 --- a/x/contract/types/message_match_lazy_order_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package types - -import ( - "testing" - - "gluon/testutil/sample" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" -) - -func TestMsgMatchLazyOrder_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg MsgMatchLazyOrder - err error - }{ - { - name: "invalid address", - msg: MsgMatchLazyOrder{ - AddressBuy: "invalid_address", - AddressSell: "invalid_address", - }, - err: sdkerrors.ErrInvalidAddress, - }, { - name: "valid address", - msg: MsgMatchLazyOrder{ - AddressBuy: sample.AccAddress(), - AddressSell: sample.AccAddress(), - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.err != nil { - require.ErrorIs(t, err, tt.err) - return - } - require.NoError(t, err) - }) - } -} diff --git a/x/contract/types/order.go b/x/contract/types/order.go index a9632dd..b915843 100644 --- a/x/contract/types/order.go +++ b/x/contract/types/order.go @@ -11,16 +11,27 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) -func NewOrder(address string, denomBase string, denomQuote string, direction OrderDirection, type_ OrderType, amount sdkmath.Int, limitPrice *sdkmath.LegacyDec, stopPrice *sdkmath.LegacyDec) Order { +func NewOrder( + address string, + denomBase string, + denomQuote string, + direction OrderDirection, + amount sdkmath.Int, + limitPrice *sdkmath.LegacyDec, + stopPrice *sdkmath.LegacyDec, + lazyContract bool, + allowLazyCounterparty bool, +) Order { return Order{ - Address: address, - DenomBase: denomBase, - DenomQuote: denomQuote, - Direction: direction, - Type: type_, - Amount: amount, - LimitPrice: limitPrice, - StopPrice: stopPrice, + Address: address, + DenomBase: denomBase, + DenomQuote: denomQuote, + Direction: direction, + Amount: amount, + LimitPrice: limitPrice, + StopPrice: stopPrice, + LazyContract: lazyContract, + AllowLazyCounterparty: allowLazyCounterparty, } } @@ -29,6 +40,16 @@ func (order Order) ValidateBasic() error { if err != nil { return err } + + err = sdk.ValidateDenom(order.DenomBase) + if err != nil { + return err + } + err = sdk.ValidateDenom(order.DenomQuote) + if err != nil { + return err + } + if !order.Amount.IsPositive() { return errorsmod.Wrap(ErrNotPositiveAmount, "amount must be positive") } @@ -88,5 +109,13 @@ func (buy Order) CrossValidate(sell Order, price sdkmath.LegacyDec, blockTime ti return ErrOrderExpired } + if buy.LazyContract && !sell.AllowLazyCounterparty { + return ErrLazyContractNotAllowed + } + + if sell.LazyContract && !buy.AllowLazyCounterparty { + return ErrLazyContractNotAllowed + } + return nil } diff --git a/x/contract/types/order.pb.go b/x/contract/types/order.pb.go index 45e8ac6..1cf02df 100644 --- a/x/contract/types/order.pb.go +++ b/x/contract/types/order.pb.go @@ -58,42 +58,18 @@ func (OrderDirection) EnumDescriptor() ([]byte, []int) { return fileDescriptor_a010d6fb1943fa40, []int{0} } -type OrderType int32 - -const ( - OrderType_NORMAL OrderType = 0 - OrderType_LAZY OrderType = 1 -) - -var OrderType_name = map[int32]string{ - 0: "NORMAL", - 1: "LAZY", -} - -var OrderType_value = map[string]int32{ - "NORMAL": 0, - "LAZY": 1, -} - -func (x OrderType) String() string { - return proto.EnumName(OrderType_name, int32(x)) -} - -func (OrderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a010d6fb1943fa40, []int{1} -} - type Order struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - DenomBase string `protobuf:"bytes,3,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` - DenomQuote string `protobuf:"bytes,4,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` - Direction OrderDirection `protobuf:"varint,5,opt,name=direction,proto3,enum=gluon.contract.OrderDirection" json:"direction,omitempty"` - Type OrderType `protobuf:"varint,6,opt,name=type,proto3,enum=gluon.contract.OrderType" json:"type,omitempty"` - Amount cosmossdk_io_math.Int `protobuf:"bytes,7,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` - LimitPrice *cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=limit_price,json=limitPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"limit_price,omitempty"` - StopPrice *cosmossdk_io_math.LegacyDec `protobuf:"bytes,9,opt,name=stop_price,json=stopPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stop_price,omitempty"` - Expiry time.Time `protobuf:"bytes,10,opt,name=expiry,proto3,stdtime" json:"expiry"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + DenomBase string `protobuf:"bytes,3,opt,name=denom_base,json=denomBase,proto3" json:"denom_base,omitempty"` + DenomQuote string `protobuf:"bytes,4,opt,name=denom_quote,json=denomQuote,proto3" json:"denom_quote,omitempty"` + Direction OrderDirection `protobuf:"varint,5,opt,name=direction,proto3,enum=gluon.contract.OrderDirection" json:"direction,omitempty"` + Amount cosmossdk_io_math.Int `protobuf:"bytes,6,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` + LimitPrice *cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=limit_price,json=limitPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"limit_price,omitempty"` + StopPrice *cosmossdk_io_math.LegacyDec `protobuf:"bytes,8,opt,name=stop_price,json=stopPrice,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"stop_price,omitempty"` + Expiry time.Time `protobuf:"bytes,9,opt,name=expiry,proto3,stdtime" json:"expiry"` + LazyContract bool `protobuf:"varint,10,opt,name=lazy_contract,json=lazyContract,proto3" json:"lazy_contract,omitempty"` + AllowLazyCounterparty bool `protobuf:"varint,11,opt,name=allow_lazy_counterparty,json=allowLazyCounterparty,proto3" json:"allow_lazy_counterparty,omitempty"` } func (m *Order) Reset() { *m = Order{} } @@ -164,64 +140,70 @@ func (m *Order) GetDirection() OrderDirection { return OrderDirection_UNKNOWN } -func (m *Order) GetType() OrderType { +func (m *Order) GetExpiry() time.Time { if m != nil { - return m.Type + return m.Expiry } - return OrderType_NORMAL + return time.Time{} } -func (m *Order) GetExpiry() time.Time { +func (m *Order) GetLazyContract() bool { if m != nil { - return m.Expiry + return m.LazyContract } - return time.Time{} + return false +} + +func (m *Order) GetAllowLazyCounterparty() bool { + if m != nil { + return m.AllowLazyCounterparty + } + return false } func init() { proto.RegisterEnum("gluon.contract.OrderDirection", OrderDirection_name, OrderDirection_value) - proto.RegisterEnum("gluon.contract.OrderType", OrderType_name, OrderType_value) proto.RegisterType((*Order)(nil), "gluon.contract.Order") } func init() { proto.RegisterFile("gluon/contract/order.proto", fileDescriptor_a010d6fb1943fa40) } var fileDescriptor_a010d6fb1943fa40 = []byte{ - // 532 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xf6, 0xa6, 0x69, 0x52, 0x4f, 0xa4, 0x28, 0xac, 0x0a, 0x72, 0x83, 0xb0, 0x03, 0xa7, 0x28, - 0x52, 0xec, 0x28, 0x48, 0x9c, 0x7a, 0x49, 0x14, 0x24, 0x2a, 0x42, 0x02, 0x6e, 0xa3, 0xaa, 0xbd, - 0x44, 0x8e, 0xbd, 0x98, 0x15, 0xb1, 0xd7, 0xd8, 0x1b, 0xa9, 0x79, 0x8b, 0x3e, 0x06, 0xc7, 0x1e, - 0xfa, 0x10, 0x39, 0x56, 0x3d, 0xa1, 0x1e, 0x02, 0x4a, 0x0e, 0xbc, 0x06, 0xf2, 0xae, 0x4d, 0xa9, - 0xe0, 0xc6, 0xc5, 0xf2, 0xcc, 0xf7, 0xb3, 0x33, 0xb3, 0xb3, 0x50, 0xf7, 0xe7, 0x0b, 0x16, 0x5a, - 0x2e, 0x0b, 0x79, 0xec, 0xb8, 0xdc, 0x62, 0xb1, 0x47, 0x62, 0x33, 0x8a, 0x19, 0x67, 0xb8, 0x2a, - 0x30, 0x33, 0xc7, 0xea, 0x8f, 0x9c, 0x80, 0x86, 0xcc, 0x12, 0x5f, 0x49, 0xa9, 0x1f, 0xb8, 0x2c, - 0x09, 0x58, 0x32, 0x15, 0x91, 0x25, 0x83, 0x0c, 0xda, 0xf7, 0x99, 0xcf, 0x64, 0x3e, 0xfd, 0xcb, - 0xb2, 0x86, 0xcf, 0x98, 0x3f, 0x27, 0x96, 0x88, 0x66, 0x8b, 0x8f, 0x16, 0xa7, 0x01, 0x49, 0xb8, - 0x13, 0x44, 0x92, 0xf0, 0xe2, 0xaa, 0x08, 0xbb, 0xe3, 0xb4, 0x08, 0x5c, 0x85, 0x02, 0xf5, 0x34, - 0xd4, 0x40, 0x4d, 0xd5, 0x2e, 0x50, 0x0f, 0x77, 0xa1, 0xec, 0x78, 0x5e, 0x4c, 0x92, 0x44, 0x2b, - 0xa4, 0xc9, 0xbe, 0x76, 0x7b, 0xdd, 0xde, 0xcf, 0xce, 0xec, 0x49, 0xe4, 0x98, 0xc7, 0x34, 0xf4, - 0xed, 0x9c, 0x88, 0x9f, 0x01, 0x78, 0x24, 0x64, 0xc1, 0x74, 0xe6, 0x24, 0x44, 0xdb, 0x11, 0x5e, - 0xaa, 0xc8, 0xf4, 0x9d, 0x84, 0x60, 0x03, 0x2a, 0x12, 0xfe, 0xb2, 0x60, 0x9c, 0x68, 0x45, 0x81, - 0x4b, 0xc5, 0x87, 0x34, 0x83, 0x0f, 0x41, 0xf5, 0x68, 0x4c, 0x5c, 0x4e, 0x59, 0xa8, 0xed, 0x36, - 0x50, 0xb3, 0xda, 0xd5, 0xcd, 0x87, 0x63, 0x31, 0x45, 0xb5, 0x83, 0x9c, 0x65, 0xdf, 0x0b, 0x70, - 0x1b, 0x8a, 0x7c, 0x19, 0x11, 0xad, 0x24, 0x84, 0x07, 0xff, 0x14, 0x9e, 0x2c, 0x23, 0x62, 0x0b, - 0x1a, 0x7e, 0x03, 0x25, 0x27, 0x60, 0x8b, 0x90, 0x6b, 0x65, 0xd1, 0x5f, 0x67, 0xb5, 0x36, 0x94, - 0xbb, 0xb5, 0xf1, 0x58, 0xf6, 0x98, 0x78, 0x9f, 0x4d, 0xca, 0xac, 0xc0, 0xe1, 0x9f, 0xcc, 0xa3, - 0x90, 0xdf, 0x5e, 0xb7, 0x21, 0x6b, 0xfe, 0x28, 0xe4, 0x5f, 0x7f, 0x5e, 0xb5, 0x90, 0x9d, 0xe9, - 0xf1, 0x29, 0x54, 0xe6, 0x34, 0xa0, 0x7c, 0x1a, 0xc5, 0xd4, 0x25, 0xda, 0x9e, 0xb0, 0x7b, 0xb5, - 0x5a, 0x1b, 0xe8, 0x6e, 0x6d, 0x3c, 0xfd, 0xdb, 0x6e, 0x48, 0x7c, 0xc7, 0x5d, 0x0e, 0x88, 0xfb, - 0x87, 0xe9, 0x80, 0xb8, 0xd2, 0x14, 0x84, 0xd5, 0xfb, 0xd4, 0x09, 0x4f, 0x00, 0x12, 0xce, 0xa2, - 0xcc, 0x57, 0xfd, 0x2f, 0x5f, 0x35, 0x75, 0x92, 0xb6, 0x87, 0x50, 0x22, 0x17, 0x11, 0x8d, 0x97, - 0x1a, 0x34, 0x50, 0xb3, 0xd2, 0xad, 0x9b, 0x72, 0x4d, 0xcc, 0x7c, 0x4d, 0xcc, 0x93, 0x7c, 0x4d, - 0xfa, 0x7b, 0xe9, 0x54, 0x2e, 0xbf, 0x1b, 0xc8, 0xce, 0x34, 0xad, 0x0e, 0x54, 0x1f, 0xde, 0x01, - 0xae, 0x40, 0x79, 0x32, 0x7a, 0x3b, 0x1a, 0x9f, 0x8e, 0x6a, 0x0a, 0x2e, 0xc3, 0x4e, 0x7f, 0x72, - 0x56, 0x43, 0x78, 0x0f, 0x8a, 0xc7, 0xaf, 0x87, 0xc3, 0x5a, 0xa1, 0xf5, 0x1c, 0xd4, 0xdf, 0xc3, - 0xc7, 0x00, 0xa5, 0xd1, 0xd8, 0x7e, 0xd7, 0x1b, 0xd6, 0x94, 0x94, 0x32, 0xec, 0x9d, 0x9f, 0xd5, - 0x50, 0xbf, 0xb3, 0xda, 0xe8, 0xe8, 0x66, 0xa3, 0xa3, 0x1f, 0x1b, 0x1d, 0x5d, 0x6e, 0x75, 0xe5, - 0x66, 0xab, 0x2b, 0xdf, 0xb6, 0xba, 0x72, 0xfe, 0x44, 0x3e, 0x99, 0x8b, 0xfb, 0x47, 0x93, 0xde, - 0x5e, 0x32, 0x2b, 0x89, 0x62, 0x5f, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x24, 0x2b, 0x63, - 0x53, 0x03, 0x00, 0x00, + // 541 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xb3, 0x69, 0x9a, 0x3f, 0x13, 0x88, 0xc2, 0xaa, 0x05, 0x13, 0x84, 0x1d, 0xc1, 0x25, + 0xaa, 0x54, 0x3b, 0x0a, 0x52, 0x4f, 0xbd, 0x10, 0x82, 0x44, 0x45, 0x94, 0x82, 0x4b, 0x54, 0xc1, + 0x25, 0xda, 0xd8, 0x8b, 0x59, 0x61, 0x7b, 0x8d, 0xbd, 0x11, 0x0d, 0x4f, 0xd1, 0xc7, 0xe0, 0xc8, + 0xa1, 0x0f, 0x91, 0x63, 0xd5, 0x13, 0xea, 0x21, 0xa0, 0xe4, 0xc0, 0x6b, 0x20, 0xef, 0xda, 0x0a, + 0x15, 0xc7, 0x5e, 0xa2, 0xec, 0xf7, 0x7d, 0xf3, 0xf3, 0xec, 0x8c, 0x16, 0x5a, 0x9e, 0x3f, 0xe3, + 0xa1, 0xe5, 0xf0, 0x50, 0xc4, 0xc4, 0x11, 0x16, 0x8f, 0x5d, 0x1a, 0x9b, 0x51, 0xcc, 0x05, 0xc7, + 0x0d, 0xe9, 0x99, 0xb9, 0xd7, 0xba, 0x47, 0x02, 0x16, 0x72, 0x4b, 0xfe, 0xaa, 0x48, 0xeb, 0xa1, + 0xc3, 0x93, 0x80, 0x27, 0x13, 0x79, 0xb2, 0xd4, 0x21, 0xb3, 0x76, 0x3c, 0xee, 0x71, 0xa5, 0xa7, + 0xff, 0x32, 0xd5, 0xf0, 0x38, 0xf7, 0x7c, 0x6a, 0xc9, 0xd3, 0x74, 0xf6, 0xd1, 0x12, 0x2c, 0xa0, + 0x89, 0x20, 0x41, 0xa4, 0x02, 0x4f, 0x96, 0x25, 0xd8, 0x3e, 0x4e, 0x9b, 0xc0, 0x0d, 0x28, 0x32, + 0x57, 0x43, 0x6d, 0xd4, 0xa9, 0xd9, 0x45, 0xe6, 0xe2, 0x1e, 0x54, 0x88, 0xeb, 0xc6, 0x34, 0x49, + 0xb4, 0x62, 0x2a, 0xf6, 0xb5, 0xab, 0x8b, 0xfd, 0x9d, 0xec, 0x9b, 0xcf, 0x95, 0x73, 0x22, 0x62, + 0x16, 0x7a, 0x76, 0x1e, 0xc4, 0x8f, 0x01, 0x5c, 0x1a, 0xf2, 0x60, 0x32, 0x25, 0x09, 0xd5, 0xb6, + 0x24, 0xab, 0x26, 0x95, 0x3e, 0x49, 0x28, 0x36, 0xa0, 0xae, 0xec, 0x2f, 0x33, 0x2e, 0xa8, 0x56, + 0x92, 0xbe, 0xaa, 0x78, 0x9b, 0x2a, 0xf8, 0x10, 0x6a, 0x2e, 0x8b, 0xa9, 0x23, 0x18, 0x0f, 0xb5, + 0xed, 0x36, 0xea, 0x34, 0x7a, 0xba, 0x79, 0x73, 0x2c, 0xa6, 0xec, 0x76, 0x90, 0xa7, 0xec, 0x4d, + 0x01, 0x7e, 0x05, 0x65, 0x12, 0xf0, 0x59, 0x28, 0xb4, 0xb2, 0x6c, 0xb8, 0xbb, 0x58, 0x1a, 0x85, + 0xeb, 0xa5, 0xb1, 0xab, 0x9a, 0x4e, 0xdc, 0xcf, 0x26, 0xe3, 0x56, 0x40, 0xc4, 0x27, 0xf3, 0x28, + 0x14, 0x57, 0x17, 0xfb, 0x90, 0xdd, 0xe6, 0x28, 0x14, 0xdf, 0xff, 0xfc, 0xd8, 0x43, 0x76, 0x56, + 0x8f, 0x4f, 0xa1, 0xee, 0xb3, 0x80, 0x89, 0x49, 0x14, 0x33, 0x87, 0x6a, 0x15, 0x89, 0x3b, 0x58, + 0x2c, 0x0d, 0x74, 0xbd, 0x34, 0x1e, 0xfd, 0x8f, 0x1b, 0x52, 0x8f, 0x38, 0xf3, 0x01, 0x75, 0xfe, + 0x81, 0x0e, 0xa8, 0xa3, 0xa0, 0x20, 0x51, 0x6f, 0x52, 0x12, 0x1e, 0x03, 0x24, 0x82, 0x47, 0x19, + 0xb7, 0x7a, 0x2b, 0x6e, 0x2d, 0x25, 0x29, 0xec, 0x21, 0x94, 0xe9, 0x59, 0xc4, 0xe2, 0xb9, 0x56, + 0x6b, 0xa3, 0x4e, 0xbd, 0xd7, 0x32, 0xd5, 0xde, 0xcd, 0x7c, 0xef, 0xe6, 0xbb, 0x7c, 0xef, 0xfd, + 0x6a, 0x3a, 0x95, 0xf3, 0x5f, 0x06, 0xb2, 0xb3, 0x1a, 0xfc, 0x14, 0xee, 0xfa, 0xe4, 0xdb, 0x7c, + 0x92, 0x8f, 0x58, 0x83, 0x36, 0xea, 0x54, 0xed, 0x3b, 0xa9, 0xf8, 0x22, 0xd3, 0xf0, 0x01, 0x3c, + 0x20, 0xbe, 0xcf, 0xbf, 0x4e, 0xb2, 0xe8, 0x2c, 0x14, 0x34, 0x8e, 0x48, 0x2c, 0xe6, 0x5a, 0x5d, + 0xc6, 0x77, 0xa5, 0x3d, 0x94, 0x35, 0x1b, 0x73, 0xaf, 0x0b, 0x8d, 0x9b, 0x1b, 0xc3, 0x75, 0xa8, + 0x8c, 0x47, 0xaf, 0x47, 0xc7, 0xa7, 0xa3, 0x66, 0x01, 0x57, 0x60, 0xab, 0x3f, 0x7e, 0xdf, 0x44, + 0xb8, 0x0a, 0xa5, 0x93, 0x97, 0xc3, 0x61, 0xb3, 0xd8, 0xef, 0x2e, 0x56, 0x3a, 0xba, 0x5c, 0xe9, + 0xe8, 0xf7, 0x4a, 0x47, 0xe7, 0x6b, 0xbd, 0x70, 0xb9, 0xd6, 0x0b, 0x3f, 0xd7, 0x7a, 0xe1, 0xc3, + 0x7d, 0xf5, 0x7a, 0xce, 0x36, 0xef, 0x47, 0xcc, 0x23, 0x9a, 0x4c, 0xcb, 0xf2, 0x9a, 0xcf, 0xfe, + 0x06, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xdf, 0x2c, 0x46, 0x5e, 0x03, 0x00, 0x00, } func (m *Order) Marshal() (dAtA []byte, err error) { @@ -244,6 +226,26 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.AllowLazyCounterparty { + i-- + if m.AllowLazyCounterparty { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.LazyContract { + i-- + if m.LazyContract { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Expiry, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry):]) if err1 != nil { return 0, err1 @@ -251,7 +253,7 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintOrder(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x4a if m.StopPrice != nil { { size := m.StopPrice.Size() @@ -262,7 +264,7 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintOrder(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x42 } if m.LimitPrice != nil { { @@ -274,7 +276,7 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintOrder(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x3a } { size := m.Amount.Size() @@ -285,12 +287,7 @@ func (m *Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintOrder(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a - if m.Type != 0 { - i = encodeVarintOrder(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x30 - } + dAtA[i] = 0x32 if m.Direction != 0 { i = encodeVarintOrder(dAtA, i, uint64(m.Direction)) i-- @@ -363,9 +360,6 @@ func (m *Order) Size() (n int) { if m.Direction != 0 { n += 1 + sovOrder(uint64(m.Direction)) } - if m.Type != 0 { - n += 1 + sovOrder(uint64(m.Type)) - } l = m.Amount.Size() n += 1 + l + sovOrder(uint64(l)) if m.LimitPrice != nil { @@ -378,6 +372,12 @@ func (m *Order) Size() (n int) { } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Expiry) n += 1 + l + sovOrder(uint64(l)) + if m.LazyContract { + n += 2 + } + if m.AllowLazyCounterparty { + n += 2 + } return n } @@ -564,25 +564,6 @@ func (m *Order) Unmarshal(dAtA []byte) error { } } case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowOrder - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= OrderType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -616,7 +597,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LimitPrice", wireType) } @@ -652,7 +633,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StopPrice", wireType) } @@ -688,7 +669,7 @@ func (m *Order) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Expiry", wireType) } @@ -721,6 +702,46 @@ func (m *Order) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LazyContract", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LazyContract = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowLazyCounterparty", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowLazyCounterparty = bool(v != 0) default: iNdEx = preIndex skippy, err := skipOrder(dAtA[iNdEx:]) diff --git a/x/contract/types/params.pb.go b/x/contract/types/params.pb.go index 31fbaa0..5b4d934 100644 --- a/x/contract/types/params.pb.go +++ b/x/contract/types/params.pb.go @@ -4,7 +4,9 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" @@ -30,7 +32,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - LazyContractPeriod time.Duration `protobuf:"bytes,1,opt,name=lazy_contract_period,json=lazyContractPeriod,proto3,stdduration" json:"lazy_contract_period"` + LazyContractPeriod time.Duration `protobuf:"bytes,1,opt,name=lazy_contract_period,json=lazyContractPeriod,proto3,stdduration" json:"lazy_contract_period"` + LazyContractMarginRatio *cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=lazy_contract_margin_ratio,json=lazyContractMarginRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"lazy_contract_margin_ratio,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -80,22 +83,28 @@ func init() { func init() { proto.RegisterFile("gluon/contract/params.proto", fileDescriptor_9da72541b83f2349) } var fileDescriptor_9da72541b83f2349 = []byte{ - // 234 bytes of a gzipped FileDescriptorProto + // 328 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0x29, 0xcd, 0xcf, 0xd3, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0x4a, 0x4c, 0x2e, 0xd1, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x03, 0x4b, 0xea, 0xc1, 0x24, 0xa5, 0x04, - 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, - 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, - 0xa4, 0xd2, 0x34, 0xfd, 0x94, 0xd2, 0xa2, 0xc4, 0x92, 0xcc, 0xfc, 0x3c, 0x88, 0xbc, 0x52, 0x23, - 0x23, 0x17, 0x5b, 0x00, 0xd8, 0x26, 0xa1, 0x50, 0x2e, 0x91, 0x9c, 0xc4, 0xaa, 0xca, 0x78, 0x98, - 0x25, 0xf1, 0x05, 0xa9, 0x45, 0x99, 0xf9, 0x29, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x92, - 0x7a, 0x10, 0x93, 0xf4, 0x60, 0x26, 0xe9, 0xb9, 0x40, 0x4d, 0x72, 0xe2, 0x38, 0x71, 0x4f, 0x9e, - 0x61, 0xc6, 0x7d, 0x79, 0xc6, 0x20, 0x21, 0x90, 0x01, 0xce, 0x50, 0xfd, 0x01, 0x60, 0xed, 0x56, - 0x0a, 0x2f, 0x16, 0xc8, 0x33, 0x76, 0x3d, 0xdf, 0xa0, 0x25, 0x0e, 0xf1, 0x60, 0x05, 0xc2, 0x8b, - 0x10, 0x8b, 0x9d, 0x0c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, - 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x0c, - 0x43, 0x4b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x11, 0xc6, 0x80, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x7b, 0x85, 0xbc, 0xf3, 0x34, 0x01, 0x00, 0x00, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, + 0x7e, 0x71, 0x3c, 0x98, 0xa7, 0x0f, 0xe1, 0x40, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0x21, 0xe2, + 0x20, 0x16, 0x54, 0x54, 0x2e, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x1f, 0xcc, 0x4b, 0x2a, 0x4d, + 0xd3, 0x4f, 0x29, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x83, 0xc8, 0x2b, 0x7d, 0x63, 0xe4, 0x62, + 0x0b, 0x00, 0x3b, 0x42, 0x28, 0x94, 0x4b, 0x24, 0x27, 0xb1, 0xaa, 0x32, 0x1e, 0x66, 0x7f, 0x7c, + 0x41, 0x6a, 0x51, 0x66, 0x7e, 0x8a, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xa4, 0x1e, 0xc4, + 0x24, 0x3d, 0x98, 0x49, 0x7a, 0x2e, 0x50, 0x93, 0x9c, 0x38, 0x4e, 0xdc, 0x93, 0x67, 0x98, 0x71, + 0x5f, 0x9e, 0x31, 0x48, 0x08, 0x64, 0x80, 0x33, 0x54, 0x7f, 0x00, 0x58, 0xbb, 0x50, 0x31, 0x97, + 0x14, 0xaa, 0xb1, 0xb9, 0x89, 0x45, 0xe9, 0x99, 0x79, 0xf1, 0x60, 0xcd, 0x12, 0x4c, 0x0a, 0x8c, + 0x1a, 0x9c, 0x4e, 0x66, 0x27, 0xee, 0xc9, 0x33, 0xde, 0xba, 0x27, 0x2f, 0x0d, 0xf1, 0x51, 0x71, + 0x4a, 0xb6, 0x5e, 0x66, 0xbe, 0x7e, 0x6e, 0x62, 0x49, 0x86, 0x9e, 0x4f, 0x6a, 0x7a, 0x62, 0x72, + 0xa5, 0x4b, 0x6a, 0xf2, 0xa5, 0x2d, 0xba, 0x5c, 0x50, 0x0f, 0xbb, 0xa4, 0x26, 0xaf, 0x78, 0xbe, + 0x41, 0x8b, 0x31, 0x48, 0x1c, 0xd9, 0x3e, 0x5f, 0xb0, 0xb9, 0x41, 0x20, 0x63, 0xad, 0x14, 0x5e, + 0x2c, 0x90, 0x67, 0xec, 0x7a, 0xbe, 0x41, 0x4b, 0x1c, 0x12, 0xe0, 0x15, 0x88, 0x20, 0x87, 0xf8, + 0xd6, 0xc9, 0xe0, 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, 0xc4, 0x30, 0xb4, + 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x7d, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0xa5, 0xf3, 0x64, 0xd4, 0xc4, 0x01, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -120,6 +129,13 @@ func (this *Params) Equal(that interface{}) bool { if this.LazyContractPeriod != that1.LazyContractPeriod { return false } + if that1.LazyContractMarginRatio == nil { + if this.LazyContractMarginRatio != nil { + return false + } + } else if !this.LazyContractMarginRatio.Equal(*that1.LazyContractMarginRatio) { + return false + } return true } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -142,6 +158,18 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LazyContractMarginRatio != nil { + { + size := m.LazyContractMarginRatio.Size() + i -= size + if _, err := m.LazyContractMarginRatio.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.LazyContractPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LazyContractPeriod):]) if err1 != nil { return 0, err1 @@ -172,6 +200,10 @@ func (m *Params) Size() (n int) { _ = l l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.LazyContractPeriod) n += 1 + l + sovParams(uint64(l)) + if m.LazyContractMarginRatio != nil { + l = m.LazyContractMarginRatio.Size() + n += 1 + l + sovParams(uint64(l)) + } return n } @@ -243,6 +275,42 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LazyContractMarginRatio", 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 + } + var v cosmossdk_io_math.LegacyDec + m.LazyContractMarginRatio = &v + if err := m.LazyContractMarginRatio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/contract/types/tx.pb.go b/x/contract/types/tx.pb.go index fdcd1a4..562738b 100644 --- a/x/contract/types/tx.pb.go +++ b/x/contract/types/tx.pb.go @@ -423,112 +423,6 @@ func (m *MsgMatchOrderResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMatchOrderResponse proto.InternalMessageInfo -type MsgMatchLazyOrder struct { - AddressBuy string `protobuf:"bytes,1,opt,name=address_buy,json=addressBuy,proto3" json:"address_buy,omitempty"` - AddressSell string `protobuf:"bytes,2,opt,name=address_sell,json=addressSell,proto3" json:"address_sell,omitempty"` - OrderIdBuy string `protobuf:"bytes,3,opt,name=order_id_buy,json=orderIdBuy,proto3" json:"order_id_buy,omitempty"` - OrderIdSell string `protobuf:"bytes,4,opt,name=order_id_sell,json=orderIdSell,proto3" json:"order_id_sell,omitempty"` - Amount cosmossdk_io_math.Int `protobuf:"bytes,5,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` - Price cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=price,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"price"` -} - -func (m *MsgMatchLazyOrder) Reset() { *m = MsgMatchLazyOrder{} } -func (m *MsgMatchLazyOrder) String() string { return proto.CompactTextString(m) } -func (*MsgMatchLazyOrder) ProtoMessage() {} -func (*MsgMatchLazyOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_a41fd393ca4bcbb6, []int{8} -} -func (m *MsgMatchLazyOrder) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMatchLazyOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMatchLazyOrder.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 *MsgMatchLazyOrder) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMatchLazyOrder.Merge(m, src) -} -func (m *MsgMatchLazyOrder) XXX_Size() int { - return m.Size() -} -func (m *MsgMatchLazyOrder) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMatchLazyOrder.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMatchLazyOrder proto.InternalMessageInfo - -func (m *MsgMatchLazyOrder) GetAddressBuy() string { - if m != nil { - return m.AddressBuy - } - return "" -} - -func (m *MsgMatchLazyOrder) GetAddressSell() string { - if m != nil { - return m.AddressSell - } - return "" -} - -func (m *MsgMatchLazyOrder) GetOrderIdBuy() string { - if m != nil { - return m.OrderIdBuy - } - return "" -} - -func (m *MsgMatchLazyOrder) GetOrderIdSell() string { - if m != nil { - return m.OrderIdSell - } - return "" -} - -type MsgMatchLazyOrderResponse struct { -} - -func (m *MsgMatchLazyOrderResponse) Reset() { *m = MsgMatchLazyOrderResponse{} } -func (m *MsgMatchLazyOrderResponse) String() string { return proto.CompactTextString(m) } -func (*MsgMatchLazyOrderResponse) ProtoMessage() {} -func (*MsgMatchLazyOrderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a41fd393ca4bcbb6, []int{9} -} -func (m *MsgMatchLazyOrderResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMatchLazyOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMatchLazyOrderResponse.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 *MsgMatchLazyOrderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMatchLazyOrderResponse.Merge(m, src) -} -func (m *MsgMatchLazyOrderResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgMatchLazyOrderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMatchLazyOrderResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMatchLazyOrderResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*MsgUpdateParams)(nil), "gluon.contract.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "gluon.contract.MsgUpdateParamsResponse") @@ -538,61 +432,57 @@ func init() { proto.RegisterType((*MsgCancelOrderResponse)(nil), "gluon.contract.MsgCancelOrderResponse") proto.RegisterType((*MsgMatchOrder)(nil), "gluon.contract.MsgMatchOrder") proto.RegisterType((*MsgMatchOrderResponse)(nil), "gluon.contract.MsgMatchOrderResponse") - proto.RegisterType((*MsgMatchLazyOrder)(nil), "gluon.contract.MsgMatchLazyOrder") - proto.RegisterType((*MsgMatchLazyOrderResponse)(nil), "gluon.contract.MsgMatchLazyOrderResponse") } func init() { proto.RegisterFile("gluon/contract/tx.proto", fileDescriptor_a41fd393ca4bcbb6) } var fileDescriptor_a41fd393ca4bcbb6 = []byte{ - // 751 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x3f, 0x4f, 0xdb, 0x4e, - 0x18, 0x8e, 0xf3, 0x4f, 0xca, 0x4b, 0xc8, 0x4f, 0x58, 0x40, 0x8c, 0x01, 0x27, 0x44, 0xbf, 0xb6, - 0x29, 0x2a, 0x09, 0x05, 0x09, 0xa9, 0x59, 0xaa, 0xa6, 0x0c, 0x8d, 0x44, 0xd4, 0xca, 0x08, 0xa9, - 0xea, 0xd0, 0xe8, 0xb0, 0x4f, 0xc6, 0x6a, 0x62, 0x47, 0xbe, 0x4b, 0x45, 0x3a, 0x55, 0x1d, 0x3b, - 0xf5, 0x63, 0x74, 0x2b, 0x03, 0x4b, 0xbf, 0x01, 0x23, 0x42, 0x1d, 0x10, 0x03, 0xaa, 0x60, 0xe0, - 0x6b, 0x54, 0xbe, 0x3b, 0x3b, 0x89, 0x93, 0x42, 0x87, 0x8e, 0x5d, 0x12, 0xdf, 0xfb, 0x3c, 0xef, - 0x73, 0xef, 0xfb, 0xdc, 0xeb, 0x33, 0xe4, 0xad, 0x76, 0xcf, 0x75, 0xaa, 0x86, 0xeb, 0x50, 0x0f, - 0x19, 0xb4, 0x4a, 0x0f, 0x2b, 0x5d, 0xcf, 0xa5, 0xae, 0x9c, 0x63, 0x40, 0x25, 0x00, 0xd4, 0x19, - 0xd4, 0xb1, 0x1d, 0xb7, 0xca, 0x7e, 0x39, 0x45, 0xcd, 0x1b, 0x2e, 0xe9, 0xb8, 0xa4, 0xda, 0x21, - 0x56, 0xf5, 0xfd, 0x63, 0xff, 0x4f, 0x00, 0x0b, 0x1c, 0x68, 0xb1, 0x55, 0x95, 0x2f, 0x04, 0x34, - 0x6b, 0xb9, 0x96, 0xcb, 0xe3, 0xfe, 0x93, 0x88, 0x2e, 0x46, 0xaa, 0xe8, 0x22, 0x0f, 0x75, 0x82, - 0x14, 0x35, 0x02, 0xba, 0x9e, 0x89, 0x3d, 0x8e, 0x95, 0xbe, 0x4b, 0xf0, 0x5f, 0x93, 0x58, 0x7b, - 0x5d, 0x13, 0x51, 0xfc, 0x8a, 0x65, 0xc9, 0x5b, 0x90, 0x41, 0x3d, 0x7a, 0xe0, 0x7a, 0x36, 0xed, - 0x2b, 0x52, 0x51, 0x2a, 0x67, 0xea, 0xca, 0xd9, 0xf1, 0xda, 0xac, 0xa8, 0xe3, 0x99, 0x69, 0x7a, - 0x98, 0x90, 0x5d, 0xea, 0xd9, 0x8e, 0xa5, 0x0f, 0xa8, 0xf2, 0x13, 0x48, 0xf3, 0x7d, 0x95, 0x78, - 0x51, 0x2a, 0x4f, 0x6d, 0xcc, 0x57, 0x46, 0x2d, 0xa8, 0x70, 0xfd, 0x7a, 0xe6, 0xe4, 0xb2, 0x10, - 0xfb, 0x7a, 0x73, 0xb4, 0x2a, 0xe9, 0x22, 0xa1, 0xb6, 0xf9, 0xe9, 0xe6, 0x68, 0x75, 0x20, 0xf5, - 0xf9, 0xe6, 0x68, 0xb5, 0xc8, 0xab, 0x3e, 0x1c, 0xd4, 0x1d, 0xa9, 0xb3, 0xb4, 0x00, 0xf9, 0x48, - 0x48, 0xc7, 0xa4, 0xeb, 0x3a, 0x04, 0x97, 0xbe, 0x49, 0x30, 0xdb, 0x24, 0xd6, 0x0e, 0xfa, 0xd0, - 0xd7, 0xb1, 0x65, 0x13, 0x8a, 0xbd, 0x97, 0x7e, 0xd7, 0x72, 0x0e, 0xe2, 0xb6, 0xc9, 0x9b, 0xd2, - 0xe3, 0xb6, 0x29, 0x6f, 0x41, 0x8a, 0xd9, 0x21, 0x4a, 0x9e, 0x8b, 0x96, 0xcc, 0xb2, 0x86, 0x2b, - 0xe6, 0x74, 0x79, 0x19, 0xa0, 0x8b, 0x6c, 0xdf, 0x81, 0x96, 0x6d, 0x2a, 0x89, 0xa2, 0x54, 0x4e, - 0xea, 0x19, 0x11, 0x69, 0x98, 0xf2, 0x12, 0x64, 0x88, 0x6d, 0x39, 0x88, 0xf6, 0x3c, 0xac, 0x24, - 0x8b, 0x52, 0x39, 0xab, 0x0f, 0x02, 0x35, 0xd9, 0xef, 0x76, 0x9a, 0x1f, 0x03, 0xe2, 0x6e, 0x96, - 0x34, 0x58, 0x9a, 0x54, 0x70, 0xd8, 0xd1, 0x53, 0xc8, 0x35, 0x89, 0xf5, 0x1c, 0x39, 0x06, 0x6e, - 0xf3, 0x56, 0x64, 0x48, 0xf6, 0x08, 0xf6, 0x44, 0x33, 0xec, 0x59, 0xb4, 0x17, 0x0f, 0xda, 0xab, - 0x65, 0xfc, 0x9d, 0x18, 0x54, 0x52, 0x60, 0x7e, 0x54, 0x20, 0x94, 0xfe, 0x11, 0x87, 0xe9, 0x26, - 0xb1, 0x9a, 0x88, 0x1a, 0x07, 0x5c, 0xba, 0x00, 0x53, 0xa2, 0xae, 0xd6, 0x7e, 0x4f, 0xcc, 0x80, - 0x0e, 0x22, 0x54, 0xef, 0xf5, 0xe5, 0x15, 0xc8, 0x06, 0x04, 0x82, 0xdb, 0x6d, 0xb1, 0x63, 0x90, - 0xb4, 0x8b, 0xdb, 0x6d, 0xb9, 0x08, 0x59, 0xd6, 0x61, 0xcb, 0x36, 0x99, 0x48, 0x82, 0x8b, 0xb0, - 0x58, 0xc3, 0xf4, 0x45, 0x4a, 0x30, 0x1d, 0x32, 0x98, 0x4a, 0x92, 0xab, 0x08, 0x0a, 0x53, 0x79, - 0x01, 0x69, 0xd4, 0x71, 0x7b, 0x0e, 0x55, 0x52, 0x6c, 0x10, 0xd7, 0xfd, 0x93, 0xb8, 0xb8, 0x2c, - 0xcc, 0xf1, 0x61, 0x24, 0xe6, 0xbb, 0x8a, 0xed, 0x56, 0x3b, 0x88, 0x1e, 0x54, 0x1a, 0x0e, 0x3d, - 0x3b, 0x5e, 0x03, 0x31, 0xa5, 0x0d, 0x87, 0x8a, 0x11, 0xe3, 0xf9, 0xf2, 0x0e, 0xa4, 0xba, 0x9e, - 0x6d, 0x60, 0x25, 0xcd, 0x84, 0xb6, 0x84, 0xd0, 0xe2, 0xb8, 0xd0, 0x0e, 0xb6, 0x90, 0xd1, 0xdf, - 0xc6, 0xc6, 0x90, 0xdc, 0x36, 0x36, 0xc4, 0xf9, 0x33, 0x91, 0xda, 0x8a, 0x6f, 0xec, 0xb0, 0x49, - 0xfe, 0x7a, 0xc4, 0x93, 0x52, 0x1e, 0xe6, 0x46, 0x5c, 0x0d, 0xfd, 0x3e, 0x8f, 0xc3, 0x4c, 0x80, - 0xf8, 0x07, 0xfe, 0xcf, 0xf3, 0xbf, 0xe6, 0xf9, 0x22, 0x2c, 0x8c, 0x39, 0x1b, 0xf8, 0xbe, 0x71, - 0x91, 0x80, 0x44, 0x93, 0x58, 0xf2, 0x6b, 0xc8, 0x8e, 0xdc, 0x77, 0x85, 0xe8, 0x4b, 0x1f, 0xb9, - 0x55, 0xd4, 0x07, 0x77, 0x10, 0x82, 0x1d, 0x64, 0x0b, 0x66, 0xc6, 0xaf, 0x9c, 0xff, 0x27, 0x64, - 0x8f, 0xb1, 0xd4, 0x47, 0x7f, 0xc2, 0x0a, 0x37, 0xda, 0x83, 0xa9, 0xe1, 0xab, 0x40, 0x9b, 0x90, - 0x3c, 0x84, 0xab, 0xf7, 0x6f, 0xc7, 0x43, 0x59, 0x1d, 0x60, 0xe8, 0x16, 0x58, 0x9e, 0x90, 0x35, - 0x80, 0xd5, 0x7b, 0xb7, 0xc2, 0xa1, 0xe6, 0x5b, 0xc8, 0x45, 0x26, 0x7d, 0xe5, 0x77, 0x89, 0x21, - 0x45, 0x7d, 0x78, 0x27, 0x25, 0xd0, 0x57, 0x53, 0x1f, 0xfd, 0x19, 0xa9, 0xaf, 0x9f, 0x5c, 0x69, - 0xd2, 0xe9, 0x95, 0x26, 0xfd, 0xbc, 0xd2, 0xa4, 0x2f, 0xd7, 0x5a, 0xec, 0xf4, 0x5a, 0x8b, 0x9d, - 0x5f, 0x6b, 0xb1, 0x37, 0xf3, 0x63, 0x1f, 0x12, 0xda, 0xef, 0x62, 0xb2, 0x9f, 0x66, 0x5f, 0xc0, - 0xcd, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xb2, 0x4b, 0xd5, 0xc2, 0x07, 0x00, 0x00, + // 712 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x4f, 0xdb, 0x4a, + 0x14, 0x8d, 0x43, 0x12, 0x29, 0x97, 0xc0, 0x13, 0x16, 0x10, 0x63, 0xc0, 0x09, 0xd1, 0x7b, 0xaf, + 0x11, 0x2a, 0x09, 0x05, 0x09, 0xa9, 0xd9, 0x54, 0x4d, 0x59, 0x34, 0x12, 0x51, 0x2b, 0x23, 0xa4, + 0xaa, 0x9b, 0x68, 0xb0, 0x47, 0x83, 0xd5, 0xc4, 0x13, 0x79, 0x26, 0x15, 0xe9, 0xaa, 0xea, 0xb2, + 0xab, 0xfe, 0x8c, 0xee, 0xca, 0x82, 0x4d, 0xff, 0x01, 0x4b, 0x84, 0xba, 0xa8, 0xba, 0x40, 0x15, + 0x2c, 0xf8, 0x0f, 0x5d, 0x55, 0x9e, 0x19, 0xe7, 0xc3, 0x89, 0x68, 0x37, 0x89, 0xe7, 0x9e, 0x7b, + 0xcf, 0x3d, 0xf7, 0xce, 0xb1, 0x21, 0x4f, 0xda, 0x3d, 0xea, 0x57, 0x1d, 0xea, 0xf3, 0x00, 0x39, + 0xbc, 0xca, 0x4f, 0x2b, 0xdd, 0x80, 0x72, 0xaa, 0xcf, 0x0b, 0xa0, 0x12, 0x01, 0xe6, 0x02, 0xea, + 0x78, 0x3e, 0xad, 0x8a, 0x5f, 0x99, 0x62, 0xe6, 0x1d, 0xca, 0x3a, 0x94, 0x55, 0x3b, 0x8c, 0x54, + 0xdf, 0x3e, 0x0a, 0xff, 0x14, 0xb0, 0x22, 0x81, 0x96, 0x38, 0x55, 0xe5, 0x41, 0x41, 0x8b, 0x84, + 0x12, 0x2a, 0xe3, 0xe1, 0x93, 0x8a, 0xae, 0xc6, 0x54, 0x74, 0x51, 0x80, 0x3a, 0x51, 0x89, 0x19, + 0x03, 0x69, 0xe0, 0xe2, 0x40, 0x62, 0xa5, 0xaf, 0x1a, 0xfc, 0xd3, 0x64, 0xe4, 0xa8, 0xeb, 0x22, + 0x8e, 0x5f, 0x8a, 0x2a, 0x7d, 0x0f, 0xb2, 0xa8, 0xc7, 0x4f, 0x68, 0xe0, 0xf1, 0xbe, 0xa1, 0x15, + 0xb5, 0x72, 0xb6, 0x6e, 0x5c, 0x9d, 0x6f, 0x2d, 0x2a, 0x1d, 0x4f, 0x5d, 0x37, 0xc0, 0x8c, 0x1d, + 0xf2, 0xc0, 0xf3, 0x89, 0x3d, 0x4c, 0xd5, 0x1f, 0x43, 0x46, 0xf6, 0x35, 0x92, 0x45, 0xad, 0x3c, + 0xbb, 0xb3, 0x5c, 0x19, 0x5f, 0x41, 0x45, 0xf2, 0xd7, 0xb3, 0x17, 0xd7, 0x85, 0xc4, 0xe7, 0xbb, + 0xb3, 0x4d, 0xcd, 0x56, 0x05, 0xb5, 0xdd, 0x0f, 0x77, 0x67, 0x9b, 0x43, 0xaa, 0x8f, 0x77, 0x67, + 0x9b, 0x45, 0xa9, 0xfa, 0x74, 0xa8, 0x3b, 0xa6, 0xb3, 0xb4, 0x02, 0xf9, 0x58, 0xc8, 0xc6, 0xac, + 0x4b, 0x7d, 0x86, 0x4b, 0x5f, 0x34, 0x58, 0x6c, 0x32, 0x72, 0x80, 0xde, 0xf5, 0x6d, 0x4c, 0x3c, + 0xc6, 0x71, 0xf0, 0x22, 0x9c, 0x5a, 0x9f, 0x87, 0xa4, 0xe7, 0xca, 0xa1, 0xec, 0xa4, 0xe7, 0xea, + 0x7b, 0x90, 0x16, 0xeb, 0x50, 0x92, 0x97, 0xe2, 0x92, 0x45, 0xd5, 0xa8, 0x62, 0x99, 0xae, 0xaf, + 0x03, 0x74, 0x91, 0x17, 0x6e, 0xa0, 0xe5, 0xb9, 0xc6, 0x4c, 0x51, 0x2b, 0xa7, 0xec, 0xac, 0x8a, + 0x34, 0x5c, 0x7d, 0x0d, 0xb2, 0xcc, 0x23, 0x3e, 0xe2, 0xbd, 0x00, 0x1b, 0xa9, 0xa2, 0x56, 0xce, + 0xd9, 0xc3, 0x40, 0x4d, 0x0f, 0xa7, 0x9d, 0x93, 0xd7, 0x80, 0xe4, 0x36, 0x4b, 0x16, 0xac, 0x4d, + 0x13, 0x3c, 0x98, 0xe8, 0x09, 0xcc, 0x37, 0x19, 0x79, 0x86, 0x7c, 0x07, 0xb7, 0xe5, 0x28, 0x3a, + 0xa4, 0x7a, 0x0c, 0x07, 0x6a, 0x18, 0xf1, 0xac, 0xc6, 0x4b, 0x46, 0xe3, 0xd5, 0xb2, 0x61, 0x27, + 0x01, 0x95, 0x0c, 0x58, 0x1e, 0x27, 0x18, 0x50, 0x7f, 0x4b, 0xc2, 0x5c, 0x93, 0x91, 0x26, 0xe2, + 0xce, 0x89, 0xa4, 0x2e, 0xc0, 0xac, 0xd2, 0xd5, 0x3a, 0xee, 0x29, 0x0f, 0xd8, 0xa0, 0x42, 0xf5, + 0x5e, 0x5f, 0xdf, 0x80, 0x5c, 0x94, 0xc0, 0x70, 0xbb, 0xad, 0x3a, 0x46, 0x45, 0x87, 0xb8, 0xdd, + 0xd6, 0x8b, 0x90, 0x13, 0x13, 0xb6, 0x3c, 0x57, 0x90, 0xcc, 0x48, 0x12, 0x11, 0x6b, 0xb8, 0x21, + 0x49, 0x09, 0xe6, 0x06, 0x19, 0x82, 0x25, 0x25, 0x59, 0x54, 0x8a, 0x60, 0x79, 0x0e, 0x19, 0xd4, + 0xa1, 0x3d, 0x9f, 0x1b, 0x69, 0x61, 0xc4, 0xed, 0xf0, 0x26, 0x7e, 0x5c, 0x17, 0x96, 0xa4, 0x19, + 0x99, 0xfb, 0xa6, 0xe2, 0xd1, 0x6a, 0x07, 0xf1, 0x93, 0x4a, 0xc3, 0xe7, 0x57, 0xe7, 0x5b, 0xa0, + 0x5c, 0xda, 0xf0, 0xb9, 0xb2, 0x98, 0xac, 0xd7, 0x0f, 0x20, 0xdd, 0x0d, 0x3c, 0x07, 0x1b, 0x19, + 0x41, 0xb4, 0xa7, 0x88, 0x56, 0x27, 0x89, 0x0e, 0x30, 0x41, 0x4e, 0x7f, 0x1f, 0x3b, 0x23, 0x74, + 0xfb, 0xd8, 0x51, 0xf7, 0x2f, 0x48, 0x6a, 0x1b, 0xe1, 0x62, 0x47, 0x97, 0x14, 0x9e, 0xc7, 0x76, + 0x52, 0xca, 0xc3, 0xd2, 0xd8, 0x56, 0xa3, 0x7d, 0xef, 0xfc, 0x4a, 0xc2, 0x4c, 0x93, 0x11, 0xfd, + 0x15, 0xe4, 0xc6, 0xde, 0xbb, 0x42, 0xdc, 0x7c, 0x31, 0x77, 0x9b, 0x0f, 0xfe, 0x90, 0x10, 0x75, + 0xd0, 0x09, 0x2c, 0x4c, 0x5a, 0xff, 0xdf, 0x29, 0xd5, 0x13, 0x59, 0xe6, 0xc3, 0xbf, 0xc9, 0x1a, + 0x34, 0x3a, 0x82, 0xd9, 0x51, 0x4b, 0x5a, 0x53, 0x8a, 0x47, 0x70, 0xf3, 0xff, 0xfb, 0xf1, 0x01, + 0xad, 0x0d, 0x30, 0xe2, 0xc6, 0xf5, 0x29, 0x55, 0x43, 0xd8, 0xfc, 0xef, 0x5e, 0x38, 0xe2, 0x34, + 0xd3, 0xef, 0xc3, 0xfb, 0xab, 0x6f, 0x5f, 0xdc, 0x58, 0xda, 0xe5, 0x8d, 0xa5, 0xfd, 0xbc, 0xb1, + 0xb4, 0x4f, 0xb7, 0x56, 0xe2, 0xf2, 0xd6, 0x4a, 0x7c, 0xbf, 0xb5, 0x12, 0xaf, 0x97, 0x27, 0x3e, + 0x38, 0xbc, 0xdf, 0xc5, 0xec, 0x38, 0x23, 0xbe, 0x94, 0xbb, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x7a, 0x9c, 0xbc, 0x67, 0xea, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -613,7 +503,6 @@ type MsgClient interface { LazyRegisterOrder(ctx context.Context, in *MsgLazyRegisterOrder, opts ...grpc.CallOption) (*MsgLazyRegisterOrderResponse, error) CancelOrder(ctx context.Context, in *MsgCancelOrder, opts ...grpc.CallOption) (*MsgCancelOrderResponse, error) MatchOrder(ctx context.Context, in *MsgMatchOrder, opts ...grpc.CallOption) (*MsgMatchOrderResponse, error) - MatchLazyOrder(ctx context.Context, in *MsgMatchLazyOrder, opts ...grpc.CallOption) (*MsgMatchLazyOrderResponse, error) } type msgClient struct { @@ -660,15 +549,6 @@ func (c *msgClient) MatchOrder(ctx context.Context, in *MsgMatchOrder, opts ...g return out, nil } -func (c *msgClient) MatchLazyOrder(ctx context.Context, in *MsgMatchLazyOrder, opts ...grpc.CallOption) (*MsgMatchLazyOrderResponse, error) { - out := new(MsgMatchLazyOrderResponse) - err := c.cc.Invoke(ctx, "/gluon.contract.Msg/MatchLazyOrder", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the module @@ -677,7 +557,6 @@ type MsgServer interface { LazyRegisterOrder(context.Context, *MsgLazyRegisterOrder) (*MsgLazyRegisterOrderResponse, error) CancelOrder(context.Context, *MsgCancelOrder) (*MsgCancelOrderResponse, error) MatchOrder(context.Context, *MsgMatchOrder) (*MsgMatchOrderResponse, error) - MatchLazyOrder(context.Context, *MsgMatchLazyOrder) (*MsgMatchLazyOrderResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -696,9 +575,6 @@ func (*UnimplementedMsgServer) CancelOrder(ctx context.Context, req *MsgCancelOr func (*UnimplementedMsgServer) MatchOrder(ctx context.Context, req *MsgMatchOrder) (*MsgMatchOrderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MatchOrder not implemented") } -func (*UnimplementedMsgServer) MatchLazyOrder(ctx context.Context, req *MsgMatchLazyOrder) (*MsgMatchLazyOrderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MatchLazyOrder not implemented") -} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -776,24 +652,6 @@ func _Msg_MatchOrder_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_MatchLazyOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgMatchLazyOrder) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MatchLazyOrder(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gluon.contract.Msg/MatchLazyOrder", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MatchLazyOrder(ctx, req.(*MsgMatchLazyOrder)) - } - return interceptor(ctx, in, info, handler) -} - var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "gluon.contract.Msg", @@ -815,10 +673,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MatchOrder", Handler: _Msg_MatchOrder_Handler, }, - { - MethodName: "MatchLazyOrder", - Handler: _Msg_MatchLazyOrder_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "gluon/contract/tx.proto", @@ -1116,100 +970,6 @@ func (m *MsgMatchOrderResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgMatchLazyOrder) 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 *MsgMatchLazyOrder) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMatchLazyOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Price.Size() - i -= size - if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.OrderIdSell) > 0 { - i -= len(m.OrderIdSell) - copy(dAtA[i:], m.OrderIdSell) - i = encodeVarintTx(dAtA, i, uint64(len(m.OrderIdSell))) - i-- - dAtA[i] = 0x22 - } - if len(m.OrderIdBuy) > 0 { - i -= len(m.OrderIdBuy) - copy(dAtA[i:], m.OrderIdBuy) - i = encodeVarintTx(dAtA, i, uint64(len(m.OrderIdBuy))) - i-- - dAtA[i] = 0x1a - } - if len(m.AddressSell) > 0 { - i -= len(m.AddressSell) - copy(dAtA[i:], m.AddressSell) - i = encodeVarintTx(dAtA, i, uint64(len(m.AddressSell))) - i-- - dAtA[i] = 0x12 - } - if len(m.AddressBuy) > 0 { - i -= len(m.AddressBuy) - copy(dAtA[i:], m.AddressBuy) - i = encodeVarintTx(dAtA, i, uint64(len(m.AddressBuy))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgMatchLazyOrderResponse) 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 *MsgMatchLazyOrderResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMatchLazyOrderResponse) 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 @@ -1340,44 +1100,6 @@ func (m *MsgMatchOrderResponse) Size() (n int) { return n } -func (m *MsgMatchLazyOrder) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AddressBuy) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.AddressSell) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.OrderIdBuy) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.OrderIdSell) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Price.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgMatchLazyOrderResponse) 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 } @@ -2227,302 +1949,6 @@ func (m *MsgMatchOrderResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgMatchLazyOrder) 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: MsgMatchLazyOrder: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMatchLazyOrder: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressBuy", 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.AddressBuy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressSell", 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.AddressSell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderIdBuy", 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.OrderIdBuy = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrderIdSell", 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.OrderIdSell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", 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 - } - if err := m.Price.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 *MsgMatchLazyOrderResponse) 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: MsgMatchLazyOrderResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMatchLazyOrderResponse: 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