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.

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