diff --git a/api/side/lending/query.pulsar.go b/api/side/lending/query.pulsar.go index 3598c077..f6c46f13 100644 --- a/api/side/lending/query.pulsar.go +++ b/api/side/lending/query.pulsar.go @@ -612,8 +612,8 @@ func (x *fastReflection_QueryLiquidationEventResponse) Interface() protoreflect. // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryLiquidationEventResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.EventId != "" { - value := protoreflect.ValueOfString(x.EventId) + if x.EventId != uint64(0) { + value := protoreflect.ValueOfUint64(x.EventId) if !f(fd_QueryLiquidationEventResponse_event_id, value) { return } @@ -652,7 +652,7 @@ func (x *fastReflection_QueryLiquidationEventResponse) Range(f func(protoreflect func (x *fastReflection_QueryLiquidationEventResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "side.lending.QueryLiquidationEventResponse.event_id": - return x.EventId != "" + return x.EventId != uint64(0) case "side.lending.QueryLiquidationEventResponse.oracle_pubkey": return x.OraclePubkey != "" case "side.lending.QueryLiquidationEventResponse.nonce": @@ -676,7 +676,7 @@ func (x *fastReflection_QueryLiquidationEventResponse) Has(fd protoreflect.Field func (x *fastReflection_QueryLiquidationEventResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "side.lending.QueryLiquidationEventResponse.event_id": - x.EventId = "" + x.EventId = uint64(0) case "side.lending.QueryLiquidationEventResponse.oracle_pubkey": x.OraclePubkey = "" case "side.lending.QueryLiquidationEventResponse.nonce": @@ -701,7 +701,7 @@ func (x *fastReflection_QueryLiquidationEventResponse) Get(descriptor protorefle switch descriptor.FullName() { case "side.lending.QueryLiquidationEventResponse.event_id": value := x.EventId - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfUint64(value) case "side.lending.QueryLiquidationEventResponse.oracle_pubkey": value := x.OraclePubkey return protoreflect.ValueOfString(value) @@ -732,7 +732,7 @@ func (x *fastReflection_QueryLiquidationEventResponse) Get(descriptor protorefle func (x *fastReflection_QueryLiquidationEventResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "side.lending.QueryLiquidationEventResponse.event_id": - x.EventId = value.Interface().(string) + x.EventId = value.Uint() case "side.lending.QueryLiquidationEventResponse.oracle_pubkey": x.OraclePubkey = value.Interface().(string) case "side.lending.QueryLiquidationEventResponse.nonce": @@ -781,7 +781,7 @@ func (x *fastReflection_QueryLiquidationEventResponse) Mutable(fd protoreflect.F func (x *fastReflection_QueryLiquidationEventResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "side.lending.QueryLiquidationEventResponse.event_id": - return protoreflect.ValueOfString("") + return protoreflect.ValueOfUint64(uint64(0)) case "side.lending.QueryLiquidationEventResponse.oracle_pubkey": return protoreflect.ValueOfString("") case "side.lending.QueryLiquidationEventResponse.nonce": @@ -857,9 +857,8 @@ func (x *fastReflection_QueryLiquidationEventResponse) ProtoMethods() *protoifac var n int var l int _ = l - l = len(x.EventId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.EventId != 0 { + n += 1 + runtime.Sov(uint64(x.EventId)) } l = len(x.OraclePubkey) if l > 0 { @@ -923,12 +922,10 @@ func (x *fastReflection_QueryLiquidationEventResponse) ProtoMethods() *protoifac i-- dAtA[i] = 0x12 } - if len(x.EventId) > 0 { - i -= len(x.EventId) - copy(dAtA[i:], x.EventId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.EventId))) + if x.EventId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EventId)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -980,10 +977,10 @@ func (x *fastReflection_QueryLiquidationEventResponse) ProtoMethods() *protoifac } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) } - var stringLen uint64 + x.EventId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -993,24 +990,11 @@ func (x *fastReflection_QueryLiquidationEventResponse) ProtoMethods() *protoifac } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.EventId |= 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.EventId = 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 OraclePubkey", wireType) @@ -4689,7 +4673,7 @@ type QueryLiquidationEventResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` + EventId uint64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` OraclePubkey string `protobuf:"bytes,2,opt,name=oracle_pubkey,json=oraclePubkey,proto3" json:"oracle_pubkey,omitempty"` Nonce string `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` Price string `protobuf:"bytes,4,opt,name=price,proto3" json:"price,omitempty"` @@ -4715,11 +4699,11 @@ func (*QueryLiquidationEventResponse) Descriptor() ([]byte, []int) { return file_side_lending_query_proto_rawDescGZIP(), []int{1} } -func (x *QueryLiquidationEventResponse) GetEventId() string { +func (x *QueryLiquidationEventResponse) GetEventId() uint64 { if x != nil { return x.EventId } - return "" + return 0 } func (x *QueryLiquidationEventResponse) GetOraclePubkey() string { @@ -5072,7 +5056,7 @@ var file_side_lending_query_proto_rawDesc = []byte{ 0x72, 0x61, 0x6c, 0x41, 0x63, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, @@ -5095,79 +5079,79 @@ var file_side_lending_query_proto_rawDesc = []byte{ 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, - 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6c, - 0x6f, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, - 0x61, 0x6e, 0x49, 0x64, 0x22, 0x49, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, - 0x6e, 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, - 0x04, 0x63, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x69, - 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x45, 0x54, 0x73, 0x42, - 0x08, 0xe2, 0xde, 0x1f, 0x04, 0x43, 0x45, 0x54, 0x73, 0x52, 0x04, 0x63, 0x65, 0x74, 0x73, 0x22, - 0x32, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f, - 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x61, - 0x6e, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x78, 0x32, 0xb3, 0x05, 0x0a, 0x05, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x6b, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, - 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x21, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x73, 0x69, - 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x98, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, - 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, - 0x72, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x73, 0x69, 0x64, - 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, - 0x65, 0x72, 0x61, 0x6c, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x94, 0x01, 0x0a, - 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, + 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x49, 0x0a, 0x15, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x63, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x2e, 0x43, 0x45, 0x54, 0x73, 0x42, 0x08, 0xe2, 0xde, 0x1f, 0x04, 0x43, 0x45, 0x54, 0x73, 0x52, + 0x04, 0x63, 0x65, 0x74, 0x73, 0x22, 0x32, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x6f, 0x61, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x35, 0x0a, 0x18, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x78, + 0x32, 0xb3, 0x05, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x6b, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x16, 0x12, 0x14, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x11, 0x43, 0x6f, 0x6c, 0x6c, + 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x08, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, 0x12, - 0x22, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, - 0x12, 0x17, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, - 0x6c, 0x6f, 0x61, 0x6e, 0x2f, 0x63, 0x65, 0x74, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x55, 0x6e, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x12, - 0x25, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x6f, 0x61, 0x6e, 0x2f, 0x72, 0x65, 0x70, 0x61, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x78, - 0x42, 0x8e, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0xa2, 0x02, 0x03, 0x53, 0x4c, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x69, 0x64, 0x65, 0x2e, - 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x0c, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x4c, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x18, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x4c, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0d, 0x53, 0x69, 0x64, 0x65, 0x3a, 0x3a, 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x69, 0x64, + 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, + 0x12, 0x20, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, + 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, + 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x08, 0x4c, 0x6f, 0x61, + 0x6e, 0x43, 0x45, 0x54, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x61, 0x6e, 0x43, 0x45, + 0x54, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x69, 0x64, 0x65, + 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, + 0x61, 0x6e, 0x43, 0x45, 0x54, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x6f, 0x61, 0x6e, 0x2f, 0x63, 0x65, 0x74, 0x73, 0x12, + 0x94, 0x01, 0x0a, 0x11, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x54, 0x78, 0x12, 0x25, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, + 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x73, + 0x69, 0x64, 0x65, 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x6c, 0x6f, 0x61, 0x6e, + 0x2f, 0x72, 0x65, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x75, 0x6e, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x5f, 0x74, 0x78, 0x42, 0x8e, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x69, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, + 0x2f, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0xa2, 0x02, 0x03, 0x53, 0x4c, 0x58, 0xaa, 0x02, + 0x0c, 0x53, 0x69, 0x64, 0x65, 0x2e, 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0xca, 0x02, 0x0c, + 0x53, 0x69, 0x64, 0x65, 0x5c, 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0xe2, 0x02, 0x18, 0x53, + 0x69, 0x64, 0x65, 0x5c, 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x53, 0x69, 0x64, 0x65, 0x3a, 0x3a, + 0x4c, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/side/lending/query.proto b/proto/side/lending/query.proto index 28fcf776..b4688fc0 100644 --- a/proto/side/lending/query.proto +++ b/proto/side/lending/query.proto @@ -40,7 +40,7 @@ message QueryLiquidationEventRequest{ } message QueryLiquidationEventResponse { - string event_id = 1; + uint64 event_id = 1; string oracle_pubkey = 2; string nonce = 3; string price = 4; @@ -63,7 +63,7 @@ message QueryParamsRequest { // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - Params params = 1; + Params params = 1 [(gogoproto.nullable) = false]; } // QueryLoanCETsRequest is request type for the Query/LoanCETs RPC method. diff --git a/x/lending/keeper/queries.go b/x/lending/keeper/queries.go index a11bdbf7..57e6412a 100644 --- a/x/lending/keeper/queries.go +++ b/x/lending/keeper/queries.go @@ -3,32 +3,85 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/sideprotocol/side/x/lending/types" ) var _ types.QueryServer = Keeper{} // CollateralAddress implements types.QueryServer. -func (k Keeper) CollateralAddress(context.Context, *types.QueryCollateralAddressRequest) (*types.QueryCollateralAddressResponse, error) { - panic("unimplemented") +func (k Keeper) CollateralAddress(goCtx context.Context, req *types.QueryCollateralAddressRequest) (*types.QueryCollateralAddressResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + // TODO: query the DCA public key + dcaPubKey := "" + + collateralAddr, err := types.CreateVaultAddress(req.BorrowerPubkey, dcaPubKey, req.HashOfLoanSecret, int64(req.MaturityTime), int64(req.FinalTimeout)) + if err != nil { + return nil, err + } + + return &types.QueryCollateralAddressResponse{Address: collateralAddr}, nil } // LiquidationEvent implements types.QueryServer. -func (k Keeper) LiquidationEvent(context.Context, *types.QueryLiquidationEventRequest) (*types.QueryLiquidationEventResponse, error) { - panic("unimplemented") +func (k Keeper) LiquidationEvent(goCtx context.Context, req *types.QueryLiquidationEventRequest) (*types.QueryLiquidationEventResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + liquidationPrice := types.GetLiquidationPrice(req.CollateralAcmount.Amount, req.BorrowAmount.Amount, k.GetParams(ctx).LiquidationThresholdPercent) + + event := k.dlcKeeper.GetEventByPrice(ctx, liquidationPrice) + if event == nil { + return nil, nil + } + + return &types.QueryLiquidationEventResponse{ + EventId: event.Id, + OraclePubkey: event.Pubkey, + Nonce: event.Nonce, + Price: event.TriggerPrice.String(), + }, nil } // LoanCETs implements types.QueryServer. -func (k Keeper) LoanCETs(context.Context, *types.QueryLoanCETsRequest) (*types.QueryLoanCETsResponse, error) { - panic("unimplemented") -} +func (k Keeper) LoanCETs(goCtx context.Context, req *types.QueryLoanCETsRequest) (*types.QueryLoanCETsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } -// Params implements types.QueryServer. -func (k Keeper) Params(context.Context, *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - panic("unimplemented") + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryLoanCETsResponse{CETs: k.GetCETs(ctx, req.LoanId)}, nil } // UnsignedPaymentTx implements types.QueryServer. -func (k Keeper) UnsignedPaymentTx(context.Context, *types.QueryRepaymentTxRequest) (*types.QueryRepaymentTxResponse, error) { - panic("unimplemented") +func (k Keeper) UnsignedPaymentTx(goCtx context.Context, req *types.QueryRepaymentTxRequest) (*types.QueryRepaymentTxResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryRepaymentTxResponse{ClaimTx: k.GetRepayment(ctx, req.LoanId).Tx}, nil +} + +// Params implements types.QueryServer. +func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } diff --git a/x/lending/types/expected_keepers.go b/x/lending/types/expected_keepers.go index 99057b65..fb09efb6 100644 --- a/x/lending/types/expected_keepers.go +++ b/x/lending/types/expected_keepers.go @@ -3,8 +3,9 @@ package types import ( "context" - sdkmath "cosmossdk.io/math" "github.com/btcsuite/btcd/btcutil" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" banktype "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -52,7 +53,9 @@ type AuctionKeeper interface { // DLCKeeper defines the expected DLC keeper interface type DLCKeeper interface { HasEvent(ctx sdk.Context, id uint64) bool + GetEvent(ctx sdk.Context, id uint64) *dlctypes.DLCPriceEvent + GetEventByPrice(ctx sdk.Context, price sdkmath.Int) *dlctypes.DLCPriceEvent GetAttestationByEvent(ctx sdk.Context, eventId uint64) *dlctypes.DLCAttestation TriggerEvent(ctx sdk.Context, id uint64) diff --git a/x/lending/types/query.pb.go b/x/lending/types/query.pb.go index 6234e5d6..e84213eb 100644 --- a/x/lending/types/query.pb.go +++ b/x/lending/types/query.pb.go @@ -84,7 +84,7 @@ func (m *QueryLiquidationEventRequest) GetCollateralAcmount() *types.Coin { } type QueryLiquidationEventResponse struct { - EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` + EventId uint64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` OraclePubkey string `protobuf:"bytes,2,opt,name=oracle_pubkey,json=oraclePubkey,proto3" json:"oracle_pubkey,omitempty"` Nonce string `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"` Price string `protobuf:"bytes,4,opt,name=price,proto3" json:"price,omitempty"` @@ -123,11 +123,11 @@ func (m *QueryLiquidationEventResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryLiquidationEventResponse proto.InternalMessageInfo -func (m *QueryLiquidationEventResponse) GetEventId() string { +func (m *QueryLiquidationEventResponse) GetEventId() uint64 { if m != nil { return m.EventId } - return "" + return 0 } func (m *QueryLiquidationEventResponse) GetOraclePubkey() string { @@ -302,7 +302,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse is response type for the Query/Params RPC method. type QueryParamsResponse struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -338,11 +338,11 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() *Params { +func (m *QueryParamsResponse) GetParams() Params { if m != nil { return m.Params } - return nil + return Params{} } // QueryLoanCETsRequest is request type for the Query/LoanCETs RPC method. @@ -539,58 +539,58 @@ func init() { func init() { proto.RegisterFile("side/lending/query.proto", fileDescriptor_27db04072aa81358) } var fileDescriptor_27db04072aa81358 = []byte{ - // 807 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0x41, 0x4f, 0xdb, 0x48, - 0x14, 0xc7, 0x31, 0x1b, 0x02, 0xcc, 0x86, 0x5d, 0x18, 0xb2, 0x4b, 0x62, 0xb1, 0x06, 0x8c, 0x76, - 0x41, 0xc0, 0xda, 0xc0, 0x6a, 0x2f, 0x7b, 0x58, 0x09, 0x22, 0x56, 0x8b, 0x84, 0x54, 0x9a, 0xa6, - 0x97, 0x5e, 0xac, 0x89, 0x3d, 0x98, 0x11, 0xf6, 0x8c, 0xb1, 0xc7, 0x34, 0xb9, 0xf6, 0xda, 0x4b, - 0xa5, 0xf6, 0xd0, 0x8f, 0xd0, 0x7b, 0x3f, 0x41, 0x6f, 0x3d, 0x22, 0xf5, 0xd2, 0x53, 0x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0x02, 0xc7, 0x84, 0xcb, 0x45, 0x9c, 0xfe, 0x05, 0xb7, 0xd5, 0x4e, 0xc1, - 0x37, 0x1a, 0x98, 0xbd, 0x7d, 0xb9, 0xe1, 0xc6, 0x10, 0xb3, 0x11, 0x1f, 0x2b, 0x7d, 0xf3, 0x41, - 0x5a, 0xc5, 0xb5, 0x26, 0xb8, 0x56, 0xe0, 0x52, 0x91, 0x2b, 0xe8, 0xeb, 0x6d, 0x71, 0xd5, 0x21, - 0x07, 0x53, 0xf9, 0x66, 0x41, 0x73, 0x98, 0x43, 0x71, 0x4f, 0xf5, 0xd5, 0x3b, 0x35, 0xca, 0x7d, - 0x49, 0xb8, 0xd7, 0xe1, 0xc2, 0x2d, 0x77, 0x86, 0xa8, 0x9d, 0x6d, 0x62, 0x36, 0x8c, 0xb9, 0xa7, - 0x34, 0x21, 0x3e, 0xc5, 0xde, 0x71, 0xbe, 0x57, 0xf0, 0xf7, 0x21, 0xbd, 0x07, 0x77, 0x55, 0xff, - 0xe3, 0x3e, 0x99, 0xa2, 0xd8, 0x16, 0x14, 0x1b, 0x70, 0x7d, 0x08, 0x45, 0x9c, 0xeb, 0xed, 0x54, - 0x61, 0x38, 0xbc, 0xb3, 0xff, 0xdf, 0xc7, 0x9e, 0xa1, 0x5d, 0xf6, 0x0c, 0xed, 0x6b, 0xcf, 0xd0, - 0x5e, 0x5d, 0x19, 0x63, 0x97, 0x57, 0xc6, 0xd8, 0xe7, 0x2b, 0x63, 0xec, 0xd9, 0x96, 0x4f, 0xf8, - 0x69, 0xda, 0xb6, 0x5c, 0x16, 0x8a, 0x6e, 0xe2, 0x07, 0xc6, 0x65, 0x81, 0x6c, 0xdd, 0xb9, 0x6e, - 0xce, 0xbb, 0x11, 0x4e, 0xda, 0x65, 0x91, 0xfe, 0xeb, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, - 0x99, 0xc5, 0x19, 0x60, 0x07, 0x00, 0x00, + // 813 bytes of a gzipped FileDescriptor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, 0xc6, 0x28, 0x41, 0x51, 0x61, 0xa3, 0x97, 0x52, 0xea, + 0xaf, 0xcc, 0x99, 0x7f, 0x68, 0x60, 0xed, 0xdb, 0xdc, 0xf9, 0x94, 0x5c, 0x65, 0xc4, 0x17, 0x8e, + 0x27, 0xd7, 0x98, 0x72, 0x07, 0x5f, 0x65, 0x38, 0xe5, 0xf0, 0x4b, 0xb0, 0xd8, 0x67, 0x49, 0xc2, + 0x7e, 0x74, 0x51, 0xc4, 0x32, 0xca, 0x9b, 0xda, 0xba, 0xb6, 0xfd, 0x6e, 0xa7, 0x65, 0x49, 0x1e, + 0x2b, 0xe7, 0xb1, 0x14, 0x8f, 0x75, 0xcc, 0x08, 0x75, 0xea, 0x52, 0x7f, 0x28, 0xe4, 0xf0, 0x6b, + 0x00, 0x3d, 0x16, 0x86, 0x88, 0xe3, 0x04, 0x85, 0x2e, 0xf2, 0x64, 0x93, 0x37, 0x2f, 0x35, 0x59, + 0x1e, 0x17, 0x1d, 0xca, 0x1a, 0xf3, 0x67, 0x0d, 0x7c, 0x34, 0x03, 0x35, 0x8d, 0x19, 0x4d, 0x31, + 0x6c, 0x81, 0x05, 0x9c, 0x07, 0x5c, 0xe2, 0x0b, 0xcc, 0xaa, 0x33, 0x2f, 0xce, 0x5d, 0x1f, 0x6e, + 0x82, 0x45, 0x96, 0x20, 0x2f, 0xc4, 0x6e, 0x9c, 0xf5, 0x2f, 0xf1, 0x50, 0x10, 0xbc, 0x75, 0xea, + 0x32, 0x78, 0x26, 0x62, 0xb0, 0x01, 0xe6, 0x28, 0xa3, 0x1e, 0x6e, 0xbe, 0x23, 0x92, 0xf2, 0x90, + 0x47, 0xe3, 0x84, 0x78, 0xb8, 0x59, 0x95, 0x51, 0x71, 0x30, 0xff, 0x2a, 0x68, 0x8e, 0xc7, 0xa0, + 0xbe, 0x9f, 0xe0, 0x34, 0x2d, 0x26, 0xb7, 0x05, 0xde, 0x97, 0x93, 0xc0, 0x49, 0x61, 0xaa, 0x89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 0xa0, 0xd8, 0x81, 0xdb, + 0x53, 0x28, 0x92, 0x42, 0x6f, 0x67, 0x0a, 0xc3, 0xe5, 0x83, 0xa3, 0xaf, 0x6e, 0x46, 0x86, 0x76, + 0x3b, 0x32, 0xb4, 0x7f, 0x47, 0x86, 0xf6, 0xcb, 0xbd, 0x51, 0xb9, 0xbd, 0x37, 0x2a, 0xff, 0xdc, + 0x1b, 0x95, 0x1f, 0xf6, 0x02, 0xc2, 0x2f, 0xb2, 0xbe, 0xe5, 0xb1, 0x48, 0x74, 0x13, 0x3f, 0x33, + 0x1e, 0x0b, 0x65, 0xeb, 0xc1, 0x43, 0x73, 0x3e, 0x8c, 0x71, 0xda, 0xaf, 0x89, 0xf4, 0x67, 0xff, + 0x07, 0x00, 0x00, 0xff, 0xff, 0x40, 0x71, 0x2a, 0x0e, 0x66, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -908,12 +908,10 @@ func (m *QueryLiquidationEventResponse) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x12 } - if len(m.EventId) > 0 { - i -= len(m.EventId) - copy(dAtA[i:], m.EventId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.EventId))) + if m.EventId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EventId)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1038,18 +1036,16 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1212,9 +1208,8 @@ func (m *QueryLiquidationEventResponse) Size() (n int) { } var l int _ = l - l = len(m.EventId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.EventId != 0 { + n += 1 + sovQuery(uint64(m.EventId)) } l = len(m.OraclePubkey) if l > 0 { @@ -1282,10 +1277,8 @@ func (m *QueryParamsResponse) Size() (n int) { } var l int _ = l - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -1499,10 +1492,10 @@ func (m *QueryLiquidationEventResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field EventId", wireType) } - var stringLen uint64 + m.EventId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1512,24 +1505,11 @@ func (m *QueryLiquidationEventResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.EventId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EventId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OraclePubkey", wireType) @@ -1989,9 +1969,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Params == nil { - m.Params = &Params{} - } if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }