diff --git a/data/outport.pb.go b/data/outport.pb.go new file mode 100644 index 0000000..e7f12f2 --- /dev/null +++ b/data/outport.pb.go @@ -0,0 +1,759 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: outport.proto + +package data + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + outport "github.com/multiversx/mx-chain-core-go/data/outport" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// 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 HyperOutportBlock struct { + MetaOutportBlock *outport.OutportBlock `protobuf:"bytes,1,opt,name=MetaOutportBlock,proto3" json:"metaOutportBlock,omitempty"` + NotarizedHeadersOutportData []*NotarizedHeaderOutportData `protobuf:"bytes,2,rep,name=NotarizedHeadersOutportData,proto3" json:"notarizedHeadersOutportData,omitempty"` +} + +func (m *HyperOutportBlock) Reset() { *m = HyperOutportBlock{} } +func (*HyperOutportBlock) ProtoMessage() {} +func (*HyperOutportBlock) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c7f6cbbb5ff4ad, []int{0} +} +func (m *HyperOutportBlock) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HyperOutportBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *HyperOutportBlock) XXX_Merge(src proto.Message) { + xxx_messageInfo_HyperOutportBlock.Merge(m, src) +} +func (m *HyperOutportBlock) XXX_Size() int { + return m.Size() +} +func (m *HyperOutportBlock) XXX_DiscardUnknown() { + xxx_messageInfo_HyperOutportBlock.DiscardUnknown(m) +} + +var xxx_messageInfo_HyperOutportBlock proto.InternalMessageInfo + +func (m *HyperOutportBlock) GetMetaOutportBlock() *outport.OutportBlock { + if m != nil { + return m.MetaOutportBlock + } + return nil +} + +func (m *HyperOutportBlock) GetNotarizedHeadersOutportData() []*NotarizedHeaderOutportData { + if m != nil { + return m.NotarizedHeadersOutportData + } + return nil +} + +type NotarizedHeaderOutportData struct { + NotarizedHeaderHash string `protobuf:"bytes,1,opt,name=NotarizedHeaderHash,proto3" json:"notarizedHeaderHash,omitempty"` + OutportBlock *outport.OutportBlock `protobuf:"bytes,2,opt,name=OutportBlock,proto3" json:"outportBlock,omitempty"` +} + +func (m *NotarizedHeaderOutportData) Reset() { *m = NotarizedHeaderOutportData{} } +func (*NotarizedHeaderOutportData) ProtoMessage() {} +func (*NotarizedHeaderOutportData) Descriptor() ([]byte, []int) { + return fileDescriptor_b3c7f6cbbb5ff4ad, []int{1} +} +func (m *NotarizedHeaderOutportData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NotarizedHeaderOutportData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NotarizedHeaderOutportData) XXX_Merge(src proto.Message) { + xxx_messageInfo_NotarizedHeaderOutportData.Merge(m, src) +} +func (m *NotarizedHeaderOutportData) XXX_Size() int { + return m.Size() +} +func (m *NotarizedHeaderOutportData) XXX_DiscardUnknown() { + xxx_messageInfo_NotarizedHeaderOutportData.DiscardUnknown(m) +} + +var xxx_messageInfo_NotarizedHeaderOutportData proto.InternalMessageInfo + +func (m *NotarizedHeaderOutportData) GetNotarizedHeaderHash() string { + if m != nil { + return m.NotarizedHeaderHash + } + return "" +} + +func (m *NotarizedHeaderOutportData) GetOutportBlock() *outport.OutportBlock { + if m != nil { + return m.OutportBlock + } + return nil +} + +func init() { + proto.RegisterType((*HyperOutportBlock)(nil), "proto.HyperOutportBlock") + proto.RegisterType((*NotarizedHeaderOutportData)(nil), "proto.NotarizedHeaderOutportData") +} + +func init() { proto.RegisterFile("outport.proto", fileDescriptor_b3c7f6cbbb5ff4ad) } + +var fileDescriptor_b3c7f6cbbb5ff4ad = []byte{ + // 384 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x4d, 0x4b, 0xe3, 0x40, + 0x18, 0xce, 0x74, 0xd9, 0x85, 0x4d, 0x77, 0x41, 0x53, 0x90, 0x12, 0x71, 0xd2, 0x16, 0x84, 0x0a, + 0xa6, 0x81, 0x7a, 0xf4, 0x64, 0x10, 0xe9, 0x45, 0x05, 0x7b, 0xf3, 0x22, 0xd3, 0x74, 0x4c, 0x83, + 0x4d, 0xde, 0x30, 0x99, 0x68, 0xab, 0x17, 0x2f, 0x5e, 0xc5, 0x9f, 0xe1, 0x2f, 0x11, 0x8f, 0x3d, + 0xf6, 0x14, 0xec, 0xf4, 0x22, 0x39, 0xf5, 0x27, 0x48, 0xd3, 0x2a, 0xe9, 0x97, 0x5e, 0x32, 0x99, + 0x79, 0xbe, 0x5e, 0x1e, 0x5e, 0xf9, 0x3f, 0x84, 0xdc, 0x07, 0xc6, 0x2b, 0x3e, 0x03, 0x0e, 0xca, + 0xef, 0xe4, 0x50, 0x75, 0xdb, 0xe1, 0xad, 0xb0, 0x51, 0xb1, 0xc0, 0x35, 0x6c, 0xb0, 0xc1, 0x48, + 0x9e, 0x1b, 0xe1, 0x65, 0x72, 0x4b, 0x2e, 0xc9, 0xdf, 0x44, 0xa5, 0x1e, 0xa5, 0xe8, 0x6e, 0xd8, + 0xe6, 0xce, 0x35, 0x65, 0x41, 0xc7, 0x70, 0x3b, 0xba, 0xd5, 0x22, 0x8e, 0xa7, 0x5b, 0xc0, 0xa8, + 0x6e, 0x83, 0xd1, 0x24, 0x9c, 0x18, 0xd3, 0xc0, 0xcf, 0xd3, 0x6c, 0x83, 0x75, 0x35, 0xf1, 0x29, + 0x3d, 0x64, 0xe4, 0xf5, 0x5a, 0xd7, 0xa7, 0xec, 0x34, 0x85, 0x29, 0x17, 0xf2, 0xda, 0x31, 0xe5, + 0x24, 0xfd, 0x96, 0x47, 0x05, 0x54, 0xce, 0x56, 0x73, 0x13, 0x5d, 0x25, 0x0d, 0x99, 0x38, 0x8e, + 0x34, 0xd5, 0x9d, 0x13, 0xec, 0x82, 0xeb, 0x70, 0xea, 0xfa, 0xbc, 0x7b, 0xb6, 0x60, 0xa6, 0x3c, + 0x22, 0x79, 0xf3, 0x04, 0x38, 0x61, 0xce, 0x2d, 0x6d, 0xd6, 0x28, 0x69, 0x52, 0x16, 0x4c, 0x09, + 0x87, 0x84, 0x93, 0x7c, 0xa6, 0xf0, 0xab, 0x9c, 0xad, 0x16, 0xa7, 0x61, 0x73, 0xcc, 0x14, 0xd1, + 0xdc, 0x89, 0x23, 0x6d, 0xdb, 0x5b, 0xed, 0x94, 0x9a, 0xe2, 0xbb, 0xc0, 0xd2, 0x0b, 0x92, 0xd5, + 0xd5, 0x31, 0x4a, 0x5d, 0xce, 0xcd, 0xa1, 0x35, 0x12, 0xb4, 0x92, 0x4e, 0xfe, 0x9a, 0xc5, 0x38, + 0xd2, 0xb6, 0xbc, 0x45, 0x38, 0x95, 0xbd, 0x4c, 0xad, 0xd4, 0xe5, 0x7f, 0x33, 0x0d, 0x67, 0x56, + 0x37, 0xac, 0xc6, 0x91, 0xb6, 0x01, 0xcb, 0xdb, 0x9d, 0x31, 0x31, 0xef, 0x7a, 0x03, 0x2c, 0xf5, + 0x07, 0x58, 0x1a, 0x0d, 0x30, 0xba, 0x17, 0x18, 0x3d, 0x0b, 0x8c, 0x5e, 0x05, 0x46, 0x3d, 0x81, + 0x51, 0x5f, 0x60, 0xf4, 0x26, 0x30, 0x7a, 0x17, 0x58, 0x1a, 0x09, 0x8c, 0x9e, 0x86, 0x58, 0xea, + 0x0d, 0xb1, 0xd4, 0x1f, 0x62, 0xe9, 0xfc, 0xe0, 0x87, 0x95, 0xba, 0x09, 0x74, 0x0b, 0x3c, 0x8f, + 0x5a, 0x1c, 0x98, 0x3e, 0xce, 0x6e, 0x13, 0xfe, 0xb5, 0x63, 0xfb, 0xe3, 0x4f, 0xe3, 0x4f, 0x32, + 0xfa, 0xde, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x36, 0xef, 0x0a, 0xe3, 0x02, 0x00, 0x00, +} + +func (this *HyperOutportBlock) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*HyperOutportBlock) + if !ok { + that2, ok := that.(HyperOutportBlock) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.MetaOutportBlock.Equal(that1.MetaOutportBlock) { + return false + } + if len(this.NotarizedHeadersOutportData) != len(that1.NotarizedHeadersOutportData) { + return false + } + for i := range this.NotarizedHeadersOutportData { + if !this.NotarizedHeadersOutportData[i].Equal(that1.NotarizedHeadersOutportData[i]) { + return false + } + } + return true +} +func (this *NotarizedHeaderOutportData) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*NotarizedHeaderOutportData) + if !ok { + that2, ok := that.(NotarizedHeaderOutportData) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.NotarizedHeaderHash != that1.NotarizedHeaderHash { + return false + } + if !this.OutportBlock.Equal(that1.OutportBlock) { + return false + } + return true +} +func (this *HyperOutportBlock) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&data.HyperOutportBlock{") + if this.MetaOutportBlock != nil { + s = append(s, "MetaOutportBlock: "+fmt.Sprintf("%#v", this.MetaOutportBlock)+",\n") + } + if this.NotarizedHeadersOutportData != nil { + s = append(s, "NotarizedHeadersOutportData: "+fmt.Sprintf("%#v", this.NotarizedHeadersOutportData)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *NotarizedHeaderOutportData) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&data.NotarizedHeaderOutportData{") + s = append(s, "NotarizedHeaderHash: "+fmt.Sprintf("%#v", this.NotarizedHeaderHash)+",\n") + if this.OutportBlock != nil { + s = append(s, "OutportBlock: "+fmt.Sprintf("%#v", this.OutportBlock)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringOutport(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *HyperOutportBlock) 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 *HyperOutportBlock) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HyperOutportBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NotarizedHeadersOutportData) > 0 { + for iNdEx := len(m.NotarizedHeadersOutportData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NotarizedHeadersOutportData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOutport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.MetaOutportBlock != nil { + { + size, err := m.MetaOutportBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOutport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NotarizedHeaderOutportData) 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 *NotarizedHeaderOutportData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NotarizedHeaderOutportData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OutportBlock != nil { + { + size, err := m.OutportBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOutport(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.NotarizedHeaderHash) > 0 { + i -= len(m.NotarizedHeaderHash) + copy(dAtA[i:], m.NotarizedHeaderHash) + i = encodeVarintOutport(dAtA, i, uint64(len(m.NotarizedHeaderHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintOutport(dAtA []byte, offset int, v uint64) int { + offset -= sovOutport(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *HyperOutportBlock) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MetaOutportBlock != nil { + l = m.MetaOutportBlock.Size() + n += 1 + l + sovOutport(uint64(l)) + } + if len(m.NotarizedHeadersOutportData) > 0 { + for _, e := range m.NotarizedHeadersOutportData { + l = e.Size() + n += 1 + l + sovOutport(uint64(l)) + } + } + return n +} + +func (m *NotarizedHeaderOutportData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NotarizedHeaderHash) + if l > 0 { + n += 1 + l + sovOutport(uint64(l)) + } + if m.OutportBlock != nil { + l = m.OutportBlock.Size() + n += 1 + l + sovOutport(uint64(l)) + } + return n +} + +func sovOutport(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOutport(x uint64) (n int) { + return sovOutport(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *HyperOutportBlock) String() string { + if this == nil { + return "nil" + } + repeatedStringForNotarizedHeadersOutportData := "[]*NotarizedHeaderOutportData{" + for _, f := range this.NotarizedHeadersOutportData { + repeatedStringForNotarizedHeadersOutportData += strings.Replace(f.String(), "NotarizedHeaderOutportData", "NotarizedHeaderOutportData", 1) + "," + } + repeatedStringForNotarizedHeadersOutportData += "}" + s := strings.Join([]string{`&HyperOutportBlock{`, + `MetaOutportBlock:` + strings.Replace(fmt.Sprintf("%v", this.MetaOutportBlock), "OutportBlock", "outport.OutportBlock", 1) + `,`, + `NotarizedHeadersOutportData:` + repeatedStringForNotarizedHeadersOutportData + `,`, + `}`, + }, "") + return s +} +func (this *NotarizedHeaderOutportData) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NotarizedHeaderOutportData{`, + `NotarizedHeaderHash:` + fmt.Sprintf("%v", this.NotarizedHeaderHash) + `,`, + `OutportBlock:` + strings.Replace(fmt.Sprintf("%v", this.OutportBlock), "OutportBlock", "outport.OutportBlock", 1) + `,`, + `}`, + }, "") + return s +} +func valueToStringOutport(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *HyperOutportBlock) 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 ErrIntOverflowOutport + } + 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: HyperOutportBlock: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HyperOutportBlock: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetaOutportBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOutport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOutport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOutport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MetaOutportBlock == nil { + m.MetaOutportBlock = &outport.OutportBlock{} + } + if err := m.MetaOutportBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NotarizedHeadersOutportData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOutport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOutport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOutport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NotarizedHeadersOutportData = append(m.NotarizedHeadersOutportData, &NotarizedHeaderOutportData{}) + if err := m.NotarizedHeadersOutportData[len(m.NotarizedHeadersOutportData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOutport(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthOutport + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOutport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NotarizedHeaderOutportData) 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 ErrIntOverflowOutport + } + 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: NotarizedHeaderOutportData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NotarizedHeaderOutportData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NotarizedHeaderHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOutport + } + 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 ErrInvalidLengthOutport + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOutport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NotarizedHeaderHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutportBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOutport + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOutport + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOutport + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutportBlock == nil { + m.OutportBlock = &outport.OutportBlock{} + } + if err := m.OutportBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOutport(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthOutport + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthOutport + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOutport(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, ErrIntOverflowOutport + } + 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, ErrIntOverflowOutport + } + 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, ErrIntOverflowOutport + } + 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, ErrInvalidLengthOutport + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOutport + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOutport + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOutport = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOutport = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOutport = fmt.Errorf("proto: unexpected end of group") +) diff --git a/data/outport.proto b/data/outport.proto new file mode 100644 index 0000000..1da54aa --- /dev/null +++ b/data/outport.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package proto; + +option go_package = "github.com/multiversx/mx-chain-ws-connector-template-go/data;data"; +option (gogoproto.stable_marshaler_all) = true; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/multiversx/mx-chain-core-go/data/outport/outportBlock.proto"; + +message HyperOutportBlock { + OutportBlock MetaOutportBlock = 1 [(gogoproto.jsontag) = "metaOutportBlock,omitempty"]; + repeated NotarizedHeaderOutportData NotarizedHeadersOutportData = 2 [(gogoproto.jsontag) = "notarizedHeadersOutportData,omitempty"]; +} + +message NotarizedHeaderOutportData { + string NotarizedHeaderHash = 1 [(gogoproto.jsontag) = "notarizedHeaderHash,omitempty"]; + OutportBlock OutportBlock = 2 [(gogoproto.jsontag) = "outportBlock,omitempty"]; +}