// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: x/ibc/23-commitment/types/types.proto package types import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" merkle "github.com/tendermint/tendermint/crypto/merkle" io "io" math "math" math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // KeyEncoding defines the encoding format of a key's bytes. type KeyEncoding int32 const ( // URL encoding URL KeyEncoding = 0 // Hex encoding HEX KeyEncoding = 1 ) var KeyEncoding_name = map[int32]string{ 0: "KEY_ENCODING_URL_UNSPECIFIED", 1: "KEY_ENCODING_HEX", } var KeyEncoding_value = map[string]int32{ "KEY_ENCODING_URL_UNSPECIFIED": 0, "KEY_ENCODING_HEX": 1, } func (KeyEncoding) EnumDescriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{0} } // MerkleRoot defines a merkle root hash. // In the Cosmos SDK, the AppHash of a block header becomes the root. type MerkleRoot struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` } func (m *MerkleRoot) Reset() { *m = MerkleRoot{} } func (m *MerkleRoot) String() string { return proto.CompactTextString(m) } func (*MerkleRoot) ProtoMessage() {} func (*MerkleRoot) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{0} } func (m *MerkleRoot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MerkleRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MerkleRoot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MerkleRoot) XXX_Merge(src proto.Message) { xxx_messageInfo_MerkleRoot.Merge(m, src) } func (m *MerkleRoot) XXX_Size() int { return m.Size() } func (m *MerkleRoot) XXX_DiscardUnknown() { xxx_messageInfo_MerkleRoot.DiscardUnknown(m) } var xxx_messageInfo_MerkleRoot proto.InternalMessageInfo // MerklePrefix is merkle path prefixed to the key. // The constructed key from the Path and the key will be append(Path.KeyPath, append(Path.KeyPrefix, key...)) type MerklePrefix struct { KeyPrefix []byte `protobuf:"bytes,1,opt,name=key_prefix,json=keyPrefix,proto3" json:"key_prefix,omitempty" yaml:"key_prefix"` } func (m *MerklePrefix) Reset() { *m = MerklePrefix{} } func (m *MerklePrefix) String() string { return proto.CompactTextString(m) } func (*MerklePrefix) ProtoMessage() {} func (*MerklePrefix) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{1} } func (m *MerklePrefix) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MerklePrefix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MerklePrefix.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MerklePrefix) XXX_Merge(src proto.Message) { xxx_messageInfo_MerklePrefix.Merge(m, src) } func (m *MerklePrefix) XXX_Size() int { return m.Size() } func (m *MerklePrefix) XXX_DiscardUnknown() { xxx_messageInfo_MerklePrefix.DiscardUnknown(m) } var xxx_messageInfo_MerklePrefix proto.InternalMessageInfo func (m *MerklePrefix) GetKeyPrefix() []byte { if m != nil { return m.KeyPrefix } return nil } // MerklePath is the path used to verify commitment proofs, which can be an arbitrary // structured object (defined by a commitment type). type MerklePath struct { KeyPath KeyPath `protobuf:"bytes,1,opt,name=key_path,json=keyPath,proto3" json:"key_path" yaml:"key_path"` } func (m *MerklePath) Reset() { *m = MerklePath{} } func (*MerklePath) ProtoMessage() {} func (*MerklePath) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{2} } func (m *MerklePath) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MerklePath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MerklePath.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MerklePath) XXX_Merge(src proto.Message) { xxx_messageInfo_MerklePath.Merge(m, src) } func (m *MerklePath) XXX_Size() int { return m.Size() } func (m *MerklePath) XXX_DiscardUnknown() { xxx_messageInfo_MerklePath.DiscardUnknown(m) } var xxx_messageInfo_MerklePath proto.InternalMessageInfo func (m *MerklePath) GetKeyPath() KeyPath { if m != nil { return m.KeyPath } return KeyPath{} } // MerkleProof is a wrapper type that contains a merkle proof. // It demonstrates membership or non-membership for an element or set of elements, // verifiable in conjunction with a known commitment root. Proofs should be // succinct. type MerkleProof struct { Proof *merkle.Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` } func (m *MerkleProof) Reset() { *m = MerkleProof{} } func (m *MerkleProof) String() string { return proto.CompactTextString(m) } func (*MerkleProof) ProtoMessage() {} func (*MerkleProof) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{3} } func (m *MerkleProof) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MerkleProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MerkleProof.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MerkleProof) XXX_Merge(src proto.Message) { xxx_messageInfo_MerkleProof.Merge(m, src) } func (m *MerkleProof) XXX_Size() int { return m.Size() } func (m *MerkleProof) XXX_DiscardUnknown() { xxx_messageInfo_MerkleProof.DiscardUnknown(m) } var xxx_messageInfo_MerkleProof proto.InternalMessageInfo func (m *MerkleProof) GetProof() *merkle.Proof { if m != nil { return m.Proof } return nil } // KeyPath defines a slice of keys type KeyPath struct { Keys []*Key `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` } func (m *KeyPath) Reset() { *m = KeyPath{} } func (*KeyPath) ProtoMessage() {} func (*KeyPath) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{4} } func (m *KeyPath) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *KeyPath) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_KeyPath.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *KeyPath) XXX_Merge(src proto.Message) { xxx_messageInfo_KeyPath.Merge(m, src) } func (m *KeyPath) XXX_Size() int { return m.Size() } func (m *KeyPath) XXX_DiscardUnknown() { xxx_messageInfo_KeyPath.DiscardUnknown(m) } var xxx_messageInfo_KeyPath proto.InternalMessageInfo // Key defines a proof Key type Key struct { name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` enc KeyEncoding `protobuf:"varint,2,opt,name=enc,proto3,enum=cosmos_sdk.x.ibc.commitment.v1.KeyEncoding" json:"enc,omitempty"` } func (m *Key) Reset() { *m = Key{} } func (m *Key) String() string { return proto.CompactTextString(m) } func (*Key) ProtoMessage() {} func (*Key) Descriptor() ([]byte, []int) { return fileDescriptor_1004b8837466efb9, []int{5} } func (m *Key) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Key.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Key) XXX_Merge(src proto.Message) { xxx_messageInfo_Key.Merge(m, src) } func (m *Key) XXX_Size() int { return m.Size() } func (m *Key) XXX_DiscardUnknown() { xxx_messageInfo_Key.DiscardUnknown(m) } var xxx_messageInfo_Key proto.InternalMessageInfo func init() { proto.RegisterEnum("cosmos_sdk.x.ibc.commitment.v1.KeyEncoding", KeyEncoding_name, KeyEncoding_value) proto.RegisterType((*MerkleRoot)(nil), "cosmos_sdk.x.ibc.commitment.v1.MerkleRoot") proto.RegisterType((*MerklePrefix)(nil), "cosmos_sdk.x.ibc.commitment.v1.MerklePrefix") proto.RegisterType((*MerklePath)(nil), "cosmos_sdk.x.ibc.commitment.v1.MerklePath") proto.RegisterType((*MerkleProof)(nil), "cosmos_sdk.x.ibc.commitment.v1.MerkleProof") proto.RegisterType((*KeyPath)(nil), "cosmos_sdk.x.ibc.commitment.v1.KeyPath") proto.RegisterType((*Key)(nil), "cosmos_sdk.x.ibc.commitment.v1.Key") } func init() { proto.RegisterFile("x/ibc/23-commitment/types/types.proto", fileDescriptor_1004b8837466efb9) } var fileDescriptor_1004b8837466efb9 = []byte{ // 534 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x31, 0x6f, 0xd3, 0x40, 0x14, 0xc7, 0x6d, 0x62, 0x48, 0xb8, 0x54, 0x50, 0x4e, 0x42, 0x44, 0x51, 0xb1, 0x23, 0x23, 0x4a, 0x00, 0xf5, 0x2c, 0x52, 0xa0, 0x52, 0xc6, 0x34, 0x2e, 0x0d, 0x09, 0x21, 0x3a, 0x14, 0xa9, 0xc0, 0x60, 0x39, 0xce, 0x35, 0xb6, 0x5c, 0xfb, 0x8c, 0x7d, 0xa0, 0xf8, 0x1b, 0x54, 0x4c, 0x8c, 0x2c, 0x48, 0x95, 0x60, 0xe0, 0xa3, 0x74, 0xec, 0xc8, 0x14, 0xa1, 0x64, 0x61, 0xee, 0x27, 0x40, 0xbe, 0x73, 0x95, 0x22, 0x04, 0xea, 0xf2, 0xee, 0x3d, 0xdd, 0xef, 0x9f, 0xff, 0xcb, 0xdf, 0x36, 0xb8, 0x3b, 0x35, 0xbc, 0x91, 0x63, 0x34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0x4d, 0x95, 0x5a, 0x83, 0xe3, 0xb9, 0x2a, 0x9f, 0xcc, 0x55, 0xf9, 0xe7, 0x5c, 0x95, 0x3f, 0x2d, 0x54, 0xe9, 0x64, 0xa1, 0x4a, 0x3f, 0x16, 0xaa, 0xf4, 0xe6, 0xe9, 0xc4, 0x63, 0xee, 0xfb, 0x51, 0xb6, 0xb2, 0x21, 0xfe, 0x47, 0x7e, 0x6c, 0x24, 0x63, 0xdf, 0xf8, 0xe7, 0xd7, 0x32, 0xba, 0xc2, 0xdf, 0xd3, 0xcd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x4d, 0x65, 0x02, 0x51, 0x03, 0x00, 0x00, } func (this *MerkleProof) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*MerkleProof) if !ok { that2, ok := that.(MerkleProof) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Proof.Equal(that1.Proof) { return false } return true } func (m *MerkleRoot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MerkleRoot) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MerkleRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Hash) > 0 { i -= len(m.Hash) copy(dAtA[i:], m.Hash) i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *MerklePrefix) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MerklePrefix) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MerklePrefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.KeyPrefix) > 0 { i -= len(m.KeyPrefix) copy(dAtA[i:], m.KeyPrefix) i = encodeVarintTypes(dAtA, i, uint64(len(m.KeyPrefix))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *MerklePath) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MerklePath) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MerklePath) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { size, err := m.KeyPath.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa return len(dAtA) - i, nil } func (m *MerkleProof) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MerkleProof) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MerkleProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Proof != nil { { size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *KeyPath) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *KeyPath) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *KeyPath) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Keys) > 0 { for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Keys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Key) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Key) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Key) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.enc != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.enc)) i-- dAtA[i] = 0x10 } if len(m.name) > 0 { i -= len(m.name) copy(dAtA[i:], m.name) i = encodeVarintTypes(dAtA, i, uint64(len(m.name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *MerkleRoot) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Hash) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } return n } func (m *MerklePrefix) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.KeyPrefix) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } return n } func (m *MerklePath) Size() (n int) { if m == nil { return 0 } var l int _ = l l = m.KeyPath.Size() n += 1 + l + sovTypes(uint64(l)) return n } func (m *MerkleProof) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Proof != nil { l = m.Proof.Size() n += 1 + l + sovTypes(uint64(l)) } return n } func (m *KeyPath) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Keys) > 0 { for _, e := range m.Keys { l = e.Size() n += 1 + l + sovTypes(uint64(l)) } } return n } func (m *Key) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.name) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } if m.enc != 0 { n += 1 + sovTypes(uint64(m.enc)) } return n } func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *MerkleRoot) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MerkleRoot: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MerkleRoot: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) if m.Hash == nil { m.Hash = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MerklePrefix) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MerklePrefix: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MerklePrefix: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KeyPrefix", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } m.KeyPrefix = append(m.KeyPrefix[:0], dAtA[iNdEx:postIndex]...) if m.KeyPrefix == nil { m.KeyPrefix = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MerklePath) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MerklePath: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MerklePath: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KeyPath", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } if err := m.KeyPath.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MerkleProof) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MerkleProof: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MerkleProof: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } if m.Proof == nil { m.Proof = &merkle.Proof{} } if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *KeyPath) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: KeyPath: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: KeyPath: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } m.Keys = append(m.Keys, &Key{}) if err := m.Keys[len(m.Keys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Key) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Key: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Key: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field name", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthTypes } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTypes } if postIndex > l { return io.ErrUnexpectedEOF } m.name = append(m.name[:0], dAtA[iNdEx:postIndex]...) if m.name == nil { m.name = []byte{} } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field enc", wireType) } m.enc = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.enc |= KeyEncoding(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) < 0 { return ErrInvalidLengthTypes } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowTypes } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthTypes } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupTypes } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthTypes } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )