mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-16 06:58:20 +00:00
6e90931837
* add fixes * more changes * simplify the solution * add shuffle * remove prom metric * add to mock * go doc * use non default source * add test * terence's review * all tests passing
1447 lines
35 KiB
Go
Executable File
Generated
1447 lines
35 KiB
Go
Executable File
Generated
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: proto/eth/v1alpha1/attestation.proto
|
|
|
|
package eth
|
|
|
|
import (
|
|
fmt "fmt"
|
|
io "io"
|
|
math "math"
|
|
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
github_com_prysmaticlabs_go_bitfield "github.com/prysmaticlabs/go-bitfield"
|
|
)
|
|
|
|
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type Attestation struct {
|
|
AggregationBits github_com_prysmaticlabs_go_bitfield.Bitlist `protobuf:"bytes,1,opt,name=aggregation_bits,json=aggregationBits,proto3,casttype=github.com/prysmaticlabs/go-bitfield.Bitlist" json:"aggregation_bits,omitempty" ssz-max:"4096"`
|
|
Data *AttestationData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
|
CustodyBits github_com_prysmaticlabs_go_bitfield.Bitlist `protobuf:"bytes,3,opt,name=custody_bits,json=custodyBits,proto3,casttype=github.com/prysmaticlabs/go-bitfield.Bitlist" json:"custody_bits,omitempty" ssz-max:"4096"`
|
|
Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty" ssz-size:"96"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Attestation) Reset() { *m = Attestation{} }
|
|
func (m *Attestation) String() string { return proto.CompactTextString(m) }
|
|
func (*Attestation) ProtoMessage() {}
|
|
func (*Attestation) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f8f395ba51cd84e0, []int{0}
|
|
}
|
|
func (m *Attestation) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Attestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Attestation.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Attestation) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Attestation.Merge(m, src)
|
|
}
|
|
func (m *Attestation) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Attestation) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Attestation.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Attestation proto.InternalMessageInfo
|
|
|
|
func (m *Attestation) GetAggregationBits() github_com_prysmaticlabs_go_bitfield.Bitlist {
|
|
if m != nil {
|
|
return m.AggregationBits
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Attestation) GetData() *AttestationData {
|
|
if m != nil {
|
|
return m.Data
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Attestation) GetCustodyBits() github_com_prysmaticlabs_go_bitfield.Bitlist {
|
|
if m != nil {
|
|
return m.CustodyBits
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Attestation) GetSignature() []byte {
|
|
if m != nil {
|
|
return m.Signature
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type AttestationData struct {
|
|
BeaconBlockRoot []byte `protobuf:"bytes,1,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"`
|
|
Source *Checkpoint `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
|
|
Target *Checkpoint `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
|
|
Crosslink *Crosslink `protobuf:"bytes,4,opt,name=crosslink,proto3" json:"crosslink,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *AttestationData) Reset() { *m = AttestationData{} }
|
|
func (m *AttestationData) String() string { return proto.CompactTextString(m) }
|
|
func (*AttestationData) ProtoMessage() {}
|
|
func (*AttestationData) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f8f395ba51cd84e0, []int{1}
|
|
}
|
|
func (m *AttestationData) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *AttestationData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_AttestationData.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *AttestationData) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_AttestationData.Merge(m, src)
|
|
}
|
|
func (m *AttestationData) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *AttestationData) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_AttestationData.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_AttestationData proto.InternalMessageInfo
|
|
|
|
func (m *AttestationData) GetBeaconBlockRoot() []byte {
|
|
if m != nil {
|
|
return m.BeaconBlockRoot
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AttestationData) GetSource() *Checkpoint {
|
|
if m != nil {
|
|
return m.Source
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AttestationData) GetTarget() *Checkpoint {
|
|
if m != nil {
|
|
return m.Target
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AttestationData) GetCrosslink() *Crosslink {
|
|
if m != nil {
|
|
return m.Crosslink
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Checkpoint struct {
|
|
Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
|
|
Root []byte `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty" ssz-size:"32"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Checkpoint) Reset() { *m = Checkpoint{} }
|
|
func (m *Checkpoint) String() string { return proto.CompactTextString(m) }
|
|
func (*Checkpoint) ProtoMessage() {}
|
|
func (*Checkpoint) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f8f395ba51cd84e0, []int{2}
|
|
}
|
|
func (m *Checkpoint) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Checkpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Checkpoint.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Checkpoint) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Checkpoint.Merge(m, src)
|
|
}
|
|
func (m *Checkpoint) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Checkpoint) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Checkpoint.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Checkpoint proto.InternalMessageInfo
|
|
|
|
func (m *Checkpoint) GetEpoch() uint64 {
|
|
if m != nil {
|
|
return m.Epoch
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Checkpoint) GetRoot() []byte {
|
|
if m != nil {
|
|
return m.Root
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Crosslink struct {
|
|
Shard uint64 `protobuf:"varint,1,opt,name=shard,proto3" json:"shard,omitempty"`
|
|
ParentRoot []byte `protobuf:"bytes,2,opt,name=parent_root,json=parentRoot,proto3" json:"parent_root,omitempty" ssz-size:"32"`
|
|
StartEpoch uint64 `protobuf:"varint,3,opt,name=start_epoch,json=startEpoch,proto3" json:"start_epoch,omitempty"`
|
|
EndEpoch uint64 `protobuf:"varint,4,opt,name=end_epoch,json=endEpoch,proto3" json:"end_epoch,omitempty"`
|
|
DataRoot []byte `protobuf:"bytes,5,opt,name=data_root,json=dataRoot,proto3" json:"data_root,omitempty" ssz-size:"32"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Crosslink) Reset() { *m = Crosslink{} }
|
|
func (m *Crosslink) String() string { return proto.CompactTextString(m) }
|
|
func (*Crosslink) ProtoMessage() {}
|
|
func (*Crosslink) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_f8f395ba51cd84e0, []int{3}
|
|
}
|
|
func (m *Crosslink) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Crosslink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Crosslink.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalTo(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Crosslink) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Crosslink.Merge(m, src)
|
|
}
|
|
func (m *Crosslink) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Crosslink) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Crosslink.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Crosslink proto.InternalMessageInfo
|
|
|
|
func (m *Crosslink) GetShard() uint64 {
|
|
if m != nil {
|
|
return m.Shard
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Crosslink) GetParentRoot() []byte {
|
|
if m != nil {
|
|
return m.ParentRoot
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Crosslink) GetStartEpoch() uint64 {
|
|
if m != nil {
|
|
return m.StartEpoch
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Crosslink) GetEndEpoch() uint64 {
|
|
if m != nil {
|
|
return m.EndEpoch
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Crosslink) GetDataRoot() []byte {
|
|
if m != nil {
|
|
return m.DataRoot
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Attestation)(nil), "ethereum.eth.v1alpha1.Attestation")
|
|
proto.RegisterType((*AttestationData)(nil), "ethereum.eth.v1alpha1.AttestationData")
|
|
proto.RegisterType((*Checkpoint)(nil), "ethereum.eth.v1alpha1.Checkpoint")
|
|
proto.RegisterType((*Crosslink)(nil), "ethereum.eth.v1alpha1.Crosslink")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("proto/eth/v1alpha1/attestation.proto", fileDescriptor_f8f395ba51cd84e0)
|
|
}
|
|
|
|
var fileDescriptor_f8f395ba51cd84e0 = []byte{
|
|
// 519 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x40,
|
|
0x10, 0x96, 0xd3, 0xb4, 0x6a, 0xc6, 0x85, 0x50, 0x0b, 0xa4, 0x08, 0xa4, 0x24, 0x58, 0x80, 0x7a,
|
|
0x20, 0x36, 0x4d, 0xa1, 0x52, 0x82, 0x40, 0xc2, 0x85, 0x03, 0x57, 0x1f, 0xb9, 0x44, 0x6b, 0x7b,
|
|
0x6b, 0xaf, 0xe2, 0x78, 0xad, 0xdd, 0x31, 0xa2, 0x7d, 0x00, 0x5e, 0x8c, 0x0b, 0xc7, 0x3e, 0x41,
|
|
0x84, 0xf2, 0x08, 0x3d, 0x72, 0x42, 0x9e, 0x4d, 0x48, 0x54, 0x08, 0xe2, 0xd0, 0x9b, 0x67, 0xe7,
|
|
0xfb, 0xdb, 0x4f, 0x2b, 0xc3, 0x93, 0x52, 0x49, 0x94, 0x3e, 0xc7, 0xcc, 0xff, 0x7c, 0xcc, 0xf2,
|
|
0x32, 0x63, 0xc7, 0x3e, 0x43, 0xe4, 0x1a, 0x19, 0x0a, 0x59, 0x78, 0xb4, 0x76, 0x1e, 0x70, 0xcc,
|
|
0xb8, 0xe2, 0xd5, 0xcc, 0xe3, 0x98, 0x79, 0x2b, 0xe0, 0xc3, 0x41, 0x2a, 0x30, 0xab, 0x22, 0x2f,
|
|
0x96, 0x33, 0x3f, 0x95, 0xa9, 0xf4, 0x09, 0x1d, 0x55, 0xe7, 0x34, 0x19, 0xe5, 0xfa, 0xcb, 0xa8,
|
|
0xb8, 0x57, 0x0d, 0xb0, 0xdf, 0xad, 0xb5, 0x9d, 0x19, 0xdc, 0x63, 0x69, 0xaa, 0x78, 0x4a, 0xe3,
|
|
0x24, 0x12, 0xa8, 0x3b, 0x56, 0xdf, 0x3a, 0x3a, 0x08, 0x82, 0xeb, 0x79, 0xef, 0xae, 0xd6, 0x97,
|
|
0x83, 0x19, 0xfb, 0x32, 0x76, 0x5f, 0xbe, 0x18, 0x9d, 0xba, 0x3f, 0xe7, 0xbd, 0xe7, 0x1b, 0x76,
|
|
0xa5, 0xba, 0xd0, 0x33, 0x86, 0x22, 0xce, 0x59, 0xa4, 0xfd, 0x54, 0x0e, 0x22, 0x81, 0xe7, 0x82,
|
|
0xe7, 0x89, 0x17, 0x08, 0xcc, 0x85, 0xc6, 0xb0, 0xbd, 0xa1, 0x1d, 0x08, 0xd4, 0xce, 0x18, 0x9a,
|
|
0x09, 0x43, 0xd6, 0x69, 0xf4, 0xad, 0x23, 0x7b, 0xf8, 0xcc, 0xfb, 0xeb, 0x9d, 0xbc, 0x8d, 0x80,
|
|
0xef, 0x19, 0xb2, 0x90, 0x38, 0x0e, 0x87, 0x83, 0xb8, 0xd2, 0x28, 0x93, 0x0b, 0x13, 0x73, 0xe7,
|
|
0xd6, 0x62, 0xda, 0x4b, 0x5d, 0x8a, 0xe8, 0x43, 0x4b, 0x8b, 0xb4, 0x60, 0x58, 0x29, 0xde, 0x69,
|
|
0x92, 0xc7, 0xe1, 0xf5, 0xbc, 0x77, 0xa7, 0xf6, 0xd0, 0xe2, 0x92, 0x8f, 0xdd, 0xd1, 0xa9, 0x1b,
|
|
0xae, 0x31, 0xee, 0xd7, 0x06, 0xb4, 0x6f, 0x24, 0x76, 0xde, 0xc0, 0x61, 0xc4, 0x59, 0x5c, 0x37,
|
|
0x9a, 0xcb, 0x78, 0x3a, 0x51, 0x52, 0xe2, 0xb2, 0xd7, 0x1b, 0x62, 0x27, 0x43, 0x37, 0x6c, 0x1b,
|
|
0x6c, 0x50, 0x43, 0x43, 0x29, 0xd1, 0x19, 0xc1, 0x9e, 0x96, 0x95, 0x8a, 0xf9, 0xb2, 0xa8, 0xc7,
|
|
0x5b, 0x8a, 0x3a, 0xcb, 0x78, 0x3c, 0x2d, 0xa5, 0x28, 0x30, 0x5c, 0x12, 0x6a, 0x2a, 0x32, 0x95,
|
|
0x72, 0xa4, 0x7e, 0xfe, 0x8f, 0x6a, 0x08, 0xce, 0x5b, 0x68, 0xc5, 0x4a, 0x6a, 0x9d, 0x8b, 0x62,
|
|
0x4a, 0x37, 0xb7, 0x87, 0xfd, 0x6d, 0xec, 0x15, 0x2e, 0x5c, 0x53, 0xdc, 0x8f, 0x00, 0x6b, 0x55,
|
|
0xe7, 0x3e, 0xec, 0xf2, 0x52, 0xc6, 0x19, 0x5d, 0xbb, 0x19, 0x9a, 0xc1, 0x79, 0x0a, 0x4d, 0xea,
|
|
0xa2, 0xb1, 0xad, 0x0b, 0x5a, 0xbb, 0xdf, 0x2c, 0x68, 0xfd, 0xf6, 0xa8, 0xa5, 0x74, 0xc6, 0x54,
|
|
0xb2, 0x92, 0xa2, 0xc1, 0x19, 0x82, 0x5d, 0x32, 0xc5, 0x0b, 0x9c, 0xfc, 0x5b, 0x11, 0x0c, 0x8a,
|
|
0x8a, 0xed, 0x81, 0xad, 0x91, 0x29, 0x9c, 0x98, 0x68, 0x3b, 0xa4, 0x07, 0x74, 0xf4, 0x81, 0xf2,
|
|
0x3d, 0x82, 0x16, 0x2f, 0x92, 0xe5, 0xba, 0x49, 0xeb, 0x7d, 0x5e, 0x24, 0x66, 0xe9, 0x41, 0xab,
|
|
0x7e, 0x89, 0xc6, 0x6f, 0x77, 0x9b, 0xdf, 0x7e, 0x8d, 0xa9, 0xdd, 0x82, 0xb3, 0xef, 0x8b, 0xae,
|
|
0x75, 0xb5, 0xe8, 0x5a, 0x3f, 0x16, 0x5d, 0xeb, 0xd3, 0xab, 0xad, 0x6f, 0x92, 0x26, 0xff, 0xcf,
|
|
0xbf, 0xc0, 0x6b, 0x8e, 0x59, 0xb4, 0x47, 0xe7, 0x27, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e,
|
|
0x9d, 0x31, 0x67, 0x26, 0x04, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *Attestation) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Attestation) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.AggregationBits) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.AggregationBits)))
|
|
i += copy(dAtA[i:], m.AggregationBits)
|
|
}
|
|
if m.Data != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Data.Size()))
|
|
n1, err := m.Data.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n1
|
|
}
|
|
if len(m.CustodyBits) > 0 {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.CustodyBits)))
|
|
i += copy(dAtA[i:], m.CustodyBits)
|
|
}
|
|
if len(m.Signature) > 0 {
|
|
dAtA[i] = 0x22
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.Signature)))
|
|
i += copy(dAtA[i:], m.Signature)
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *AttestationData) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *AttestationData) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.BeaconBlockRoot) > 0 {
|
|
dAtA[i] = 0xa
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.BeaconBlockRoot)))
|
|
i += copy(dAtA[i:], m.BeaconBlockRoot)
|
|
}
|
|
if m.Source != nil {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Source.Size()))
|
|
n2, err := m.Source.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n2
|
|
}
|
|
if m.Target != nil {
|
|
dAtA[i] = 0x1a
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Target.Size()))
|
|
n3, err := m.Target.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n3
|
|
}
|
|
if m.Crosslink != nil {
|
|
dAtA[i] = 0x22
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Crosslink.Size()))
|
|
n4, err := m.Crosslink.MarshalTo(dAtA[i:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i += n4
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Checkpoint) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Checkpoint) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Epoch != 0 {
|
|
dAtA[i] = 0x8
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Epoch))
|
|
}
|
|
if len(m.Root) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.Root)))
|
|
i += copy(dAtA[i:], m.Root)
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func (m *Crosslink) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalTo(dAtA)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Crosslink) MarshalTo(dAtA []byte) (int, error) {
|
|
var i int
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Shard != 0 {
|
|
dAtA[i] = 0x8
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.Shard))
|
|
}
|
|
if len(m.ParentRoot) > 0 {
|
|
dAtA[i] = 0x12
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.ParentRoot)))
|
|
i += copy(dAtA[i:], m.ParentRoot)
|
|
}
|
|
if m.StartEpoch != 0 {
|
|
dAtA[i] = 0x18
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.StartEpoch))
|
|
}
|
|
if m.EndEpoch != 0 {
|
|
dAtA[i] = 0x20
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(m.EndEpoch))
|
|
}
|
|
if len(m.DataRoot) > 0 {
|
|
dAtA[i] = 0x2a
|
|
i++
|
|
i = encodeVarintAttestation(dAtA, i, uint64(len(m.DataRoot)))
|
|
i += copy(dAtA[i:], m.DataRoot)
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
|
}
|
|
return i, nil
|
|
}
|
|
|
|
func encodeVarintAttestation(dAtA []byte, offset int, v uint64) int {
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return offset + 1
|
|
}
|
|
func (m *Attestation) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.AggregationBits)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.Data != nil {
|
|
l = m.Data.Size()
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
l = len(m.CustodyBits)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
l = len(m.Signature)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *AttestationData) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.BeaconBlockRoot)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.Source != nil {
|
|
l = m.Source.Size()
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.Target != nil {
|
|
l = m.Target.Size()
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.Crosslink != nil {
|
|
l = m.Crosslink.Size()
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Checkpoint) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Epoch != 0 {
|
|
n += 1 + sovAttestation(uint64(m.Epoch))
|
|
}
|
|
l = len(m.Root)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *Crosslink) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.Shard != 0 {
|
|
n += 1 + sovAttestation(uint64(m.Shard))
|
|
}
|
|
l = len(m.ParentRoot)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.StartEpoch != 0 {
|
|
n += 1 + sovAttestation(uint64(m.StartEpoch))
|
|
}
|
|
if m.EndEpoch != 0 {
|
|
n += 1 + sovAttestation(uint64(m.EndEpoch))
|
|
}
|
|
l = len(m.DataRoot)
|
|
if l > 0 {
|
|
n += 1 + l + sovAttestation(uint64(l))
|
|
}
|
|
if m.XXX_unrecognized != nil {
|
|
n += len(m.XXX_unrecognized)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovAttestation(x uint64) (n int) {
|
|
for {
|
|
n++
|
|
x >>= 7
|
|
if x == 0 {
|
|
break
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
func sozAttestation(x uint64) (n int) {
|
|
return sovAttestation(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *Attestation) 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 ErrIntOverflowAttestation
|
|
}
|
|
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: Attestation: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field AggregationBits", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.AggregationBits = append(m.AggregationBits[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.AggregationBits == nil {
|
|
m.AggregationBits = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Data == nil {
|
|
m.Data = &AttestationData{}
|
|
}
|
|
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field CustodyBits", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.CustodyBits = append(m.CustodyBits[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.CustodyBits == nil {
|
|
m.CustodyBits = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Signature == nil {
|
|
m.Signature = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAttestation(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *AttestationData) 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 ErrIntOverflowAttestation
|
|
}
|
|
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: AttestationData: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: AttestationData: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field BeaconBlockRoot", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.BeaconBlockRoot = append(m.BeaconBlockRoot[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.BeaconBlockRoot == nil {
|
|
m.BeaconBlockRoot = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Source == nil {
|
|
m.Source = &Checkpoint{}
|
|
}
|
|
if err := m.Source.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Target == nil {
|
|
m.Target = &Checkpoint{}
|
|
}
|
|
if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Crosslink", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if m.Crosslink == nil {
|
|
m.Crosslink = &Crosslink{}
|
|
}
|
|
if err := m.Crosslink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAttestation(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Checkpoint) 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 ErrIntOverflowAttestation
|
|
}
|
|
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: Checkpoint: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Checkpoint: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType)
|
|
}
|
|
m.Epoch = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Epoch |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Root = append(m.Root[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Root == nil {
|
|
m.Root = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAttestation(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Crosslink) 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 ErrIntOverflowAttestation
|
|
}
|
|
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: Crosslink: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Crosslink: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType)
|
|
}
|
|
m.Shard = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Shard |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ParentRoot", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.ParentRoot = append(m.ParentRoot[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.ParentRoot == nil {
|
|
m.ParentRoot = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field StartEpoch", wireType)
|
|
}
|
|
m.StartEpoch = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.StartEpoch |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 4:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field EndEpoch", wireType)
|
|
}
|
|
m.EndEpoch = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.EndEpoch |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field DataRoot", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.DataRoot = append(m.DataRoot[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.DataRoot == nil {
|
|
m.DataRoot = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipAttestation(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if skippy < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) < 0 {
|
|
return ErrInvalidLengthAttestation
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipAttestation(dAtA []byte) (n int, err error) {
|
|
l := len(dAtA)
|
|
iNdEx := 0
|
|
for iNdEx < l {
|
|
var wire uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAttestation
|
|
}
|
|
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, ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx++
|
|
if dAtA[iNdEx-1] < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 1:
|
|
iNdEx += 8
|
|
return iNdEx, nil
|
|
case 2:
|
|
var length int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAttestation
|
|
}
|
|
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, ErrInvalidLengthAttestation
|
|
}
|
|
iNdEx += length
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthAttestation
|
|
}
|
|
return iNdEx, nil
|
|
case 3:
|
|
for {
|
|
var innerWire uint64
|
|
var start int = iNdEx
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return 0, ErrIntOverflowAttestation
|
|
}
|
|
if iNdEx >= l {
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
innerWire |= (uint64(b) & 0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
innerWireType := int(innerWire & 0x7)
|
|
if innerWireType == 4 {
|
|
break
|
|
}
|
|
next, err := skipAttestation(dAtA[start:])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
iNdEx = start + next
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthAttestation
|
|
}
|
|
}
|
|
return iNdEx, nil
|
|
case 4:
|
|
return iNdEx, nil
|
|
case 5:
|
|
iNdEx += 4
|
|
return iNdEx, nil
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
}
|
|
panic("unreachable")
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthAttestation = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowAttestation = fmt.Errorf("proto: integer overflow")
|
|
)
|