forked from cerc-io/laconicd
Prathamesh Musale
213c390c37
Part of https://www.notion.so/Rename-laconic2d-to-laconicd-9028d0c020d24d1288e92ebcb773d7a7 Co-authored-by: neeraj <neeraj.rtly@gmail.com> Reviewed-on: cerc-io/laconic2d#26 Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to> Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
621 lines
15 KiB
Go
621 lines
15 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: cerc/bond/v1/bond.proto
|
|
|
|
package bond
|
|
|
|
import (
|
|
fmt "fmt"
|
|
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
|
types "github.com/cosmos/cosmos-sdk/types"
|
|
_ "github.com/cosmos/gogoproto/gogoproto"
|
|
proto "github.com/cosmos/gogoproto/proto"
|
|
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
|
|
|
|
// Params defines the parameters of the bond module.
|
|
type Params struct {
|
|
// max_bond_amount is maximum amount to bond
|
|
MaxBondAmount types.Coin `protobuf:"bytes,1,opt,name=max_bond_amount,json=maxBondAmount,proto3" json:"max_bond_amount" json:"max_bond_amount" yaml:"max_bond_amount"`
|
|
}
|
|
|
|
func (m *Params) Reset() { *m = Params{} }
|
|
func (m *Params) String() string { return proto.CompactTextString(m) }
|
|
func (*Params) ProtoMessage() {}
|
|
func (*Params) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_a3e353c952ca4df9, []int{0}
|
|
}
|
|
func (m *Params) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Params.Merge(m, src)
|
|
}
|
|
func (m *Params) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Params) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Params.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Params proto.InternalMessageInfo
|
|
|
|
func (m *Params) GetMaxBondAmount() types.Coin {
|
|
if m != nil {
|
|
return m.MaxBondAmount
|
|
}
|
|
return types.Coin{}
|
|
}
|
|
|
|
// Bond represents funds deposited by an account for record rent payments.
|
|
type Bond struct {
|
|
// id is unique identifier of the bond
|
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
// owner of the bond
|
|
Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
|
|
// balance of the bond
|
|
Balance github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=balance,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balance" json:"balance" yaml:"balance"`
|
|
}
|
|
|
|
func (m *Bond) Reset() { *m = Bond{} }
|
|
func (m *Bond) String() string { return proto.CompactTextString(m) }
|
|
func (*Bond) ProtoMessage() {}
|
|
func (*Bond) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_a3e353c952ca4df9, []int{1}
|
|
}
|
|
func (m *Bond) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Bond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Bond.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 *Bond) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Bond.Merge(m, src)
|
|
}
|
|
func (m *Bond) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Bond) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Bond.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Bond proto.InternalMessageInfo
|
|
|
|
func (m *Bond) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Bond) GetOwner() string {
|
|
if m != nil {
|
|
return m.Owner
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Bond) GetBalance() github_com_cosmos_cosmos_sdk_types.Coins {
|
|
if m != nil {
|
|
return m.Balance
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Params)(nil), "cerc.bond.v1.Params")
|
|
proto.RegisterType((*Bond)(nil), "cerc.bond.v1.Bond")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("cerc/bond/v1/bond.proto", fileDescriptor_a3e353c952ca4df9) }
|
|
|
|
var fileDescriptor_a3e353c952ca4df9 = []byte{
|
|
// 342 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0xbd, 0x4e, 0xf3, 0x30,
|
|
0x14, 0x8d, 0xdb, 0xef, 0x2b, 0x22, 0xfc, 0x49, 0x51, 0x25, 0x4a, 0x25, 0xd2, 0x2a, 0x53, 0x97,
|
|
0xda, 0x0a, 0x88, 0x05, 0xb1, 0x50, 0x5e, 0x00, 0x3a, 0xb2, 0x54, 0x8e, 0x13, 0x05, 0x43, 0xed,
|
|
0x5b, 0xc5, 0x6e, 0x48, 0x57, 0x06, 0x66, 0x9e, 0x83, 0x9d, 0x77, 0xe8, 0xd8, 0x91, 0xa9, 0xa0,
|
|
0xf6, 0x0d, 0x78, 0x02, 0x14, 0x3b, 0x5d, 0x40, 0x62, 0xba, 0x39, 0xe7, 0xe4, 0x9e, 0x7b, 0xe4,
|
|
0xe3, 0x1e, 0xb2, 0x24, 0x63, 0x24, 0x02, 0x19, 0x93, 0x3c, 0x34, 0x13, 0x4f, 0x32, 0xd0, 0xe0,
|
|
0xed, 0x96, 0x02, 0x36, 0x44, 0x1e, 0xb6, 0x9b, 0x29, 0xa4, 0x60, 0x04, 0x52, 0x7e, 0xd9, 0x7f,
|
|
0xda, 0x3e, 0x03, 0x25, 0x40, 0x91, 0x88, 0xaa, 0x84, 0xe4, 0x61, 0x94, 0x68, 0x1a, 0x12, 0x06,
|
|
0x5c, 0x5a, 0x3d, 0x78, 0x42, 0x6e, 0xe3, 0x9a, 0x66, 0x54, 0x28, 0xaf, 0x70, 0x0f, 0x04, 0x2d,
|
|
0x46, 0xa5, 0xdf, 0x88, 0x0a, 0x98, 0x4a, 0xdd, 0x42, 0x5d, 0xd4, 0xdb, 0x39, 0x39, 0xc2, 0xd6,
|
|
0x04, 0x97, 0x26, 0xb8, 0x32, 0xc1, 0x57, 0xc0, 0xe5, 0xe0, 0x6c, 0xbe, 0xec, 0x38, 0x5f, 0xcb,
|
|
0x4e, 0xff, 0x5e, 0x81, 0x3c, 0x0f, 0x7e, 0xec, 0x07, 0xdd, 0x19, 0x15, 0xe3, 0xdf, 0xf4, 0x70,
|
|
0x4f, 0xd0, 0x62, 0x00, 0x32, 0xbe, 0xb4, 0xf8, 0x0d, 0xb9, 0xff, 0x4a, 0xe8, 0xed, 0xbb, 0x35,
|
|
0x1e, 0x9b, 0xab, 0xdb, 0xc3, 0x1a, 0x8f, 0xbd, 0xa6, 0xfb, 0x1f, 0x1e, 0x65, 0x92, 0xb5, 0x6a,
|
|
0x86, 0xb2, 0xc0, 0x7b, 0x46, 0xee, 0x56, 0x44, 0xc7, 0x54, 0xb2, 0xa4, 0x55, 0xef, 0xd6, 0xff,
|
|
0x4e, 0x78, 0x53, 0x25, 0x3c, 0xb6, 0x09, 0xab, 0xbd, 0x4d, 0xb2, 0x0d, 0x7c, 0xfd, 0xe8, 0xf4,
|
|
0x52, 0xae, 0xef, 0xa6, 0x11, 0x66, 0x20, 0x48, 0xf5, 0x68, 0x76, 0xf4, 0x55, 0xfc, 0x40, 0xf4,
|
|
0x6c, 0x92, 0x28, 0xe3, 0xa8, 0x86, 0x9b, 0xe3, 0x83, 0x8b, 0xf9, 0xca, 0x47, 0x8b, 0x95, 0x8f,
|
|
0x3e, 0x57, 0x3e, 0x7a, 0x59, 0xfb, 0xce, 0x62, 0xed, 0x3b, 0xef, 0x6b, 0xdf, 0xb9, 0x0d, 0x52,
|
|
0xae, 0x71, 0x1e, 0x47, 0x58, 0x03, 0x29, 0x5b, 0xea, 0x73, 0x20, 0x63, 0xca, 0x40, 0x72, 0x16,
|
|
0x93, 0xc2, 0x94, 0x18, 0x35, 0x4c, 0x03, 0xa7, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x74, 0x4f,
|
|
0x79, 0x5a, 0xe0, 0x01, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
{
|
|
size, err := m.MaxBondAmount.MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintBond(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Bond) 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 *Bond) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Bond) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Balance) > 0 {
|
|
for iNdEx := len(m.Balance) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Balance[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintBond(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
}
|
|
if len(m.Owner) > 0 {
|
|
i -= len(m.Owner)
|
|
copy(dAtA[i:], m.Owner)
|
|
i = encodeVarintBond(dAtA, i, uint64(len(m.Owner)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if len(m.Id) > 0 {
|
|
i -= len(m.Id)
|
|
copy(dAtA[i:], m.Id)
|
|
i = encodeVarintBond(dAtA, i, uint64(len(m.Id)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintBond(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovBond(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *Params) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = m.MaxBondAmount.Size()
|
|
n += 1 + l + sovBond(uint64(l))
|
|
return n
|
|
}
|
|
|
|
func (m *Bond) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Id)
|
|
if l > 0 {
|
|
n += 1 + l + sovBond(uint64(l))
|
|
}
|
|
l = len(m.Owner)
|
|
if l > 0 {
|
|
n += 1 + l + sovBond(uint64(l))
|
|
}
|
|
if len(m.Balance) > 0 {
|
|
for _, e := range m.Balance {
|
|
l = e.Size()
|
|
n += 1 + l + sovBond(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovBond(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozBond(x uint64) (n int) {
|
|
return sovBond(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *Params) 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 ErrIntOverflowBond
|
|
}
|
|
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: Params: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field MaxBondAmount", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowBond
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
if err := m.MaxBondAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipBond(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *Bond) 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 ErrIntOverflowBond
|
|
}
|
|
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: Bond: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Bond: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowBond
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Id = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowBond
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
stringLen |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
intStringLen := int(stringLen)
|
|
if intStringLen < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Owner = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowBond
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Balance = append(m.Balance, types.Coin{})
|
|
if err := m.Balance[len(m.Balance)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipBond(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthBond
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipBond(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, ErrIntOverflowBond
|
|
}
|
|
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, ErrIntOverflowBond
|
|
}
|
|
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, ErrIntOverflowBond
|
|
}
|
|
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, ErrInvalidLengthBond
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupBond
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthBond
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthBond = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowBond = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupBond = fmt.Errorf("proto: unexpected end of group")
|
|
)
|