github.com/InjectiveLabs/sdk-go@v1.53.0/chain/peggy/types/attestation.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: injective/peggy/v1/attestation.proto
     3  
     4  package types
     5  
     6  import (
     7  	cosmossdk_io_math "cosmossdk.io/math"
     8  	fmt "fmt"
     9  	types "github.com/cosmos/cosmos-sdk/codec/types"
    10  	_ "github.com/cosmos/gogoproto/gogoproto"
    11  	proto "github.com/cosmos/gogoproto/proto"
    12  	io "io"
    13  	math "math"
    14  	math_bits "math/bits"
    15  )
    16  
    17  // Reference imports to suppress errors if they are not otherwise used.
    18  var _ = proto.Marshal
    19  var _ = fmt.Errorf
    20  var _ = math.Inf
    21  
    22  // This is a compile-time assertion to ensure that this generated file
    23  // is compatible with the proto package it is being compiled against.
    24  // A compilation error at this line likely means your copy of the
    25  // proto package needs to be updated.
    26  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    27  
    28  // ClaimType is the cosmos type of an event from the counterpart chain that can
    29  // be handled
    30  type ClaimType int32
    31  
    32  const (
    33  	CLAIM_TYPE_UNKNOWN        ClaimType = 0
    34  	CLAIM_TYPE_DEPOSIT        ClaimType = 1
    35  	CLAIM_TYPE_WITHDRAW       ClaimType = 2
    36  	CLAIM_TYPE_ERC20_DEPLOYED ClaimType = 3
    37  	CLAIM_TYPE_VALSET_UPDATED ClaimType = 4
    38  )
    39  
    40  var ClaimType_name = map[int32]string{
    41  	0: "CLAIM_TYPE_UNKNOWN",
    42  	1: "CLAIM_TYPE_DEPOSIT",
    43  	2: "CLAIM_TYPE_WITHDRAW",
    44  	3: "CLAIM_TYPE_ERC20_DEPLOYED",
    45  	4: "CLAIM_TYPE_VALSET_UPDATED",
    46  }
    47  
    48  var ClaimType_value = map[string]int32{
    49  	"CLAIM_TYPE_UNKNOWN":        0,
    50  	"CLAIM_TYPE_DEPOSIT":        1,
    51  	"CLAIM_TYPE_WITHDRAW":       2,
    52  	"CLAIM_TYPE_ERC20_DEPLOYED": 3,
    53  	"CLAIM_TYPE_VALSET_UPDATED": 4,
    54  }
    55  
    56  func (x ClaimType) String() string {
    57  	return proto.EnumName(ClaimType_name, int32(x))
    58  }
    59  
    60  func (ClaimType) EnumDescriptor() ([]byte, []int) {
    61  	return fileDescriptor_3022043570947e1e, []int{0}
    62  }
    63  
    64  // Attestation is an aggregate of `claims` that eventually becomes `observed` by
    65  // all orchestrators
    66  // EVENT_NONCE:
    67  // EventNonce a nonce provided by the peggy contract that is unique per event
    68  // fired These event nonces must be relayed in order. This is a correctness
    69  // issue, if relaying out of order transaction replay attacks become possible
    70  // OBSERVED:
    71  // Observed indicates that >67% of validators have attested to the event,
    72  // and that the event should be executed by the peggy state machine
    73  //
    74  // The actual content of the claims is passed in with the transaction making the
    75  // claim and then passed through the call stack alongside the attestation while
    76  // it is processed the key in which the attestation is stored is keyed on the
    77  // exact details of the claim but there is no reason to store those exact
    78  // details becuause the next message sender will kindly provide you with them.
    79  type Attestation struct {
    80  	Observed bool       `protobuf:"varint,1,opt,name=observed,proto3" json:"observed,omitempty"`
    81  	Votes    []string   `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes,omitempty"`
    82  	Height   uint64     `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
    83  	Claim    *types.Any `protobuf:"bytes,4,opt,name=claim,proto3" json:"claim,omitempty"`
    84  }
    85  
    86  func (m *Attestation) Reset()         { *m = Attestation{} }
    87  func (m *Attestation) String() string { return proto.CompactTextString(m) }
    88  func (*Attestation) ProtoMessage()    {}
    89  func (*Attestation) Descriptor() ([]byte, []int) {
    90  	return fileDescriptor_3022043570947e1e, []int{0}
    91  }
    92  func (m *Attestation) XXX_Unmarshal(b []byte) error {
    93  	return m.Unmarshal(b)
    94  }
    95  func (m *Attestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    96  	if deterministic {
    97  		return xxx_messageInfo_Attestation.Marshal(b, m, deterministic)
    98  	} else {
    99  		b = b[:cap(b)]
   100  		n, err := m.MarshalToSizedBuffer(b)
   101  		if err != nil {
   102  			return nil, err
   103  		}
   104  		return b[:n], nil
   105  	}
   106  }
   107  func (m *Attestation) XXX_Merge(src proto.Message) {
   108  	xxx_messageInfo_Attestation.Merge(m, src)
   109  }
   110  func (m *Attestation) XXX_Size() int {
   111  	return m.Size()
   112  }
   113  func (m *Attestation) XXX_DiscardUnknown() {
   114  	xxx_messageInfo_Attestation.DiscardUnknown(m)
   115  }
   116  
   117  var xxx_messageInfo_Attestation proto.InternalMessageInfo
   118  
   119  func (m *Attestation) GetObserved() bool {
   120  	if m != nil {
   121  		return m.Observed
   122  	}
   123  	return false
   124  }
   125  
   126  func (m *Attestation) GetVotes() []string {
   127  	if m != nil {
   128  		return m.Votes
   129  	}
   130  	return nil
   131  }
   132  
   133  func (m *Attestation) GetHeight() uint64 {
   134  	if m != nil {
   135  		return m.Height
   136  	}
   137  	return 0
   138  }
   139  
   140  func (m *Attestation) GetClaim() *types.Any {
   141  	if m != nil {
   142  		return m.Claim
   143  	}
   144  	return nil
   145  }
   146  
   147  // ERC20Token unique identifier for an Ethereum ERC20 token.
   148  // CONTRACT:
   149  // The contract address on ETH of the token, this could be a Cosmos
   150  // originated token, if so it will be the ERC20 address of the representation
   151  // (note: developers should look up the token symbol using the address on ETH to
   152  // display for UI)
   153  type ERC20Token struct {
   154  	Contract string                `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"`
   155  	Amount   cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"`
   156  }
   157  
   158  func (m *ERC20Token) Reset()         { *m = ERC20Token{} }
   159  func (m *ERC20Token) String() string { return proto.CompactTextString(m) }
   160  func (*ERC20Token) ProtoMessage()    {}
   161  func (*ERC20Token) Descriptor() ([]byte, []int) {
   162  	return fileDescriptor_3022043570947e1e, []int{1}
   163  }
   164  func (m *ERC20Token) XXX_Unmarshal(b []byte) error {
   165  	return m.Unmarshal(b)
   166  }
   167  func (m *ERC20Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   168  	if deterministic {
   169  		return xxx_messageInfo_ERC20Token.Marshal(b, m, deterministic)
   170  	} else {
   171  		b = b[:cap(b)]
   172  		n, err := m.MarshalToSizedBuffer(b)
   173  		if err != nil {
   174  			return nil, err
   175  		}
   176  		return b[:n], nil
   177  	}
   178  }
   179  func (m *ERC20Token) XXX_Merge(src proto.Message) {
   180  	xxx_messageInfo_ERC20Token.Merge(m, src)
   181  }
   182  func (m *ERC20Token) XXX_Size() int {
   183  	return m.Size()
   184  }
   185  func (m *ERC20Token) XXX_DiscardUnknown() {
   186  	xxx_messageInfo_ERC20Token.DiscardUnknown(m)
   187  }
   188  
   189  var xxx_messageInfo_ERC20Token proto.InternalMessageInfo
   190  
   191  func (m *ERC20Token) GetContract() string {
   192  	if m != nil {
   193  		return m.Contract
   194  	}
   195  	return ""
   196  }
   197  
   198  func init() {
   199  	proto.RegisterEnum("injective.peggy.v1.ClaimType", ClaimType_name, ClaimType_value)
   200  	proto.RegisterType((*Attestation)(nil), "injective.peggy.v1.Attestation")
   201  	proto.RegisterType((*ERC20Token)(nil), "injective.peggy.v1.ERC20Token")
   202  }
   203  
   204  func init() {
   205  	proto.RegisterFile("injective/peggy/v1/attestation.proto", fileDescriptor_3022043570947e1e)
   206  }
   207  
   208  var fileDescriptor_3022043570947e1e = []byte{
   209  	// 483 bytes of a gzipped FileDescriptorProto
   210  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xda, 0x40,
   211  	0x14, 0xc7, 0x6d, 0x20, 0x28, 0x5c, 0x16, 0xeb, 0x4a, 0x53, 0xc7, 0x52, 0x1c, 0x2b, 0xea, 0x80,
   212  	0x22, 0xf5, 0x2e, 0x49, 0xd5, 0xad, 0x8b, 0x83, 0x2d, 0xd5, 0x0a, 0x05, 0xe4, 0x38, 0x45, 0xe9,
   213  	0x82, 0x6c, 0x73, 0xb5, 0xdd, 0x60, 0x1f, 0xe2, 0x0e, 0x4b, 0x9e, 0xbb, 0x54, 0x4c, 0xfd, 0x02,
   214  	0xa8, 0x43, 0xbf, 0x4c, 0xc6, 0x8c, 0x55, 0x87, 0xa8, 0x82, 0x2f, 0x52, 0x61, 0x13, 0x4a, 0x93,
   215  	0x74, 0xbb, 0xff, 0xfb, 0xff, 0xde, 0xbb, 0xbf, 0xee, 0x1e, 0x78, 0x19, 0x25, 0x9f, 0x89, 0xcf,
   216  	0xa3, 0x94, 0xe0, 0x11, 0x09, 0x82, 0x0c, 0xa7, 0x27, 0xd8, 0xe5, 0x9c, 0x30, 0xee, 0xf2, 0x88,
   217  	0x26, 0x68, 0x34, 0xa6, 0x9c, 0x42, 0xb8, 0xa6, 0x50, 0x4e, 0xa1, 0xf4, 0x44, 0xa9, 0x07, 0x34,
   218  	0xa0, 0xb9, 0x8d, 0x97, 0xa7, 0x82, 0x54, 0xf6, 0x02, 0x4a, 0x83, 0x21, 0xc1, 0xb9, 0xf2, 0x26,
   219  	0x9f, 0xb0, 0x9b, 0x64, 0x85, 0x75, 0xf8, 0x45, 0x04, 0x3b, 0xfa, 0xdf, 0xd1, 0x50, 0x01, 0xdb,
   220  	0xd4, 0x63, 0x64, 0x9c, 0x92, 0x81, 0x2c, 0x6a, 0x62, 0x63, 0xdb, 0x5e, 0x6b, 0x58, 0x07, 0x5b,
   221  	0x29, 0xe5, 0x84, 0xc9, 0x25, 0xad, 0xdc, 0xa8, 0xd9, 0x85, 0x80, 0xbb, 0xa0, 0x1a, 0x92, 0x28,
   222  	0x08, 0xb9, 0x5c, 0xd6, 0xc4, 0x46, 0xc5, 0x5e, 0x29, 0x78, 0x04, 0xb6, 0xfc, 0xa1, 0x1b, 0xc5,
   223  	0x72, 0x45, 0x13, 0x1b, 0x3b, 0xa7, 0x75, 0x54, 0x84, 0x40, 0xf7, 0x21, 0x90, 0x9e, 0x64, 0x76,
   224  	0x81, 0x1c, 0xf6, 0x01, 0x30, 0xed, 0xe6, 0xe9, 0xb1, 0x43, 0xaf, 0x49, 0x9e, 0xc1, 0xa7, 0x09,
   225  	0x1f, 0xbb, 0x3e, 0xcf, 0x33, 0xd4, 0xec, 0xb5, 0x86, 0x6f, 0x40, 0xd5, 0x8d, 0xe9, 0x24, 0xe1,
   226  	0x72, 0x69, 0xe9, 0x9c, 0xed, 0xdf, 0xdc, 0x1d, 0x08, 0xbf, 0xee, 0x0e, 0x9e, 0xfb, 0x94, 0xc5,
   227  	0x94, 0xb1, 0xc1, 0x35, 0x8a, 0x28, 0x8e, 0x5d, 0x1e, 0x22, 0x2b, 0xe1, 0xf6, 0x0a, 0x3e, 0xfa,
   228  	0x5e, 0x02, 0xb5, 0xe6, 0xf2, 0x2a, 0x27, 0x1b, 0x11, 0x88, 0x00, 0x6c, 0xb6, 0x74, 0xeb, 0x7d,
   229  	0xdf, 0xb9, 0xea, 0x9a, 0xfd, 0xcb, 0xf6, 0x79, 0xbb, 0xd3, 0x6b, 0x4b, 0x82, 0xb2, 0x3b, 0x9d,
   230  	0x69, 0x4f, 0x38, 0x0f, 0x78, 0xc3, 0xec, 0x76, 0x2e, 0x2c, 0x47, 0x12, 0x1f, 0xf1, 0x2b, 0x07,
   231  	0x1e, 0x83, 0x67, 0x1b, 0xd5, 0x9e, 0xe5, 0xbc, 0x33, 0x6c, 0xbd, 0x27, 0x95, 0x94, 0x17, 0xd3,
   232  	0x99, 0xf6, 0x94, 0x05, 0xdf, 0x82, 0xbd, 0x8d, 0x72, 0xfe, 0x16, 0xcb, 0x69, 0xad, 0xce, 0x95,
   233  	0x69, 0x48, 0x65, 0x65, 0x7f, 0x3a, 0xd3, 0xfe, 0x0f, 0x3c, 0xe8, 0xfe, 0xa0, 0xb7, 0x2e, 0x4c,
   234  	0xa7, 0x7f, 0xd9, 0x35, 0x74, 0xc7, 0x34, 0xa4, 0xca, 0xa3, 0xee, 0x7f, 0x01, 0xa5, 0xf2, 0xf5,
   235  	0x87, 0x2a, 0x9c, 0x91, 0x9b, 0xb9, 0x2a, 0xde, 0xce, 0x55, 0xf1, 0xf7, 0x5c, 0x15, 0xbf, 0x2d,
   236  	0x54, 0xe1, 0x76, 0xa1, 0x0a, 0x3f, 0x17, 0xaa, 0xf0, 0xf1, 0x3c, 0x88, 0x78, 0x38, 0xf1, 0x90,
   237  	0x4f, 0x63, 0x6c, 0xdd, 0xaf, 0x5c, 0xcb, 0xf5, 0x18, 0x5e, 0x2f, 0xe0, 0x2b, 0x9f, 0x8e, 0xc9,
   238  	0xa6, 0x0c, 0xdd, 0x28, 0xc1, 0x31, 0x1d, 0x4c, 0x86, 0x84, 0xad, 0x76, 0x98, 0x67, 0x23, 0xc2,
   239  	0xbc, 0x6a, 0xfe, 0xfd, 0xaf, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x9f, 0x86, 0x0b, 0xe3,
   240  	0x02, 0x00, 0x00,
   241  }
   242  
   243  func (m *Attestation) Marshal() (dAtA []byte, err error) {
   244  	size := m.Size()
   245  	dAtA = make([]byte, size)
   246  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   247  	if err != nil {
   248  		return nil, err
   249  	}
   250  	return dAtA[:n], nil
   251  }
   252  
   253  func (m *Attestation) MarshalTo(dAtA []byte) (int, error) {
   254  	size := m.Size()
   255  	return m.MarshalToSizedBuffer(dAtA[:size])
   256  }
   257  
   258  func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   259  	i := len(dAtA)
   260  	_ = i
   261  	var l int
   262  	_ = l
   263  	if m.Claim != nil {
   264  		{
   265  			size, err := m.Claim.MarshalToSizedBuffer(dAtA[:i])
   266  			if err != nil {
   267  				return 0, err
   268  			}
   269  			i -= size
   270  			i = encodeVarintAttestation(dAtA, i, uint64(size))
   271  		}
   272  		i--
   273  		dAtA[i] = 0x22
   274  	}
   275  	if m.Height != 0 {
   276  		i = encodeVarintAttestation(dAtA, i, uint64(m.Height))
   277  		i--
   278  		dAtA[i] = 0x18
   279  	}
   280  	if len(m.Votes) > 0 {
   281  		for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- {
   282  			i -= len(m.Votes[iNdEx])
   283  			copy(dAtA[i:], m.Votes[iNdEx])
   284  			i = encodeVarintAttestation(dAtA, i, uint64(len(m.Votes[iNdEx])))
   285  			i--
   286  			dAtA[i] = 0x12
   287  		}
   288  	}
   289  	if m.Observed {
   290  		i--
   291  		if m.Observed {
   292  			dAtA[i] = 1
   293  		} else {
   294  			dAtA[i] = 0
   295  		}
   296  		i--
   297  		dAtA[i] = 0x8
   298  	}
   299  	return len(dAtA) - i, nil
   300  }
   301  
   302  func (m *ERC20Token) Marshal() (dAtA []byte, err error) {
   303  	size := m.Size()
   304  	dAtA = make([]byte, size)
   305  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   306  	if err != nil {
   307  		return nil, err
   308  	}
   309  	return dAtA[:n], nil
   310  }
   311  
   312  func (m *ERC20Token) MarshalTo(dAtA []byte) (int, error) {
   313  	size := m.Size()
   314  	return m.MarshalToSizedBuffer(dAtA[:size])
   315  }
   316  
   317  func (m *ERC20Token) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   318  	i := len(dAtA)
   319  	_ = i
   320  	var l int
   321  	_ = l
   322  	{
   323  		size := m.Amount.Size()
   324  		i -= size
   325  		if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil {
   326  			return 0, err
   327  		}
   328  		i = encodeVarintAttestation(dAtA, i, uint64(size))
   329  	}
   330  	i--
   331  	dAtA[i] = 0x12
   332  	if len(m.Contract) > 0 {
   333  		i -= len(m.Contract)
   334  		copy(dAtA[i:], m.Contract)
   335  		i = encodeVarintAttestation(dAtA, i, uint64(len(m.Contract)))
   336  		i--
   337  		dAtA[i] = 0xa
   338  	}
   339  	return len(dAtA) - i, nil
   340  }
   341  
   342  func encodeVarintAttestation(dAtA []byte, offset int, v uint64) int {
   343  	offset -= sovAttestation(v)
   344  	base := offset
   345  	for v >= 1<<7 {
   346  		dAtA[offset] = uint8(v&0x7f | 0x80)
   347  		v >>= 7
   348  		offset++
   349  	}
   350  	dAtA[offset] = uint8(v)
   351  	return base
   352  }
   353  func (m *Attestation) Size() (n int) {
   354  	if m == nil {
   355  		return 0
   356  	}
   357  	var l int
   358  	_ = l
   359  	if m.Observed {
   360  		n += 2
   361  	}
   362  	if len(m.Votes) > 0 {
   363  		for _, s := range m.Votes {
   364  			l = len(s)
   365  			n += 1 + l + sovAttestation(uint64(l))
   366  		}
   367  	}
   368  	if m.Height != 0 {
   369  		n += 1 + sovAttestation(uint64(m.Height))
   370  	}
   371  	if m.Claim != nil {
   372  		l = m.Claim.Size()
   373  		n += 1 + l + sovAttestation(uint64(l))
   374  	}
   375  	return n
   376  }
   377  
   378  func (m *ERC20Token) Size() (n int) {
   379  	if m == nil {
   380  		return 0
   381  	}
   382  	var l int
   383  	_ = l
   384  	l = len(m.Contract)
   385  	if l > 0 {
   386  		n += 1 + l + sovAttestation(uint64(l))
   387  	}
   388  	l = m.Amount.Size()
   389  	n += 1 + l + sovAttestation(uint64(l))
   390  	return n
   391  }
   392  
   393  func sovAttestation(x uint64) (n int) {
   394  	return (math_bits.Len64(x|1) + 6) / 7
   395  }
   396  func sozAttestation(x uint64) (n int) {
   397  	return sovAttestation(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   398  }
   399  func (m *Attestation) Unmarshal(dAtA []byte) error {
   400  	l := len(dAtA)
   401  	iNdEx := 0
   402  	for iNdEx < l {
   403  		preIndex := iNdEx
   404  		var wire uint64
   405  		for shift := uint(0); ; shift += 7 {
   406  			if shift >= 64 {
   407  				return ErrIntOverflowAttestation
   408  			}
   409  			if iNdEx >= l {
   410  				return io.ErrUnexpectedEOF
   411  			}
   412  			b := dAtA[iNdEx]
   413  			iNdEx++
   414  			wire |= uint64(b&0x7F) << shift
   415  			if b < 0x80 {
   416  				break
   417  			}
   418  		}
   419  		fieldNum := int32(wire >> 3)
   420  		wireType := int(wire & 0x7)
   421  		if wireType == 4 {
   422  			return fmt.Errorf("proto: Attestation: wiretype end group for non-group")
   423  		}
   424  		if fieldNum <= 0 {
   425  			return fmt.Errorf("proto: Attestation: illegal tag %d (wire type %d)", fieldNum, wire)
   426  		}
   427  		switch fieldNum {
   428  		case 1:
   429  			if wireType != 0 {
   430  				return fmt.Errorf("proto: wrong wireType = %d for field Observed", wireType)
   431  			}
   432  			var v int
   433  			for shift := uint(0); ; shift += 7 {
   434  				if shift >= 64 {
   435  					return ErrIntOverflowAttestation
   436  				}
   437  				if iNdEx >= l {
   438  					return io.ErrUnexpectedEOF
   439  				}
   440  				b := dAtA[iNdEx]
   441  				iNdEx++
   442  				v |= int(b&0x7F) << shift
   443  				if b < 0x80 {
   444  					break
   445  				}
   446  			}
   447  			m.Observed = bool(v != 0)
   448  		case 2:
   449  			if wireType != 2 {
   450  				return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType)
   451  			}
   452  			var stringLen uint64
   453  			for shift := uint(0); ; shift += 7 {
   454  				if shift >= 64 {
   455  					return ErrIntOverflowAttestation
   456  				}
   457  				if iNdEx >= l {
   458  					return io.ErrUnexpectedEOF
   459  				}
   460  				b := dAtA[iNdEx]
   461  				iNdEx++
   462  				stringLen |= uint64(b&0x7F) << shift
   463  				if b < 0x80 {
   464  					break
   465  				}
   466  			}
   467  			intStringLen := int(stringLen)
   468  			if intStringLen < 0 {
   469  				return ErrInvalidLengthAttestation
   470  			}
   471  			postIndex := iNdEx + intStringLen
   472  			if postIndex < 0 {
   473  				return ErrInvalidLengthAttestation
   474  			}
   475  			if postIndex > l {
   476  				return io.ErrUnexpectedEOF
   477  			}
   478  			m.Votes = append(m.Votes, string(dAtA[iNdEx:postIndex]))
   479  			iNdEx = postIndex
   480  		case 3:
   481  			if wireType != 0 {
   482  				return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
   483  			}
   484  			m.Height = 0
   485  			for shift := uint(0); ; shift += 7 {
   486  				if shift >= 64 {
   487  					return ErrIntOverflowAttestation
   488  				}
   489  				if iNdEx >= l {
   490  					return io.ErrUnexpectedEOF
   491  				}
   492  				b := dAtA[iNdEx]
   493  				iNdEx++
   494  				m.Height |= uint64(b&0x7F) << shift
   495  				if b < 0x80 {
   496  					break
   497  				}
   498  			}
   499  		case 4:
   500  			if wireType != 2 {
   501  				return fmt.Errorf("proto: wrong wireType = %d for field Claim", wireType)
   502  			}
   503  			var msglen int
   504  			for shift := uint(0); ; shift += 7 {
   505  				if shift >= 64 {
   506  					return ErrIntOverflowAttestation
   507  				}
   508  				if iNdEx >= l {
   509  					return io.ErrUnexpectedEOF
   510  				}
   511  				b := dAtA[iNdEx]
   512  				iNdEx++
   513  				msglen |= int(b&0x7F) << shift
   514  				if b < 0x80 {
   515  					break
   516  				}
   517  			}
   518  			if msglen < 0 {
   519  				return ErrInvalidLengthAttestation
   520  			}
   521  			postIndex := iNdEx + msglen
   522  			if postIndex < 0 {
   523  				return ErrInvalidLengthAttestation
   524  			}
   525  			if postIndex > l {
   526  				return io.ErrUnexpectedEOF
   527  			}
   528  			if m.Claim == nil {
   529  				m.Claim = &types.Any{}
   530  			}
   531  			if err := m.Claim.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   532  				return err
   533  			}
   534  			iNdEx = postIndex
   535  		default:
   536  			iNdEx = preIndex
   537  			skippy, err := skipAttestation(dAtA[iNdEx:])
   538  			if err != nil {
   539  				return err
   540  			}
   541  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   542  				return ErrInvalidLengthAttestation
   543  			}
   544  			if (iNdEx + skippy) > l {
   545  				return io.ErrUnexpectedEOF
   546  			}
   547  			iNdEx += skippy
   548  		}
   549  	}
   550  
   551  	if iNdEx > l {
   552  		return io.ErrUnexpectedEOF
   553  	}
   554  	return nil
   555  }
   556  func (m *ERC20Token) Unmarshal(dAtA []byte) error {
   557  	l := len(dAtA)
   558  	iNdEx := 0
   559  	for iNdEx < l {
   560  		preIndex := iNdEx
   561  		var wire uint64
   562  		for shift := uint(0); ; shift += 7 {
   563  			if shift >= 64 {
   564  				return ErrIntOverflowAttestation
   565  			}
   566  			if iNdEx >= l {
   567  				return io.ErrUnexpectedEOF
   568  			}
   569  			b := dAtA[iNdEx]
   570  			iNdEx++
   571  			wire |= uint64(b&0x7F) << shift
   572  			if b < 0x80 {
   573  				break
   574  			}
   575  		}
   576  		fieldNum := int32(wire >> 3)
   577  		wireType := int(wire & 0x7)
   578  		if wireType == 4 {
   579  			return fmt.Errorf("proto: ERC20Token: wiretype end group for non-group")
   580  		}
   581  		if fieldNum <= 0 {
   582  			return fmt.Errorf("proto: ERC20Token: illegal tag %d (wire type %d)", fieldNum, wire)
   583  		}
   584  		switch fieldNum {
   585  		case 1:
   586  			if wireType != 2 {
   587  				return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType)
   588  			}
   589  			var stringLen uint64
   590  			for shift := uint(0); ; shift += 7 {
   591  				if shift >= 64 {
   592  					return ErrIntOverflowAttestation
   593  				}
   594  				if iNdEx >= l {
   595  					return io.ErrUnexpectedEOF
   596  				}
   597  				b := dAtA[iNdEx]
   598  				iNdEx++
   599  				stringLen |= uint64(b&0x7F) << shift
   600  				if b < 0x80 {
   601  					break
   602  				}
   603  			}
   604  			intStringLen := int(stringLen)
   605  			if intStringLen < 0 {
   606  				return ErrInvalidLengthAttestation
   607  			}
   608  			postIndex := iNdEx + intStringLen
   609  			if postIndex < 0 {
   610  				return ErrInvalidLengthAttestation
   611  			}
   612  			if postIndex > l {
   613  				return io.ErrUnexpectedEOF
   614  			}
   615  			m.Contract = string(dAtA[iNdEx:postIndex])
   616  			iNdEx = postIndex
   617  		case 2:
   618  			if wireType != 2 {
   619  				return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
   620  			}
   621  			var stringLen uint64
   622  			for shift := uint(0); ; shift += 7 {
   623  				if shift >= 64 {
   624  					return ErrIntOverflowAttestation
   625  				}
   626  				if iNdEx >= l {
   627  					return io.ErrUnexpectedEOF
   628  				}
   629  				b := dAtA[iNdEx]
   630  				iNdEx++
   631  				stringLen |= uint64(b&0x7F) << shift
   632  				if b < 0x80 {
   633  					break
   634  				}
   635  			}
   636  			intStringLen := int(stringLen)
   637  			if intStringLen < 0 {
   638  				return ErrInvalidLengthAttestation
   639  			}
   640  			postIndex := iNdEx + intStringLen
   641  			if postIndex < 0 {
   642  				return ErrInvalidLengthAttestation
   643  			}
   644  			if postIndex > l {
   645  				return io.ErrUnexpectedEOF
   646  			}
   647  			if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   648  				return err
   649  			}
   650  			iNdEx = postIndex
   651  		default:
   652  			iNdEx = preIndex
   653  			skippy, err := skipAttestation(dAtA[iNdEx:])
   654  			if err != nil {
   655  				return err
   656  			}
   657  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   658  				return ErrInvalidLengthAttestation
   659  			}
   660  			if (iNdEx + skippy) > l {
   661  				return io.ErrUnexpectedEOF
   662  			}
   663  			iNdEx += skippy
   664  		}
   665  	}
   666  
   667  	if iNdEx > l {
   668  		return io.ErrUnexpectedEOF
   669  	}
   670  	return nil
   671  }
   672  func skipAttestation(dAtA []byte) (n int, err error) {
   673  	l := len(dAtA)
   674  	iNdEx := 0
   675  	depth := 0
   676  	for iNdEx < l {
   677  		var wire uint64
   678  		for shift := uint(0); ; shift += 7 {
   679  			if shift >= 64 {
   680  				return 0, ErrIntOverflowAttestation
   681  			}
   682  			if iNdEx >= l {
   683  				return 0, io.ErrUnexpectedEOF
   684  			}
   685  			b := dAtA[iNdEx]
   686  			iNdEx++
   687  			wire |= (uint64(b) & 0x7F) << shift
   688  			if b < 0x80 {
   689  				break
   690  			}
   691  		}
   692  		wireType := int(wire & 0x7)
   693  		switch wireType {
   694  		case 0:
   695  			for shift := uint(0); ; shift += 7 {
   696  				if shift >= 64 {
   697  					return 0, ErrIntOverflowAttestation
   698  				}
   699  				if iNdEx >= l {
   700  					return 0, io.ErrUnexpectedEOF
   701  				}
   702  				iNdEx++
   703  				if dAtA[iNdEx-1] < 0x80 {
   704  					break
   705  				}
   706  			}
   707  		case 1:
   708  			iNdEx += 8
   709  		case 2:
   710  			var length int
   711  			for shift := uint(0); ; shift += 7 {
   712  				if shift >= 64 {
   713  					return 0, ErrIntOverflowAttestation
   714  				}
   715  				if iNdEx >= l {
   716  					return 0, io.ErrUnexpectedEOF
   717  				}
   718  				b := dAtA[iNdEx]
   719  				iNdEx++
   720  				length |= (int(b) & 0x7F) << shift
   721  				if b < 0x80 {
   722  					break
   723  				}
   724  			}
   725  			if length < 0 {
   726  				return 0, ErrInvalidLengthAttestation
   727  			}
   728  			iNdEx += length
   729  		case 3:
   730  			depth++
   731  		case 4:
   732  			if depth == 0 {
   733  				return 0, ErrUnexpectedEndOfGroupAttestation
   734  			}
   735  			depth--
   736  		case 5:
   737  			iNdEx += 4
   738  		default:
   739  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   740  		}
   741  		if iNdEx < 0 {
   742  			return 0, ErrInvalidLengthAttestation
   743  		}
   744  		if depth == 0 {
   745  			return iNdEx, nil
   746  		}
   747  	}
   748  	return 0, io.ErrUnexpectedEOF
   749  }
   750  
   751  var (
   752  	ErrInvalidLengthAttestation        = fmt.Errorf("proto: negative length found during unmarshaling")
   753  	ErrIntOverflowAttestation          = fmt.Errorf("proto: integer overflow")
   754  	ErrUnexpectedEndOfGroupAttestation = fmt.Errorf("proto: unexpected end of group")
   755  )