github.com/devwanda/aphelion-staking@v0.33.9/crypto/merkle/merkle.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: crypto/merkle/merkle.proto
     3  
     4  package merkle
     5  
     6  import (
     7  	bytes "bytes"
     8  	fmt "fmt"
     9  	_ "github.com/gogo/protobuf/gogoproto"
    10  	proto "github.com/gogo/protobuf/proto"
    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  // ProofOp defines an operation used for calculating Merkle root
    28  // The data could be arbitrary format, providing nessecary data
    29  // for example neighbouring node hash
    30  type ProofOp struct {
    31  	Type                 string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
    32  	Key                  []byte   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
    33  	Data                 []byte   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
    34  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    35  	XXX_unrecognized     []byte   `json:"-"`
    36  	XXX_sizecache        int32    `json:"-"`
    37  }
    38  
    39  func (m *ProofOp) Reset()         { *m = ProofOp{} }
    40  func (m *ProofOp) String() string { return proto.CompactTextString(m) }
    41  func (*ProofOp) ProtoMessage()    {}
    42  func (*ProofOp) Descriptor() ([]byte, []int) {
    43  	return fileDescriptor_9c1c2162d560d38e, []int{0}
    44  }
    45  func (m *ProofOp) XXX_Unmarshal(b []byte) error {
    46  	return m.Unmarshal(b)
    47  }
    48  func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    49  	if deterministic {
    50  		return xxx_messageInfo_ProofOp.Marshal(b, m, deterministic)
    51  	} else {
    52  		b = b[:cap(b)]
    53  		n, err := m.MarshalToSizedBuffer(b)
    54  		if err != nil {
    55  			return nil, err
    56  		}
    57  		return b[:n], nil
    58  	}
    59  }
    60  func (m *ProofOp) XXX_Merge(src proto.Message) {
    61  	xxx_messageInfo_ProofOp.Merge(m, src)
    62  }
    63  func (m *ProofOp) XXX_Size() int {
    64  	return m.Size()
    65  }
    66  func (m *ProofOp) XXX_DiscardUnknown() {
    67  	xxx_messageInfo_ProofOp.DiscardUnknown(m)
    68  }
    69  
    70  var xxx_messageInfo_ProofOp proto.InternalMessageInfo
    71  
    72  func (m *ProofOp) GetType() string {
    73  	if m != nil {
    74  		return m.Type
    75  	}
    76  	return ""
    77  }
    78  
    79  func (m *ProofOp) GetKey() []byte {
    80  	if m != nil {
    81  		return m.Key
    82  	}
    83  	return nil
    84  }
    85  
    86  func (m *ProofOp) GetData() []byte {
    87  	if m != nil {
    88  		return m.Data
    89  	}
    90  	return nil
    91  }
    92  
    93  // Proof is Merkle proof defined by the list of ProofOps
    94  type Proof struct {
    95  	Ops                  []ProofOp `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"`
    96  	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
    97  	XXX_unrecognized     []byte    `json:"-"`
    98  	XXX_sizecache        int32     `json:"-"`
    99  }
   100  
   101  func (m *Proof) Reset()         { *m = Proof{} }
   102  func (m *Proof) String() string { return proto.CompactTextString(m) }
   103  func (*Proof) ProtoMessage()    {}
   104  func (*Proof) Descriptor() ([]byte, []int) {
   105  	return fileDescriptor_9c1c2162d560d38e, []int{1}
   106  }
   107  func (m *Proof) XXX_Unmarshal(b []byte) error {
   108  	return m.Unmarshal(b)
   109  }
   110  func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   111  	if deterministic {
   112  		return xxx_messageInfo_Proof.Marshal(b, m, deterministic)
   113  	} else {
   114  		b = b[:cap(b)]
   115  		n, err := m.MarshalToSizedBuffer(b)
   116  		if err != nil {
   117  			return nil, err
   118  		}
   119  		return b[:n], nil
   120  	}
   121  }
   122  func (m *Proof) XXX_Merge(src proto.Message) {
   123  	xxx_messageInfo_Proof.Merge(m, src)
   124  }
   125  func (m *Proof) XXX_Size() int {
   126  	return m.Size()
   127  }
   128  func (m *Proof) XXX_DiscardUnknown() {
   129  	xxx_messageInfo_Proof.DiscardUnknown(m)
   130  }
   131  
   132  var xxx_messageInfo_Proof proto.InternalMessageInfo
   133  
   134  func (m *Proof) GetOps() []ProofOp {
   135  	if m != nil {
   136  		return m.Ops
   137  	}
   138  	return nil
   139  }
   140  
   141  func init() {
   142  	proto.RegisterType((*ProofOp)(nil), "tendermint.crypto.merkle.ProofOp")
   143  	proto.RegisterType((*Proof)(nil), "tendermint.crypto.merkle.Proof")
   144  }
   145  
   146  func init() { proto.RegisterFile("crypto/merkle/merkle.proto", fileDescriptor_9c1c2162d560d38e) }
   147  
   148  var fileDescriptor_9c1c2162d560d38e = []byte{
   149  	// 230 bytes of a gzipped FileDescriptorProto
   150  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x2e, 0xaa, 0x2c,
   151  	0x28, 0xc9, 0xd7, 0xcf, 0x4d, 0x2d, 0xca, 0xce, 0x49, 0x85, 0x52, 0x7a, 0x05, 0x45, 0xf9, 0x25,
   152  	0xf9, 0x42, 0x12, 0x25, 0xa9, 0x79, 0x29, 0xa9, 0x45, 0xb9, 0x99, 0x79, 0x25, 0x7a, 0x10, 0x65,
   153  	0x7a, 0x10, 0x79, 0x29, 0xb5, 0x92, 0x8c, 0xcc, 0xa2, 0x94, 0xf8, 0x82, 0xc4, 0xa2, 0x92, 0x4a,
   154  	0x7d, 0xb0, 0x62, 0xfd, 0xf4, 0xfc, 0xf4, 0x7c, 0x04, 0x0b, 0x62, 0x82, 0x92, 0x33, 0x17, 0x7b,
   155  	0x40, 0x51, 0x7e, 0x7e, 0x9a, 0x7f, 0x81, 0x90, 0x10, 0x17, 0x4b, 0x49, 0x65, 0x41, 0xaa, 0x04,
   156  	0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x98, 0x2d, 0x24, 0xc0, 0xc5, 0x9c, 0x9d, 0x5a, 0x29, 0xc1,
   157  	0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x62, 0x82, 0x54, 0xa5, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x83,
   158  	0x85, 0xc0, 0x6c, 0x25, 0x27, 0x2e, 0x56, 0xb0, 0x21, 0x42, 0x96, 0x5c, 0xcc, 0xf9, 0x05, 0xc5,
   159  	0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x8a, 0x7a, 0xb8, 0x5c, 0xa7, 0x07, 0xb5, 0xd2, 0x89,
   160  	0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0x90, 0x1e, 0x27, 0x97, 0x1f, 0x0f, 0xe5, 0x18, 0x57, 0x3c,
   161  	0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0xa3,
   162  	0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x11, 0xa6, 0x21, 0x33,
   163  	0x51, 0x42, 0x27, 0x89, 0x0d, 0xec, 0x2b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0xcc,
   164  	0x2c, 0x91, 0x35, 0x01, 0x00, 0x00,
   165  }
   166  
   167  func (this *ProofOp) Equal(that interface{}) bool {
   168  	if that == nil {
   169  		return this == nil
   170  	}
   171  
   172  	that1, ok := that.(*ProofOp)
   173  	if !ok {
   174  		that2, ok := that.(ProofOp)
   175  		if ok {
   176  			that1 = &that2
   177  		} else {
   178  			return false
   179  		}
   180  	}
   181  	if that1 == nil {
   182  		return this == nil
   183  	} else if this == nil {
   184  		return false
   185  	}
   186  	if this.Type != that1.Type {
   187  		return false
   188  	}
   189  	if !bytes.Equal(this.Key, that1.Key) {
   190  		return false
   191  	}
   192  	if !bytes.Equal(this.Data, that1.Data) {
   193  		return false
   194  	}
   195  	if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
   196  		return false
   197  	}
   198  	return true
   199  }
   200  func (this *Proof) Equal(that interface{}) bool {
   201  	if that == nil {
   202  		return this == nil
   203  	}
   204  
   205  	that1, ok := that.(*Proof)
   206  	if !ok {
   207  		that2, ok := that.(Proof)
   208  		if ok {
   209  			that1 = &that2
   210  		} else {
   211  			return false
   212  		}
   213  	}
   214  	if that1 == nil {
   215  		return this == nil
   216  	} else if this == nil {
   217  		return false
   218  	}
   219  	if len(this.Ops) != len(that1.Ops) {
   220  		return false
   221  	}
   222  	for i := range this.Ops {
   223  		if !this.Ops[i].Equal(&that1.Ops[i]) {
   224  			return false
   225  		}
   226  	}
   227  	if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
   228  		return false
   229  	}
   230  	return true
   231  }
   232  func (m *ProofOp) Marshal() (dAtA []byte, err error) {
   233  	size := m.Size()
   234  	dAtA = make([]byte, size)
   235  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   236  	if err != nil {
   237  		return nil, err
   238  	}
   239  	return dAtA[:n], nil
   240  }
   241  
   242  func (m *ProofOp) MarshalTo(dAtA []byte) (int, error) {
   243  	size := m.Size()
   244  	return m.MarshalToSizedBuffer(dAtA[:size])
   245  }
   246  
   247  func (m *ProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   248  	i := len(dAtA)
   249  	_ = i
   250  	var l int
   251  	_ = l
   252  	if m.XXX_unrecognized != nil {
   253  		i -= len(m.XXX_unrecognized)
   254  		copy(dAtA[i:], m.XXX_unrecognized)
   255  	}
   256  	if len(m.Data) > 0 {
   257  		i -= len(m.Data)
   258  		copy(dAtA[i:], m.Data)
   259  		i = encodeVarintMerkle(dAtA, i, uint64(len(m.Data)))
   260  		i--
   261  		dAtA[i] = 0x1a
   262  	}
   263  	if len(m.Key) > 0 {
   264  		i -= len(m.Key)
   265  		copy(dAtA[i:], m.Key)
   266  		i = encodeVarintMerkle(dAtA, i, uint64(len(m.Key)))
   267  		i--
   268  		dAtA[i] = 0x12
   269  	}
   270  	if len(m.Type) > 0 {
   271  		i -= len(m.Type)
   272  		copy(dAtA[i:], m.Type)
   273  		i = encodeVarintMerkle(dAtA, i, uint64(len(m.Type)))
   274  		i--
   275  		dAtA[i] = 0xa
   276  	}
   277  	return len(dAtA) - i, nil
   278  }
   279  
   280  func (m *Proof) Marshal() (dAtA []byte, err error) {
   281  	size := m.Size()
   282  	dAtA = make([]byte, size)
   283  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   284  	if err != nil {
   285  		return nil, err
   286  	}
   287  	return dAtA[:n], nil
   288  }
   289  
   290  func (m *Proof) MarshalTo(dAtA []byte) (int, error) {
   291  	size := m.Size()
   292  	return m.MarshalToSizedBuffer(dAtA[:size])
   293  }
   294  
   295  func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   296  	i := len(dAtA)
   297  	_ = i
   298  	var l int
   299  	_ = l
   300  	if m.XXX_unrecognized != nil {
   301  		i -= len(m.XXX_unrecognized)
   302  		copy(dAtA[i:], m.XXX_unrecognized)
   303  	}
   304  	if len(m.Ops) > 0 {
   305  		for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- {
   306  			{
   307  				size, err := m.Ops[iNdEx].MarshalToSizedBuffer(dAtA[:i])
   308  				if err != nil {
   309  					return 0, err
   310  				}
   311  				i -= size
   312  				i = encodeVarintMerkle(dAtA, i, uint64(size))
   313  			}
   314  			i--
   315  			dAtA[i] = 0xa
   316  		}
   317  	}
   318  	return len(dAtA) - i, nil
   319  }
   320  
   321  func encodeVarintMerkle(dAtA []byte, offset int, v uint64) int {
   322  	offset -= sovMerkle(v)
   323  	base := offset
   324  	for v >= 1<<7 {
   325  		dAtA[offset] = uint8(v&0x7f | 0x80)
   326  		v >>= 7
   327  		offset++
   328  	}
   329  	dAtA[offset] = uint8(v)
   330  	return base
   331  }
   332  func NewPopulatedProofOp(r randyMerkle, easy bool) *ProofOp {
   333  	this := &ProofOp{}
   334  	this.Type = string(randStringMerkle(r))
   335  	v1 := r.Intn(100)
   336  	this.Key = make([]byte, v1)
   337  	for i := 0; i < v1; i++ {
   338  		this.Key[i] = byte(r.Intn(256))
   339  	}
   340  	v2 := r.Intn(100)
   341  	this.Data = make([]byte, v2)
   342  	for i := 0; i < v2; i++ {
   343  		this.Data[i] = byte(r.Intn(256))
   344  	}
   345  	if !easy && r.Intn(10) != 0 {
   346  		this.XXX_unrecognized = randUnrecognizedMerkle(r, 4)
   347  	}
   348  	return this
   349  }
   350  
   351  func NewPopulatedProof(r randyMerkle, easy bool) *Proof {
   352  	this := &Proof{}
   353  	if r.Intn(5) != 0 {
   354  		v3 := r.Intn(5)
   355  		this.Ops = make([]ProofOp, v3)
   356  		for i := 0; i < v3; i++ {
   357  			v4 := NewPopulatedProofOp(r, easy)
   358  			this.Ops[i] = *v4
   359  		}
   360  	}
   361  	if !easy && r.Intn(10) != 0 {
   362  		this.XXX_unrecognized = randUnrecognizedMerkle(r, 2)
   363  	}
   364  	return this
   365  }
   366  
   367  type randyMerkle interface {
   368  	Float32() float32
   369  	Float64() float64
   370  	Int63() int64
   371  	Int31() int32
   372  	Uint32() uint32
   373  	Intn(n int) int
   374  }
   375  
   376  func randUTF8RuneMerkle(r randyMerkle) rune {
   377  	ru := r.Intn(62)
   378  	if ru < 10 {
   379  		return rune(ru + 48)
   380  	} else if ru < 36 {
   381  		return rune(ru + 55)
   382  	}
   383  	return rune(ru + 61)
   384  }
   385  func randStringMerkle(r randyMerkle) string {
   386  	v5 := r.Intn(100)
   387  	tmps := make([]rune, v5)
   388  	for i := 0; i < v5; i++ {
   389  		tmps[i] = randUTF8RuneMerkle(r)
   390  	}
   391  	return string(tmps)
   392  }
   393  func randUnrecognizedMerkle(r randyMerkle, maxFieldNumber int) (dAtA []byte) {
   394  	l := r.Intn(5)
   395  	for i := 0; i < l; i++ {
   396  		wire := r.Intn(4)
   397  		if wire == 3 {
   398  			wire = 5
   399  		}
   400  		fieldNumber := maxFieldNumber + r.Intn(100)
   401  		dAtA = randFieldMerkle(dAtA, r, fieldNumber, wire)
   402  	}
   403  	return dAtA
   404  }
   405  func randFieldMerkle(dAtA []byte, r randyMerkle, fieldNumber int, wire int) []byte {
   406  	key := uint32(fieldNumber)<<3 | uint32(wire)
   407  	switch wire {
   408  	case 0:
   409  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
   410  		v6 := r.Int63()
   411  		if r.Intn(2) == 0 {
   412  			v6 *= -1
   413  		}
   414  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(v6))
   415  	case 1:
   416  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
   417  		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
   418  	case 2:
   419  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
   420  		ll := r.Intn(100)
   421  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(ll))
   422  		for j := 0; j < ll; j++ {
   423  			dAtA = append(dAtA, byte(r.Intn(256)))
   424  		}
   425  	default:
   426  		dAtA = encodeVarintPopulateMerkle(dAtA, uint64(key))
   427  		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
   428  	}
   429  	return dAtA
   430  }
   431  func encodeVarintPopulateMerkle(dAtA []byte, v uint64) []byte {
   432  	for v >= 1<<7 {
   433  		dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
   434  		v >>= 7
   435  	}
   436  	dAtA = append(dAtA, uint8(v))
   437  	return dAtA
   438  }
   439  func (m *ProofOp) Size() (n int) {
   440  	if m == nil {
   441  		return 0
   442  	}
   443  	var l int
   444  	_ = l
   445  	l = len(m.Type)
   446  	if l > 0 {
   447  		n += 1 + l + sovMerkle(uint64(l))
   448  	}
   449  	l = len(m.Key)
   450  	if l > 0 {
   451  		n += 1 + l + sovMerkle(uint64(l))
   452  	}
   453  	l = len(m.Data)
   454  	if l > 0 {
   455  		n += 1 + l + sovMerkle(uint64(l))
   456  	}
   457  	if m.XXX_unrecognized != nil {
   458  		n += len(m.XXX_unrecognized)
   459  	}
   460  	return n
   461  }
   462  
   463  func (m *Proof) Size() (n int) {
   464  	if m == nil {
   465  		return 0
   466  	}
   467  	var l int
   468  	_ = l
   469  	if len(m.Ops) > 0 {
   470  		for _, e := range m.Ops {
   471  			l = e.Size()
   472  			n += 1 + l + sovMerkle(uint64(l))
   473  		}
   474  	}
   475  	if m.XXX_unrecognized != nil {
   476  		n += len(m.XXX_unrecognized)
   477  	}
   478  	return n
   479  }
   480  
   481  func sovMerkle(x uint64) (n int) {
   482  	return (math_bits.Len64(x|1) + 6) / 7
   483  }
   484  func sozMerkle(x uint64) (n int) {
   485  	return sovMerkle(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   486  }
   487  func (m *ProofOp) Unmarshal(dAtA []byte) error {
   488  	l := len(dAtA)
   489  	iNdEx := 0
   490  	for iNdEx < l {
   491  		preIndex := iNdEx
   492  		var wire uint64
   493  		for shift := uint(0); ; shift += 7 {
   494  			if shift >= 64 {
   495  				return ErrIntOverflowMerkle
   496  			}
   497  			if iNdEx >= l {
   498  				return io.ErrUnexpectedEOF
   499  			}
   500  			b := dAtA[iNdEx]
   501  			iNdEx++
   502  			wire |= uint64(b&0x7F) << shift
   503  			if b < 0x80 {
   504  				break
   505  			}
   506  		}
   507  		fieldNum := int32(wire >> 3)
   508  		wireType := int(wire & 0x7)
   509  		if wireType == 4 {
   510  			return fmt.Errorf("proto: ProofOp: wiretype end group for non-group")
   511  		}
   512  		if fieldNum <= 0 {
   513  			return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire)
   514  		}
   515  		switch fieldNum {
   516  		case 1:
   517  			if wireType != 2 {
   518  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
   519  			}
   520  			var stringLen uint64
   521  			for shift := uint(0); ; shift += 7 {
   522  				if shift >= 64 {
   523  					return ErrIntOverflowMerkle
   524  				}
   525  				if iNdEx >= l {
   526  					return io.ErrUnexpectedEOF
   527  				}
   528  				b := dAtA[iNdEx]
   529  				iNdEx++
   530  				stringLen |= uint64(b&0x7F) << shift
   531  				if b < 0x80 {
   532  					break
   533  				}
   534  			}
   535  			intStringLen := int(stringLen)
   536  			if intStringLen < 0 {
   537  				return ErrInvalidLengthMerkle
   538  			}
   539  			postIndex := iNdEx + intStringLen
   540  			if postIndex < 0 {
   541  				return ErrInvalidLengthMerkle
   542  			}
   543  			if postIndex > l {
   544  				return io.ErrUnexpectedEOF
   545  			}
   546  			m.Type = string(dAtA[iNdEx:postIndex])
   547  			iNdEx = postIndex
   548  		case 2:
   549  			if wireType != 2 {
   550  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   551  			}
   552  			var byteLen int
   553  			for shift := uint(0); ; shift += 7 {
   554  				if shift >= 64 {
   555  					return ErrIntOverflowMerkle
   556  				}
   557  				if iNdEx >= l {
   558  					return io.ErrUnexpectedEOF
   559  				}
   560  				b := dAtA[iNdEx]
   561  				iNdEx++
   562  				byteLen |= int(b&0x7F) << shift
   563  				if b < 0x80 {
   564  					break
   565  				}
   566  			}
   567  			if byteLen < 0 {
   568  				return ErrInvalidLengthMerkle
   569  			}
   570  			postIndex := iNdEx + byteLen
   571  			if postIndex < 0 {
   572  				return ErrInvalidLengthMerkle
   573  			}
   574  			if postIndex > l {
   575  				return io.ErrUnexpectedEOF
   576  			}
   577  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   578  			if m.Key == nil {
   579  				m.Key = []byte{}
   580  			}
   581  			iNdEx = postIndex
   582  		case 3:
   583  			if wireType != 2 {
   584  				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
   585  			}
   586  			var byteLen int
   587  			for shift := uint(0); ; shift += 7 {
   588  				if shift >= 64 {
   589  					return ErrIntOverflowMerkle
   590  				}
   591  				if iNdEx >= l {
   592  					return io.ErrUnexpectedEOF
   593  				}
   594  				b := dAtA[iNdEx]
   595  				iNdEx++
   596  				byteLen |= int(b&0x7F) << shift
   597  				if b < 0x80 {
   598  					break
   599  				}
   600  			}
   601  			if byteLen < 0 {
   602  				return ErrInvalidLengthMerkle
   603  			}
   604  			postIndex := iNdEx + byteLen
   605  			if postIndex < 0 {
   606  				return ErrInvalidLengthMerkle
   607  			}
   608  			if postIndex > l {
   609  				return io.ErrUnexpectedEOF
   610  			}
   611  			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
   612  			if m.Data == nil {
   613  				m.Data = []byte{}
   614  			}
   615  			iNdEx = postIndex
   616  		default:
   617  			iNdEx = preIndex
   618  			skippy, err := skipMerkle(dAtA[iNdEx:])
   619  			if err != nil {
   620  				return err
   621  			}
   622  			if skippy < 0 {
   623  				return ErrInvalidLengthMerkle
   624  			}
   625  			if (iNdEx + skippy) < 0 {
   626  				return ErrInvalidLengthMerkle
   627  			}
   628  			if (iNdEx + skippy) > l {
   629  				return io.ErrUnexpectedEOF
   630  			}
   631  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   632  			iNdEx += skippy
   633  		}
   634  	}
   635  
   636  	if iNdEx > l {
   637  		return io.ErrUnexpectedEOF
   638  	}
   639  	return nil
   640  }
   641  func (m *Proof) Unmarshal(dAtA []byte) error {
   642  	l := len(dAtA)
   643  	iNdEx := 0
   644  	for iNdEx < l {
   645  		preIndex := iNdEx
   646  		var wire uint64
   647  		for shift := uint(0); ; shift += 7 {
   648  			if shift >= 64 {
   649  				return ErrIntOverflowMerkle
   650  			}
   651  			if iNdEx >= l {
   652  				return io.ErrUnexpectedEOF
   653  			}
   654  			b := dAtA[iNdEx]
   655  			iNdEx++
   656  			wire |= uint64(b&0x7F) << shift
   657  			if b < 0x80 {
   658  				break
   659  			}
   660  		}
   661  		fieldNum := int32(wire >> 3)
   662  		wireType := int(wire & 0x7)
   663  		if wireType == 4 {
   664  			return fmt.Errorf("proto: Proof: wiretype end group for non-group")
   665  		}
   666  		if fieldNum <= 0 {
   667  			return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire)
   668  		}
   669  		switch fieldNum {
   670  		case 1:
   671  			if wireType != 2 {
   672  				return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType)
   673  			}
   674  			var msglen int
   675  			for shift := uint(0); ; shift += 7 {
   676  				if shift >= 64 {
   677  					return ErrIntOverflowMerkle
   678  				}
   679  				if iNdEx >= l {
   680  					return io.ErrUnexpectedEOF
   681  				}
   682  				b := dAtA[iNdEx]
   683  				iNdEx++
   684  				msglen |= int(b&0x7F) << shift
   685  				if b < 0x80 {
   686  					break
   687  				}
   688  			}
   689  			if msglen < 0 {
   690  				return ErrInvalidLengthMerkle
   691  			}
   692  			postIndex := iNdEx + msglen
   693  			if postIndex < 0 {
   694  				return ErrInvalidLengthMerkle
   695  			}
   696  			if postIndex > l {
   697  				return io.ErrUnexpectedEOF
   698  			}
   699  			m.Ops = append(m.Ops, ProofOp{})
   700  			if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   701  				return err
   702  			}
   703  			iNdEx = postIndex
   704  		default:
   705  			iNdEx = preIndex
   706  			skippy, err := skipMerkle(dAtA[iNdEx:])
   707  			if err != nil {
   708  				return err
   709  			}
   710  			if skippy < 0 {
   711  				return ErrInvalidLengthMerkle
   712  			}
   713  			if (iNdEx + skippy) < 0 {
   714  				return ErrInvalidLengthMerkle
   715  			}
   716  			if (iNdEx + skippy) > l {
   717  				return io.ErrUnexpectedEOF
   718  			}
   719  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   720  			iNdEx += skippy
   721  		}
   722  	}
   723  
   724  	if iNdEx > l {
   725  		return io.ErrUnexpectedEOF
   726  	}
   727  	return nil
   728  }
   729  func skipMerkle(dAtA []byte) (n int, err error) {
   730  	l := len(dAtA)
   731  	iNdEx := 0
   732  	depth := 0
   733  	for iNdEx < l {
   734  		var wire uint64
   735  		for shift := uint(0); ; shift += 7 {
   736  			if shift >= 64 {
   737  				return 0, ErrIntOverflowMerkle
   738  			}
   739  			if iNdEx >= l {
   740  				return 0, io.ErrUnexpectedEOF
   741  			}
   742  			b := dAtA[iNdEx]
   743  			iNdEx++
   744  			wire |= (uint64(b) & 0x7F) << shift
   745  			if b < 0x80 {
   746  				break
   747  			}
   748  		}
   749  		wireType := int(wire & 0x7)
   750  		switch wireType {
   751  		case 0:
   752  			for shift := uint(0); ; shift += 7 {
   753  				if shift >= 64 {
   754  					return 0, ErrIntOverflowMerkle
   755  				}
   756  				if iNdEx >= l {
   757  					return 0, io.ErrUnexpectedEOF
   758  				}
   759  				iNdEx++
   760  				if dAtA[iNdEx-1] < 0x80 {
   761  					break
   762  				}
   763  			}
   764  		case 1:
   765  			iNdEx += 8
   766  		case 2:
   767  			var length int
   768  			for shift := uint(0); ; shift += 7 {
   769  				if shift >= 64 {
   770  					return 0, ErrIntOverflowMerkle
   771  				}
   772  				if iNdEx >= l {
   773  					return 0, io.ErrUnexpectedEOF
   774  				}
   775  				b := dAtA[iNdEx]
   776  				iNdEx++
   777  				length |= (int(b) & 0x7F) << shift
   778  				if b < 0x80 {
   779  					break
   780  				}
   781  			}
   782  			if length < 0 {
   783  				return 0, ErrInvalidLengthMerkle
   784  			}
   785  			iNdEx += length
   786  		case 3:
   787  			depth++
   788  		case 4:
   789  			if depth == 0 {
   790  				return 0, ErrUnexpectedEndOfGroupMerkle
   791  			}
   792  			depth--
   793  		case 5:
   794  			iNdEx += 4
   795  		default:
   796  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   797  		}
   798  		if iNdEx < 0 {
   799  			return 0, ErrInvalidLengthMerkle
   800  		}
   801  		if depth == 0 {
   802  			return iNdEx, nil
   803  		}
   804  	}
   805  	return 0, io.ErrUnexpectedEOF
   806  }
   807  
   808  var (
   809  	ErrInvalidLengthMerkle        = fmt.Errorf("proto: negative length found during unmarshaling")
   810  	ErrIntOverflowMerkle          = fmt.Errorf("proto: integer overflow")
   811  	ErrUnexpectedEndOfGroupMerkle = fmt.Errorf("proto: unexpected end of group")
   812  )