You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1503 lines
33 KiB

  1. // Code generated by protoc-gen-gogo.
  2. // source: test.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package test is a generated protocol buffer package.
  6. It is generated from these files:
  7. test.proto
  8. It has these top-level messages:
  9. ResultStatus
  10. NodeInfo
  11. PubKey
  12. PubKeyEd25519
  13. */
  14. package test
  15. import proto "github.com/gogo/protobuf/proto"
  16. import fmt "fmt"
  17. import math "math"
  18. import bytes "bytes"
  19. import strings "strings"
  20. import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
  21. import sort "sort"
  22. import strconv "strconv"
  23. import reflect "reflect"
  24. import io "io"
  25. // Reference imports to suppress errors if they are not otherwise used.
  26. var _ = proto.Marshal
  27. var _ = fmt.Errorf
  28. var _ = math.Inf
  29. type ResultStatus struct {
  30. NodeInfo *NodeInfo `protobuf:"bytes,1,opt,name=nodeInfo" json:"nodeInfo,omitempty"`
  31. PubKey *PubKey `protobuf:"bytes,2,req,name=pubKey" json:"pubKey,omitempty"`
  32. LatestBlockHash []byte `protobuf:"bytes,3,req,name=latestBlockHash" json:"latestBlockHash"`
  33. LatestBlockHeight int64 `protobuf:"varint,4,req,name=latestBlockHeight" json:"latestBlockHeight"`
  34. LatestBlocktime int64 `protobuf:"varint,5,req,name=latestBlocktime" json:"latestBlocktime"`
  35. }
  36. func (m *ResultStatus) Reset() { *m = ResultStatus{} }
  37. func (*ResultStatus) ProtoMessage() {}
  38. func (m *ResultStatus) GetNodeInfo() *NodeInfo {
  39. if m != nil {
  40. return m.NodeInfo
  41. }
  42. return nil
  43. }
  44. func (m *ResultStatus) GetPubKey() *PubKey {
  45. if m != nil {
  46. return m.PubKey
  47. }
  48. return nil
  49. }
  50. func (m *ResultStatus) GetLatestBlockHash() []byte {
  51. if m != nil {
  52. return m.LatestBlockHash
  53. }
  54. return nil
  55. }
  56. func (m *ResultStatus) GetLatestBlockHeight() int64 {
  57. if m != nil {
  58. return m.LatestBlockHeight
  59. }
  60. return 0
  61. }
  62. func (m *ResultStatus) GetLatestBlocktime() int64 {
  63. if m != nil {
  64. return m.LatestBlocktime
  65. }
  66. return 0
  67. }
  68. type NodeInfo struct {
  69. PubKey *PubKey `protobuf:"bytes,1,req,name=pubKey" json:"pubKey,omitempty"`
  70. Moniker string `protobuf:"bytes,2,req,name=moniker" json:"moniker"`
  71. Network string `protobuf:"bytes,3,req,name=network" json:"network"`
  72. RemoteAddr string `protobuf:"bytes,4,req,name=remoteAddr" json:"remoteAddr"`
  73. ListenAddr string `protobuf:"bytes,5,req,name=listenAddr" json:"listenAddr"`
  74. Version string `protobuf:"bytes,6,req,name=version" json:"version"`
  75. Other []string `protobuf:"bytes,7,rep,name=other" json:"other,omitempty"`
  76. }
  77. func (m *NodeInfo) Reset() { *m = NodeInfo{} }
  78. func (*NodeInfo) ProtoMessage() {}
  79. func (m *NodeInfo) GetPubKey() *PubKey {
  80. if m != nil {
  81. return m.PubKey
  82. }
  83. return nil
  84. }
  85. func (m *NodeInfo) GetMoniker() string {
  86. if m != nil {
  87. return m.Moniker
  88. }
  89. return ""
  90. }
  91. func (m *NodeInfo) GetNetwork() string {
  92. if m != nil {
  93. return m.Network
  94. }
  95. return ""
  96. }
  97. func (m *NodeInfo) GetRemoteAddr() string {
  98. if m != nil {
  99. return m.RemoteAddr
  100. }
  101. return ""
  102. }
  103. func (m *NodeInfo) GetListenAddr() string {
  104. if m != nil {
  105. return m.ListenAddr
  106. }
  107. return ""
  108. }
  109. func (m *NodeInfo) GetVersion() string {
  110. if m != nil {
  111. return m.Version
  112. }
  113. return ""
  114. }
  115. func (m *NodeInfo) GetOther() []string {
  116. if m != nil {
  117. return m.Other
  118. }
  119. return nil
  120. }
  121. type PubKey struct {
  122. Ed25519 *PubKeyEd25519 `protobuf:"bytes,1,opt,name=ed25519" json:"ed25519,omitempty"`
  123. }
  124. func (m *PubKey) Reset() { *m = PubKey{} }
  125. func (*PubKey) ProtoMessage() {}
  126. func (m *PubKey) GetEd25519() *PubKeyEd25519 {
  127. if m != nil {
  128. return m.Ed25519
  129. }
  130. return nil
  131. }
  132. type PubKeyEd25519 struct {
  133. Bytes []byte `protobuf:"bytes,1,req,name=bytes" json:"bytes"`
  134. }
  135. func (m *PubKeyEd25519) Reset() { *m = PubKeyEd25519{} }
  136. func (*PubKeyEd25519) ProtoMessage() {}
  137. func (m *PubKeyEd25519) GetBytes() []byte {
  138. if m != nil {
  139. return m.Bytes
  140. }
  141. return nil
  142. }
  143. func init() {
  144. proto.RegisterType((*ResultStatus)(nil), "ResultStatus")
  145. proto.RegisterType((*NodeInfo)(nil), "NodeInfo")
  146. proto.RegisterType((*PubKey)(nil), "PubKey")
  147. proto.RegisterType((*PubKeyEd25519)(nil), "PubKeyEd25519")
  148. }
  149. func (this *ResultStatus) Equal(that interface{}) bool {
  150. if that == nil {
  151. if this == nil {
  152. return true
  153. }
  154. return false
  155. }
  156. that1, ok := that.(*ResultStatus)
  157. if !ok {
  158. that2, ok := that.(ResultStatus)
  159. if ok {
  160. that1 = &that2
  161. } else {
  162. return false
  163. }
  164. }
  165. if that1 == nil {
  166. if this == nil {
  167. return true
  168. }
  169. return false
  170. } else if this == nil {
  171. return false
  172. }
  173. if !this.NodeInfo.Equal(that1.NodeInfo) {
  174. return false
  175. }
  176. if !this.PubKey.Equal(that1.PubKey) {
  177. return false
  178. }
  179. if !bytes.Equal(this.LatestBlockHash, that1.LatestBlockHash) {
  180. return false
  181. }
  182. if this.LatestBlockHeight != that1.LatestBlockHeight {
  183. return false
  184. }
  185. if this.LatestBlocktime != that1.LatestBlocktime {
  186. return false
  187. }
  188. return true
  189. }
  190. func (this *NodeInfo) Equal(that interface{}) bool {
  191. if that == nil {
  192. if this == nil {
  193. return true
  194. }
  195. return false
  196. }
  197. that1, ok := that.(*NodeInfo)
  198. if !ok {
  199. that2, ok := that.(NodeInfo)
  200. if ok {
  201. that1 = &that2
  202. } else {
  203. return false
  204. }
  205. }
  206. if that1 == nil {
  207. if this == nil {
  208. return true
  209. }
  210. return false
  211. } else if this == nil {
  212. return false
  213. }
  214. if !this.PubKey.Equal(that1.PubKey) {
  215. return false
  216. }
  217. if this.Moniker != that1.Moniker {
  218. return false
  219. }
  220. if this.Network != that1.Network {
  221. return false
  222. }
  223. if this.RemoteAddr != that1.RemoteAddr {
  224. return false
  225. }
  226. if this.ListenAddr != that1.ListenAddr {
  227. return false
  228. }
  229. if this.Version != that1.Version {
  230. return false
  231. }
  232. if len(this.Other) != len(that1.Other) {
  233. return false
  234. }
  235. for i := range this.Other {
  236. if this.Other[i] != that1.Other[i] {
  237. return false
  238. }
  239. }
  240. return true
  241. }
  242. func (this *PubKey) Equal(that interface{}) bool {
  243. if that == nil {
  244. if this == nil {
  245. return true
  246. }
  247. return false
  248. }
  249. that1, ok := that.(*PubKey)
  250. if !ok {
  251. that2, ok := that.(PubKey)
  252. if ok {
  253. that1 = &that2
  254. } else {
  255. return false
  256. }
  257. }
  258. if that1 == nil {
  259. if this == nil {
  260. return true
  261. }
  262. return false
  263. } else if this == nil {
  264. return false
  265. }
  266. if !this.Ed25519.Equal(that1.Ed25519) {
  267. return false
  268. }
  269. return true
  270. }
  271. func (this *PubKeyEd25519) Equal(that interface{}) bool {
  272. if that == nil {
  273. if this == nil {
  274. return true
  275. }
  276. return false
  277. }
  278. that1, ok := that.(*PubKeyEd25519)
  279. if !ok {
  280. that2, ok := that.(PubKeyEd25519)
  281. if ok {
  282. that1 = &that2
  283. } else {
  284. return false
  285. }
  286. }
  287. if that1 == nil {
  288. if this == nil {
  289. return true
  290. }
  291. return false
  292. } else if this == nil {
  293. return false
  294. }
  295. if !bytes.Equal(this.Bytes, that1.Bytes) {
  296. return false
  297. }
  298. return true
  299. }
  300. func (this *ResultStatus) GoString() string {
  301. if this == nil {
  302. return "nil"
  303. }
  304. s := make([]string, 0, 9)
  305. s = append(s, "&test.ResultStatus{")
  306. if this.NodeInfo != nil {
  307. s = append(s, "NodeInfo: "+fmt.Sprintf("%#v", this.NodeInfo)+",\n")
  308. }
  309. if this.PubKey != nil {
  310. s = append(s, "PubKey: "+fmt.Sprintf("%#v", this.PubKey)+",\n")
  311. }
  312. s = append(s, "LatestBlockHash: "+fmt.Sprintf("%#v", this.LatestBlockHash)+",\n")
  313. s = append(s, "LatestBlockHeight: "+fmt.Sprintf("%#v", this.LatestBlockHeight)+",\n")
  314. s = append(s, "LatestBlocktime: "+fmt.Sprintf("%#v", this.LatestBlocktime)+",\n")
  315. s = append(s, "}")
  316. return strings.Join(s, "")
  317. }
  318. func (this *NodeInfo) GoString() string {
  319. if this == nil {
  320. return "nil"
  321. }
  322. s := make([]string, 0, 11)
  323. s = append(s, "&test.NodeInfo{")
  324. if this.PubKey != nil {
  325. s = append(s, "PubKey: "+fmt.Sprintf("%#v", this.PubKey)+",\n")
  326. }
  327. s = append(s, "Moniker: "+fmt.Sprintf("%#v", this.Moniker)+",\n")
  328. s = append(s, "Network: "+fmt.Sprintf("%#v", this.Network)+",\n")
  329. s = append(s, "RemoteAddr: "+fmt.Sprintf("%#v", this.RemoteAddr)+",\n")
  330. s = append(s, "ListenAddr: "+fmt.Sprintf("%#v", this.ListenAddr)+",\n")
  331. s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n")
  332. if this.Other != nil {
  333. s = append(s, "Other: "+fmt.Sprintf("%#v", this.Other)+",\n")
  334. }
  335. s = append(s, "}")
  336. return strings.Join(s, "")
  337. }
  338. func (this *PubKey) GoString() string {
  339. if this == nil {
  340. return "nil"
  341. }
  342. s := make([]string, 0, 5)
  343. s = append(s, "&test.PubKey{")
  344. if this.Ed25519 != nil {
  345. s = append(s, "Ed25519: "+fmt.Sprintf("%#v", this.Ed25519)+",\n")
  346. }
  347. s = append(s, "}")
  348. return strings.Join(s, "")
  349. }
  350. func (this *PubKeyEd25519) GoString() string {
  351. if this == nil {
  352. return "nil"
  353. }
  354. s := make([]string, 0, 5)
  355. s = append(s, "&test.PubKeyEd25519{")
  356. s = append(s, "Bytes: "+fmt.Sprintf("%#v", this.Bytes)+",\n")
  357. s = append(s, "}")
  358. return strings.Join(s, "")
  359. }
  360. func valueToGoStringTest(v interface{}, typ string) string {
  361. rv := reflect.ValueOf(v)
  362. if rv.IsNil() {
  363. return "nil"
  364. }
  365. pv := reflect.Indirect(rv).Interface()
  366. return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
  367. }
  368. func extensionToGoStringTest(e map[int32]github_com_gogo_protobuf_proto.Extension) string {
  369. if e == nil {
  370. return "nil"
  371. }
  372. s := "map[int32]proto.Extension{"
  373. keys := make([]int, 0, len(e))
  374. for k := range e {
  375. keys = append(keys, int(k))
  376. }
  377. sort.Ints(keys)
  378. ss := []string{}
  379. for _, k := range keys {
  380. ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString())
  381. }
  382. s += strings.Join(ss, ",") + "}"
  383. return s
  384. }
  385. func (m *ResultStatus) Marshal() (data []byte, err error) {
  386. size := m.Size()
  387. data = make([]byte, size)
  388. n, err := m.MarshalTo(data)
  389. if err != nil {
  390. return nil, err
  391. }
  392. return data[:n], nil
  393. }
  394. func (m *ResultStatus) MarshalTo(data []byte) (int, error) {
  395. var i int
  396. _ = i
  397. var l int
  398. _ = l
  399. if m.NodeInfo != nil {
  400. data[i] = 0xa
  401. i++
  402. i = encodeVarintTest(data, i, uint64(m.NodeInfo.Size()))
  403. n1, err := m.NodeInfo.MarshalTo(data[i:])
  404. if err != nil {
  405. return 0, err
  406. }
  407. i += n1
  408. }
  409. if m.PubKey == nil {
  410. return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
  411. } else {
  412. data[i] = 0x12
  413. i++
  414. i = encodeVarintTest(data, i, uint64(m.PubKey.Size()))
  415. n2, err := m.PubKey.MarshalTo(data[i:])
  416. if err != nil {
  417. return 0, err
  418. }
  419. i += n2
  420. }
  421. if m.LatestBlockHash != nil {
  422. data[i] = 0x1a
  423. i++
  424. i = encodeVarintTest(data, i, uint64(len(m.LatestBlockHash)))
  425. i += copy(data[i:], m.LatestBlockHash)
  426. }
  427. data[i] = 0x20
  428. i++
  429. i = encodeVarintTest(data, i, uint64(m.LatestBlockHeight))
  430. data[i] = 0x28
  431. i++
  432. i = encodeVarintTest(data, i, uint64(m.LatestBlocktime))
  433. return i, nil
  434. }
  435. func (m *NodeInfo) Marshal() (data []byte, err error) {
  436. size := m.Size()
  437. data = make([]byte, size)
  438. n, err := m.MarshalTo(data)
  439. if err != nil {
  440. return nil, err
  441. }
  442. return data[:n], nil
  443. }
  444. func (m *NodeInfo) MarshalTo(data []byte) (int, error) {
  445. var i int
  446. _ = i
  447. var l int
  448. _ = l
  449. if m.PubKey == nil {
  450. return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
  451. } else {
  452. data[i] = 0xa
  453. i++
  454. i = encodeVarintTest(data, i, uint64(m.PubKey.Size()))
  455. n3, err := m.PubKey.MarshalTo(data[i:])
  456. if err != nil {
  457. return 0, err
  458. }
  459. i += n3
  460. }
  461. data[i] = 0x12
  462. i++
  463. i = encodeVarintTest(data, i, uint64(len(m.Moniker)))
  464. i += copy(data[i:], m.Moniker)
  465. data[i] = 0x1a
  466. i++
  467. i = encodeVarintTest(data, i, uint64(len(m.Network)))
  468. i += copy(data[i:], m.Network)
  469. data[i] = 0x22
  470. i++
  471. i = encodeVarintTest(data, i, uint64(len(m.RemoteAddr)))
  472. i += copy(data[i:], m.RemoteAddr)
  473. data[i] = 0x2a
  474. i++
  475. i = encodeVarintTest(data, i, uint64(len(m.ListenAddr)))
  476. i += copy(data[i:], m.ListenAddr)
  477. data[i] = 0x32
  478. i++
  479. i = encodeVarintTest(data, i, uint64(len(m.Version)))
  480. i += copy(data[i:], m.Version)
  481. if len(m.Other) > 0 {
  482. for _, s := range m.Other {
  483. data[i] = 0x3a
  484. i++
  485. l = len(s)
  486. for l >= 1<<7 {
  487. data[i] = uint8(uint64(l)&0x7f | 0x80)
  488. l >>= 7
  489. i++
  490. }
  491. data[i] = uint8(l)
  492. i++
  493. i += copy(data[i:], s)
  494. }
  495. }
  496. return i, nil
  497. }
  498. func (m *PubKey) Marshal() (data []byte, err error) {
  499. size := m.Size()
  500. data = make([]byte, size)
  501. n, err := m.MarshalTo(data)
  502. if err != nil {
  503. return nil, err
  504. }
  505. return data[:n], nil
  506. }
  507. func (m *PubKey) MarshalTo(data []byte) (int, error) {
  508. var i int
  509. _ = i
  510. var l int
  511. _ = l
  512. if m.Ed25519 != nil {
  513. data[i] = 0xa
  514. i++
  515. i = encodeVarintTest(data, i, uint64(m.Ed25519.Size()))
  516. n4, err := m.Ed25519.MarshalTo(data[i:])
  517. if err != nil {
  518. return 0, err
  519. }
  520. i += n4
  521. }
  522. return i, nil
  523. }
  524. func (m *PubKeyEd25519) Marshal() (data []byte, err error) {
  525. size := m.Size()
  526. data = make([]byte, size)
  527. n, err := m.MarshalTo(data)
  528. if err != nil {
  529. return nil, err
  530. }
  531. return data[:n], nil
  532. }
  533. func (m *PubKeyEd25519) MarshalTo(data []byte) (int, error) {
  534. var i int
  535. _ = i
  536. var l int
  537. _ = l
  538. if m.Bytes != nil {
  539. data[i] = 0xa
  540. i++
  541. i = encodeVarintTest(data, i, uint64(len(m.Bytes)))
  542. i += copy(data[i:], m.Bytes)
  543. }
  544. return i, nil
  545. }
  546. func encodeFixed64Test(data []byte, offset int, v uint64) int {
  547. data[offset] = uint8(v)
  548. data[offset+1] = uint8(v >> 8)
  549. data[offset+2] = uint8(v >> 16)
  550. data[offset+3] = uint8(v >> 24)
  551. data[offset+4] = uint8(v >> 32)
  552. data[offset+5] = uint8(v >> 40)
  553. data[offset+6] = uint8(v >> 48)
  554. data[offset+7] = uint8(v >> 56)
  555. return offset + 8
  556. }
  557. func encodeFixed32Test(data []byte, offset int, v uint32) int {
  558. data[offset] = uint8(v)
  559. data[offset+1] = uint8(v >> 8)
  560. data[offset+2] = uint8(v >> 16)
  561. data[offset+3] = uint8(v >> 24)
  562. return offset + 4
  563. }
  564. func encodeVarintTest(data []byte, offset int, v uint64) int {
  565. for v >= 1<<7 {
  566. data[offset] = uint8(v&0x7f | 0x80)
  567. v >>= 7
  568. offset++
  569. }
  570. data[offset] = uint8(v)
  571. return offset + 1
  572. }
  573. func (m *ResultStatus) Size() (n int) {
  574. var l int
  575. _ = l
  576. if m.NodeInfo != nil {
  577. l = m.NodeInfo.Size()
  578. n += 1 + l + sovTest(uint64(l))
  579. }
  580. if m.PubKey != nil {
  581. l = m.PubKey.Size()
  582. n += 1 + l + sovTest(uint64(l))
  583. }
  584. if m.LatestBlockHash != nil {
  585. l = len(m.LatestBlockHash)
  586. n += 1 + l + sovTest(uint64(l))
  587. }
  588. n += 1 + sovTest(uint64(m.LatestBlockHeight))
  589. n += 1 + sovTest(uint64(m.LatestBlocktime))
  590. return n
  591. }
  592. func (m *NodeInfo) Size() (n int) {
  593. var l int
  594. _ = l
  595. if m.PubKey != nil {
  596. l = m.PubKey.Size()
  597. n += 1 + l + sovTest(uint64(l))
  598. }
  599. l = len(m.Moniker)
  600. n += 1 + l + sovTest(uint64(l))
  601. l = len(m.Network)
  602. n += 1 + l + sovTest(uint64(l))
  603. l = len(m.RemoteAddr)
  604. n += 1 + l + sovTest(uint64(l))
  605. l = len(m.ListenAddr)
  606. n += 1 + l + sovTest(uint64(l))
  607. l = len(m.Version)
  608. n += 1 + l + sovTest(uint64(l))
  609. if len(m.Other) > 0 {
  610. for _, s := range m.Other {
  611. l = len(s)
  612. n += 1 + l + sovTest(uint64(l))
  613. }
  614. }
  615. return n
  616. }
  617. func (m *PubKey) Size() (n int) {
  618. var l int
  619. _ = l
  620. if m.Ed25519 != nil {
  621. l = m.Ed25519.Size()
  622. n += 1 + l + sovTest(uint64(l))
  623. }
  624. return n
  625. }
  626. func (m *PubKeyEd25519) Size() (n int) {
  627. var l int
  628. _ = l
  629. if m.Bytes != nil {
  630. l = len(m.Bytes)
  631. n += 1 + l + sovTest(uint64(l))
  632. }
  633. return n
  634. }
  635. func sovTest(x uint64) (n int) {
  636. for {
  637. n++
  638. x >>= 7
  639. if x == 0 {
  640. break
  641. }
  642. }
  643. return n
  644. }
  645. func sozTest(x uint64) (n int) {
  646. return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  647. }
  648. func (this *ResultStatus) String() string {
  649. if this == nil {
  650. return "nil"
  651. }
  652. s := strings.Join([]string{`&ResultStatus{`,
  653. `NodeInfo:` + strings.Replace(fmt.Sprintf("%v", this.NodeInfo), "NodeInfo", "NodeInfo", 1) + `,`,
  654. `PubKey:` + strings.Replace(fmt.Sprintf("%v", this.PubKey), "PubKey", "PubKey", 1) + `,`,
  655. `LatestBlockHash:` + fmt.Sprintf("%v", this.LatestBlockHash) + `,`,
  656. `LatestBlockHeight:` + fmt.Sprintf("%v", this.LatestBlockHeight) + `,`,
  657. `LatestBlocktime:` + fmt.Sprintf("%v", this.LatestBlocktime) + `,`,
  658. `}`,
  659. }, "")
  660. return s
  661. }
  662. func (this *NodeInfo) String() string {
  663. if this == nil {
  664. return "nil"
  665. }
  666. s := strings.Join([]string{`&NodeInfo{`,
  667. `PubKey:` + strings.Replace(fmt.Sprintf("%v", this.PubKey), "PubKey", "PubKey", 1) + `,`,
  668. `Moniker:` + fmt.Sprintf("%v", this.Moniker) + `,`,
  669. `Network:` + fmt.Sprintf("%v", this.Network) + `,`,
  670. `RemoteAddr:` + fmt.Sprintf("%v", this.RemoteAddr) + `,`,
  671. `ListenAddr:` + fmt.Sprintf("%v", this.ListenAddr) + `,`,
  672. `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
  673. `Other:` + fmt.Sprintf("%v", this.Other) + `,`,
  674. `}`,
  675. }, "")
  676. return s
  677. }
  678. func (this *PubKey) String() string {
  679. if this == nil {
  680. return "nil"
  681. }
  682. s := strings.Join([]string{`&PubKey{`,
  683. `Ed25519:` + strings.Replace(fmt.Sprintf("%v", this.Ed25519), "PubKeyEd25519", "PubKeyEd25519", 1) + `,`,
  684. `}`,
  685. }, "")
  686. return s
  687. }
  688. func (this *PubKeyEd25519) String() string {
  689. if this == nil {
  690. return "nil"
  691. }
  692. s := strings.Join([]string{`&PubKeyEd25519{`,
  693. `Bytes:` + fmt.Sprintf("%v", this.Bytes) + `,`,
  694. `}`,
  695. }, "")
  696. return s
  697. }
  698. func valueToStringTest(v interface{}) string {
  699. rv := reflect.ValueOf(v)
  700. if rv.IsNil() {
  701. return "nil"
  702. }
  703. pv := reflect.Indirect(rv).Interface()
  704. return fmt.Sprintf("*%v", pv)
  705. }
  706. func (m *ResultStatus) Unmarshal(data []byte) error {
  707. var hasFields [1]uint64
  708. l := len(data)
  709. iNdEx := 0
  710. for iNdEx < l {
  711. preIndex := iNdEx
  712. var wire uint64
  713. for shift := uint(0); ; shift += 7 {
  714. if shift >= 64 {
  715. return ErrIntOverflowTest
  716. }
  717. if iNdEx >= l {
  718. return io.ErrUnexpectedEOF
  719. }
  720. b := data[iNdEx]
  721. iNdEx++
  722. wire |= (uint64(b) & 0x7F) << shift
  723. if b < 0x80 {
  724. break
  725. }
  726. }
  727. fieldNum := int32(wire >> 3)
  728. wireType := int(wire & 0x7)
  729. if wireType == 4 {
  730. return fmt.Errorf("proto: ResultStatus: wiretype end group for non-group")
  731. }
  732. if fieldNum <= 0 {
  733. return fmt.Errorf("proto: ResultStatus: illegal tag %d (wire type %d)", fieldNum, wire)
  734. }
  735. switch fieldNum {
  736. case 1:
  737. if wireType != 2 {
  738. return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType)
  739. }
  740. var msglen int
  741. for shift := uint(0); ; shift += 7 {
  742. if shift >= 64 {
  743. return ErrIntOverflowTest
  744. }
  745. if iNdEx >= l {
  746. return io.ErrUnexpectedEOF
  747. }
  748. b := data[iNdEx]
  749. iNdEx++
  750. msglen |= (int(b) & 0x7F) << shift
  751. if b < 0x80 {
  752. break
  753. }
  754. }
  755. if msglen < 0 {
  756. return ErrInvalidLengthTest
  757. }
  758. postIndex := iNdEx + msglen
  759. if postIndex > l {
  760. return io.ErrUnexpectedEOF
  761. }
  762. if m.NodeInfo == nil {
  763. m.NodeInfo = &NodeInfo{}
  764. }
  765. if err := m.NodeInfo.Unmarshal(data[iNdEx:postIndex]); err != nil {
  766. return err
  767. }
  768. iNdEx = postIndex
  769. case 2:
  770. if wireType != 2 {
  771. return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
  772. }
  773. var msglen int
  774. for shift := uint(0); ; shift += 7 {
  775. if shift >= 64 {
  776. return ErrIntOverflowTest
  777. }
  778. if iNdEx >= l {
  779. return io.ErrUnexpectedEOF
  780. }
  781. b := data[iNdEx]
  782. iNdEx++
  783. msglen |= (int(b) & 0x7F) << shift
  784. if b < 0x80 {
  785. break
  786. }
  787. }
  788. if msglen < 0 {
  789. return ErrInvalidLengthTest
  790. }
  791. postIndex := iNdEx + msglen
  792. if postIndex > l {
  793. return io.ErrUnexpectedEOF
  794. }
  795. if m.PubKey == nil {
  796. m.PubKey = &PubKey{}
  797. }
  798. if err := m.PubKey.Unmarshal(data[iNdEx:postIndex]); err != nil {
  799. return err
  800. }
  801. iNdEx = postIndex
  802. hasFields[0] |= uint64(0x00000001)
  803. case 3:
  804. if wireType != 2 {
  805. return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHash", wireType)
  806. }
  807. var byteLen int
  808. for shift := uint(0); ; shift += 7 {
  809. if shift >= 64 {
  810. return ErrIntOverflowTest
  811. }
  812. if iNdEx >= l {
  813. return io.ErrUnexpectedEOF
  814. }
  815. b := data[iNdEx]
  816. iNdEx++
  817. byteLen |= (int(b) & 0x7F) << shift
  818. if b < 0x80 {
  819. break
  820. }
  821. }
  822. if byteLen < 0 {
  823. return ErrInvalidLengthTest
  824. }
  825. postIndex := iNdEx + byteLen
  826. if postIndex > l {
  827. return io.ErrUnexpectedEOF
  828. }
  829. m.LatestBlockHash = append([]byte{}, data[iNdEx:postIndex]...)
  830. iNdEx = postIndex
  831. hasFields[0] |= uint64(0x00000002)
  832. case 4:
  833. if wireType != 0 {
  834. return fmt.Errorf("proto: wrong wireType = %d for field LatestBlockHeight", wireType)
  835. }
  836. m.LatestBlockHeight = 0
  837. for shift := uint(0); ; shift += 7 {
  838. if shift >= 64 {
  839. return ErrIntOverflowTest
  840. }
  841. if iNdEx >= l {
  842. return io.ErrUnexpectedEOF
  843. }
  844. b := data[iNdEx]
  845. iNdEx++
  846. m.LatestBlockHeight |= (int64(b) & 0x7F) << shift
  847. if b < 0x80 {
  848. break
  849. }
  850. }
  851. hasFields[0] |= uint64(0x00000004)
  852. case 5:
  853. if wireType != 0 {
  854. return fmt.Errorf("proto: wrong wireType = %d for field LatestBlocktime", wireType)
  855. }
  856. m.LatestBlocktime = 0
  857. for shift := uint(0); ; shift += 7 {
  858. if shift >= 64 {
  859. return ErrIntOverflowTest
  860. }
  861. if iNdEx >= l {
  862. return io.ErrUnexpectedEOF
  863. }
  864. b := data[iNdEx]
  865. iNdEx++
  866. m.LatestBlocktime |= (int64(b) & 0x7F) << shift
  867. if b < 0x80 {
  868. break
  869. }
  870. }
  871. hasFields[0] |= uint64(0x00000008)
  872. default:
  873. iNdEx = preIndex
  874. skippy, err := skipTest(data[iNdEx:])
  875. if err != nil {
  876. return err
  877. }
  878. if skippy < 0 {
  879. return ErrInvalidLengthTest
  880. }
  881. if (iNdEx + skippy) > l {
  882. return io.ErrUnexpectedEOF
  883. }
  884. iNdEx += skippy
  885. }
  886. }
  887. if hasFields[0]&uint64(0x00000001) == 0 {
  888. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
  889. }
  890. if hasFields[0]&uint64(0x00000002) == 0 {
  891. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("latestBlockHash")
  892. }
  893. if hasFields[0]&uint64(0x00000004) == 0 {
  894. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("latestBlockHeight")
  895. }
  896. if hasFields[0]&uint64(0x00000008) == 0 {
  897. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("latestBlocktime")
  898. }
  899. if iNdEx > l {
  900. return io.ErrUnexpectedEOF
  901. }
  902. return nil
  903. }
  904. func (m *NodeInfo) Unmarshal(data []byte) error {
  905. var hasFields [1]uint64
  906. l := len(data)
  907. iNdEx := 0
  908. for iNdEx < l {
  909. preIndex := iNdEx
  910. var wire uint64
  911. for shift := uint(0); ; shift += 7 {
  912. if shift >= 64 {
  913. return ErrIntOverflowTest
  914. }
  915. if iNdEx >= l {
  916. return io.ErrUnexpectedEOF
  917. }
  918. b := data[iNdEx]
  919. iNdEx++
  920. wire |= (uint64(b) & 0x7F) << shift
  921. if b < 0x80 {
  922. break
  923. }
  924. }
  925. fieldNum := int32(wire >> 3)
  926. wireType := int(wire & 0x7)
  927. if wireType == 4 {
  928. return fmt.Errorf("proto: NodeInfo: wiretype end group for non-group")
  929. }
  930. if fieldNum <= 0 {
  931. return fmt.Errorf("proto: NodeInfo: illegal tag %d (wire type %d)", fieldNum, wire)
  932. }
  933. switch fieldNum {
  934. case 1:
  935. if wireType != 2 {
  936. return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType)
  937. }
  938. var msglen int
  939. for shift := uint(0); ; shift += 7 {
  940. if shift >= 64 {
  941. return ErrIntOverflowTest
  942. }
  943. if iNdEx >= l {
  944. return io.ErrUnexpectedEOF
  945. }
  946. b := data[iNdEx]
  947. iNdEx++
  948. msglen |= (int(b) & 0x7F) << shift
  949. if b < 0x80 {
  950. break
  951. }
  952. }
  953. if msglen < 0 {
  954. return ErrInvalidLengthTest
  955. }
  956. postIndex := iNdEx + msglen
  957. if postIndex > l {
  958. return io.ErrUnexpectedEOF
  959. }
  960. if m.PubKey == nil {
  961. m.PubKey = &PubKey{}
  962. }
  963. if err := m.PubKey.Unmarshal(data[iNdEx:postIndex]); err != nil {
  964. return err
  965. }
  966. iNdEx = postIndex
  967. hasFields[0] |= uint64(0x00000001)
  968. case 2:
  969. if wireType != 2 {
  970. return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType)
  971. }
  972. var stringLen uint64
  973. for shift := uint(0); ; shift += 7 {
  974. if shift >= 64 {
  975. return ErrIntOverflowTest
  976. }
  977. if iNdEx >= l {
  978. return io.ErrUnexpectedEOF
  979. }
  980. b := data[iNdEx]
  981. iNdEx++
  982. stringLen |= (uint64(b) & 0x7F) << shift
  983. if b < 0x80 {
  984. break
  985. }
  986. }
  987. intStringLen := int(stringLen)
  988. if intStringLen < 0 {
  989. return ErrInvalidLengthTest
  990. }
  991. postIndex := iNdEx + intStringLen
  992. if postIndex > l {
  993. return io.ErrUnexpectedEOF
  994. }
  995. m.Moniker = string(data[iNdEx:postIndex])
  996. iNdEx = postIndex
  997. hasFields[0] |= uint64(0x00000002)
  998. case 3:
  999. if wireType != 2 {
  1000. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  1001. }
  1002. var stringLen uint64
  1003. for shift := uint(0); ; shift += 7 {
  1004. if shift >= 64 {
  1005. return ErrIntOverflowTest
  1006. }
  1007. if iNdEx >= l {
  1008. return io.ErrUnexpectedEOF
  1009. }
  1010. b := data[iNdEx]
  1011. iNdEx++
  1012. stringLen |= (uint64(b) & 0x7F) << shift
  1013. if b < 0x80 {
  1014. break
  1015. }
  1016. }
  1017. intStringLen := int(stringLen)
  1018. if intStringLen < 0 {
  1019. return ErrInvalidLengthTest
  1020. }
  1021. postIndex := iNdEx + intStringLen
  1022. if postIndex > l {
  1023. return io.ErrUnexpectedEOF
  1024. }
  1025. m.Network = string(data[iNdEx:postIndex])
  1026. iNdEx = postIndex
  1027. hasFields[0] |= uint64(0x00000004)
  1028. case 4:
  1029. if wireType != 2 {
  1030. return fmt.Errorf("proto: wrong wireType = %d for field RemoteAddr", wireType)
  1031. }
  1032. var stringLen uint64
  1033. for shift := uint(0); ; shift += 7 {
  1034. if shift >= 64 {
  1035. return ErrIntOverflowTest
  1036. }
  1037. if iNdEx >= l {
  1038. return io.ErrUnexpectedEOF
  1039. }
  1040. b := data[iNdEx]
  1041. iNdEx++
  1042. stringLen |= (uint64(b) & 0x7F) << shift
  1043. if b < 0x80 {
  1044. break
  1045. }
  1046. }
  1047. intStringLen := int(stringLen)
  1048. if intStringLen < 0 {
  1049. return ErrInvalidLengthTest
  1050. }
  1051. postIndex := iNdEx + intStringLen
  1052. if postIndex > l {
  1053. return io.ErrUnexpectedEOF
  1054. }
  1055. m.RemoteAddr = string(data[iNdEx:postIndex])
  1056. iNdEx = postIndex
  1057. hasFields[0] |= uint64(0x00000008)
  1058. case 5:
  1059. if wireType != 2 {
  1060. return fmt.Errorf("proto: wrong wireType = %d for field ListenAddr", wireType)
  1061. }
  1062. var stringLen uint64
  1063. for shift := uint(0); ; shift += 7 {
  1064. if shift >= 64 {
  1065. return ErrIntOverflowTest
  1066. }
  1067. if iNdEx >= l {
  1068. return io.ErrUnexpectedEOF
  1069. }
  1070. b := data[iNdEx]
  1071. iNdEx++
  1072. stringLen |= (uint64(b) & 0x7F) << shift
  1073. if b < 0x80 {
  1074. break
  1075. }
  1076. }
  1077. intStringLen := int(stringLen)
  1078. if intStringLen < 0 {
  1079. return ErrInvalidLengthTest
  1080. }
  1081. postIndex := iNdEx + intStringLen
  1082. if postIndex > l {
  1083. return io.ErrUnexpectedEOF
  1084. }
  1085. m.ListenAddr = string(data[iNdEx:postIndex])
  1086. iNdEx = postIndex
  1087. hasFields[0] |= uint64(0x00000010)
  1088. case 6:
  1089. if wireType != 2 {
  1090. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1091. }
  1092. var stringLen uint64
  1093. for shift := uint(0); ; shift += 7 {
  1094. if shift >= 64 {
  1095. return ErrIntOverflowTest
  1096. }
  1097. if iNdEx >= l {
  1098. return io.ErrUnexpectedEOF
  1099. }
  1100. b := data[iNdEx]
  1101. iNdEx++
  1102. stringLen |= (uint64(b) & 0x7F) << shift
  1103. if b < 0x80 {
  1104. break
  1105. }
  1106. }
  1107. intStringLen := int(stringLen)
  1108. if intStringLen < 0 {
  1109. return ErrInvalidLengthTest
  1110. }
  1111. postIndex := iNdEx + intStringLen
  1112. if postIndex > l {
  1113. return io.ErrUnexpectedEOF
  1114. }
  1115. m.Version = string(data[iNdEx:postIndex])
  1116. iNdEx = postIndex
  1117. hasFields[0] |= uint64(0x00000020)
  1118. case 7:
  1119. if wireType != 2 {
  1120. return fmt.Errorf("proto: wrong wireType = %d for field Other", wireType)
  1121. }
  1122. var stringLen uint64
  1123. for shift := uint(0); ; shift += 7 {
  1124. if shift >= 64 {
  1125. return ErrIntOverflowTest
  1126. }
  1127. if iNdEx >= l {
  1128. return io.ErrUnexpectedEOF
  1129. }
  1130. b := data[iNdEx]
  1131. iNdEx++
  1132. stringLen |= (uint64(b) & 0x7F) << shift
  1133. if b < 0x80 {
  1134. break
  1135. }
  1136. }
  1137. intStringLen := int(stringLen)
  1138. if intStringLen < 0 {
  1139. return ErrInvalidLengthTest
  1140. }
  1141. postIndex := iNdEx + intStringLen
  1142. if postIndex > l {
  1143. return io.ErrUnexpectedEOF
  1144. }
  1145. m.Other = append(m.Other, string(data[iNdEx:postIndex]))
  1146. iNdEx = postIndex
  1147. default:
  1148. iNdEx = preIndex
  1149. skippy, err := skipTest(data[iNdEx:])
  1150. if err != nil {
  1151. return err
  1152. }
  1153. if skippy < 0 {
  1154. return ErrInvalidLengthTest
  1155. }
  1156. if (iNdEx + skippy) > l {
  1157. return io.ErrUnexpectedEOF
  1158. }
  1159. iNdEx += skippy
  1160. }
  1161. }
  1162. if hasFields[0]&uint64(0x00000001) == 0 {
  1163. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("pubKey")
  1164. }
  1165. if hasFields[0]&uint64(0x00000002) == 0 {
  1166. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("moniker")
  1167. }
  1168. if hasFields[0]&uint64(0x00000004) == 0 {
  1169. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("network")
  1170. }
  1171. if hasFields[0]&uint64(0x00000008) == 0 {
  1172. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("remoteAddr")
  1173. }
  1174. if hasFields[0]&uint64(0x00000010) == 0 {
  1175. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("listenAddr")
  1176. }
  1177. if hasFields[0]&uint64(0x00000020) == 0 {
  1178. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("version")
  1179. }
  1180. if iNdEx > l {
  1181. return io.ErrUnexpectedEOF
  1182. }
  1183. return nil
  1184. }
  1185. func (m *PubKey) Unmarshal(data []byte) error {
  1186. l := len(data)
  1187. iNdEx := 0
  1188. for iNdEx < l {
  1189. preIndex := iNdEx
  1190. var wire uint64
  1191. for shift := uint(0); ; shift += 7 {
  1192. if shift >= 64 {
  1193. return ErrIntOverflowTest
  1194. }
  1195. if iNdEx >= l {
  1196. return io.ErrUnexpectedEOF
  1197. }
  1198. b := data[iNdEx]
  1199. iNdEx++
  1200. wire |= (uint64(b) & 0x7F) << shift
  1201. if b < 0x80 {
  1202. break
  1203. }
  1204. }
  1205. fieldNum := int32(wire >> 3)
  1206. wireType := int(wire & 0x7)
  1207. if wireType == 4 {
  1208. return fmt.Errorf("proto: PubKey: wiretype end group for non-group")
  1209. }
  1210. if fieldNum <= 0 {
  1211. return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire)
  1212. }
  1213. switch fieldNum {
  1214. case 1:
  1215. if wireType != 2 {
  1216. return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType)
  1217. }
  1218. var msglen int
  1219. for shift := uint(0); ; shift += 7 {
  1220. if shift >= 64 {
  1221. return ErrIntOverflowTest
  1222. }
  1223. if iNdEx >= l {
  1224. return io.ErrUnexpectedEOF
  1225. }
  1226. b := data[iNdEx]
  1227. iNdEx++
  1228. msglen |= (int(b) & 0x7F) << shift
  1229. if b < 0x80 {
  1230. break
  1231. }
  1232. }
  1233. if msglen < 0 {
  1234. return ErrInvalidLengthTest
  1235. }
  1236. postIndex := iNdEx + msglen
  1237. if postIndex > l {
  1238. return io.ErrUnexpectedEOF
  1239. }
  1240. if m.Ed25519 == nil {
  1241. m.Ed25519 = &PubKeyEd25519{}
  1242. }
  1243. if err := m.Ed25519.Unmarshal(data[iNdEx:postIndex]); err != nil {
  1244. return err
  1245. }
  1246. iNdEx = postIndex
  1247. default:
  1248. iNdEx = preIndex
  1249. skippy, err := skipTest(data[iNdEx:])
  1250. if err != nil {
  1251. return err
  1252. }
  1253. if skippy < 0 {
  1254. return ErrInvalidLengthTest
  1255. }
  1256. if (iNdEx + skippy) > l {
  1257. return io.ErrUnexpectedEOF
  1258. }
  1259. iNdEx += skippy
  1260. }
  1261. }
  1262. if iNdEx > l {
  1263. return io.ErrUnexpectedEOF
  1264. }
  1265. return nil
  1266. }
  1267. func (m *PubKeyEd25519) Unmarshal(data []byte) error {
  1268. var hasFields [1]uint64
  1269. l := len(data)
  1270. iNdEx := 0
  1271. for iNdEx < l {
  1272. preIndex := iNdEx
  1273. var wire uint64
  1274. for shift := uint(0); ; shift += 7 {
  1275. if shift >= 64 {
  1276. return ErrIntOverflowTest
  1277. }
  1278. if iNdEx >= l {
  1279. return io.ErrUnexpectedEOF
  1280. }
  1281. b := data[iNdEx]
  1282. iNdEx++
  1283. wire |= (uint64(b) & 0x7F) << shift
  1284. if b < 0x80 {
  1285. break
  1286. }
  1287. }
  1288. fieldNum := int32(wire >> 3)
  1289. wireType := int(wire & 0x7)
  1290. if wireType == 4 {
  1291. return fmt.Errorf("proto: PubKeyEd25519: wiretype end group for non-group")
  1292. }
  1293. if fieldNum <= 0 {
  1294. return fmt.Errorf("proto: PubKeyEd25519: illegal tag %d (wire type %d)", fieldNum, wire)
  1295. }
  1296. switch fieldNum {
  1297. case 1:
  1298. if wireType != 2 {
  1299. return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType)
  1300. }
  1301. var byteLen int
  1302. for shift := uint(0); ; shift += 7 {
  1303. if shift >= 64 {
  1304. return ErrIntOverflowTest
  1305. }
  1306. if iNdEx >= l {
  1307. return io.ErrUnexpectedEOF
  1308. }
  1309. b := data[iNdEx]
  1310. iNdEx++
  1311. byteLen |= (int(b) & 0x7F) << shift
  1312. if b < 0x80 {
  1313. break
  1314. }
  1315. }
  1316. if byteLen < 0 {
  1317. return ErrInvalidLengthTest
  1318. }
  1319. postIndex := iNdEx + byteLen
  1320. if postIndex > l {
  1321. return io.ErrUnexpectedEOF
  1322. }
  1323. m.Bytes = append([]byte{}, data[iNdEx:postIndex]...)
  1324. iNdEx = postIndex
  1325. hasFields[0] |= uint64(0x00000001)
  1326. default:
  1327. iNdEx = preIndex
  1328. skippy, err := skipTest(data[iNdEx:])
  1329. if err != nil {
  1330. return err
  1331. }
  1332. if skippy < 0 {
  1333. return ErrInvalidLengthTest
  1334. }
  1335. if (iNdEx + skippy) > l {
  1336. return io.ErrUnexpectedEOF
  1337. }
  1338. iNdEx += skippy
  1339. }
  1340. }
  1341. if hasFields[0]&uint64(0x00000001) == 0 {
  1342. return github_com_gogo_protobuf_proto.NewRequiredNotSetError("bytes")
  1343. }
  1344. if iNdEx > l {
  1345. return io.ErrUnexpectedEOF
  1346. }
  1347. return nil
  1348. }
  1349. func skipTest(data []byte) (n int, err error) {
  1350. l := len(data)
  1351. iNdEx := 0
  1352. for iNdEx < l {
  1353. var wire uint64
  1354. for shift := uint(0); ; shift += 7 {
  1355. if shift >= 64 {
  1356. return 0, ErrIntOverflowTest
  1357. }
  1358. if iNdEx >= l {
  1359. return 0, io.ErrUnexpectedEOF
  1360. }
  1361. b := data[iNdEx]
  1362. iNdEx++
  1363. wire |= (uint64(b) & 0x7F) << shift
  1364. if b < 0x80 {
  1365. break
  1366. }
  1367. }
  1368. wireType := int(wire & 0x7)
  1369. switch wireType {
  1370. case 0:
  1371. for shift := uint(0); ; shift += 7 {
  1372. if shift >= 64 {
  1373. return 0, ErrIntOverflowTest
  1374. }
  1375. if iNdEx >= l {
  1376. return 0, io.ErrUnexpectedEOF
  1377. }
  1378. iNdEx++
  1379. if data[iNdEx-1] < 0x80 {
  1380. break
  1381. }
  1382. }
  1383. return iNdEx, nil
  1384. case 1:
  1385. iNdEx += 8
  1386. return iNdEx, nil
  1387. case 2:
  1388. var length int
  1389. for shift := uint(0); ; shift += 7 {
  1390. if shift >= 64 {
  1391. return 0, ErrIntOverflowTest
  1392. }
  1393. if iNdEx >= l {
  1394. return 0, io.ErrUnexpectedEOF
  1395. }
  1396. b := data[iNdEx]
  1397. iNdEx++
  1398. length |= (int(b) & 0x7F) << shift
  1399. if b < 0x80 {
  1400. break
  1401. }
  1402. }
  1403. iNdEx += length
  1404. if length < 0 {
  1405. return 0, ErrInvalidLengthTest
  1406. }
  1407. return iNdEx, nil
  1408. case 3:
  1409. for {
  1410. var innerWire uint64
  1411. var start int = iNdEx
  1412. for shift := uint(0); ; shift += 7 {
  1413. if shift >= 64 {
  1414. return 0, ErrIntOverflowTest
  1415. }
  1416. if iNdEx >= l {
  1417. return 0, io.ErrUnexpectedEOF
  1418. }
  1419. b := data[iNdEx]
  1420. iNdEx++
  1421. innerWire |= (uint64(b) & 0x7F) << shift
  1422. if b < 0x80 {
  1423. break
  1424. }
  1425. }
  1426. innerWireType := int(innerWire & 0x7)
  1427. if innerWireType == 4 {
  1428. break
  1429. }
  1430. next, err := skipTest(data[start:])
  1431. if err != nil {
  1432. return 0, err
  1433. }
  1434. iNdEx = start + next
  1435. }
  1436. return iNdEx, nil
  1437. case 4:
  1438. return iNdEx, nil
  1439. case 5:
  1440. iNdEx += 4
  1441. return iNdEx, nil
  1442. default:
  1443. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1444. }
  1445. }
  1446. panic("unreachable")
  1447. }
  1448. var (
  1449. ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling")
  1450. ErrIntOverflowTest = fmt.Errorf("proto: integer overflow")
  1451. )