github.com/ethersphere/bee/v2@v2.2.0/pkg/settlement/swap/swapprotocol/pb/swap.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: swap.proto
     3  
     4  package pb
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  type EmitCheque struct {
    26  	Cheque []byte `protobuf:"bytes,1,opt,name=Cheque,proto3" json:"Cheque,omitempty"`
    27  }
    28  
    29  func (m *EmitCheque) Reset()         { *m = EmitCheque{} }
    30  func (m *EmitCheque) String() string { return proto.CompactTextString(m) }
    31  func (*EmitCheque) ProtoMessage()    {}
    32  func (*EmitCheque) Descriptor() ([]byte, []int) {
    33  	return fileDescriptor_c35a3890a6e60fb7, []int{0}
    34  }
    35  func (m *EmitCheque) XXX_Unmarshal(b []byte) error {
    36  	return m.Unmarshal(b)
    37  }
    38  func (m *EmitCheque) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    39  	if deterministic {
    40  		return xxx_messageInfo_EmitCheque.Marshal(b, m, deterministic)
    41  	} else {
    42  		b = b[:cap(b)]
    43  		n, err := m.MarshalToSizedBuffer(b)
    44  		if err != nil {
    45  			return nil, err
    46  		}
    47  		return b[:n], nil
    48  	}
    49  }
    50  func (m *EmitCheque) XXX_Merge(src proto.Message) {
    51  	xxx_messageInfo_EmitCheque.Merge(m, src)
    52  }
    53  func (m *EmitCheque) XXX_Size() int {
    54  	return m.Size()
    55  }
    56  func (m *EmitCheque) XXX_DiscardUnknown() {
    57  	xxx_messageInfo_EmitCheque.DiscardUnknown(m)
    58  }
    59  
    60  var xxx_messageInfo_EmitCheque proto.InternalMessageInfo
    61  
    62  func (m *EmitCheque) GetCheque() []byte {
    63  	if m != nil {
    64  		return m.Cheque
    65  	}
    66  	return nil
    67  }
    68  
    69  type Handshake struct {
    70  	Beneficiary []byte `protobuf:"bytes,1,opt,name=Beneficiary,proto3" json:"Beneficiary,omitempty"`
    71  }
    72  
    73  func (m *Handshake) Reset()         { *m = Handshake{} }
    74  func (m *Handshake) String() string { return proto.CompactTextString(m) }
    75  func (*Handshake) ProtoMessage()    {}
    76  func (*Handshake) Descriptor() ([]byte, []int) {
    77  	return fileDescriptor_c35a3890a6e60fb7, []int{1}
    78  }
    79  func (m *Handshake) XXX_Unmarshal(b []byte) error {
    80  	return m.Unmarshal(b)
    81  }
    82  func (m *Handshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    83  	if deterministic {
    84  		return xxx_messageInfo_Handshake.Marshal(b, m, deterministic)
    85  	} else {
    86  		b = b[:cap(b)]
    87  		n, err := m.MarshalToSizedBuffer(b)
    88  		if err != nil {
    89  			return nil, err
    90  		}
    91  		return b[:n], nil
    92  	}
    93  }
    94  func (m *Handshake) XXX_Merge(src proto.Message) {
    95  	xxx_messageInfo_Handshake.Merge(m, src)
    96  }
    97  func (m *Handshake) XXX_Size() int {
    98  	return m.Size()
    99  }
   100  func (m *Handshake) XXX_DiscardUnknown() {
   101  	xxx_messageInfo_Handshake.DiscardUnknown(m)
   102  }
   103  
   104  var xxx_messageInfo_Handshake proto.InternalMessageInfo
   105  
   106  func (m *Handshake) GetBeneficiary() []byte {
   107  	if m != nil {
   108  		return m.Beneficiary
   109  	}
   110  	return nil
   111  }
   112  
   113  func init() {
   114  	proto.RegisterType((*EmitCheque)(nil), "swapprotocol.EmitCheque")
   115  	proto.RegisterType((*Handshake)(nil), "swapprotocol.Handshake")
   116  }
   117  
   118  func init() { proto.RegisterFile("swap.proto", fileDescriptor_c35a3890a6e60fb7) }
   119  
   120  var fileDescriptor_c35a3890a6e60fb7 = []byte{
   121  	// 142 bytes of a gzipped FileDescriptorProto
   122  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x2e, 0x4f, 0x2c,
   123  	0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0xb1, 0xc1, 0xcc, 0xe4, 0xfc, 0x1c, 0x25,
   124  	0x15, 0x2e, 0x2e, 0xd7, 0xdc, 0xcc, 0x12, 0xe7, 0x8c, 0xd4, 0xc2, 0xd2, 0x54, 0x21, 0x31, 0x2e,
   125  	0x36, 0x08, 0x4b, 0x82, 0x51, 0x81, 0x51, 0x83, 0x27, 0x08, 0xca, 0x53, 0xd2, 0xe5, 0xe2, 0xf4,
   126  	0x48, 0xcc, 0x4b, 0x29, 0xce, 0x48, 0xcc, 0x4e, 0x15, 0x52, 0xe0, 0xe2, 0x76, 0x4a, 0xcd, 0x4b,
   127  	0x4d, 0xcb, 0x4c, 0xce, 0x4c, 0x2c, 0xaa, 0x84, 0xaa, 0x44, 0x16, 0x72, 0x92, 0x39, 0xf1, 0x48,
   128  	0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0,
   129  	0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa6, 0x82, 0xa4, 0x24, 0x36, 0xb0, 0xe5, 0xc6,
   130  	0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xdd, 0x22, 0xd8, 0x95, 0x00, 0x00, 0x00,
   131  }
   132  
   133  func (m *EmitCheque) Marshal() (dAtA []byte, err error) {
   134  	size := m.Size()
   135  	dAtA = make([]byte, size)
   136  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	return dAtA[:n], nil
   141  }
   142  
   143  func (m *EmitCheque) MarshalTo(dAtA []byte) (int, error) {
   144  	size := m.Size()
   145  	return m.MarshalToSizedBuffer(dAtA[:size])
   146  }
   147  
   148  func (m *EmitCheque) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   149  	i := len(dAtA)
   150  	_ = i
   151  	var l int
   152  	_ = l
   153  	if len(m.Cheque) > 0 {
   154  		i -= len(m.Cheque)
   155  		copy(dAtA[i:], m.Cheque)
   156  		i = encodeVarintSwap(dAtA, i, uint64(len(m.Cheque)))
   157  		i--
   158  		dAtA[i] = 0xa
   159  	}
   160  	return len(dAtA) - i, nil
   161  }
   162  
   163  func (m *Handshake) Marshal() (dAtA []byte, err error) {
   164  	size := m.Size()
   165  	dAtA = make([]byte, size)
   166  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   167  	if err != nil {
   168  		return nil, err
   169  	}
   170  	return dAtA[:n], nil
   171  }
   172  
   173  func (m *Handshake) MarshalTo(dAtA []byte) (int, error) {
   174  	size := m.Size()
   175  	return m.MarshalToSizedBuffer(dAtA[:size])
   176  }
   177  
   178  func (m *Handshake) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   179  	i := len(dAtA)
   180  	_ = i
   181  	var l int
   182  	_ = l
   183  	if len(m.Beneficiary) > 0 {
   184  		i -= len(m.Beneficiary)
   185  		copy(dAtA[i:], m.Beneficiary)
   186  		i = encodeVarintSwap(dAtA, i, uint64(len(m.Beneficiary)))
   187  		i--
   188  		dAtA[i] = 0xa
   189  	}
   190  	return len(dAtA) - i, nil
   191  }
   192  
   193  func encodeVarintSwap(dAtA []byte, offset int, v uint64) int {
   194  	offset -= sovSwap(v)
   195  	base := offset
   196  	for v >= 1<<7 {
   197  		dAtA[offset] = uint8(v&0x7f | 0x80)
   198  		v >>= 7
   199  		offset++
   200  	}
   201  	dAtA[offset] = uint8(v)
   202  	return base
   203  }
   204  func (m *EmitCheque) Size() (n int) {
   205  	if m == nil {
   206  		return 0
   207  	}
   208  	var l int
   209  	_ = l
   210  	l = len(m.Cheque)
   211  	if l > 0 {
   212  		n += 1 + l + sovSwap(uint64(l))
   213  	}
   214  	return n
   215  }
   216  
   217  func (m *Handshake) Size() (n int) {
   218  	if m == nil {
   219  		return 0
   220  	}
   221  	var l int
   222  	_ = l
   223  	l = len(m.Beneficiary)
   224  	if l > 0 {
   225  		n += 1 + l + sovSwap(uint64(l))
   226  	}
   227  	return n
   228  }
   229  
   230  func sovSwap(x uint64) (n int) {
   231  	return (math_bits.Len64(x|1) + 6) / 7
   232  }
   233  func sozSwap(x uint64) (n int) {
   234  	return sovSwap(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   235  }
   236  func (m *EmitCheque) Unmarshal(dAtA []byte) error {
   237  	l := len(dAtA)
   238  	iNdEx := 0
   239  	for iNdEx < l {
   240  		preIndex := iNdEx
   241  		var wire uint64
   242  		for shift := uint(0); ; shift += 7 {
   243  			if shift >= 64 {
   244  				return ErrIntOverflowSwap
   245  			}
   246  			if iNdEx >= l {
   247  				return io.ErrUnexpectedEOF
   248  			}
   249  			b := dAtA[iNdEx]
   250  			iNdEx++
   251  			wire |= uint64(b&0x7F) << shift
   252  			if b < 0x80 {
   253  				break
   254  			}
   255  		}
   256  		fieldNum := int32(wire >> 3)
   257  		wireType := int(wire & 0x7)
   258  		if wireType == 4 {
   259  			return fmt.Errorf("proto: EmitCheque: wiretype end group for non-group")
   260  		}
   261  		if fieldNum <= 0 {
   262  			return fmt.Errorf("proto: EmitCheque: illegal tag %d (wire type %d)", fieldNum, wire)
   263  		}
   264  		switch fieldNum {
   265  		case 1:
   266  			if wireType != 2 {
   267  				return fmt.Errorf("proto: wrong wireType = %d for field Cheque", wireType)
   268  			}
   269  			var byteLen int
   270  			for shift := uint(0); ; shift += 7 {
   271  				if shift >= 64 {
   272  					return ErrIntOverflowSwap
   273  				}
   274  				if iNdEx >= l {
   275  					return io.ErrUnexpectedEOF
   276  				}
   277  				b := dAtA[iNdEx]
   278  				iNdEx++
   279  				byteLen |= int(b&0x7F) << shift
   280  				if b < 0x80 {
   281  					break
   282  				}
   283  			}
   284  			if byteLen < 0 {
   285  				return ErrInvalidLengthSwap
   286  			}
   287  			postIndex := iNdEx + byteLen
   288  			if postIndex < 0 {
   289  				return ErrInvalidLengthSwap
   290  			}
   291  			if postIndex > l {
   292  				return io.ErrUnexpectedEOF
   293  			}
   294  			m.Cheque = append(m.Cheque[:0], dAtA[iNdEx:postIndex]...)
   295  			if m.Cheque == nil {
   296  				m.Cheque = []byte{}
   297  			}
   298  			iNdEx = postIndex
   299  		default:
   300  			iNdEx = preIndex
   301  			skippy, err := skipSwap(dAtA[iNdEx:])
   302  			if err != nil {
   303  				return err
   304  			}
   305  			if skippy < 0 {
   306  				return ErrInvalidLengthSwap
   307  			}
   308  			if (iNdEx + skippy) < 0 {
   309  				return ErrInvalidLengthSwap
   310  			}
   311  			if (iNdEx + skippy) > l {
   312  				return io.ErrUnexpectedEOF
   313  			}
   314  			iNdEx += skippy
   315  		}
   316  	}
   317  
   318  	if iNdEx > l {
   319  		return io.ErrUnexpectedEOF
   320  	}
   321  	return nil
   322  }
   323  func (m *Handshake) Unmarshal(dAtA []byte) error {
   324  	l := len(dAtA)
   325  	iNdEx := 0
   326  	for iNdEx < l {
   327  		preIndex := iNdEx
   328  		var wire uint64
   329  		for shift := uint(0); ; shift += 7 {
   330  			if shift >= 64 {
   331  				return ErrIntOverflowSwap
   332  			}
   333  			if iNdEx >= l {
   334  				return io.ErrUnexpectedEOF
   335  			}
   336  			b := dAtA[iNdEx]
   337  			iNdEx++
   338  			wire |= uint64(b&0x7F) << shift
   339  			if b < 0x80 {
   340  				break
   341  			}
   342  		}
   343  		fieldNum := int32(wire >> 3)
   344  		wireType := int(wire & 0x7)
   345  		if wireType == 4 {
   346  			return fmt.Errorf("proto: Handshake: wiretype end group for non-group")
   347  		}
   348  		if fieldNum <= 0 {
   349  			return fmt.Errorf("proto: Handshake: illegal tag %d (wire type %d)", fieldNum, wire)
   350  		}
   351  		switch fieldNum {
   352  		case 1:
   353  			if wireType != 2 {
   354  				return fmt.Errorf("proto: wrong wireType = %d for field Beneficiary", wireType)
   355  			}
   356  			var byteLen int
   357  			for shift := uint(0); ; shift += 7 {
   358  				if shift >= 64 {
   359  					return ErrIntOverflowSwap
   360  				}
   361  				if iNdEx >= l {
   362  					return io.ErrUnexpectedEOF
   363  				}
   364  				b := dAtA[iNdEx]
   365  				iNdEx++
   366  				byteLen |= int(b&0x7F) << shift
   367  				if b < 0x80 {
   368  					break
   369  				}
   370  			}
   371  			if byteLen < 0 {
   372  				return ErrInvalidLengthSwap
   373  			}
   374  			postIndex := iNdEx + byteLen
   375  			if postIndex < 0 {
   376  				return ErrInvalidLengthSwap
   377  			}
   378  			if postIndex > l {
   379  				return io.ErrUnexpectedEOF
   380  			}
   381  			m.Beneficiary = append(m.Beneficiary[:0], dAtA[iNdEx:postIndex]...)
   382  			if m.Beneficiary == nil {
   383  				m.Beneficiary = []byte{}
   384  			}
   385  			iNdEx = postIndex
   386  		default:
   387  			iNdEx = preIndex
   388  			skippy, err := skipSwap(dAtA[iNdEx:])
   389  			if err != nil {
   390  				return err
   391  			}
   392  			if skippy < 0 {
   393  				return ErrInvalidLengthSwap
   394  			}
   395  			if (iNdEx + skippy) < 0 {
   396  				return ErrInvalidLengthSwap
   397  			}
   398  			if (iNdEx + skippy) > l {
   399  				return io.ErrUnexpectedEOF
   400  			}
   401  			iNdEx += skippy
   402  		}
   403  	}
   404  
   405  	if iNdEx > l {
   406  		return io.ErrUnexpectedEOF
   407  	}
   408  	return nil
   409  }
   410  func skipSwap(dAtA []byte) (n int, err error) {
   411  	l := len(dAtA)
   412  	iNdEx := 0
   413  	depth := 0
   414  	for iNdEx < l {
   415  		var wire uint64
   416  		for shift := uint(0); ; shift += 7 {
   417  			if shift >= 64 {
   418  				return 0, ErrIntOverflowSwap
   419  			}
   420  			if iNdEx >= l {
   421  				return 0, io.ErrUnexpectedEOF
   422  			}
   423  			b := dAtA[iNdEx]
   424  			iNdEx++
   425  			wire |= (uint64(b) & 0x7F) << shift
   426  			if b < 0x80 {
   427  				break
   428  			}
   429  		}
   430  		wireType := int(wire & 0x7)
   431  		switch wireType {
   432  		case 0:
   433  			for shift := uint(0); ; shift += 7 {
   434  				if shift >= 64 {
   435  					return 0, ErrIntOverflowSwap
   436  				}
   437  				if iNdEx >= l {
   438  					return 0, io.ErrUnexpectedEOF
   439  				}
   440  				iNdEx++
   441  				if dAtA[iNdEx-1] < 0x80 {
   442  					break
   443  				}
   444  			}
   445  		case 1:
   446  			iNdEx += 8
   447  		case 2:
   448  			var length int
   449  			for shift := uint(0); ; shift += 7 {
   450  				if shift >= 64 {
   451  					return 0, ErrIntOverflowSwap
   452  				}
   453  				if iNdEx >= l {
   454  					return 0, io.ErrUnexpectedEOF
   455  				}
   456  				b := dAtA[iNdEx]
   457  				iNdEx++
   458  				length |= (int(b) & 0x7F) << shift
   459  				if b < 0x80 {
   460  					break
   461  				}
   462  			}
   463  			if length < 0 {
   464  				return 0, ErrInvalidLengthSwap
   465  			}
   466  			iNdEx += length
   467  		case 3:
   468  			depth++
   469  		case 4:
   470  			if depth == 0 {
   471  				return 0, ErrUnexpectedEndOfGroupSwap
   472  			}
   473  			depth--
   474  		case 5:
   475  			iNdEx += 4
   476  		default:
   477  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   478  		}
   479  		if iNdEx < 0 {
   480  			return 0, ErrInvalidLengthSwap
   481  		}
   482  		if depth == 0 {
   483  			return iNdEx, nil
   484  		}
   485  	}
   486  	return 0, io.ErrUnexpectedEOF
   487  }
   488  
   489  var (
   490  	ErrInvalidLengthSwap        = fmt.Errorf("proto: negative length found during unmarshaling")
   491  	ErrIntOverflowSwap          = fmt.Errorf("proto: integer overflow")
   492  	ErrUnexpectedEndOfGroupSwap = fmt.Errorf("proto: unexpected end of group")
   493  )