diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index f35bd9507..be2f40ed4 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -46437,6 +46437,42 @@ paths: } tags: - Query + /tellor-io/layer/dispute/params: + get: + summary: Parameters queries the parameters of the module. + operationId: LayerDisputeParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query /layer/oracle/get_reportsby_qid/{qId}: get: summary: Queries a list of GetReportsbyQid items. @@ -75482,6 +75518,16 @@ definitions: description: |- Version defines the versioning scheme used to negotiate the IBC verison in the connection handshake. + layer.dispute.Params: + type: object + description: Params defines the parameters for the module. + layer.dispute.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. layer.oracle.MicroReport: type: object properties: diff --git a/proto/layer/dispute/dispute.proto b/proto/layer/dispute/dispute.proto new file mode 100644 index 000000000..e02ceb4c3 --- /dev/null +++ b/proto/layer/dispute/dispute.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package layer.dispute; + +option go_package = "github.com/tellor-io/layer/x/dispute/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "layer/dispute/payment_info.proto"; + +message Dispute { + + bytes hashId = 1; // represents the hash of Report+category + uint64 disputeId = 2; + DisputeCategory category = 3; + uint64 disputeFee = 4; + uint64 startTime = 5; + uint64 endTime = 6; + uint64 block = 7; + DisputeStatus status = 8; + MicroReport report = 9; + repeated PaymentInfo feePayers = 10 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin feeTotal = 11 [(gogoproto.nullable) = false]; + uint64 round = 12; + repeated uint64 prevDisputeIds = 13; +} + +enum DisputeCategory { + INVALID = 0; + WARNING = 1; + MINOR = 2; + MAJOR = 3; +} + +enum DisputeStatus { + PREVOTE = 0; // CURRENTLY IN WAITING PERIOD + VOTING = 1; // VOTING IN PROGRESS + RESOLVED = 2; // VOTING CONCLUDED AND QUORUM REACHED + UNRESOLVED = 3; // VOTING FAILED TO REACH QUORUM + FAILED = 4; // FEES NOT MET TO BEGIN VOTING +} + +message MicroReport { + string reporter = 1; + string qid = 2; + string value = 3; + uint64 timestamp = 4; +} \ No newline at end of file diff --git a/proto/layer/dispute/dispute_params.proto b/proto/layer/dispute/dispute_params.proto new file mode 100644 index 000000000..4a2ac9236 --- /dev/null +++ b/proto/layer/dispute/dispute_params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package layer.dispute; + +option go_package = "github.com/tellor-io/layer/x/dispute/types"; +import "gogoproto/gogo.proto"; +import "layer/dispute/dispute.proto"; + +message DisputeParams { + + MicroReport report = 1 [(gogoproto.nullable) = false]; + DisputeCategory category = 2; +} diff --git a/proto/layer/dispute/payment_info.proto b/proto/layer/dispute/payment_info.proto new file mode 100644 index 000000000..d4aeb49dd --- /dev/null +++ b/proto/layer/dispute/payment_info.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package layer.dispute; + +option go_package = "github.com/tellor-io/layer/x/dispute/types"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +message PaymentInfo { + + bytes disputer = 1; //sdk.AccAddress type + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; +} diff --git a/x/dispute/types/dispute.pb.go b/x/dispute/types/dispute.pb.go new file mode 100644 index 000000000..a8e9a1116 --- /dev/null +++ b/x/dispute/types/dispute.pb.go @@ -0,0 +1,1284 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: layer/dispute/dispute.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DisputeCategory int32 + +const ( + DisputeCategory_INVALID DisputeCategory = 0 + DisputeCategory_WARNING DisputeCategory = 1 + DisputeCategory_MINOR DisputeCategory = 2 + DisputeCategory_MAJOR DisputeCategory = 3 +) + +var DisputeCategory_name = map[int32]string{ + 0: "INVALID", + 1: "WARNING", + 2: "MINOR", + 3: "MAJOR", +} + +var DisputeCategory_value = map[string]int32{ + "INVALID": 0, + "WARNING": 1, + "MINOR": 2, + "MAJOR": 3, +} + +func (x DisputeCategory) String() string { + return proto.EnumName(DisputeCategory_name, int32(x)) +} + +func (DisputeCategory) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2a5d4b70d69c78b5, []int{0} +} + +type DisputeStatus int32 + +const ( + DisputeStatus_PREVOTE DisputeStatus = 0 + DisputeStatus_VOTING DisputeStatus = 1 + DisputeStatus_RESOLVED DisputeStatus = 2 + DisputeStatus_UNRESOLVED DisputeStatus = 3 + DisputeStatus_FAILED DisputeStatus = 4 +) + +var DisputeStatus_name = map[int32]string{ + 0: "PREVOTE", + 1: "VOTING", + 2: "RESOLVED", + 3: "UNRESOLVED", + 4: "FAILED", +} + +var DisputeStatus_value = map[string]int32{ + "PREVOTE": 0, + "VOTING": 1, + "RESOLVED": 2, + "UNRESOLVED": 3, + "FAILED": 4, +} + +func (x DisputeStatus) String() string { + return proto.EnumName(DisputeStatus_name, int32(x)) +} + +func (DisputeStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2a5d4b70d69c78b5, []int{1} +} + +type Dispute struct { + HashId []byte `protobuf:"bytes,1,opt,name=hashId,proto3" json:"hashId,omitempty"` + DisputeId uint64 `protobuf:"varint,2,opt,name=disputeId,proto3" json:"disputeId,omitempty"` + Category DisputeCategory `protobuf:"varint,3,opt,name=category,proto3,enum=layer.dispute.DisputeCategory" json:"category,omitempty"` + DisputeFee uint64 `protobuf:"varint,4,opt,name=disputeFee,proto3" json:"disputeFee,omitempty"` + StartTime uint64 `protobuf:"varint,5,opt,name=startTime,proto3" json:"startTime,omitempty"` + EndTime uint64 `protobuf:"varint,6,opt,name=endTime,proto3" json:"endTime,omitempty"` + Block uint64 `protobuf:"varint,7,opt,name=block,proto3" json:"block,omitempty"` + Status DisputeStatus `protobuf:"varint,8,opt,name=status,proto3,enum=layer.dispute.DisputeStatus" json:"status,omitempty"` + Report *MicroReport `protobuf:"bytes,9,opt,name=report,proto3" json:"report,omitempty"` + FeePayers []PaymentInfo `protobuf:"bytes,10,rep,name=feePayers,proto3" json:"feePayers"` + FeeTotal types.Coin `protobuf:"bytes,11,opt,name=feeTotal,proto3" json:"feeTotal"` + Round uint64 `protobuf:"varint,12,opt,name=round,proto3" json:"round,omitempty"` + PrevDisputeIds []uint64 `protobuf:"varint,13,rep,packed,name=prevDisputeIds,proto3" json:"prevDisputeIds,omitempty"` +} + +func (m *Dispute) Reset() { *m = Dispute{} } +func (m *Dispute) String() string { return proto.CompactTextString(m) } +func (*Dispute) ProtoMessage() {} +func (*Dispute) Descriptor() ([]byte, []int) { + return fileDescriptor_2a5d4b70d69c78b5, []int{0} +} +func (m *Dispute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Dispute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Dispute.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 *Dispute) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dispute.Merge(m, src) +} +func (m *Dispute) XXX_Size() int { + return m.Size() +} +func (m *Dispute) XXX_DiscardUnknown() { + xxx_messageInfo_Dispute.DiscardUnknown(m) +} + +var xxx_messageInfo_Dispute proto.InternalMessageInfo + +func (m *Dispute) GetHashId() []byte { + if m != nil { + return m.HashId + } + return nil +} + +func (m *Dispute) GetDisputeId() uint64 { + if m != nil { + return m.DisputeId + } + return 0 +} + +func (m *Dispute) GetCategory() DisputeCategory { + if m != nil { + return m.Category + } + return DisputeCategory_INVALID +} + +func (m *Dispute) GetDisputeFee() uint64 { + if m != nil { + return m.DisputeFee + } + return 0 +} + +func (m *Dispute) GetStartTime() uint64 { + if m != nil { + return m.StartTime + } + return 0 +} + +func (m *Dispute) GetEndTime() uint64 { + if m != nil { + return m.EndTime + } + return 0 +} + +func (m *Dispute) GetBlock() uint64 { + if m != nil { + return m.Block + } + return 0 +} + +func (m *Dispute) GetStatus() DisputeStatus { + if m != nil { + return m.Status + } + return DisputeStatus_PREVOTE +} + +func (m *Dispute) GetReport() *MicroReport { + if m != nil { + return m.Report + } + return nil +} + +func (m *Dispute) GetFeePayers() []PaymentInfo { + if m != nil { + return m.FeePayers + } + return nil +} + +func (m *Dispute) GetFeeTotal() types.Coin { + if m != nil { + return m.FeeTotal + } + return types.Coin{} +} + +func (m *Dispute) GetRound() uint64 { + if m != nil { + return m.Round + } + return 0 +} + +func (m *Dispute) GetPrevDisputeIds() []uint64 { + if m != nil { + return m.PrevDisputeIds + } + return nil +} + +type MicroReport struct { + Reporter string `protobuf:"bytes,1,opt,name=reporter,proto3" json:"reporter,omitempty"` + Qid string `protobuf:"bytes,2,opt,name=qid,proto3" json:"qid,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (m *MicroReport) Reset() { *m = MicroReport{} } +func (m *MicroReport) String() string { return proto.CompactTextString(m) } +func (*MicroReport) ProtoMessage() {} +func (*MicroReport) Descriptor() ([]byte, []int) { + return fileDescriptor_2a5d4b70d69c78b5, []int{1} +} +func (m *MicroReport) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MicroReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MicroReport.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 *MicroReport) XXX_Merge(src proto.Message) { + xxx_messageInfo_MicroReport.Merge(m, src) +} +func (m *MicroReport) XXX_Size() int { + return m.Size() +} +func (m *MicroReport) XXX_DiscardUnknown() { + xxx_messageInfo_MicroReport.DiscardUnknown(m) +} + +var xxx_messageInfo_MicroReport proto.InternalMessageInfo + +func (m *MicroReport) GetReporter() string { + if m != nil { + return m.Reporter + } + return "" +} + +func (m *MicroReport) GetQid() string { + if m != nil { + return m.Qid + } + return "" +} + +func (m *MicroReport) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *MicroReport) GetTimestamp() uint64 { + if m != nil { + return m.Timestamp + } + return 0 +} + +func init() { + proto.RegisterEnum("layer.dispute.DisputeCategory", DisputeCategory_name, DisputeCategory_value) + proto.RegisterEnum("layer.dispute.DisputeStatus", DisputeStatus_name, DisputeStatus_value) + proto.RegisterType((*Dispute)(nil), "layer.dispute.Dispute") + proto.RegisterType((*MicroReport)(nil), "layer.dispute.MicroReport") +} + +func init() { proto.RegisterFile("layer/dispute/dispute.proto", fileDescriptor_2a5d4b70d69c78b5) } + +var fileDescriptor_2a5d4b70d69c78b5 = []byte{ + // 595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x51, 0x4f, 0xdb, 0x3c, + 0x14, 0x6d, 0x68, 0x69, 0x9b, 0x5b, 0xe0, 0x8b, 0x2c, 0xf4, 0xc9, 0xeb, 0x50, 0x16, 0xf1, 0x30, + 0x55, 0x48, 0x4b, 0x04, 0xdb, 0xd3, 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x00, 0x00, 0xff, 0xff, 0x51, 0xac, 0x47, 0xaa, 0xeb, + 0x03, 0x00, 0x00, +} + +func (m *Dispute) 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 *Dispute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Dispute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PrevDisputeIds) > 0 { + dAtA2 := make([]byte, len(m.PrevDisputeIds)*10) + var j1 int + for _, num := range m.PrevDisputeIds { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintDispute(dAtA, i, uint64(j1)) + i-- + dAtA[i] = 0x6a + } + if m.Round != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.Round)) + i-- + dAtA[i] = 0x60 + } + { + size, err := m.FeeTotal.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispute(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + if len(m.FeePayers) > 0 { + for iNdEx := len(m.FeePayers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeePayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispute(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if m.Report != nil { + { + size, err := m.Report.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDispute(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Status != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x40 + } + if m.Block != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.Block)) + i-- + dAtA[i] = 0x38 + } + if m.EndTime != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.EndTime)) + i-- + dAtA[i] = 0x30 + } + if m.StartTime != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x28 + } + if m.DisputeFee != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.DisputeFee)) + i-- + dAtA[i] = 0x20 + } + if m.Category != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.Category)) + i-- + dAtA[i] = 0x18 + } + if m.DisputeId != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.DisputeId)) + i-- + dAtA[i] = 0x10 + } + if len(m.HashId) > 0 { + i -= len(m.HashId) + copy(dAtA[i:], m.HashId) + i = encodeVarintDispute(dAtA, i, uint64(len(m.HashId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MicroReport) 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 *MicroReport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MicroReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Timestamp != 0 { + i = encodeVarintDispute(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x20 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintDispute(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x1a + } + if len(m.Qid) > 0 { + i -= len(m.Qid) + copy(dAtA[i:], m.Qid) + i = encodeVarintDispute(dAtA, i, uint64(len(m.Qid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Reporter) > 0 { + i -= len(m.Reporter) + copy(dAtA[i:], m.Reporter) + i = encodeVarintDispute(dAtA, i, uint64(len(m.Reporter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDispute(dAtA []byte, offset int, v uint64) int { + offset -= sovDispute(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Dispute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HashId) + if l > 0 { + n += 1 + l + sovDispute(uint64(l)) + } + if m.DisputeId != 0 { + n += 1 + sovDispute(uint64(m.DisputeId)) + } + if m.Category != 0 { + n += 1 + sovDispute(uint64(m.Category)) + } + if m.DisputeFee != 0 { + n += 1 + sovDispute(uint64(m.DisputeFee)) + } + if m.StartTime != 0 { + n += 1 + sovDispute(uint64(m.StartTime)) + } + if m.EndTime != 0 { + n += 1 + sovDispute(uint64(m.EndTime)) + } + if m.Block != 0 { + n += 1 + sovDispute(uint64(m.Block)) + } + if m.Status != 0 { + n += 1 + sovDispute(uint64(m.Status)) + } + if m.Report != nil { + l = m.Report.Size() + n += 1 + l + sovDispute(uint64(l)) + } + if len(m.FeePayers) > 0 { + for _, e := range m.FeePayers { + l = e.Size() + n += 1 + l + sovDispute(uint64(l)) + } + } + l = m.FeeTotal.Size() + n += 1 + l + sovDispute(uint64(l)) + if m.Round != 0 { + n += 1 + sovDispute(uint64(m.Round)) + } + if len(m.PrevDisputeIds) > 0 { + l = 0 + for _, e := range m.PrevDisputeIds { + l += sovDispute(uint64(e)) + } + n += 1 + sovDispute(uint64(l)) + l + } + return n +} + +func (m *MicroReport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Reporter) + if l > 0 { + n += 1 + l + sovDispute(uint64(l)) + } + l = len(m.Qid) + if l > 0 { + n += 1 + l + sovDispute(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovDispute(uint64(l)) + } + if m.Timestamp != 0 { + n += 1 + sovDispute(uint64(m.Timestamp)) + } + return n +} + +func sovDispute(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDispute(x uint64) (n int) { + return sovDispute(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Dispute) 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 ErrIntOverflowDispute + } + 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: Dispute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Dispute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HashId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashId = append(m.HashId[:0], dAtA[iNdEx:postIndex]...) + if m.HashId == nil { + m.HashId = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisputeId", wireType) + } + m.DisputeId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisputeId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + m.Category = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Category |= DisputeCategory(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisputeFee", wireType) + } + m.DisputeFee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisputeFee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + m.EndTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + m.Block = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Block |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DisputeStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Report == nil { + m.Report = &MicroReport{} + } + if err := m.Report.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayers = append(m.FeePayers, PaymentInfo{}) + if err := m.FeePayers[len(m.FeePayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeTotal", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeTotal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) + } + m.Round = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Round |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PrevDisputeIds = append(m.PrevDisputeIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthDispute + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.PrevDisputeIds) == 0 { + m.PrevDisputeIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PrevDisputeIds = append(m.PrevDisputeIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PrevDisputeIds", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipDispute(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDispute + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MicroReport) 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 ErrIntOverflowDispute + } + 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: MicroReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MicroReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reporter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + 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 ErrInvalidLengthDispute + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reporter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Qid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + 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 ErrInvalidLengthDispute + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Qid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + 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 ErrInvalidLengthDispute + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDispute + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDispute + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDispute(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDispute + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDispute(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDispute + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDispute + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDispute + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDispute + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDispute + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDispute + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDispute = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDispute = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDispute = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/dispute/types/dispute_params.pb.go b/x/dispute/types/dispute_params.pb.go new file mode 100644 index 000000000..829d8647d --- /dev/null +++ b/x/dispute/types/dispute_params.pb.go @@ -0,0 +1,359 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: layer/dispute/dispute_params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type DisputeParams struct { + Report MicroReport `protobuf:"bytes,1,opt,name=report,proto3" json:"report"` + Category DisputeCategory `protobuf:"varint,2,opt,name=category,proto3,enum=layer.dispute.DisputeCategory" json:"category,omitempty"` +} + +func (m *DisputeParams) Reset() { *m = DisputeParams{} } +func (m *DisputeParams) String() string { return proto.CompactTextString(m) } +func (*DisputeParams) ProtoMessage() {} +func (*DisputeParams) Descriptor() ([]byte, []int) { + return fileDescriptor_2b782315e5e42770, []int{0} +} +func (m *DisputeParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DisputeParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DisputeParams.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 *DisputeParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DisputeParams.Merge(m, src) +} +func (m *DisputeParams) XXX_Size() int { + return m.Size() +} +func (m *DisputeParams) XXX_DiscardUnknown() { + xxx_messageInfo_DisputeParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DisputeParams proto.InternalMessageInfo + +func (m *DisputeParams) GetReport() MicroReport { + if m != nil { + return m.Report + } + return MicroReport{} +} + +func (m *DisputeParams) GetCategory() DisputeCategory { + if m != nil { + return m.Category + } + return DisputeCategory_INVALID +} + +func init() { + proto.RegisterType((*DisputeParams)(nil), "layer.dispute.DisputeParams") +} + +func init() { + proto.RegisterFile("layer/dispute/dispute_params.proto", fileDescriptor_2b782315e5e42770) +} + +var fileDescriptor_2b782315e5e42770 = []byte{ + // 226 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xca, 0x49, 0xac, 0x4c, + 0x2d, 0xd2, 0x4f, 0xc9, 0x2c, 0x2e, 0x28, 0x2d, 0x49, 0x85, 0xd1, 0xf1, 0x05, 0x89, 0x45, 0x89, + 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xbc, 0x60, 0x35, 0x7a, 0x50, 0x39, 0x29, + 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0xb0, 0x8c, 0x3e, 0x88, 0x05, 0x51, 0x24, 0x25, 0x8d, 0xd5, 0x20, + 0x88, 0xa4, 0x52, 0x2b, 0x23, 0x17, 0xaf, 0x0b, 0x44, 0x24, 0x00, 0x6c, 0xb2, 0x90, 0x05, 0x17, + 0x5b, 0x51, 0x6a, 0x41, 0x7e, 0x51, 0x89, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x94, 0x1e, + 0x8a, 0x25, 0x7a, 0xbe, 0x99, 0xc9, 0x45, 0xf9, 0x41, 0x60, 0x15, 0x4e, 0x2c, 0x27, 0xee, 0xc9, + 0x33, 0x04, 0x41, 0xd5, 0x0b, 0x59, 0x71, 0x71, 0x24, 0x27, 0x96, 0xa4, 0xa6, 0xe7, 0x17, 0x55, + 0x4a, 0x30, 0x29, 0x30, 0x6a, 0xf0, 0x19, 0xc9, 0xa1, 0xe9, 0x85, 0xda, 0xe4, 0x0c, 0x55, 0x15, + 0x04, 0x57, 0xef, 0xe4, 0x72, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, + 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x5a, + 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x25, 0xa9, 0x39, 0x39, 0xf9, + 0x45, 0xba, 0x99, 0xf9, 0xfa, 0x10, 0x3f, 0x55, 0xc0, 0x7d, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, + 0xc4, 0x06, 0xf6, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x91, 0x9e, 0x66, 0x7a, 0x3c, 0x01, + 0x00, 0x00, +} + +func (m *DisputeParams) 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 *DisputeParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DisputeParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Category != 0 { + i = encodeVarintDisputeParams(dAtA, i, uint64(m.Category)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Report.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDisputeParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintDisputeParams(dAtA []byte, offset int, v uint64) int { + offset -= sovDisputeParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DisputeParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Report.Size() + n += 1 + l + sovDisputeParams(uint64(l)) + if m.Category != 0 { + n += 1 + sovDisputeParams(uint64(m.Category)) + } + return n +} + +func sovDisputeParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDisputeParams(x uint64) (n int) { + return sovDisputeParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DisputeParams) 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 ErrIntOverflowDisputeParams + } + 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: DisputeParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DisputeParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDisputeParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDisputeParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDisputeParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Report.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + m.Category = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDisputeParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Category |= DisputeCategory(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDisputeParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDisputeParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDisputeParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDisputeParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDisputeParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDisputeParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDisputeParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDisputeParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDisputeParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDisputeParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDisputeParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDisputeParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/dispute/types/payment_info.pb.go b/x/dispute/types/payment_info.pb.go new file mode 100644 index 000000000..9f19c8d4f --- /dev/null +++ b/x/dispute/types/payment_info.pb.go @@ -0,0 +1,376 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: layer/dispute/payment_info.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type PaymentInfo struct { + Disputer []byte `protobuf:"bytes,1,opt,name=disputer,proto3" json:"disputer,omitempty"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` +} + +func (m *PaymentInfo) Reset() { *m = PaymentInfo{} } +func (m *PaymentInfo) String() string { return proto.CompactTextString(m) } +func (*PaymentInfo) ProtoMessage() {} +func (*PaymentInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_5f629a13af7989e0, []int{0} +} +func (m *PaymentInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PaymentInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PaymentInfo.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 *PaymentInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_PaymentInfo.Merge(m, src) +} +func (m *PaymentInfo) XXX_Size() int { + return m.Size() +} +func (m *PaymentInfo) XXX_DiscardUnknown() { + xxx_messageInfo_PaymentInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_PaymentInfo proto.InternalMessageInfo + +func (m *PaymentInfo) GetDisputer() []byte { + if m != nil { + return m.Disputer + } + return nil +} + +func (m *PaymentInfo) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +func init() { + proto.RegisterType((*PaymentInfo)(nil), "layer.dispute.PaymentInfo") +} + +func init() { proto.RegisterFile("layer/dispute/payment_info.proto", fileDescriptor_5f629a13af7989e0) } + +var fileDescriptor_5f629a13af7989e0 = []byte{ + // 240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8f, 0xb1, 0x4a, 0xc4, 0x40, + 0x10, 0x86, 0xb3, 0x22, 0x87, 0xe4, 0xb4, 0x09, 0x16, 0x67, 0x8a, 0x35, 0x58, 0x1d, 0x82, 0x3b, + 0x9c, 0x16, 0xf6, 0xa7, 0x8d, 0x9d, 0x5c, 0x69, 0x23, 0xbb, 0x71, 0x2f, 0x2e, 0x24, 0x3b, 0x21, + 0x3b, 0x11, 0xf3, 0x16, 0x3e, 0xd6, 0x95, 0x57, 0x5a, 0x89, 0x24, 0x2f, 0x72, 0x5c, 0x76, 0x49, + 0x37, 0xc3, 0xff, 0xf1, 0xf1, 0xff, 0x71, 0x56, 0xca, 0x4e, 0x37, 0xf0, 0x61, 0x5c, 0xdd, 0x92, + 0x86, 0x5a, 0x76, 0x95, 0xb6, 0xf4, 0x6e, 0xec, 0x16, 0x45, 0xdd, 0x20, 0x61, 0x72, 0x31, 0x12, + 0x22, 0x10, 0xe9, 0x65, 0x81, 0x05, 0x8e, 0x09, 0x1c, 0x2f, 0x0f, 0xa5, 0x3c, 0x47, 0x57, 0xa1, + 0x03, 0x25, 0x9d, 0x86, 0xaf, 0x95, 0xd2, 0x24, 0x57, 0x90, 0xa3, 0xb1, 0x3e, 0xbf, 0x51, 0xf1, + 0xfc, 0xd5, 0xab, 0x5f, 0xec, 0x16, 0x93, 0x34, 0x3e, 0x0b, 0xbe, 0x66, 0xc1, 0x32, 0xb6, 0x3c, + 0xdf, 0x4c, 0x7f, 0xf2, 0x18, 0xcf, 0x64, 0x85, 0xad, 0xa5, 0xc5, 0x49, 0xc6, 0x96, 0xf3, 0xfb, + 0x2b, 0xe1, 0xdd, 0xe2, 0xe8, 0x16, 0xc1, 0x2d, 0x9e, 0xd0, 0xd8, 0xf5, 0xe9, 0xee, 0xef, 0x3a, + 0xda, 0x04, 0x7c, 0xfd, 0xbc, 0xeb, 0x39, 0xdb, 0xf7, 0x9c, 0xfd, 0xf7, 0x9c, 0xfd, 0x0c, 0x3c, + 0xda, 0x0f, 0x3c, 0xfa, 0x1d, 0x78, 0xf4, 0x76, 0x5b, 0x18, 0xfa, 0x6c, 0x95, 0xc8, 0xb1, 0x02, + 0xd2, 0x65, 0x89, 0xcd, 0x9d, 0x41, 0xf0, 0xcb, 0xbf, 0xa7, 0xed, 0xd4, 0xd5, 0xda, 0xa9, 0xd9, + 0x58, 0xf8, 0xe1, 0x10, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x18, 0x9a, 0xcb, 0x19, 0x01, 0x00, 0x00, +} + +func (m *PaymentInfo) 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 *PaymentInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PaymentInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPaymentInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Disputer) > 0 { + i -= len(m.Disputer) + copy(dAtA[i:], m.Disputer) + i = encodeVarintPaymentInfo(dAtA, i, uint64(len(m.Disputer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPaymentInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovPaymentInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PaymentInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Disputer) + if l > 0 { + n += 1 + l + sovPaymentInfo(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovPaymentInfo(uint64(l)) + return n +} + +func sovPaymentInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPaymentInfo(x uint64) (n int) { + return sovPaymentInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PaymentInfo) 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 ErrIntOverflowPaymentInfo + } + 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: PaymentInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PaymentInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Disputer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPaymentInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPaymentInfo + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPaymentInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Disputer = append(m.Disputer[:0], dAtA[iNdEx:postIndex]...) + if m.Disputer == nil { + m.Disputer = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPaymentInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPaymentInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPaymentInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPaymentInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPaymentInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPaymentInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaymentInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaymentInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPaymentInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPaymentInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPaymentInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPaymentInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPaymentInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPaymentInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPaymentInfo = fmt.Errorf("proto: unexpected end of group") +)