Commit 3ac49d2d authored by harrylee's avatar harrylee

add result type

parent 58cc8183
Pipeline #8459 failed with stages
......@@ -3,6 +3,8 @@ package pb
import (
"crypto/sha256"
"fmt"
"strconv"
"strings"
"github.com/meshplus/bitxhub-kit/types"
)
......@@ -40,3 +42,68 @@ func (m *IBTP) Category() IBTP_Category {
}
return IBTP_UNKNOWN
}
func (m *IBTP) ServicePair() string {
return fmt.Sprintf("%s-%s", m.From, m.To)
}
// ParseFrom should be called after CheckServiceID is called
func (m *IBTP) ParseFrom() (string, string, string) {
bxhID, chainID, serviceID, _ := ParseFullServiceID(m.From)
return bxhID, chainID, serviceID
}
// ParseTo should be called after CheckServiceID is called
func (m *IBTP) ParseTo() (string, string, string) {
bxhID, chainID, serviceID, _ := ParseFullServiceID(m.To)
return bxhID, chainID, serviceID
}
func (m *IBTP) CheckServiceID() error {
_, _, _, err := ParseFullServiceID(m.From)
if err != nil {
return err
}
_, _, _, err = ParseFullServiceID(m.To)
return err
}
func ParseFullServiceID(id string) (string, string, string, error) {
splits := strings.Split(id, ":")
if len(splits) != 3 {
return "", "", "", fmt.Errorf("invalid full service ID: %s", id)
}
return splits[0], splits[1], splits[2], nil
}
func ParseServicePair(servicePair string) (string, string, error) {
splits := strings.Split(servicePair, "-")
if len(splits) != 2 {
return "", "", fmt.Errorf("invalid service pair: %s", servicePair)
}
return splits[0], splits[1], nil
}
func ParseIBTPID(id string) (string, string, uint64, error) {
splits := strings.Split(id, "-")
if len(splits) != 3 {
return "", "", 0, fmt.Errorf("invalid IBTP ID: %s", id)
}
index, err := strconv.Atoi(splits[2])
if err != nil {
return "", "", 0, fmt.Errorf("invalid IBTP ID: %s", id)
}
return splits[0], splits[1], uint64(index), nil
}
func GenServicePair(from, to string) string {
return fmt.Sprintf("%s-%s", from, to)
}
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ibtp.proto
package pb
import (
fmt "fmt"
io "io"
proto "github.com/golang/protobuf/proto"
math "math"
math_bits "math/bits"
proto "github.com/gogo/protobuf/proto"
)
// 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
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type IBTP_Type int32
......@@ -108,44 +103,31 @@ type IBTP struct {
// Message version
Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"`
// Self-defined fields used by app-chain
Extra []byte `protobuf:"bytes,10,opt,name=extra,proto3" json:"extra,omitempty"`
Extra []byte `protobuf:"bytes,10,opt,name=extra,proto3" json:"extra,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IBTP) Reset() { *m = IBTP{} }
func (m *IBTP) Reset() { *m = IBTP{} }
func (m *IBTP) String() string { return proto.CompactTextString(m) }
func (*IBTP) ProtoMessage() {}
func (*IBTP) ProtoMessage() {}
func (*IBTP) Descriptor() ([]byte, []int) {
return fileDescriptor_7576a0a5bf0190a3, []int{0}
}
func (m *IBTP) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_IBTP.Unmarshal(m, b)
}
func (m *IBTP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_IBTP.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_IBTP.Marshal(b, m, deterministic)
}
func (m *IBTP) XXX_Merge(src proto.Message) {
xxx_messageInfo_IBTP.Merge(m, src)
}
func (m *IBTP) XXX_Size() int {
return m.Size()
return xxx_messageInfo_IBTP.Size(m)
}
func (m *IBTP) XXX_DiscardUnknown() {
xxx_messageInfo_IBTP.DiscardUnknown(m)
}
......@@ -223,45 +205,32 @@ func (m *IBTP) GetExtra() []byte {
}
type Payload struct {
Encrypted bool `protobuf:"varint,1,opt,name=encrypted,proto3" json:"encrypted,omitempty"`
Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
Encrypted bool `protobuf:"varint,1,opt,name=encrypted,proto3" json:"encrypted,omitempty"`
Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Payload) Reset() { *m = Payload{} }
func (m *Payload) Reset() { *m = Payload{} }
func (m *Payload) String() string { return proto.CompactTextString(m) }
func (*Payload) ProtoMessage() {}
func (*Payload) ProtoMessage() {}
func (*Payload) Descriptor() ([]byte, []int) {
return fileDescriptor_7576a0a5bf0190a3, []int{1}
}
func (m *Payload) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_Payload.Unmarshal(m, b)
}
func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Payload.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_Payload.Marshal(b, m, deterministic)
}
func (m *Payload) XXX_Merge(src proto.Message) {
xxx_messageInfo_Payload.Merge(m, src)
}
func (m *Payload) XXX_Size() int {
return m.Size()
return xxx_messageInfo_Payload.Size(m)
}
func (m *Payload) XXX_DiscardUnknown() {
xxx_messageInfo_Payload.DiscardUnknown(m)
}
......@@ -283,51 +252,38 @@ func (m *Payload) GetContent() []byte {
}
type Content struct {
SrcContractId string `protobuf:"bytes,1,opt,name=src_contract_id,json=srcContractId,proto3" json:"src_contract_id,omitempty"`
DstContractId string `protobuf:"bytes,2,opt,name=dst_contract_id,json=dstContractId,proto3" json:"dst_contract_id,omitempty"`
Func string `protobuf:"bytes,3,opt,name=func,proto3" json:"func,omitempty"`
Args [][]byte `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"`
Callback string `protobuf:"bytes,5,opt,name=callback,proto3" json:"callback,omitempty"`
ArgsCb [][]byte `protobuf:"bytes,6,rep,name=argsCb,proto3" json:"argsCb,omitempty"`
Rollback string `protobuf:"bytes,7,opt,name=rollback,proto3" json:"rollback,omitempty"`
ArgsRb [][]byte `protobuf:"bytes,8,rep,name=argsRb,proto3" json:"argsRb,omitempty"`
}
func (m *Content) Reset() { *m = Content{} }
SrcContractId string `protobuf:"bytes,1,opt,name=src_contract_id,json=srcContractId,proto3" json:"src_contract_id,omitempty"`
DstContractId string `protobuf:"bytes,2,opt,name=dst_contract_id,json=dstContractId,proto3" json:"dst_contract_id,omitempty"`
Func string `protobuf:"bytes,3,opt,name=func,proto3" json:"func,omitempty"`
Args [][]byte `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"`
Callback string `protobuf:"bytes,5,opt,name=callback,proto3" json:"callback,omitempty"`
ArgsCb [][]byte `protobuf:"bytes,6,rep,name=argsCb,proto3" json:"argsCb,omitempty"`
Rollback string `protobuf:"bytes,7,opt,name=rollback,proto3" json:"rollback,omitempty"`
ArgsRb [][]byte `protobuf:"bytes,8,rep,name=argsRb,proto3" json:"argsRb,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Content) Reset() { *m = Content{} }
func (m *Content) String() string { return proto.CompactTextString(m) }
func (*Content) ProtoMessage() {}
func (*Content) ProtoMessage() {}
func (*Content) Descriptor() ([]byte, []int) {
return fileDescriptor_7576a0a5bf0190a3, []int{2}
}
func (m *Content) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_Content.Unmarshal(m, b)
}
func (m *Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Content.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_Content.Marshal(b, m, deterministic)
}
func (m *Content) XXX_Merge(src proto.Message) {
xxx_messageInfo_Content.Merge(m, src)
}
func (m *Content) XXX_Size() int {
return m.Size()
return xxx_messageInfo_Content.Size(m)
}
func (m *Content) XXX_DiscardUnknown() {
xxx_messageInfo_Content.DiscardUnknown(m)
}
......@@ -391,44 +347,31 @@ func (m *Content) GetArgsRb() [][]byte {
}
type IBTPs struct {
Ibtps []*IBTP `protobuf:"bytes,1,rep,name=ibtps,proto3" json:"ibtps,omitempty"`
Ibtps []*IBTP `protobuf:"bytes,1,rep,name=ibtps,proto3" json:"ibtps,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IBTPs) Reset() { *m = IBTPs{} }
func (m *IBTPs) Reset() { *m = IBTPs{} }
func (m *IBTPs) String() string { return proto.CompactTextString(m) }
func (*IBTPs) ProtoMessage() {}
func (*IBTPs) ProtoMessage() {}
func (*IBTPs) Descriptor() ([]byte, []int) {
return fileDescriptor_7576a0a5bf0190a3, []int{3}
}
func (m *IBTPs) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
return xxx_messageInfo_IBTPs.Unmarshal(m, b)
}
func (m *IBTPs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_IBTPs.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
return xxx_messageInfo_IBTPs.Marshal(b, m, deterministic)
}
func (m *IBTPs) XXX_Merge(src proto.Message) {
xxx_messageInfo_IBTPs.Merge(m, src)
}
func (m *IBTPs) XXX_Size() int {
return m.Size()
return xxx_messageInfo_IBTPs.Size(m)
}
func (m *IBTPs) XXX_DiscardUnknown() {
xxx_messageInfo_IBTPs.DiscardUnknown(m)
}
......@@ -442,1374 +385,93 @@ func (m *IBTPs) GetIbtps() []*IBTP {
return nil
}
func init() {
proto.RegisterEnum("pb.IBTP_Type", IBTP_Type_name, IBTP_Type_value)
proto.RegisterEnum("pb.IBTP_Category", IBTP_Category_name, IBTP_Category_value)
proto.RegisterType((*IBTP)(nil), "pb.IBTP")
proto.RegisterType((*Payload)(nil), "pb.payload")
proto.RegisterType((*Content)(nil), "pb.content")
proto.RegisterType((*IBTPs)(nil), "pb.IBTPs")
type Result struct {
Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func init() { proto.RegisterFile("ibtp.proto", fileDescriptor_7576a0a5bf0190a3) }
var fileDescriptor_7576a0a5bf0190a3 = []byte{
// 551 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x53, 0xcd, 0x6e, 0xd3, 0x4c,
0x14, 0xcd, 0xc4, 0x4e, 0xe2, 0xdc, 0xa4, 0xad, 0x35, 0xad, 0x3e, 0x8d, 0xaa, 0x4f, 0x96, 0xf1,
0x02, 0xcc, 0x26, 0x8b, 0x80, 0xd8, 0xa7, 0x96, 0x11, 0x56, 0x8b, 0x5b, 0xc6, 0x89, 0x58, 0x56,
0xfe, 0x6b, 0x64, 0xd1, 0x7a, 0x46, 0xe3, 0x29, 0x22, 0x6f, 0xc1, 0x53, 0xf0, 0x2c, 0x2c, 0xbb,
0x64, 0x89, 0xda, 0x15, 0x6f, 0x81, 0x66, 0x1c, 0x27, 0x65, 0x37, 0xe7, 0xdc, 0x73, 0xee, 0xf5,
0xcc, 0x3d, 0x06, 0xa8, 0x32, 0xc9, 0x67, 0x5c, 0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 0x84, 0x31, 0xdd, 0x61, 0xfc, 0x1f, 0x0c,
0x95, 0x26, 0xc8, 0xc8, 0x50, 0x3b, 0xb6, 0x48, 0x79, 0x04, 0xdb, 0x7a, 0x46, 0xad, 0xa7, 0xc3,
0x9d, 0x87, 0x66, 0xc4, 0xda, 0x7b, 0x68, 0xe6, 0xbd, 0x82, 0x81, 0x0a, 0x61, 0x83, 0x1d, 0x18,
0xa8, 0xfc, 0x37, 0x04, 0xb9, 0x86, 0x3f, 0x99, 0x5b, 0x5d, 0x3c, 0x69, 0x4b, 0x9f, 0x91, 0x9f,
0x8f, 0x0e, 0x7a, 0x78, 0x74, 0xd0, 0xef, 0x47, 0x07, 0x7d, 0x7f, 0x72, 0x7a, 0x0f, 0x4f, 0x4e,
0xef, 0xd7, 0x93, 0xd3, 0xcb, 0x86, 0xfa, 0x0f, 0x79, 0xf3, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf4,
0x8e, 0xc3, 0xc2, 0x40, 0x03, 0x00, 0x00,
func (m *Result) Reset() { *m = Result{} }
func (m *Result) String() string { return proto.CompactTextString(m) }
func (*Result) ProtoMessage() {}
func (*Result) Descriptor() ([]byte, []int) {
return fileDescriptor_7576a0a5bf0190a3, []int{4}
}
func (m *IBTP) 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 *Result) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Result.Unmarshal(m, b)
}
func (m *IBTP) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Result.Marshal(b, m, deterministic)
}
func (m *IBTP) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Extra) > 0 {
i -= len(m.Extra)
copy(dAtA[i:], m.Extra)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Extra)))
i--
dAtA[i] = 0x52
}
if len(m.Version) > 0 {
i -= len(m.Version)
copy(dAtA[i:], m.Version)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Version)))
i--
dAtA[i] = 0x4a
}
if m.Group != nil {
{
size, err := m.Group.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintIbtp(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x42
}
if len(m.Payload) > 0 {
i -= len(m.Payload)
copy(dAtA[i:], m.Payload)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Payload)))
i--
dAtA[i] = 0x3a
}
if len(m.Proof) > 0 {
i -= len(m.Proof)
copy(dAtA[i:], m.Proof)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Proof)))
i--
dAtA[i] = 0x32
}
if m.Timestamp != 0 {
i = encodeVarintIbtp(dAtA, i, uint64(m.Timestamp))
i--
dAtA[i] = 0x28
}
if m.Type != 0 {
i = encodeVarintIbtp(dAtA, i, uint64(m.Type))
i--
dAtA[i] = 0x20
}
if m.Nonce != 0 {
i = encodeVarintIbtp(dAtA, i, uint64(m.Nonce))
i--
dAtA[i] = 0x18
}
if len(m.To) > 0 {
i -= len(m.To)
copy(dAtA[i:], m.To)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.To)))
i--
dAtA[i] = 0x12
}
if len(m.From) > 0 {
i -= len(m.From)
copy(dAtA[i:], m.From)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.From)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
func (m *Result) XXX_Merge(src proto.Message) {
xxx_messageInfo_Result.Merge(m, src)
}
func (m *Payload) 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 *Payload) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Payload) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Content) > 0 {
i -= len(m.Content)
copy(dAtA[i:], m.Content)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Content)))
i--
dAtA[i] = 0x12
}
if m.Encrypted {
i--
if m.Encrypted {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
func (m *Result) XXX_Size() int {
return xxx_messageInfo_Result.Size(m)
}
func (m *Content) 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 *Result) XXX_DiscardUnknown() {
xxx_messageInfo_Result.DiscardUnknown(m)
}
func (m *Content) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
var xxx_messageInfo_Result proto.InternalMessageInfo
func (m *Content) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.ArgsRb) > 0 {
for iNdEx := len(m.ArgsRb) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.ArgsRb[iNdEx])
copy(dAtA[i:], m.ArgsRb[iNdEx])
i = encodeVarintIbtp(dAtA, i, uint64(len(m.ArgsRb[iNdEx])))
i--
dAtA[i] = 0x42
}
}
if len(m.Rollback) > 0 {
i -= len(m.Rollback)
copy(dAtA[i:], m.Rollback)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Rollback)))
i--
dAtA[i] = 0x3a
}
if len(m.ArgsCb) > 0 {
for iNdEx := len(m.ArgsCb) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.ArgsCb[iNdEx])
copy(dAtA[i:], m.ArgsCb[iNdEx])
i = encodeVarintIbtp(dAtA, i, uint64(len(m.ArgsCb[iNdEx])))
i--
dAtA[i] = 0x32
}
}
if len(m.Callback) > 0 {
i -= len(m.Callback)
copy(dAtA[i:], m.Callback)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Callback)))
i--
dAtA[i] = 0x2a
}
if len(m.Args) > 0 {
for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Args[iNdEx])
copy(dAtA[i:], m.Args[iNdEx])
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Args[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.Func) > 0 {
i -= len(m.Func)
copy(dAtA[i:], m.Func)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.Func)))
i--
dAtA[i] = 0x1a
}
if len(m.DstContractId) > 0 {
i -= len(m.DstContractId)
copy(dAtA[i:], m.DstContractId)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.DstContractId)))
i--
dAtA[i] = 0x12
}
if len(m.SrcContractId) > 0 {
i -= len(m.SrcContractId)
copy(dAtA[i:], m.SrcContractId)
i = encodeVarintIbtp(dAtA, i, uint64(len(m.SrcContractId)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *IBTPs) 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 *IBTPs) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *IBTPs) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Ibtps) > 0 {
for iNdEx := len(m.Ibtps) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Ibtps[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintIbtp(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func encodeVarintIbtp(dAtA []byte, offset int, v uint64) int {
offset -= sovIbtp(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *IBTP) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.From)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.To)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
if m.Nonce != 0 {
n += 1 + sovIbtp(uint64(m.Nonce))
}
if m.Type != 0 {
n += 1 + sovIbtp(uint64(m.Type))
}
if m.Timestamp != 0 {
n += 1 + sovIbtp(uint64(m.Timestamp))
}
l = len(m.Proof)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.Payload)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
if m.Group != nil {
l = m.Group.Size()
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.Version)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.Extra)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
return n
}
func (m *Payload) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Encrypted {
n += 2
}
l = len(m.Content)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
return n
}
func (m *Content) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.SrcContractId)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.DstContractId)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
l = len(m.Func)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
if len(m.Args) > 0 {
for _, b := range m.Args {
l = len(b)
n += 1 + l + sovIbtp(uint64(l))
}
}
l = len(m.Callback)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
if len(m.ArgsCb) > 0 {
for _, b := range m.ArgsCb {
l = len(b)
n += 1 + l + sovIbtp(uint64(l))
}
}
l = len(m.Rollback)
if l > 0 {
n += 1 + l + sovIbtp(uint64(l))
}
if len(m.ArgsRb) > 0 {
for _, b := range m.ArgsRb {
l = len(b)
n += 1 + l + sovIbtp(uint64(l))
}
}
return n
}
func (m *IBTPs) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Ibtps) > 0 {
for _, e := range m.Ibtps {
l = e.Size()
n += 1 + l + sovIbtp(uint64(l))
}
}
return n
}
func sovIbtp(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozIbtp(x uint64) (n int) {
return sovIbtp(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *IBTP) 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 ErrIntOverflowIbtp
}
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: IBTP: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: IBTP: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.From = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.To = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType)
}
m.Nonce = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Nonce |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= IBTP_Type(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
}
m.Timestamp = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Timestamp |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...)
if m.Proof == nil {
m.Proof = []byte{}
}
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...)
if m.Payload == nil {
m.Payload = []byte{}
}
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Group == nil {
m.Group = &StringUint64Map{}
}
if err := m.Group.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 9:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Version = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 10:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Extra", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Extra = append(m.Extra[:0], dAtA[iNdEx:postIndex]...)
if m.Extra == nil {
m.Extra = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipIbtp(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIbtp
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Payload) 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 ErrIntOverflowIbtp
}
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: payload: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: payload: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Encrypted", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Encrypted = bool(v != 0)
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Content = append(m.Content[:0], dAtA[iNdEx:postIndex]...)
if m.Content == nil {
m.Content = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipIbtp(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIbtp
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
func (m *Result) GetData() [][]byte {
if m != nil {
return m.Data
}
return nil
}
func (m *Content) 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 ErrIntOverflowIbtp
}
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: content: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: content: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SrcContractId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SrcContractId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field DstContractId", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.DstContractId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Func = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Args = append(m.Args, make([]byte, postIndex-iNdEx))
copy(m.Args[len(m.Args)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Callback", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Callback = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ArgsCb", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ArgsCb = append(m.ArgsCb, make([]byte, postIndex-iNdEx))
copy(m.ArgsCb[len(m.ArgsCb)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Rollback", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
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 ErrInvalidLengthIbtp
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Rollback = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ArgsRb", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ArgsRb = append(m.ArgsRb, make([]byte, postIndex-iNdEx))
copy(m.ArgsRb[len(m.ArgsRb)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipIbtp(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIbtp
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
func init() {
proto.RegisterEnum("pb.IBTP_Type", IBTP_Type_name, IBTP_Type_value)
proto.RegisterEnum("pb.IBTP_Category", IBTP_Category_name, IBTP_Category_value)
proto.RegisterType((*IBTP)(nil), "pb.IBTP")
proto.RegisterType((*Payload)(nil), "pb.payload")
proto.RegisterType((*Content)(nil), "pb.content")
proto.RegisterType((*IBTPs)(nil), "pb.IBTPs")
proto.RegisterType((*Result)(nil), "pb.result")
}
func (m *IBTPs) 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 ErrIntOverflowIbtp
}
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: IBTPs: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: IBTPs: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Ibtps", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowIbtp
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthIbtp
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthIbtp
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Ibtps = append(m.Ibtps, &IBTP{})
if err := m.Ibtps[len(m.Ibtps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipIbtp(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIbtp
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
func init() {
proto.RegisterFile("ibtp.proto", fileDescriptor_7576a0a5bf0190a3)
}
func skipIbtp(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, ErrIntOverflowIbtp
}
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, ErrIntOverflowIbtp
}
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, ErrIntOverflowIbtp
}
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, ErrInvalidLengthIbtp
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupIbtp
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthIbtp
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
var fileDescriptor_7576a0a5bf0190a3 = []byte{
// 534 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x53, 0xcd, 0x8e, 0xda, 0x3c,
0x14, 0x9d, 0xfc, 0x00, 0xe1, 0xc2, 0xcc, 0x44, 0x9e, 0xd1, 0x27, 0x6b, 0x34, 0xfa, 0x94, 0x66,
0xd1, 0xa6, 0x1b, 0x16, 0xb4, 0xea, 0x9e, 0x89, 0x52, 0x35, 0x1a, 0x1a, 0xa8, 0x03, 0xea, 0x12,
0x39, 0x3f, 0x83, 0xa2, 0x42, 0x6c, 0x39, 0xa6, 0x2a, 0x2f, 0xd4, 0x77, 0xeb, 0x5b, 0x54, 0x76,
0x08, 0x4c, 0x77, 0x3e, 0xe7, 0x9e, 0x73, 0x6f, 0xec, 0x7b, 0x02, 0x50, 0x65, 0x92, 0x4f, 0xb8,
0x60, 0x92, 0x21, 0x93, 0x67, 0x0f, 0xa3, 0x8c, 0x36, 0x55, 0xde, 0x12, 0xfe, 0x6f, 0x0b, 0xec,
0xf8, 0x69, 0xb5, 0x44, 0x08, 0xec, 0x17, 0xc1, 0xf6, 0xd8, 0xf0, 0x8c, 0x60, 0x48, 0xf4, 0x19,
0xdd, 0x80, 0x29, 0x19, 0x36, 0x35, 0x63, 0x4a, 0x86, 0xee, 0xa1, 0x57, 0xb3, 0x3a, 0x2f, 0xb1,
0xe5, 0x19, 0x81, 0x4d, 0x5a, 0x80, 0xde, 0x80, 0x2d, 0x8f, 0xbc, 0xc4, 0xb6, 0x67, 0x04, 0x37,
0xd3, 0xeb, 0x09, 0xcf, 0x26, 0xaa, 0xe3, 0x64, 0x75, 0xe4, 0x25, 0xd1, 0x25, 0xf4, 0x08, 0x43,
0x59, 0xed, 0xcb, 0x46, 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, 0x00, 0x00,
}
var (
ErrInvalidLengthIbtp = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowIbtp = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupIbtp = fmt.Errorf("proto: unexpected end of group")
)
......@@ -61,3 +61,7 @@ message content {
message IBTPs {
repeated IBTP ibtps = 1;
}
message result {
repeated bytes data = 1;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment