github.com/InjectiveLabs/sdk-go@v1.53.0/chain/peggy/types/batch.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: injective/peggy/v1/batch.proto
     3  
     4  package types
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/cosmos/gogoproto/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  // OutgoingTxBatch represents a batch of transactions going from Peggy to ETH
    26  type OutgoingTxBatch struct {
    27  	BatchNonce    uint64                `protobuf:"varint,1,opt,name=batch_nonce,json=batchNonce,proto3" json:"batch_nonce,omitempty"`
    28  	BatchTimeout  uint64                `protobuf:"varint,2,opt,name=batch_timeout,json=batchTimeout,proto3" json:"batch_timeout,omitempty"`
    29  	Transactions  []*OutgoingTransferTx `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"`
    30  	TokenContract string                `protobuf:"bytes,4,opt,name=token_contract,json=tokenContract,proto3" json:"token_contract,omitempty"`
    31  	Block         uint64                `protobuf:"varint,5,opt,name=block,proto3" json:"block,omitempty"`
    32  }
    33  
    34  func (m *OutgoingTxBatch) Reset()         { *m = OutgoingTxBatch{} }
    35  func (m *OutgoingTxBatch) String() string { return proto.CompactTextString(m) }
    36  func (*OutgoingTxBatch) ProtoMessage()    {}
    37  func (*OutgoingTxBatch) Descriptor() ([]byte, []int) {
    38  	return fileDescriptor_48fd09581f1b5901, []int{0}
    39  }
    40  func (m *OutgoingTxBatch) XXX_Unmarshal(b []byte) error {
    41  	return m.Unmarshal(b)
    42  }
    43  func (m *OutgoingTxBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    44  	if deterministic {
    45  		return xxx_messageInfo_OutgoingTxBatch.Marshal(b, m, deterministic)
    46  	} else {
    47  		b = b[:cap(b)]
    48  		n, err := m.MarshalToSizedBuffer(b)
    49  		if err != nil {
    50  			return nil, err
    51  		}
    52  		return b[:n], nil
    53  	}
    54  }
    55  func (m *OutgoingTxBatch) XXX_Merge(src proto.Message) {
    56  	xxx_messageInfo_OutgoingTxBatch.Merge(m, src)
    57  }
    58  func (m *OutgoingTxBatch) XXX_Size() int {
    59  	return m.Size()
    60  }
    61  func (m *OutgoingTxBatch) XXX_DiscardUnknown() {
    62  	xxx_messageInfo_OutgoingTxBatch.DiscardUnknown(m)
    63  }
    64  
    65  var xxx_messageInfo_OutgoingTxBatch proto.InternalMessageInfo
    66  
    67  func (m *OutgoingTxBatch) GetBatchNonce() uint64 {
    68  	if m != nil {
    69  		return m.BatchNonce
    70  	}
    71  	return 0
    72  }
    73  
    74  func (m *OutgoingTxBatch) GetBatchTimeout() uint64 {
    75  	if m != nil {
    76  		return m.BatchTimeout
    77  	}
    78  	return 0
    79  }
    80  
    81  func (m *OutgoingTxBatch) GetTransactions() []*OutgoingTransferTx {
    82  	if m != nil {
    83  		return m.Transactions
    84  	}
    85  	return nil
    86  }
    87  
    88  func (m *OutgoingTxBatch) GetTokenContract() string {
    89  	if m != nil {
    90  		return m.TokenContract
    91  	}
    92  	return ""
    93  }
    94  
    95  func (m *OutgoingTxBatch) GetBlock() uint64 {
    96  	if m != nil {
    97  		return m.Block
    98  	}
    99  	return 0
   100  }
   101  
   102  // OutgoingTransferTx represents an individual send from Peggy to ETH
   103  type OutgoingTransferTx struct {
   104  	Id          uint64      `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
   105  	Sender      string      `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"`
   106  	DestAddress string      `protobuf:"bytes,3,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"`
   107  	Erc20Token  *ERC20Token `protobuf:"bytes,4,opt,name=erc20_token,json=erc20Token,proto3" json:"erc20_token,omitempty"`
   108  	Erc20Fee    *ERC20Token `protobuf:"bytes,5,opt,name=erc20_fee,json=erc20Fee,proto3" json:"erc20_fee,omitempty"`
   109  }
   110  
   111  func (m *OutgoingTransferTx) Reset()         { *m = OutgoingTransferTx{} }
   112  func (m *OutgoingTransferTx) String() string { return proto.CompactTextString(m) }
   113  func (*OutgoingTransferTx) ProtoMessage()    {}
   114  func (*OutgoingTransferTx) Descriptor() ([]byte, []int) {
   115  	return fileDescriptor_48fd09581f1b5901, []int{1}
   116  }
   117  func (m *OutgoingTransferTx) XXX_Unmarshal(b []byte) error {
   118  	return m.Unmarshal(b)
   119  }
   120  func (m *OutgoingTransferTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   121  	if deterministic {
   122  		return xxx_messageInfo_OutgoingTransferTx.Marshal(b, m, deterministic)
   123  	} else {
   124  		b = b[:cap(b)]
   125  		n, err := m.MarshalToSizedBuffer(b)
   126  		if err != nil {
   127  			return nil, err
   128  		}
   129  		return b[:n], nil
   130  	}
   131  }
   132  func (m *OutgoingTransferTx) XXX_Merge(src proto.Message) {
   133  	xxx_messageInfo_OutgoingTransferTx.Merge(m, src)
   134  }
   135  func (m *OutgoingTransferTx) XXX_Size() int {
   136  	return m.Size()
   137  }
   138  func (m *OutgoingTransferTx) XXX_DiscardUnknown() {
   139  	xxx_messageInfo_OutgoingTransferTx.DiscardUnknown(m)
   140  }
   141  
   142  var xxx_messageInfo_OutgoingTransferTx proto.InternalMessageInfo
   143  
   144  func (m *OutgoingTransferTx) GetId() uint64 {
   145  	if m != nil {
   146  		return m.Id
   147  	}
   148  	return 0
   149  }
   150  
   151  func (m *OutgoingTransferTx) GetSender() string {
   152  	if m != nil {
   153  		return m.Sender
   154  	}
   155  	return ""
   156  }
   157  
   158  func (m *OutgoingTransferTx) GetDestAddress() string {
   159  	if m != nil {
   160  		return m.DestAddress
   161  	}
   162  	return ""
   163  }
   164  
   165  func (m *OutgoingTransferTx) GetErc20Token() *ERC20Token {
   166  	if m != nil {
   167  		return m.Erc20Token
   168  	}
   169  	return nil
   170  }
   171  
   172  func (m *OutgoingTransferTx) GetErc20Fee() *ERC20Token {
   173  	if m != nil {
   174  		return m.Erc20Fee
   175  	}
   176  	return nil
   177  }
   178  
   179  func init() {
   180  	proto.RegisterType((*OutgoingTxBatch)(nil), "injective.peggy.v1.OutgoingTxBatch")
   181  	proto.RegisterType((*OutgoingTransferTx)(nil), "injective.peggy.v1.OutgoingTransferTx")
   182  }
   183  
   184  func init() { proto.RegisterFile("injective/peggy/v1/batch.proto", fileDescriptor_48fd09581f1b5901) }
   185  
   186  var fileDescriptor_48fd09581f1b5901 = []byte{
   187  	// 409 bytes of a gzipped FileDescriptorProto
   188  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4d, 0x6b, 0xdc, 0x30,
   189  	0x10, 0x86, 0x57, 0x9b, 0x0f, 0xba, 0xf2, 0x26, 0x05, 0x51, 0x8a, 0xe9, 0x41, 0xdd, 0xa6, 0x1f,
   190  	0xec, 0xa5, 0x76, 0xe2, 0x1e, 0x7b, 0x28, 0x4d, 0x68, 0xa1, 0x1f, 0xb4, 0x60, 0x7c, 0xea, 0xc5,
   191  	0xc8, 0xf2, 0xc4, 0xab, 0x26, 0x2b, 0x2d, 0xd2, 0x78, 0x49, 0xfe, 0x45, 0x7f, 0x56, 0x8f, 0x39,
   192  	0xf6, 0x52, 0x08, 0xbb, 0x7f, 0xa4, 0x48, 0x76, 0x97, 0x96, 0x04, 0x72, 0xd3, 0x3c, 0x33, 0xef,
   193  	0xab, 0x77, 0x60, 0x28, 0x57, 0xfa, 0x3b, 0x48, 0x54, 0x4b, 0x48, 0x17, 0xd0, 0x34, 0x97, 0xe9,
   194  	0xf2, 0x28, 0xad, 0x04, 0xca, 0x59, 0xb2, 0xb0, 0x06, 0x0d, 0x63, 0x9b, 0x7e, 0x12, 0xfa, 0xc9,
   195  	0xf2, 0xe8, 0xd1, 0xb3, 0x5b, 0x34, 0x02, 0x11, 0x1c, 0x0a, 0x54, 0x46, 0x77, 0xca, 0x83, 0x6b,
   196  	0x42, 0xef, 0x7f, 0x6d, 0xb1, 0x31, 0x4a, 0x37, 0xc5, 0xc5, 0xb1, 0xf7, 0x64, 0x8f, 0x69, 0x14,
   197  	0xcc, 0x4b, 0x6d, 0xb4, 0x84, 0x98, 0x4c, 0xc8, 0x74, 0x3b, 0xa7, 0x01, 0x7d, 0xf1, 0x84, 0x3d,
   198  	0xa5, 0x7b, 0xdd, 0x00, 0xaa, 0x39, 0x98, 0x16, 0xe3, 0x61, 0x18, 0x19, 0x07, 0x58, 0x74, 0x8c,
   199  	0x7d, 0xa4, 0x63, 0xb4, 0x42, 0x3b, 0x21, 0xfd, 0x77, 0x2e, 0xde, 0x9a, 0x6c, 0x4d, 0xa3, 0xec,
   200  	0x45, 0x72, 0x33, 0x6a, 0xb2, 0x09, 0xe0, 0xe7, 0x4f, 0xc1, 0x16, 0x17, 0xf9, 0x7f, 0x5a, 0xf6,
   201  	0x9c, 0xee, 0xa3, 0x39, 0x03, 0x5d, 0x4a, 0xa3, 0xd1, 0x0a, 0x89, 0xf1, 0xf6, 0x84, 0x4c, 0x47,
   202  	0xf9, 0x5e, 0xa0, 0x27, 0x3d, 0x64, 0x0f, 0xe8, 0x4e, 0x75, 0x6e, 0xe4, 0x59, 0xbc, 0x13, 0xf2,
   203  	0x74, 0xc5, 0xc1, 0x6f, 0x42, 0xd9, 0xcd, 0x1f, 0xd8, 0x3e, 0x1d, 0xaa, 0xba, 0x5f, 0x6e, 0xa8,
   204  	0x6a, 0xf6, 0x90, 0xee, 0x3a, 0xd0, 0x35, 0xd8, 0xb0, 0xcd, 0x28, 0xef, 0x2b, 0xf6, 0x84, 0x8e,
   205  	0x6b, 0x70, 0x58, 0x8a, 0xba, 0xb6, 0xe0, 0xfc, 0x1e, 0xbe, 0x1b, 0x79, 0xf6, 0xb6, 0x43, 0xec,
   206  	0x0d, 0x8d, 0xc0, 0xca, 0xec, 0xb0, 0x0c, 0x71, 0x42, 0xb6, 0x28, 0xe3, 0xb7, 0x6d, 0xfa, 0x2e,
   207  	0x3f, 0xc9, 0x0e, 0x0b, 0x3f, 0x95, 0xd3, 0x20, 0x09, 0x6f, 0xf6, 0x9a, 0x8e, 0x3a, 0x83, 0x53,
   208  	0x80, 0x10, 0xfe, 0x6e, 0xf9, 0xbd, 0x20, 0x78, 0x0f, 0x70, 0x0c, 0x3f, 0x57, 0x9c, 0x5c, 0xad,
   209  	0x38, 0xb9, 0x5e, 0x71, 0xf2, 0x63, 0xcd, 0x07, 0x57, 0x6b, 0x3e, 0xf8, 0xb5, 0xe6, 0x83, 0x6f,
   210  	0x9f, 0x1a, 0x85, 0xb3, 0xb6, 0x4a, 0xa4, 0x99, 0xa7, 0x1f, 0xfe, 0xba, 0x7d, 0x16, 0x95, 0x4b,
   211  	0x37, 0xde, 0x2f, 0xa5, 0xb1, 0xf0, 0x6f, 0x39, 0x13, 0x4a, 0xa7, 0x73, 0x53, 0xb7, 0xe7, 0xe0,
   212  	0xfa, 0xc3, 0xc1, 0xcb, 0x05, 0xb8, 0x6a, 0x37, 0x1c, 0xcc, 0xab, 0x3f, 0x01, 0x00, 0x00, 0xff,
   213  	0xff, 0x24, 0x11, 0x91, 0x29, 0x8c, 0x02, 0x00, 0x00,
   214  }
   215  
   216  func (m *OutgoingTxBatch) Marshal() (dAtA []byte, err error) {
   217  	size := m.Size()
   218  	dAtA = make([]byte, size)
   219  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   220  	if err != nil {
   221  		return nil, err
   222  	}
   223  	return dAtA[:n], nil
   224  }
   225  
   226  func (m *OutgoingTxBatch) MarshalTo(dAtA []byte) (int, error) {
   227  	size := m.Size()
   228  	return m.MarshalToSizedBuffer(dAtA[:size])
   229  }
   230  
   231  func (m *OutgoingTxBatch) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   232  	i := len(dAtA)
   233  	_ = i
   234  	var l int
   235  	_ = l
   236  	if m.Block != 0 {
   237  		i = encodeVarintBatch(dAtA, i, uint64(m.Block))
   238  		i--
   239  		dAtA[i] = 0x28
   240  	}
   241  	if len(m.TokenContract) > 0 {
   242  		i -= len(m.TokenContract)
   243  		copy(dAtA[i:], m.TokenContract)
   244  		i = encodeVarintBatch(dAtA, i, uint64(len(m.TokenContract)))
   245  		i--
   246  		dAtA[i] = 0x22
   247  	}
   248  	if len(m.Transactions) > 0 {
   249  		for iNdEx := len(m.Transactions) - 1; iNdEx >= 0; iNdEx-- {
   250  			{
   251  				size, err := m.Transactions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   252  				if err != nil {
   253  					return 0, err
   254  				}
   255  				i -= size
   256  				i = encodeVarintBatch(dAtA, i, uint64(size))
   257  			}
   258  			i--
   259  			dAtA[i] = 0x1a
   260  		}
   261  	}
   262  	if m.BatchTimeout != 0 {
   263  		i = encodeVarintBatch(dAtA, i, uint64(m.BatchTimeout))
   264  		i--
   265  		dAtA[i] = 0x10
   266  	}
   267  	if m.BatchNonce != 0 {
   268  		i = encodeVarintBatch(dAtA, i, uint64(m.BatchNonce))
   269  		i--
   270  		dAtA[i] = 0x8
   271  	}
   272  	return len(dAtA) - i, nil
   273  }
   274  
   275  func (m *OutgoingTransferTx) Marshal() (dAtA []byte, err error) {
   276  	size := m.Size()
   277  	dAtA = make([]byte, size)
   278  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   279  	if err != nil {
   280  		return nil, err
   281  	}
   282  	return dAtA[:n], nil
   283  }
   284  
   285  func (m *OutgoingTransferTx) MarshalTo(dAtA []byte) (int, error) {
   286  	size := m.Size()
   287  	return m.MarshalToSizedBuffer(dAtA[:size])
   288  }
   289  
   290  func (m *OutgoingTransferTx) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   291  	i := len(dAtA)
   292  	_ = i
   293  	var l int
   294  	_ = l
   295  	if m.Erc20Fee != nil {
   296  		{
   297  			size, err := m.Erc20Fee.MarshalToSizedBuffer(dAtA[:i])
   298  			if err != nil {
   299  				return 0, err
   300  			}
   301  			i -= size
   302  			i = encodeVarintBatch(dAtA, i, uint64(size))
   303  		}
   304  		i--
   305  		dAtA[i] = 0x2a
   306  	}
   307  	if m.Erc20Token != nil {
   308  		{
   309  			size, err := m.Erc20Token.MarshalToSizedBuffer(dAtA[:i])
   310  			if err != nil {
   311  				return 0, err
   312  			}
   313  			i -= size
   314  			i = encodeVarintBatch(dAtA, i, uint64(size))
   315  		}
   316  		i--
   317  		dAtA[i] = 0x22
   318  	}
   319  	if len(m.DestAddress) > 0 {
   320  		i -= len(m.DestAddress)
   321  		copy(dAtA[i:], m.DestAddress)
   322  		i = encodeVarintBatch(dAtA, i, uint64(len(m.DestAddress)))
   323  		i--
   324  		dAtA[i] = 0x1a
   325  	}
   326  	if len(m.Sender) > 0 {
   327  		i -= len(m.Sender)
   328  		copy(dAtA[i:], m.Sender)
   329  		i = encodeVarintBatch(dAtA, i, uint64(len(m.Sender)))
   330  		i--
   331  		dAtA[i] = 0x12
   332  	}
   333  	if m.Id != 0 {
   334  		i = encodeVarintBatch(dAtA, i, uint64(m.Id))
   335  		i--
   336  		dAtA[i] = 0x8
   337  	}
   338  	return len(dAtA) - i, nil
   339  }
   340  
   341  func encodeVarintBatch(dAtA []byte, offset int, v uint64) int {
   342  	offset -= sovBatch(v)
   343  	base := offset
   344  	for v >= 1<<7 {
   345  		dAtA[offset] = uint8(v&0x7f | 0x80)
   346  		v >>= 7
   347  		offset++
   348  	}
   349  	dAtA[offset] = uint8(v)
   350  	return base
   351  }
   352  func (m *OutgoingTxBatch) Size() (n int) {
   353  	if m == nil {
   354  		return 0
   355  	}
   356  	var l int
   357  	_ = l
   358  	if m.BatchNonce != 0 {
   359  		n += 1 + sovBatch(uint64(m.BatchNonce))
   360  	}
   361  	if m.BatchTimeout != 0 {
   362  		n += 1 + sovBatch(uint64(m.BatchTimeout))
   363  	}
   364  	if len(m.Transactions) > 0 {
   365  		for _, e := range m.Transactions {
   366  			l = e.Size()
   367  			n += 1 + l + sovBatch(uint64(l))
   368  		}
   369  	}
   370  	l = len(m.TokenContract)
   371  	if l > 0 {
   372  		n += 1 + l + sovBatch(uint64(l))
   373  	}
   374  	if m.Block != 0 {
   375  		n += 1 + sovBatch(uint64(m.Block))
   376  	}
   377  	return n
   378  }
   379  
   380  func (m *OutgoingTransferTx) Size() (n int) {
   381  	if m == nil {
   382  		return 0
   383  	}
   384  	var l int
   385  	_ = l
   386  	if m.Id != 0 {
   387  		n += 1 + sovBatch(uint64(m.Id))
   388  	}
   389  	l = len(m.Sender)
   390  	if l > 0 {
   391  		n += 1 + l + sovBatch(uint64(l))
   392  	}
   393  	l = len(m.DestAddress)
   394  	if l > 0 {
   395  		n += 1 + l + sovBatch(uint64(l))
   396  	}
   397  	if m.Erc20Token != nil {
   398  		l = m.Erc20Token.Size()
   399  		n += 1 + l + sovBatch(uint64(l))
   400  	}
   401  	if m.Erc20Fee != nil {
   402  		l = m.Erc20Fee.Size()
   403  		n += 1 + l + sovBatch(uint64(l))
   404  	}
   405  	return n
   406  }
   407  
   408  func sovBatch(x uint64) (n int) {
   409  	return (math_bits.Len64(x|1) + 6) / 7
   410  }
   411  func sozBatch(x uint64) (n int) {
   412  	return sovBatch(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   413  }
   414  func (m *OutgoingTxBatch) Unmarshal(dAtA []byte) error {
   415  	l := len(dAtA)
   416  	iNdEx := 0
   417  	for iNdEx < l {
   418  		preIndex := iNdEx
   419  		var wire uint64
   420  		for shift := uint(0); ; shift += 7 {
   421  			if shift >= 64 {
   422  				return ErrIntOverflowBatch
   423  			}
   424  			if iNdEx >= l {
   425  				return io.ErrUnexpectedEOF
   426  			}
   427  			b := dAtA[iNdEx]
   428  			iNdEx++
   429  			wire |= uint64(b&0x7F) << shift
   430  			if b < 0x80 {
   431  				break
   432  			}
   433  		}
   434  		fieldNum := int32(wire >> 3)
   435  		wireType := int(wire & 0x7)
   436  		if wireType == 4 {
   437  			return fmt.Errorf("proto: OutgoingTxBatch: wiretype end group for non-group")
   438  		}
   439  		if fieldNum <= 0 {
   440  			return fmt.Errorf("proto: OutgoingTxBatch: illegal tag %d (wire type %d)", fieldNum, wire)
   441  		}
   442  		switch fieldNum {
   443  		case 1:
   444  			if wireType != 0 {
   445  				return fmt.Errorf("proto: wrong wireType = %d for field BatchNonce", wireType)
   446  			}
   447  			m.BatchNonce = 0
   448  			for shift := uint(0); ; shift += 7 {
   449  				if shift >= 64 {
   450  					return ErrIntOverflowBatch
   451  				}
   452  				if iNdEx >= l {
   453  					return io.ErrUnexpectedEOF
   454  				}
   455  				b := dAtA[iNdEx]
   456  				iNdEx++
   457  				m.BatchNonce |= uint64(b&0x7F) << shift
   458  				if b < 0x80 {
   459  					break
   460  				}
   461  			}
   462  		case 2:
   463  			if wireType != 0 {
   464  				return fmt.Errorf("proto: wrong wireType = %d for field BatchTimeout", wireType)
   465  			}
   466  			m.BatchTimeout = 0
   467  			for shift := uint(0); ; shift += 7 {
   468  				if shift >= 64 {
   469  					return ErrIntOverflowBatch
   470  				}
   471  				if iNdEx >= l {
   472  					return io.ErrUnexpectedEOF
   473  				}
   474  				b := dAtA[iNdEx]
   475  				iNdEx++
   476  				m.BatchTimeout |= uint64(b&0x7F) << shift
   477  				if b < 0x80 {
   478  					break
   479  				}
   480  			}
   481  		case 3:
   482  			if wireType != 2 {
   483  				return fmt.Errorf("proto: wrong wireType = %d for field Transactions", wireType)
   484  			}
   485  			var msglen int
   486  			for shift := uint(0); ; shift += 7 {
   487  				if shift >= 64 {
   488  					return ErrIntOverflowBatch
   489  				}
   490  				if iNdEx >= l {
   491  					return io.ErrUnexpectedEOF
   492  				}
   493  				b := dAtA[iNdEx]
   494  				iNdEx++
   495  				msglen |= int(b&0x7F) << shift
   496  				if b < 0x80 {
   497  					break
   498  				}
   499  			}
   500  			if msglen < 0 {
   501  				return ErrInvalidLengthBatch
   502  			}
   503  			postIndex := iNdEx + msglen
   504  			if postIndex < 0 {
   505  				return ErrInvalidLengthBatch
   506  			}
   507  			if postIndex > l {
   508  				return io.ErrUnexpectedEOF
   509  			}
   510  			m.Transactions = append(m.Transactions, &OutgoingTransferTx{})
   511  			if err := m.Transactions[len(m.Transactions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   512  				return err
   513  			}
   514  			iNdEx = postIndex
   515  		case 4:
   516  			if wireType != 2 {
   517  				return fmt.Errorf("proto: wrong wireType = %d for field TokenContract", wireType)
   518  			}
   519  			var stringLen uint64
   520  			for shift := uint(0); ; shift += 7 {
   521  				if shift >= 64 {
   522  					return ErrIntOverflowBatch
   523  				}
   524  				if iNdEx >= l {
   525  					return io.ErrUnexpectedEOF
   526  				}
   527  				b := dAtA[iNdEx]
   528  				iNdEx++
   529  				stringLen |= uint64(b&0x7F) << shift
   530  				if b < 0x80 {
   531  					break
   532  				}
   533  			}
   534  			intStringLen := int(stringLen)
   535  			if intStringLen < 0 {
   536  				return ErrInvalidLengthBatch
   537  			}
   538  			postIndex := iNdEx + intStringLen
   539  			if postIndex < 0 {
   540  				return ErrInvalidLengthBatch
   541  			}
   542  			if postIndex > l {
   543  				return io.ErrUnexpectedEOF
   544  			}
   545  			m.TokenContract = string(dAtA[iNdEx:postIndex])
   546  			iNdEx = postIndex
   547  		case 5:
   548  			if wireType != 0 {
   549  				return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
   550  			}
   551  			m.Block = 0
   552  			for shift := uint(0); ; shift += 7 {
   553  				if shift >= 64 {
   554  					return ErrIntOverflowBatch
   555  				}
   556  				if iNdEx >= l {
   557  					return io.ErrUnexpectedEOF
   558  				}
   559  				b := dAtA[iNdEx]
   560  				iNdEx++
   561  				m.Block |= uint64(b&0x7F) << shift
   562  				if b < 0x80 {
   563  					break
   564  				}
   565  			}
   566  		default:
   567  			iNdEx = preIndex
   568  			skippy, err := skipBatch(dAtA[iNdEx:])
   569  			if err != nil {
   570  				return err
   571  			}
   572  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   573  				return ErrInvalidLengthBatch
   574  			}
   575  			if (iNdEx + skippy) > l {
   576  				return io.ErrUnexpectedEOF
   577  			}
   578  			iNdEx += skippy
   579  		}
   580  	}
   581  
   582  	if iNdEx > l {
   583  		return io.ErrUnexpectedEOF
   584  	}
   585  	return nil
   586  }
   587  func (m *OutgoingTransferTx) Unmarshal(dAtA []byte) error {
   588  	l := len(dAtA)
   589  	iNdEx := 0
   590  	for iNdEx < l {
   591  		preIndex := iNdEx
   592  		var wire uint64
   593  		for shift := uint(0); ; shift += 7 {
   594  			if shift >= 64 {
   595  				return ErrIntOverflowBatch
   596  			}
   597  			if iNdEx >= l {
   598  				return io.ErrUnexpectedEOF
   599  			}
   600  			b := dAtA[iNdEx]
   601  			iNdEx++
   602  			wire |= uint64(b&0x7F) << shift
   603  			if b < 0x80 {
   604  				break
   605  			}
   606  		}
   607  		fieldNum := int32(wire >> 3)
   608  		wireType := int(wire & 0x7)
   609  		if wireType == 4 {
   610  			return fmt.Errorf("proto: OutgoingTransferTx: wiretype end group for non-group")
   611  		}
   612  		if fieldNum <= 0 {
   613  			return fmt.Errorf("proto: OutgoingTransferTx: illegal tag %d (wire type %d)", fieldNum, wire)
   614  		}
   615  		switch fieldNum {
   616  		case 1:
   617  			if wireType != 0 {
   618  				return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
   619  			}
   620  			m.Id = 0
   621  			for shift := uint(0); ; shift += 7 {
   622  				if shift >= 64 {
   623  					return ErrIntOverflowBatch
   624  				}
   625  				if iNdEx >= l {
   626  					return io.ErrUnexpectedEOF
   627  				}
   628  				b := dAtA[iNdEx]
   629  				iNdEx++
   630  				m.Id |= uint64(b&0x7F) << shift
   631  				if b < 0x80 {
   632  					break
   633  				}
   634  			}
   635  		case 2:
   636  			if wireType != 2 {
   637  				return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType)
   638  			}
   639  			var stringLen uint64
   640  			for shift := uint(0); ; shift += 7 {
   641  				if shift >= 64 {
   642  					return ErrIntOverflowBatch
   643  				}
   644  				if iNdEx >= l {
   645  					return io.ErrUnexpectedEOF
   646  				}
   647  				b := dAtA[iNdEx]
   648  				iNdEx++
   649  				stringLen |= uint64(b&0x7F) << shift
   650  				if b < 0x80 {
   651  					break
   652  				}
   653  			}
   654  			intStringLen := int(stringLen)
   655  			if intStringLen < 0 {
   656  				return ErrInvalidLengthBatch
   657  			}
   658  			postIndex := iNdEx + intStringLen
   659  			if postIndex < 0 {
   660  				return ErrInvalidLengthBatch
   661  			}
   662  			if postIndex > l {
   663  				return io.ErrUnexpectedEOF
   664  			}
   665  			m.Sender = string(dAtA[iNdEx:postIndex])
   666  			iNdEx = postIndex
   667  		case 3:
   668  			if wireType != 2 {
   669  				return fmt.Errorf("proto: wrong wireType = %d for field DestAddress", wireType)
   670  			}
   671  			var stringLen uint64
   672  			for shift := uint(0); ; shift += 7 {
   673  				if shift >= 64 {
   674  					return ErrIntOverflowBatch
   675  				}
   676  				if iNdEx >= l {
   677  					return io.ErrUnexpectedEOF
   678  				}
   679  				b := dAtA[iNdEx]
   680  				iNdEx++
   681  				stringLen |= uint64(b&0x7F) << shift
   682  				if b < 0x80 {
   683  					break
   684  				}
   685  			}
   686  			intStringLen := int(stringLen)
   687  			if intStringLen < 0 {
   688  				return ErrInvalidLengthBatch
   689  			}
   690  			postIndex := iNdEx + intStringLen
   691  			if postIndex < 0 {
   692  				return ErrInvalidLengthBatch
   693  			}
   694  			if postIndex > l {
   695  				return io.ErrUnexpectedEOF
   696  			}
   697  			m.DestAddress = string(dAtA[iNdEx:postIndex])
   698  			iNdEx = postIndex
   699  		case 4:
   700  			if wireType != 2 {
   701  				return fmt.Errorf("proto: wrong wireType = %d for field Erc20Token", wireType)
   702  			}
   703  			var msglen int
   704  			for shift := uint(0); ; shift += 7 {
   705  				if shift >= 64 {
   706  					return ErrIntOverflowBatch
   707  				}
   708  				if iNdEx >= l {
   709  					return io.ErrUnexpectedEOF
   710  				}
   711  				b := dAtA[iNdEx]
   712  				iNdEx++
   713  				msglen |= int(b&0x7F) << shift
   714  				if b < 0x80 {
   715  					break
   716  				}
   717  			}
   718  			if msglen < 0 {
   719  				return ErrInvalidLengthBatch
   720  			}
   721  			postIndex := iNdEx + msglen
   722  			if postIndex < 0 {
   723  				return ErrInvalidLengthBatch
   724  			}
   725  			if postIndex > l {
   726  				return io.ErrUnexpectedEOF
   727  			}
   728  			if m.Erc20Token == nil {
   729  				m.Erc20Token = &ERC20Token{}
   730  			}
   731  			if err := m.Erc20Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   732  				return err
   733  			}
   734  			iNdEx = postIndex
   735  		case 5:
   736  			if wireType != 2 {
   737  				return fmt.Errorf("proto: wrong wireType = %d for field Erc20Fee", wireType)
   738  			}
   739  			var msglen int
   740  			for shift := uint(0); ; shift += 7 {
   741  				if shift >= 64 {
   742  					return ErrIntOverflowBatch
   743  				}
   744  				if iNdEx >= l {
   745  					return io.ErrUnexpectedEOF
   746  				}
   747  				b := dAtA[iNdEx]
   748  				iNdEx++
   749  				msglen |= int(b&0x7F) << shift
   750  				if b < 0x80 {
   751  					break
   752  				}
   753  			}
   754  			if msglen < 0 {
   755  				return ErrInvalidLengthBatch
   756  			}
   757  			postIndex := iNdEx + msglen
   758  			if postIndex < 0 {
   759  				return ErrInvalidLengthBatch
   760  			}
   761  			if postIndex > l {
   762  				return io.ErrUnexpectedEOF
   763  			}
   764  			if m.Erc20Fee == nil {
   765  				m.Erc20Fee = &ERC20Token{}
   766  			}
   767  			if err := m.Erc20Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   768  				return err
   769  			}
   770  			iNdEx = postIndex
   771  		default:
   772  			iNdEx = preIndex
   773  			skippy, err := skipBatch(dAtA[iNdEx:])
   774  			if err != nil {
   775  				return err
   776  			}
   777  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   778  				return ErrInvalidLengthBatch
   779  			}
   780  			if (iNdEx + skippy) > l {
   781  				return io.ErrUnexpectedEOF
   782  			}
   783  			iNdEx += skippy
   784  		}
   785  	}
   786  
   787  	if iNdEx > l {
   788  		return io.ErrUnexpectedEOF
   789  	}
   790  	return nil
   791  }
   792  func skipBatch(dAtA []byte) (n int, err error) {
   793  	l := len(dAtA)
   794  	iNdEx := 0
   795  	depth := 0
   796  	for iNdEx < l {
   797  		var wire uint64
   798  		for shift := uint(0); ; shift += 7 {
   799  			if shift >= 64 {
   800  				return 0, ErrIntOverflowBatch
   801  			}
   802  			if iNdEx >= l {
   803  				return 0, io.ErrUnexpectedEOF
   804  			}
   805  			b := dAtA[iNdEx]
   806  			iNdEx++
   807  			wire |= (uint64(b) & 0x7F) << shift
   808  			if b < 0x80 {
   809  				break
   810  			}
   811  		}
   812  		wireType := int(wire & 0x7)
   813  		switch wireType {
   814  		case 0:
   815  			for shift := uint(0); ; shift += 7 {
   816  				if shift >= 64 {
   817  					return 0, ErrIntOverflowBatch
   818  				}
   819  				if iNdEx >= l {
   820  					return 0, io.ErrUnexpectedEOF
   821  				}
   822  				iNdEx++
   823  				if dAtA[iNdEx-1] < 0x80 {
   824  					break
   825  				}
   826  			}
   827  		case 1:
   828  			iNdEx += 8
   829  		case 2:
   830  			var length int
   831  			for shift := uint(0); ; shift += 7 {
   832  				if shift >= 64 {
   833  					return 0, ErrIntOverflowBatch
   834  				}
   835  				if iNdEx >= l {
   836  					return 0, io.ErrUnexpectedEOF
   837  				}
   838  				b := dAtA[iNdEx]
   839  				iNdEx++
   840  				length |= (int(b) & 0x7F) << shift
   841  				if b < 0x80 {
   842  					break
   843  				}
   844  			}
   845  			if length < 0 {
   846  				return 0, ErrInvalidLengthBatch
   847  			}
   848  			iNdEx += length
   849  		case 3:
   850  			depth++
   851  		case 4:
   852  			if depth == 0 {
   853  				return 0, ErrUnexpectedEndOfGroupBatch
   854  			}
   855  			depth--
   856  		case 5:
   857  			iNdEx += 4
   858  		default:
   859  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   860  		}
   861  		if iNdEx < 0 {
   862  			return 0, ErrInvalidLengthBatch
   863  		}
   864  		if depth == 0 {
   865  			return iNdEx, nil
   866  		}
   867  	}
   868  	return 0, io.ErrUnexpectedEOF
   869  }
   870  
   871  var (
   872  	ErrInvalidLengthBatch        = fmt.Errorf("proto: negative length found during unmarshaling")
   873  	ErrIntOverflowBatch          = fmt.Errorf("proto: integer overflow")
   874  	ErrUnexpectedEndOfGroupBatch = fmt.Errorf("proto: unexpected end of group")
   875  )