github.com/Finschia/ostracon@v1.1.5/proto/ostracon/blockchain/types.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: ostracon/blockchain/types.proto
     3  
     4  package blockchain
     5  
     6  import (
     7  	fmt "fmt"
     8  	types "github.com/Finschia/ostracon/proto/ostracon/types"
     9  	proto "github.com/gogo/protobuf/proto"
    10  	blockchain "github.com/tendermint/tendermint/proto/tendermint/blockchain"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  // BlockResponse returns block to the requested
    28  type BlockResponse struct {
    29  	Block *types.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
    30  }
    31  
    32  func (m *BlockResponse) Reset()         { *m = BlockResponse{} }
    33  func (m *BlockResponse) String() string { return proto.CompactTextString(m) }
    34  func (*BlockResponse) ProtoMessage()    {}
    35  func (*BlockResponse) Descriptor() ([]byte, []int) {
    36  	return fileDescriptor_8fcd44ecf244cfa3, []int{0}
    37  }
    38  func (m *BlockResponse) XXX_Unmarshal(b []byte) error {
    39  	return m.Unmarshal(b)
    40  }
    41  func (m *BlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    42  	if deterministic {
    43  		return xxx_messageInfo_BlockResponse.Marshal(b, m, deterministic)
    44  	} else {
    45  		b = b[:cap(b)]
    46  		n, err := m.MarshalToSizedBuffer(b)
    47  		if err != nil {
    48  			return nil, err
    49  		}
    50  		return b[:n], nil
    51  	}
    52  }
    53  func (m *BlockResponse) XXX_Merge(src proto.Message) {
    54  	xxx_messageInfo_BlockResponse.Merge(m, src)
    55  }
    56  func (m *BlockResponse) XXX_Size() int {
    57  	return m.Size()
    58  }
    59  func (m *BlockResponse) XXX_DiscardUnknown() {
    60  	xxx_messageInfo_BlockResponse.DiscardUnknown(m)
    61  }
    62  
    63  var xxx_messageInfo_BlockResponse proto.InternalMessageInfo
    64  
    65  func (m *BlockResponse) GetBlock() *types.Block {
    66  	if m != nil {
    67  		return m.Block
    68  	}
    69  	return nil
    70  }
    71  
    72  type Message struct {
    73  	// Types that are valid to be assigned to Sum:
    74  	//	*Message_BlockRequest
    75  	//	*Message_NoBlockResponse
    76  	//	*Message_BlockResponse
    77  	//	*Message_StatusRequest
    78  	//	*Message_StatusResponse
    79  	Sum isMessage_Sum `protobuf_oneof:"sum"`
    80  }
    81  
    82  func (m *Message) Reset()         { *m = Message{} }
    83  func (m *Message) String() string { return proto.CompactTextString(m) }
    84  func (*Message) ProtoMessage()    {}
    85  func (*Message) Descriptor() ([]byte, []int) {
    86  	return fileDescriptor_8fcd44ecf244cfa3, []int{1}
    87  }
    88  func (m *Message) XXX_Unmarshal(b []byte) error {
    89  	return m.Unmarshal(b)
    90  }
    91  func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    92  	if deterministic {
    93  		return xxx_messageInfo_Message.Marshal(b, m, deterministic)
    94  	} else {
    95  		b = b[:cap(b)]
    96  		n, err := m.MarshalToSizedBuffer(b)
    97  		if err != nil {
    98  			return nil, err
    99  		}
   100  		return b[:n], nil
   101  	}
   102  }
   103  func (m *Message) XXX_Merge(src proto.Message) {
   104  	xxx_messageInfo_Message.Merge(m, src)
   105  }
   106  func (m *Message) XXX_Size() int {
   107  	return m.Size()
   108  }
   109  func (m *Message) XXX_DiscardUnknown() {
   110  	xxx_messageInfo_Message.DiscardUnknown(m)
   111  }
   112  
   113  var xxx_messageInfo_Message proto.InternalMessageInfo
   114  
   115  type isMessage_Sum interface {
   116  	isMessage_Sum()
   117  	MarshalTo([]byte) (int, error)
   118  	Size() int
   119  }
   120  
   121  type Message_BlockRequest struct {
   122  	BlockRequest *blockchain.BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"`
   123  }
   124  type Message_NoBlockResponse struct {
   125  	NoBlockResponse *blockchain.NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"`
   126  }
   127  type Message_BlockResponse struct {
   128  	BlockResponse *BlockResponse `protobuf:"bytes,3,opt,name=block_response,json=blockResponse,proto3,oneof" json:"block_response,omitempty"`
   129  }
   130  type Message_StatusRequest struct {
   131  	StatusRequest *blockchain.StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"`
   132  }
   133  type Message_StatusResponse struct {
   134  	StatusResponse *blockchain.StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"`
   135  }
   136  
   137  func (*Message_BlockRequest) isMessage_Sum()    {}
   138  func (*Message_NoBlockResponse) isMessage_Sum() {}
   139  func (*Message_BlockResponse) isMessage_Sum()   {}
   140  func (*Message_StatusRequest) isMessage_Sum()   {}
   141  func (*Message_StatusResponse) isMessage_Sum()  {}
   142  
   143  func (m *Message) GetSum() isMessage_Sum {
   144  	if m != nil {
   145  		return m.Sum
   146  	}
   147  	return nil
   148  }
   149  
   150  func (m *Message) GetBlockRequest() *blockchain.BlockRequest {
   151  	if x, ok := m.GetSum().(*Message_BlockRequest); ok {
   152  		return x.BlockRequest
   153  	}
   154  	return nil
   155  }
   156  
   157  func (m *Message) GetNoBlockResponse() *blockchain.NoBlockResponse {
   158  	if x, ok := m.GetSum().(*Message_NoBlockResponse); ok {
   159  		return x.NoBlockResponse
   160  	}
   161  	return nil
   162  }
   163  
   164  func (m *Message) GetBlockResponse() *BlockResponse {
   165  	if x, ok := m.GetSum().(*Message_BlockResponse); ok {
   166  		return x.BlockResponse
   167  	}
   168  	return nil
   169  }
   170  
   171  func (m *Message) GetStatusRequest() *blockchain.StatusRequest {
   172  	if x, ok := m.GetSum().(*Message_StatusRequest); ok {
   173  		return x.StatusRequest
   174  	}
   175  	return nil
   176  }
   177  
   178  func (m *Message) GetStatusResponse() *blockchain.StatusResponse {
   179  	if x, ok := m.GetSum().(*Message_StatusResponse); ok {
   180  		return x.StatusResponse
   181  	}
   182  	return nil
   183  }
   184  
   185  // XXX_OneofWrappers is for the internal use of the proto package.
   186  func (*Message) XXX_OneofWrappers() []interface{} {
   187  	return []interface{}{
   188  		(*Message_BlockRequest)(nil),
   189  		(*Message_NoBlockResponse)(nil),
   190  		(*Message_BlockResponse)(nil),
   191  		(*Message_StatusRequest)(nil),
   192  		(*Message_StatusResponse)(nil),
   193  	}
   194  }
   195  
   196  func init() {
   197  	proto.RegisterType((*BlockResponse)(nil), "ostracon.blockchain.BlockResponse")
   198  	proto.RegisterType((*Message)(nil), "ostracon.blockchain.Message")
   199  }
   200  
   201  func init() { proto.RegisterFile("ostracon/blockchain/types.proto", fileDescriptor_8fcd44ecf244cfa3) }
   202  
   203  var fileDescriptor_8fcd44ecf244cfa3 = []byte{
   204  	// 340 bytes of a gzipped FileDescriptorProto
   205  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x4a, 0xc3, 0x40,
   206  	0x10, 0x87, 0x13, 0x6b, 0x15, 0x56, 0xd3, 0xe2, 0x8a, 0x50, 0x7a, 0x58, 0xb5, 0xfe, 0x41, 0x10,
   207  	0x36, 0xa0, 0xe0, 0xc9, 0x53, 0x0f, 0x52, 0x94, 0x4a, 0xa9, 0x9e, 0xbc, 0x94, 0x24, 0x2e, 0x6d,
   208  	0xd0, 0xee, 0xd6, 0xcc, 0xe6, 0xe0, 0x5b, 0xf8, 0x08, 0x3e, 0x8e, 0xc7, 0x1e, 0x3d, 0x4a, 0xf2,
   209  	0x22, 0xe2, 0x6e, 0xba, 0x49, 0x4a, 0x83, 0xc7, 0xcc, 0x7c, 0xf3, 0xe5, 0x37, 0xcb, 0xa0, 0x7d,
   210  	0x01, 0x32, 0xf2, 0x02, 0xc1, 0x5d, 0xff, 0x55, 0x04, 0x2f, 0xc1, 0xc4, 0x0b, 0xb9, 0x2b, 0xdf,
   211  	0x67, 0x0c, 0xe8, 0x2c, 0x12, 0x52, 0xe0, 0xdd, 0x05, 0x40, 0x73, 0xa0, 0xdd, 0x36, 0x53, 0x0a,
   212  	0xd5, 0xb3, 0x7a, 0xa0, 0x7d, 0x28, 0x19, 0x7f, 0x66, 0xd1, 0x34, 0xe4, 0xb2, 0xc2, 0xd9, 0xb9,
   213  	0x46, 0x4e, 0xf7, 0xaf, 0x33, 0x64, 0x30, 0x13, 0x1c, 0x18, 0x3e, 0x47, 0x75, 0x85, 0xb6, 0xec,
   214  	0x03, 0xfb, 0x6c, 0xeb, 0x62, 0x8f, 0x9a, 0x9f, 0xea, 0x31, 0x4d, 0x6b, 0xa6, 0xf3, 0x59, 0x43,
   215  	0x9b, 0x7d, 0x06, 0xe0, 0x8d, 0x19, 0xbe, 0x45, 0x8e, 0x2a, 0x8e, 0x22, 0xf6, 0x16, 0x33, 0x90,
   216  	0x99, 0xe0, 0x88, 0xe6, 0x21, 0x0a, 0xb9, 0x33, 0x8f, 0x46, 0x7b, 0xd6, 0x70, 0xdb, 0x2f, 0x7c,
   217  	0xe3, 0x47, 0xb4, 0xc3, 0xc5, 0x68, 0xa1, 0xd3, 0xc9, 0x5a, 0x6b, 0xca, 0x77, 0x5a, 0xe1, 0xbb,
   218  	0x17, 0xa5, 0x3d, 0x7a, 0xd6, 0xb0, 0xc9, 0xcb, 0x25, 0x7c, 0x87, 0x1a, 0x4b, 0xca, 0x9a, 0x52,
   219  	0x76, 0xe8, 0x8a, 0x87, 0xa5, 0xcb, 0x3a, 0xc7, 0x2f, 0xc9, 0xfa, 0xa8, 0x01, 0xd2, 0x93, 0x31,
   220  	0x98, 0x7d, 0xd7, 0x95, 0xec, 0xb8, 0x22, 0xdf, 0x83, 0x82, 0xf3, 0x85, 0x1d, 0x28, 0x16, 0xf0,
   221  	0x00, 0x35, 0x8d, 0x2e, 0x0b, 0x57, 0x57, 0xbe, 0x93, 0x7f, 0x7c, 0x26, 0x5f, 0x03, 0x4a, 0x95,
   222  	0x6e, 0x1d, 0xd5, 0x20, 0x9e, 0x76, 0x07, 0x5f, 0x09, 0xb1, 0xe7, 0x09, 0xb1, 0x7f, 0x12, 0x62,
   223  	0x7f, 0xa4, 0xc4, 0x9a, 0xa7, 0xc4, 0xfa, 0x4e, 0x89, 0xf5, 0x74, 0x35, 0x0e, 0xe5, 0x24, 0xf6,
   224  	0x69, 0x20, 0xa6, 0xee, 0x4d, 0xc8, 0x21, 0x98, 0x84, 0x9e, 0x6b, 0xae, 0x49, 0x9d, 0x87, 0xbb,
   225  	0xe2, 0x24, 0xfd, 0x0d, 0xd5, 0xba, 0xfc, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x49, 0x62, 0x54,
   226  	0xb0, 0x02, 0x00, 0x00,
   227  }
   228  
   229  func (m *BlockResponse) Marshal() (dAtA []byte, err error) {
   230  	size := m.Size()
   231  	dAtA = make([]byte, size)
   232  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   233  	if err != nil {
   234  		return nil, err
   235  	}
   236  	return dAtA[:n], nil
   237  }
   238  
   239  func (m *BlockResponse) MarshalTo(dAtA []byte) (int, error) {
   240  	size := m.Size()
   241  	return m.MarshalToSizedBuffer(dAtA[:size])
   242  }
   243  
   244  func (m *BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   245  	i := len(dAtA)
   246  	_ = i
   247  	var l int
   248  	_ = l
   249  	if m.Block != nil {
   250  		{
   251  			size, err := m.Block.MarshalToSizedBuffer(dAtA[:i])
   252  			if err != nil {
   253  				return 0, err
   254  			}
   255  			i -= size
   256  			i = encodeVarintTypes(dAtA, i, uint64(size))
   257  		}
   258  		i--
   259  		dAtA[i] = 0xa
   260  	}
   261  	return len(dAtA) - i, nil
   262  }
   263  
   264  func (m *Message) Marshal() (dAtA []byte, err error) {
   265  	size := m.Size()
   266  	dAtA = make([]byte, size)
   267  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   268  	if err != nil {
   269  		return nil, err
   270  	}
   271  	return dAtA[:n], nil
   272  }
   273  
   274  func (m *Message) MarshalTo(dAtA []byte) (int, error) {
   275  	size := m.Size()
   276  	return m.MarshalToSizedBuffer(dAtA[:size])
   277  }
   278  
   279  func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   280  	i := len(dAtA)
   281  	_ = i
   282  	var l int
   283  	_ = l
   284  	if m.Sum != nil {
   285  		{
   286  			size := m.Sum.Size()
   287  			i -= size
   288  			if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil {
   289  				return 0, err
   290  			}
   291  		}
   292  	}
   293  	return len(dAtA) - i, nil
   294  }
   295  
   296  func (m *Message_BlockRequest) MarshalTo(dAtA []byte) (int, error) {
   297  	size := m.Size()
   298  	return m.MarshalToSizedBuffer(dAtA[:size])
   299  }
   300  
   301  func (m *Message_BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   302  	i := len(dAtA)
   303  	if m.BlockRequest != nil {
   304  		{
   305  			size, err := m.BlockRequest.MarshalToSizedBuffer(dAtA[:i])
   306  			if err != nil {
   307  				return 0, err
   308  			}
   309  			i -= size
   310  			i = encodeVarintTypes(dAtA, i, uint64(size))
   311  		}
   312  		i--
   313  		dAtA[i] = 0xa
   314  	}
   315  	return len(dAtA) - i, nil
   316  }
   317  func (m *Message_NoBlockResponse) MarshalTo(dAtA []byte) (int, error) {
   318  	size := m.Size()
   319  	return m.MarshalToSizedBuffer(dAtA[:size])
   320  }
   321  
   322  func (m *Message_NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   323  	i := len(dAtA)
   324  	if m.NoBlockResponse != nil {
   325  		{
   326  			size, err := m.NoBlockResponse.MarshalToSizedBuffer(dAtA[:i])
   327  			if err != nil {
   328  				return 0, err
   329  			}
   330  			i -= size
   331  			i = encodeVarintTypes(dAtA, i, uint64(size))
   332  		}
   333  		i--
   334  		dAtA[i] = 0x12
   335  	}
   336  	return len(dAtA) - i, nil
   337  }
   338  func (m *Message_BlockResponse) MarshalTo(dAtA []byte) (int, error) {
   339  	size := m.Size()
   340  	return m.MarshalToSizedBuffer(dAtA[:size])
   341  }
   342  
   343  func (m *Message_BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   344  	i := len(dAtA)
   345  	if m.BlockResponse != nil {
   346  		{
   347  			size, err := m.BlockResponse.MarshalToSizedBuffer(dAtA[:i])
   348  			if err != nil {
   349  				return 0, err
   350  			}
   351  			i -= size
   352  			i = encodeVarintTypes(dAtA, i, uint64(size))
   353  		}
   354  		i--
   355  		dAtA[i] = 0x1a
   356  	}
   357  	return len(dAtA) - i, nil
   358  }
   359  func (m *Message_StatusRequest) MarshalTo(dAtA []byte) (int, error) {
   360  	size := m.Size()
   361  	return m.MarshalToSizedBuffer(dAtA[:size])
   362  }
   363  
   364  func (m *Message_StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   365  	i := len(dAtA)
   366  	if m.StatusRequest != nil {
   367  		{
   368  			size, err := m.StatusRequest.MarshalToSizedBuffer(dAtA[:i])
   369  			if err != nil {
   370  				return 0, err
   371  			}
   372  			i -= size
   373  			i = encodeVarintTypes(dAtA, i, uint64(size))
   374  		}
   375  		i--
   376  		dAtA[i] = 0x22
   377  	}
   378  	return len(dAtA) - i, nil
   379  }
   380  func (m *Message_StatusResponse) MarshalTo(dAtA []byte) (int, error) {
   381  	size := m.Size()
   382  	return m.MarshalToSizedBuffer(dAtA[:size])
   383  }
   384  
   385  func (m *Message_StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   386  	i := len(dAtA)
   387  	if m.StatusResponse != nil {
   388  		{
   389  			size, err := m.StatusResponse.MarshalToSizedBuffer(dAtA[:i])
   390  			if err != nil {
   391  				return 0, err
   392  			}
   393  			i -= size
   394  			i = encodeVarintTypes(dAtA, i, uint64(size))
   395  		}
   396  		i--
   397  		dAtA[i] = 0x2a
   398  	}
   399  	return len(dAtA) - i, nil
   400  }
   401  func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
   402  	offset -= sovTypes(v)
   403  	base := offset
   404  	for v >= 1<<7 {
   405  		dAtA[offset] = uint8(v&0x7f | 0x80)
   406  		v >>= 7
   407  		offset++
   408  	}
   409  	dAtA[offset] = uint8(v)
   410  	return base
   411  }
   412  func (m *BlockResponse) Size() (n int) {
   413  	if m == nil {
   414  		return 0
   415  	}
   416  	var l int
   417  	_ = l
   418  	if m.Block != nil {
   419  		l = m.Block.Size()
   420  		n += 1 + l + sovTypes(uint64(l))
   421  	}
   422  	return n
   423  }
   424  
   425  func (m *Message) Size() (n int) {
   426  	if m == nil {
   427  		return 0
   428  	}
   429  	var l int
   430  	_ = l
   431  	if m.Sum != nil {
   432  		n += m.Sum.Size()
   433  	}
   434  	return n
   435  }
   436  
   437  func (m *Message_BlockRequest) Size() (n int) {
   438  	if m == nil {
   439  		return 0
   440  	}
   441  	var l int
   442  	_ = l
   443  	if m.BlockRequest != nil {
   444  		l = m.BlockRequest.Size()
   445  		n += 1 + l + sovTypes(uint64(l))
   446  	}
   447  	return n
   448  }
   449  func (m *Message_NoBlockResponse) Size() (n int) {
   450  	if m == nil {
   451  		return 0
   452  	}
   453  	var l int
   454  	_ = l
   455  	if m.NoBlockResponse != nil {
   456  		l = m.NoBlockResponse.Size()
   457  		n += 1 + l + sovTypes(uint64(l))
   458  	}
   459  	return n
   460  }
   461  func (m *Message_BlockResponse) Size() (n int) {
   462  	if m == nil {
   463  		return 0
   464  	}
   465  	var l int
   466  	_ = l
   467  	if m.BlockResponse != nil {
   468  		l = m.BlockResponse.Size()
   469  		n += 1 + l + sovTypes(uint64(l))
   470  	}
   471  	return n
   472  }
   473  func (m *Message_StatusRequest) Size() (n int) {
   474  	if m == nil {
   475  		return 0
   476  	}
   477  	var l int
   478  	_ = l
   479  	if m.StatusRequest != nil {
   480  		l = m.StatusRequest.Size()
   481  		n += 1 + l + sovTypes(uint64(l))
   482  	}
   483  	return n
   484  }
   485  func (m *Message_StatusResponse) Size() (n int) {
   486  	if m == nil {
   487  		return 0
   488  	}
   489  	var l int
   490  	_ = l
   491  	if m.StatusResponse != nil {
   492  		l = m.StatusResponse.Size()
   493  		n += 1 + l + sovTypes(uint64(l))
   494  	}
   495  	return n
   496  }
   497  
   498  func sovTypes(x uint64) (n int) {
   499  	return (math_bits.Len64(x|1) + 6) / 7
   500  }
   501  func sozTypes(x uint64) (n int) {
   502  	return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   503  }
   504  func (m *BlockResponse) Unmarshal(dAtA []byte) error {
   505  	l := len(dAtA)
   506  	iNdEx := 0
   507  	for iNdEx < l {
   508  		preIndex := iNdEx
   509  		var wire uint64
   510  		for shift := uint(0); ; shift += 7 {
   511  			if shift >= 64 {
   512  				return ErrIntOverflowTypes
   513  			}
   514  			if iNdEx >= l {
   515  				return io.ErrUnexpectedEOF
   516  			}
   517  			b := dAtA[iNdEx]
   518  			iNdEx++
   519  			wire |= uint64(b&0x7F) << shift
   520  			if b < 0x80 {
   521  				break
   522  			}
   523  		}
   524  		fieldNum := int32(wire >> 3)
   525  		wireType := int(wire & 0x7)
   526  		if wireType == 4 {
   527  			return fmt.Errorf("proto: BlockResponse: wiretype end group for non-group")
   528  		}
   529  		if fieldNum <= 0 {
   530  			return fmt.Errorf("proto: BlockResponse: illegal tag %d (wire type %d)", fieldNum, wire)
   531  		}
   532  		switch fieldNum {
   533  		case 1:
   534  			if wireType != 2 {
   535  				return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
   536  			}
   537  			var msglen int
   538  			for shift := uint(0); ; shift += 7 {
   539  				if shift >= 64 {
   540  					return ErrIntOverflowTypes
   541  				}
   542  				if iNdEx >= l {
   543  					return io.ErrUnexpectedEOF
   544  				}
   545  				b := dAtA[iNdEx]
   546  				iNdEx++
   547  				msglen |= int(b&0x7F) << shift
   548  				if b < 0x80 {
   549  					break
   550  				}
   551  			}
   552  			if msglen < 0 {
   553  				return ErrInvalidLengthTypes
   554  			}
   555  			postIndex := iNdEx + msglen
   556  			if postIndex < 0 {
   557  				return ErrInvalidLengthTypes
   558  			}
   559  			if postIndex > l {
   560  				return io.ErrUnexpectedEOF
   561  			}
   562  			if m.Block == nil {
   563  				m.Block = &types.Block{}
   564  			}
   565  			if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   566  				return err
   567  			}
   568  			iNdEx = postIndex
   569  		default:
   570  			iNdEx = preIndex
   571  			skippy, err := skipTypes(dAtA[iNdEx:])
   572  			if err != nil {
   573  				return err
   574  			}
   575  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   576  				return ErrInvalidLengthTypes
   577  			}
   578  			if (iNdEx + skippy) > l {
   579  				return io.ErrUnexpectedEOF
   580  			}
   581  			iNdEx += skippy
   582  		}
   583  	}
   584  
   585  	if iNdEx > l {
   586  		return io.ErrUnexpectedEOF
   587  	}
   588  	return nil
   589  }
   590  func (m *Message) Unmarshal(dAtA []byte) error {
   591  	l := len(dAtA)
   592  	iNdEx := 0
   593  	for iNdEx < l {
   594  		preIndex := iNdEx
   595  		var wire uint64
   596  		for shift := uint(0); ; shift += 7 {
   597  			if shift >= 64 {
   598  				return ErrIntOverflowTypes
   599  			}
   600  			if iNdEx >= l {
   601  				return io.ErrUnexpectedEOF
   602  			}
   603  			b := dAtA[iNdEx]
   604  			iNdEx++
   605  			wire |= uint64(b&0x7F) << shift
   606  			if b < 0x80 {
   607  				break
   608  			}
   609  		}
   610  		fieldNum := int32(wire >> 3)
   611  		wireType := int(wire & 0x7)
   612  		if wireType == 4 {
   613  			return fmt.Errorf("proto: Message: wiretype end group for non-group")
   614  		}
   615  		if fieldNum <= 0 {
   616  			return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
   617  		}
   618  		switch fieldNum {
   619  		case 1:
   620  			if wireType != 2 {
   621  				return fmt.Errorf("proto: wrong wireType = %d for field BlockRequest", wireType)
   622  			}
   623  			var msglen int
   624  			for shift := uint(0); ; shift += 7 {
   625  				if shift >= 64 {
   626  					return ErrIntOverflowTypes
   627  				}
   628  				if iNdEx >= l {
   629  					return io.ErrUnexpectedEOF
   630  				}
   631  				b := dAtA[iNdEx]
   632  				iNdEx++
   633  				msglen |= int(b&0x7F) << shift
   634  				if b < 0x80 {
   635  					break
   636  				}
   637  			}
   638  			if msglen < 0 {
   639  				return ErrInvalidLengthTypes
   640  			}
   641  			postIndex := iNdEx + msglen
   642  			if postIndex < 0 {
   643  				return ErrInvalidLengthTypes
   644  			}
   645  			if postIndex > l {
   646  				return io.ErrUnexpectedEOF
   647  			}
   648  			v := &blockchain.BlockRequest{}
   649  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   650  				return err
   651  			}
   652  			m.Sum = &Message_BlockRequest{v}
   653  			iNdEx = postIndex
   654  		case 2:
   655  			if wireType != 2 {
   656  				return fmt.Errorf("proto: wrong wireType = %d for field NoBlockResponse", wireType)
   657  			}
   658  			var msglen int
   659  			for shift := uint(0); ; shift += 7 {
   660  				if shift >= 64 {
   661  					return ErrIntOverflowTypes
   662  				}
   663  				if iNdEx >= l {
   664  					return io.ErrUnexpectedEOF
   665  				}
   666  				b := dAtA[iNdEx]
   667  				iNdEx++
   668  				msglen |= int(b&0x7F) << shift
   669  				if b < 0x80 {
   670  					break
   671  				}
   672  			}
   673  			if msglen < 0 {
   674  				return ErrInvalidLengthTypes
   675  			}
   676  			postIndex := iNdEx + msglen
   677  			if postIndex < 0 {
   678  				return ErrInvalidLengthTypes
   679  			}
   680  			if postIndex > l {
   681  				return io.ErrUnexpectedEOF
   682  			}
   683  			v := &blockchain.NoBlockResponse{}
   684  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   685  				return err
   686  			}
   687  			m.Sum = &Message_NoBlockResponse{v}
   688  			iNdEx = postIndex
   689  		case 3:
   690  			if wireType != 2 {
   691  				return fmt.Errorf("proto: wrong wireType = %d for field BlockResponse", wireType)
   692  			}
   693  			var msglen int
   694  			for shift := uint(0); ; shift += 7 {
   695  				if shift >= 64 {
   696  					return ErrIntOverflowTypes
   697  				}
   698  				if iNdEx >= l {
   699  					return io.ErrUnexpectedEOF
   700  				}
   701  				b := dAtA[iNdEx]
   702  				iNdEx++
   703  				msglen |= int(b&0x7F) << shift
   704  				if b < 0x80 {
   705  					break
   706  				}
   707  			}
   708  			if msglen < 0 {
   709  				return ErrInvalidLengthTypes
   710  			}
   711  			postIndex := iNdEx + msglen
   712  			if postIndex < 0 {
   713  				return ErrInvalidLengthTypes
   714  			}
   715  			if postIndex > l {
   716  				return io.ErrUnexpectedEOF
   717  			}
   718  			v := &BlockResponse{}
   719  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   720  				return err
   721  			}
   722  			m.Sum = &Message_BlockResponse{v}
   723  			iNdEx = postIndex
   724  		case 4:
   725  			if wireType != 2 {
   726  				return fmt.Errorf("proto: wrong wireType = %d for field StatusRequest", wireType)
   727  			}
   728  			var msglen int
   729  			for shift := uint(0); ; shift += 7 {
   730  				if shift >= 64 {
   731  					return ErrIntOverflowTypes
   732  				}
   733  				if iNdEx >= l {
   734  					return io.ErrUnexpectedEOF
   735  				}
   736  				b := dAtA[iNdEx]
   737  				iNdEx++
   738  				msglen |= int(b&0x7F) << shift
   739  				if b < 0x80 {
   740  					break
   741  				}
   742  			}
   743  			if msglen < 0 {
   744  				return ErrInvalidLengthTypes
   745  			}
   746  			postIndex := iNdEx + msglen
   747  			if postIndex < 0 {
   748  				return ErrInvalidLengthTypes
   749  			}
   750  			if postIndex > l {
   751  				return io.ErrUnexpectedEOF
   752  			}
   753  			v := &blockchain.StatusRequest{}
   754  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   755  				return err
   756  			}
   757  			m.Sum = &Message_StatusRequest{v}
   758  			iNdEx = postIndex
   759  		case 5:
   760  			if wireType != 2 {
   761  				return fmt.Errorf("proto: wrong wireType = %d for field StatusResponse", wireType)
   762  			}
   763  			var msglen int
   764  			for shift := uint(0); ; shift += 7 {
   765  				if shift >= 64 {
   766  					return ErrIntOverflowTypes
   767  				}
   768  				if iNdEx >= l {
   769  					return io.ErrUnexpectedEOF
   770  				}
   771  				b := dAtA[iNdEx]
   772  				iNdEx++
   773  				msglen |= int(b&0x7F) << shift
   774  				if b < 0x80 {
   775  					break
   776  				}
   777  			}
   778  			if msglen < 0 {
   779  				return ErrInvalidLengthTypes
   780  			}
   781  			postIndex := iNdEx + msglen
   782  			if postIndex < 0 {
   783  				return ErrInvalidLengthTypes
   784  			}
   785  			if postIndex > l {
   786  				return io.ErrUnexpectedEOF
   787  			}
   788  			v := &blockchain.StatusResponse{}
   789  			if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   790  				return err
   791  			}
   792  			m.Sum = &Message_StatusResponse{v}
   793  			iNdEx = postIndex
   794  		default:
   795  			iNdEx = preIndex
   796  			skippy, err := skipTypes(dAtA[iNdEx:])
   797  			if err != nil {
   798  				return err
   799  			}
   800  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   801  				return ErrInvalidLengthTypes
   802  			}
   803  			if (iNdEx + skippy) > l {
   804  				return io.ErrUnexpectedEOF
   805  			}
   806  			iNdEx += skippy
   807  		}
   808  	}
   809  
   810  	if iNdEx > l {
   811  		return io.ErrUnexpectedEOF
   812  	}
   813  	return nil
   814  }
   815  func skipTypes(dAtA []byte) (n int, err error) {
   816  	l := len(dAtA)
   817  	iNdEx := 0
   818  	depth := 0
   819  	for iNdEx < l {
   820  		var wire uint64
   821  		for shift := uint(0); ; shift += 7 {
   822  			if shift >= 64 {
   823  				return 0, ErrIntOverflowTypes
   824  			}
   825  			if iNdEx >= l {
   826  				return 0, io.ErrUnexpectedEOF
   827  			}
   828  			b := dAtA[iNdEx]
   829  			iNdEx++
   830  			wire |= (uint64(b) & 0x7F) << shift
   831  			if b < 0x80 {
   832  				break
   833  			}
   834  		}
   835  		wireType := int(wire & 0x7)
   836  		switch wireType {
   837  		case 0:
   838  			for shift := uint(0); ; shift += 7 {
   839  				if shift >= 64 {
   840  					return 0, ErrIntOverflowTypes
   841  				}
   842  				if iNdEx >= l {
   843  					return 0, io.ErrUnexpectedEOF
   844  				}
   845  				iNdEx++
   846  				if dAtA[iNdEx-1] < 0x80 {
   847  					break
   848  				}
   849  			}
   850  		case 1:
   851  			iNdEx += 8
   852  		case 2:
   853  			var length int
   854  			for shift := uint(0); ; shift += 7 {
   855  				if shift >= 64 {
   856  					return 0, ErrIntOverflowTypes
   857  				}
   858  				if iNdEx >= l {
   859  					return 0, io.ErrUnexpectedEOF
   860  				}
   861  				b := dAtA[iNdEx]
   862  				iNdEx++
   863  				length |= (int(b) & 0x7F) << shift
   864  				if b < 0x80 {
   865  					break
   866  				}
   867  			}
   868  			if length < 0 {
   869  				return 0, ErrInvalidLengthTypes
   870  			}
   871  			iNdEx += length
   872  		case 3:
   873  			depth++
   874  		case 4:
   875  			if depth == 0 {
   876  				return 0, ErrUnexpectedEndOfGroupTypes
   877  			}
   878  			depth--
   879  		case 5:
   880  			iNdEx += 4
   881  		default:
   882  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   883  		}
   884  		if iNdEx < 0 {
   885  			return 0, ErrInvalidLengthTypes
   886  		}
   887  		if depth == 0 {
   888  			return iNdEx, nil
   889  		}
   890  	}
   891  	return 0, io.ErrUnexpectedEOF
   892  }
   893  
   894  var (
   895  	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
   896  	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
   897  	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
   898  )