github.com/cosmos/cosmos-sdk@v0.50.1/crypto/hd/hd.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: cosmos/crypto/hd/v1/hd.proto
     3  
     4  package hd
     5  
     6  import (
     7  	fmt "fmt"
     8  	_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
     9  	_ "github.com/cosmos/gogoproto/gogoproto"
    10  	proto "github.com/cosmos/gogoproto/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  // BIP44Params is used as path field in ledger item in Record.
    28  type BIP44Params struct {
    29  	// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation
    30  	Purpose uint32 `protobuf:"varint,1,opt,name=purpose,proto3" json:"purpose,omitempty"`
    31  	// coin_type is a constant that improves privacy
    32  	CoinType uint32 `protobuf:"varint,2,opt,name=coin_type,json=coinType,proto3" json:"coin_type,omitempty"`
    33  	// account splits the key space into independent user identities
    34  	Account uint32 `protobuf:"varint,3,opt,name=account,proto3" json:"account,omitempty"`
    35  	// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal
    36  	// chain.
    37  	Change bool `protobuf:"varint,4,opt,name=change,proto3" json:"change,omitempty"`
    38  	// address_index is used as child index in BIP32 derivation
    39  	AddressIndex uint32 `protobuf:"varint,5,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"`
    40  }
    41  
    42  func (m *BIP44Params) Reset()      { *m = BIP44Params{} }
    43  func (*BIP44Params) ProtoMessage() {}
    44  func (*BIP44Params) Descriptor() ([]byte, []int) {
    45  	return fileDescriptor_cf10f1fb5e778a8d, []int{0}
    46  }
    47  func (m *BIP44Params) XXX_Unmarshal(b []byte) error {
    48  	return m.Unmarshal(b)
    49  }
    50  func (m *BIP44Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    51  	if deterministic {
    52  		return xxx_messageInfo_BIP44Params.Marshal(b, m, deterministic)
    53  	} else {
    54  		b = b[:cap(b)]
    55  		n, err := m.MarshalToSizedBuffer(b)
    56  		if err != nil {
    57  			return nil, err
    58  		}
    59  		return b[:n], nil
    60  	}
    61  }
    62  func (m *BIP44Params) XXX_Merge(src proto.Message) {
    63  	xxx_messageInfo_BIP44Params.Merge(m, src)
    64  }
    65  func (m *BIP44Params) XXX_Size() int {
    66  	return m.Size()
    67  }
    68  func (m *BIP44Params) XXX_DiscardUnknown() {
    69  	xxx_messageInfo_BIP44Params.DiscardUnknown(m)
    70  }
    71  
    72  var xxx_messageInfo_BIP44Params proto.InternalMessageInfo
    73  
    74  func init() {
    75  	proto.RegisterType((*BIP44Params)(nil), "cosmos.crypto.hd.v1.BIP44Params")
    76  }
    77  
    78  func init() { proto.RegisterFile("cosmos/crypto/hd/v1/hd.proto", fileDescriptor_cf10f1fb5e778a8d) }
    79  
    80  var fileDescriptor_cf10f1fb5e778a8d = []byte{
    81  	// 294 bytes of a gzipped FileDescriptorProto
    82  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce,
    83  	0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x48, 0xd1, 0x2f, 0x33, 0xd4,
    84  	0xcf, 0x48, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x41, 0x64, 0xf5,
    85  	0x32, 0x52, 0xf4, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44,
    86  	0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x0e, 0x30,
    87  	0x72, 0x71, 0x3b, 0x79, 0x06, 0x98, 0x98, 0x04, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x0b, 0x49, 0x70,
    88  	0xb1, 0x17, 0x94, 0x16, 0x15, 0xe4, 0x17, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x06, 0xc1,
    89  	0xb8, 0x42, 0xd2, 0x5c, 0x9c, 0xc9, 0xf9, 0x99, 0x79, 0xf1, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x4c,
    90  	0x60, 0x39, 0x0e, 0x90, 0x40, 0x48, 0x65, 0x41, 0x2a, 0x48, 0x5b, 0x62, 0x72, 0x72, 0x7e, 0x69,
    91  	0x5e, 0x89, 0x04, 0x33, 0x44, 0x1b, 0x94, 0x2b, 0x24, 0xc6, 0xc5, 0x96, 0x9c, 0x91, 0x98, 0x97,
    92  	0x9e, 0x2a, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x11, 0x04, 0xe5, 0x09, 0x29, 0x73, 0xf1, 0x26, 0xa6,
    93  	0xa4, 0x14, 0xa5, 0x16, 0x17, 0xc7, 0x67, 0xe6, 0xa5, 0xa4, 0x56, 0x48, 0xb0, 0x82, 0xf5, 0xf1,
    94  	0x40, 0x05, 0x3d, 0x41, 0x62, 0x56, 0xca, 0x33, 0x16, 0xc8, 0x33, 0x74, 0x3d, 0xdf, 0xa0, 0x25,
    95  	0x05, 0xf5, 0x7b, 0x76, 0x6a, 0x65, 0x31, 0x28, 0x00, 0x90, 0x9c, 0xec, 0xe4, 0x72, 0xe2, 0xa1,
    96  	0x1c, 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1,
    97  	0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa5, 0x67, 0x96,
    98  	0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xc2, 0x11, 0x4c, 0xe9, 0x16, 0xa7, 0x64,
    99  	0x23, 0x82, 0x34, 0x89, 0x0d, 0x1c, 0x1e, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x0c,
   100  	0x7a, 0x26, 0x6d, 0x01, 0x00, 0x00,
   101  }
   102  
   103  func (m *BIP44Params) Marshal() (dAtA []byte, err error) {
   104  	size := m.Size()
   105  	dAtA = make([]byte, size)
   106  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return dAtA[:n], nil
   111  }
   112  
   113  func (m *BIP44Params) MarshalTo(dAtA []byte) (int, error) {
   114  	size := m.Size()
   115  	return m.MarshalToSizedBuffer(dAtA[:size])
   116  }
   117  
   118  func (m *BIP44Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   119  	i := len(dAtA)
   120  	_ = i
   121  	var l int
   122  	_ = l
   123  	if m.AddressIndex != 0 {
   124  		i = encodeVarintHd(dAtA, i, uint64(m.AddressIndex))
   125  		i--
   126  		dAtA[i] = 0x28
   127  	}
   128  	if m.Change {
   129  		i--
   130  		if m.Change {
   131  			dAtA[i] = 1
   132  		} else {
   133  			dAtA[i] = 0
   134  		}
   135  		i--
   136  		dAtA[i] = 0x20
   137  	}
   138  	if m.Account != 0 {
   139  		i = encodeVarintHd(dAtA, i, uint64(m.Account))
   140  		i--
   141  		dAtA[i] = 0x18
   142  	}
   143  	if m.CoinType != 0 {
   144  		i = encodeVarintHd(dAtA, i, uint64(m.CoinType))
   145  		i--
   146  		dAtA[i] = 0x10
   147  	}
   148  	if m.Purpose != 0 {
   149  		i = encodeVarintHd(dAtA, i, uint64(m.Purpose))
   150  		i--
   151  		dAtA[i] = 0x8
   152  	}
   153  	return len(dAtA) - i, nil
   154  }
   155  
   156  func encodeVarintHd(dAtA []byte, offset int, v uint64) int {
   157  	offset -= sovHd(v)
   158  	base := offset
   159  	for v >= 1<<7 {
   160  		dAtA[offset] = uint8(v&0x7f | 0x80)
   161  		v >>= 7
   162  		offset++
   163  	}
   164  	dAtA[offset] = uint8(v)
   165  	return base
   166  }
   167  func (m *BIP44Params) Size() (n int) {
   168  	if m == nil {
   169  		return 0
   170  	}
   171  	var l int
   172  	_ = l
   173  	if m.Purpose != 0 {
   174  		n += 1 + sovHd(uint64(m.Purpose))
   175  	}
   176  	if m.CoinType != 0 {
   177  		n += 1 + sovHd(uint64(m.CoinType))
   178  	}
   179  	if m.Account != 0 {
   180  		n += 1 + sovHd(uint64(m.Account))
   181  	}
   182  	if m.Change {
   183  		n += 2
   184  	}
   185  	if m.AddressIndex != 0 {
   186  		n += 1 + sovHd(uint64(m.AddressIndex))
   187  	}
   188  	return n
   189  }
   190  
   191  func sovHd(x uint64) (n int) {
   192  	return (math_bits.Len64(x|1) + 6) / 7
   193  }
   194  func sozHd(x uint64) (n int) {
   195  	return sovHd(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   196  }
   197  func (m *BIP44Params) Unmarshal(dAtA []byte) error {
   198  	l := len(dAtA)
   199  	iNdEx := 0
   200  	for iNdEx < l {
   201  		preIndex := iNdEx
   202  		var wire uint64
   203  		for shift := uint(0); ; shift += 7 {
   204  			if shift >= 64 {
   205  				return ErrIntOverflowHd
   206  			}
   207  			if iNdEx >= l {
   208  				return io.ErrUnexpectedEOF
   209  			}
   210  			b := dAtA[iNdEx]
   211  			iNdEx++
   212  			wire |= uint64(b&0x7F) << shift
   213  			if b < 0x80 {
   214  				break
   215  			}
   216  		}
   217  		fieldNum := int32(wire >> 3)
   218  		wireType := int(wire & 0x7)
   219  		if wireType == 4 {
   220  			return fmt.Errorf("proto: BIP44Params: wiretype end group for non-group")
   221  		}
   222  		if fieldNum <= 0 {
   223  			return fmt.Errorf("proto: BIP44Params: illegal tag %d (wire type %d)", fieldNum, wire)
   224  		}
   225  		switch fieldNum {
   226  		case 1:
   227  			if wireType != 0 {
   228  				return fmt.Errorf("proto: wrong wireType = %d for field Purpose", wireType)
   229  			}
   230  			m.Purpose = 0
   231  			for shift := uint(0); ; shift += 7 {
   232  				if shift >= 64 {
   233  					return ErrIntOverflowHd
   234  				}
   235  				if iNdEx >= l {
   236  					return io.ErrUnexpectedEOF
   237  				}
   238  				b := dAtA[iNdEx]
   239  				iNdEx++
   240  				m.Purpose |= uint32(b&0x7F) << shift
   241  				if b < 0x80 {
   242  					break
   243  				}
   244  			}
   245  		case 2:
   246  			if wireType != 0 {
   247  				return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType)
   248  			}
   249  			m.CoinType = 0
   250  			for shift := uint(0); ; shift += 7 {
   251  				if shift >= 64 {
   252  					return ErrIntOverflowHd
   253  				}
   254  				if iNdEx >= l {
   255  					return io.ErrUnexpectedEOF
   256  				}
   257  				b := dAtA[iNdEx]
   258  				iNdEx++
   259  				m.CoinType |= uint32(b&0x7F) << shift
   260  				if b < 0x80 {
   261  					break
   262  				}
   263  			}
   264  		case 3:
   265  			if wireType != 0 {
   266  				return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
   267  			}
   268  			m.Account = 0
   269  			for shift := uint(0); ; shift += 7 {
   270  				if shift >= 64 {
   271  					return ErrIntOverflowHd
   272  				}
   273  				if iNdEx >= l {
   274  					return io.ErrUnexpectedEOF
   275  				}
   276  				b := dAtA[iNdEx]
   277  				iNdEx++
   278  				m.Account |= uint32(b&0x7F) << shift
   279  				if b < 0x80 {
   280  					break
   281  				}
   282  			}
   283  		case 4:
   284  			if wireType != 0 {
   285  				return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType)
   286  			}
   287  			var v int
   288  			for shift := uint(0); ; shift += 7 {
   289  				if shift >= 64 {
   290  					return ErrIntOverflowHd
   291  				}
   292  				if iNdEx >= l {
   293  					return io.ErrUnexpectedEOF
   294  				}
   295  				b := dAtA[iNdEx]
   296  				iNdEx++
   297  				v |= int(b&0x7F) << shift
   298  				if b < 0x80 {
   299  					break
   300  				}
   301  			}
   302  			m.Change = bool(v != 0)
   303  		case 5:
   304  			if wireType != 0 {
   305  				return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType)
   306  			}
   307  			m.AddressIndex = 0
   308  			for shift := uint(0); ; shift += 7 {
   309  				if shift >= 64 {
   310  					return ErrIntOverflowHd
   311  				}
   312  				if iNdEx >= l {
   313  					return io.ErrUnexpectedEOF
   314  				}
   315  				b := dAtA[iNdEx]
   316  				iNdEx++
   317  				m.AddressIndex |= uint32(b&0x7F) << shift
   318  				if b < 0x80 {
   319  					break
   320  				}
   321  			}
   322  		default:
   323  			iNdEx = preIndex
   324  			skippy, err := skipHd(dAtA[iNdEx:])
   325  			if err != nil {
   326  				return err
   327  			}
   328  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   329  				return ErrInvalidLengthHd
   330  			}
   331  			if (iNdEx + skippy) > l {
   332  				return io.ErrUnexpectedEOF
   333  			}
   334  			iNdEx += skippy
   335  		}
   336  	}
   337  
   338  	if iNdEx > l {
   339  		return io.ErrUnexpectedEOF
   340  	}
   341  	return nil
   342  }
   343  func skipHd(dAtA []byte) (n int, err error) {
   344  	l := len(dAtA)
   345  	iNdEx := 0
   346  	depth := 0
   347  	for iNdEx < l {
   348  		var wire uint64
   349  		for shift := uint(0); ; shift += 7 {
   350  			if shift >= 64 {
   351  				return 0, ErrIntOverflowHd
   352  			}
   353  			if iNdEx >= l {
   354  				return 0, io.ErrUnexpectedEOF
   355  			}
   356  			b := dAtA[iNdEx]
   357  			iNdEx++
   358  			wire |= (uint64(b) & 0x7F) << shift
   359  			if b < 0x80 {
   360  				break
   361  			}
   362  		}
   363  		wireType := int(wire & 0x7)
   364  		switch wireType {
   365  		case 0:
   366  			for shift := uint(0); ; shift += 7 {
   367  				if shift >= 64 {
   368  					return 0, ErrIntOverflowHd
   369  				}
   370  				if iNdEx >= l {
   371  					return 0, io.ErrUnexpectedEOF
   372  				}
   373  				iNdEx++
   374  				if dAtA[iNdEx-1] < 0x80 {
   375  					break
   376  				}
   377  			}
   378  		case 1:
   379  			iNdEx += 8
   380  		case 2:
   381  			var length int
   382  			for shift := uint(0); ; shift += 7 {
   383  				if shift >= 64 {
   384  					return 0, ErrIntOverflowHd
   385  				}
   386  				if iNdEx >= l {
   387  					return 0, io.ErrUnexpectedEOF
   388  				}
   389  				b := dAtA[iNdEx]
   390  				iNdEx++
   391  				length |= (int(b) & 0x7F) << shift
   392  				if b < 0x80 {
   393  					break
   394  				}
   395  			}
   396  			if length < 0 {
   397  				return 0, ErrInvalidLengthHd
   398  			}
   399  			iNdEx += length
   400  		case 3:
   401  			depth++
   402  		case 4:
   403  			if depth == 0 {
   404  				return 0, ErrUnexpectedEndOfGroupHd
   405  			}
   406  			depth--
   407  		case 5:
   408  			iNdEx += 4
   409  		default:
   410  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   411  		}
   412  		if iNdEx < 0 {
   413  			return 0, ErrInvalidLengthHd
   414  		}
   415  		if depth == 0 {
   416  			return iNdEx, nil
   417  		}
   418  	}
   419  	return 0, io.ErrUnexpectedEOF
   420  }
   421  
   422  var (
   423  	ErrInvalidLengthHd        = fmt.Errorf("proto: negative length found during unmarshaling")
   424  	ErrIntOverflowHd          = fmt.Errorf("proto: integer overflow")
   425  	ErrUnexpectedEndOfGroupHd = fmt.Errorf("proto: unexpected end of group")
   426  )