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.

1464 lines
35 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: proto/p2p/types.proto
  3. package p2p
  4. import (
  5. fmt "fmt"
  6. _ "github.com/gogo/protobuf/gogoproto"
  7. proto "github.com/gogo/protobuf/proto"
  8. io "io"
  9. math "math"
  10. math_bits "math/bits"
  11. )
  12. // Reference imports to suppress errors if they are not otherwise used.
  13. var _ = proto.Marshal
  14. var _ = fmt.Errorf
  15. var _ = math.Inf
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the proto package it is being compiled against.
  18. // A compilation error at this line likely means your copy of the
  19. // proto package needs to be updated.
  20. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  21. type NetAddress struct {
  22. ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  23. IP string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
  24. Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
  25. Str string `protobuf:"bytes,4,opt,name=str,proto3" json:"str,omitempty"`
  26. }
  27. func (m *NetAddress) Reset() { *m = NetAddress{} }
  28. func (m *NetAddress) String() string { return proto.CompactTextString(m) }
  29. func (*NetAddress) ProtoMessage() {}
  30. func (*NetAddress) Descriptor() ([]byte, []int) {
  31. return fileDescriptor_5c4320c1810ca85c, []int{0}
  32. }
  33. func (m *NetAddress) XXX_Unmarshal(b []byte) error {
  34. return m.Unmarshal(b)
  35. }
  36. func (m *NetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  37. if deterministic {
  38. return xxx_messageInfo_NetAddress.Marshal(b, m, deterministic)
  39. } else {
  40. b = b[:cap(b)]
  41. n, err := m.MarshalToSizedBuffer(b)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return b[:n], nil
  46. }
  47. }
  48. func (m *NetAddress) XXX_Merge(src proto.Message) {
  49. xxx_messageInfo_NetAddress.Merge(m, src)
  50. }
  51. func (m *NetAddress) XXX_Size() int {
  52. return m.Size()
  53. }
  54. func (m *NetAddress) XXX_DiscardUnknown() {
  55. xxx_messageInfo_NetAddress.DiscardUnknown(m)
  56. }
  57. var xxx_messageInfo_NetAddress proto.InternalMessageInfo
  58. func (m *NetAddress) GetID() string {
  59. if m != nil {
  60. return m.ID
  61. }
  62. return ""
  63. }
  64. func (m *NetAddress) GetIP() string {
  65. if m != nil {
  66. return m.IP
  67. }
  68. return ""
  69. }
  70. func (m *NetAddress) GetPort() uint32 {
  71. if m != nil {
  72. return m.Port
  73. }
  74. return 0
  75. }
  76. func (m *NetAddress) GetStr() string {
  77. if m != nil {
  78. return m.Str
  79. }
  80. return ""
  81. }
  82. type ProtocolVersion struct {
  83. P2P uint64 `protobuf:"varint,1,opt,name=p2p,proto3" json:"p2p,omitempty"`
  84. Block uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
  85. App uint64 `protobuf:"varint,3,opt,name=app,proto3" json:"app,omitempty"`
  86. }
  87. func (m *ProtocolVersion) Reset() { *m = ProtocolVersion{} }
  88. func (m *ProtocolVersion) String() string { return proto.CompactTextString(m) }
  89. func (*ProtocolVersion) ProtoMessage() {}
  90. func (*ProtocolVersion) Descriptor() ([]byte, []int) {
  91. return fileDescriptor_5c4320c1810ca85c, []int{1}
  92. }
  93. func (m *ProtocolVersion) XXX_Unmarshal(b []byte) error {
  94. return m.Unmarshal(b)
  95. }
  96. func (m *ProtocolVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  97. if deterministic {
  98. return xxx_messageInfo_ProtocolVersion.Marshal(b, m, deterministic)
  99. } else {
  100. b = b[:cap(b)]
  101. n, err := m.MarshalToSizedBuffer(b)
  102. if err != nil {
  103. return nil, err
  104. }
  105. return b[:n], nil
  106. }
  107. }
  108. func (m *ProtocolVersion) XXX_Merge(src proto.Message) {
  109. xxx_messageInfo_ProtocolVersion.Merge(m, src)
  110. }
  111. func (m *ProtocolVersion) XXX_Size() int {
  112. return m.Size()
  113. }
  114. func (m *ProtocolVersion) XXX_DiscardUnknown() {
  115. xxx_messageInfo_ProtocolVersion.DiscardUnknown(m)
  116. }
  117. var xxx_messageInfo_ProtocolVersion proto.InternalMessageInfo
  118. func (m *ProtocolVersion) GetP2P() uint64 {
  119. if m != nil {
  120. return m.P2P
  121. }
  122. return 0
  123. }
  124. func (m *ProtocolVersion) GetBlock() uint64 {
  125. if m != nil {
  126. return m.Block
  127. }
  128. return 0
  129. }
  130. func (m *ProtocolVersion) GetApp() uint64 {
  131. if m != nil {
  132. return m.App
  133. }
  134. return 0
  135. }
  136. type DefaultNodeInfo struct {
  137. ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"`
  138. DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"`
  139. ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"`
  140. Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
  141. Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
  142. Channels []byte `protobuf:"bytes,6,opt,name=channels,proto3" json:"channels,omitempty"`
  143. Moniker string `protobuf:"bytes,7,opt,name=moniker,proto3" json:"moniker,omitempty"`
  144. Other DefaultNodeInfoOther `protobuf:"bytes,8,opt,name=other,proto3" json:"other"`
  145. }
  146. func (m *DefaultNodeInfo) Reset() { *m = DefaultNodeInfo{} }
  147. func (m *DefaultNodeInfo) String() string { return proto.CompactTextString(m) }
  148. func (*DefaultNodeInfo) ProtoMessage() {}
  149. func (*DefaultNodeInfo) Descriptor() ([]byte, []int) {
  150. return fileDescriptor_5c4320c1810ca85c, []int{2}
  151. }
  152. func (m *DefaultNodeInfo) XXX_Unmarshal(b []byte) error {
  153. return m.Unmarshal(b)
  154. }
  155. func (m *DefaultNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  156. if deterministic {
  157. return xxx_messageInfo_DefaultNodeInfo.Marshal(b, m, deterministic)
  158. } else {
  159. b = b[:cap(b)]
  160. n, err := m.MarshalToSizedBuffer(b)
  161. if err != nil {
  162. return nil, err
  163. }
  164. return b[:n], nil
  165. }
  166. }
  167. func (m *DefaultNodeInfo) XXX_Merge(src proto.Message) {
  168. xxx_messageInfo_DefaultNodeInfo.Merge(m, src)
  169. }
  170. func (m *DefaultNodeInfo) XXX_Size() int {
  171. return m.Size()
  172. }
  173. func (m *DefaultNodeInfo) XXX_DiscardUnknown() {
  174. xxx_messageInfo_DefaultNodeInfo.DiscardUnknown(m)
  175. }
  176. var xxx_messageInfo_DefaultNodeInfo proto.InternalMessageInfo
  177. func (m *DefaultNodeInfo) GetProtocolVersion() ProtocolVersion {
  178. if m != nil {
  179. return m.ProtocolVersion
  180. }
  181. return ProtocolVersion{}
  182. }
  183. func (m *DefaultNodeInfo) GetDefaultNodeID() string {
  184. if m != nil {
  185. return m.DefaultNodeID
  186. }
  187. return ""
  188. }
  189. func (m *DefaultNodeInfo) GetListenAddr() string {
  190. if m != nil {
  191. return m.ListenAddr
  192. }
  193. return ""
  194. }
  195. func (m *DefaultNodeInfo) GetNetwork() string {
  196. if m != nil {
  197. return m.Network
  198. }
  199. return ""
  200. }
  201. func (m *DefaultNodeInfo) GetVersion() string {
  202. if m != nil {
  203. return m.Version
  204. }
  205. return ""
  206. }
  207. func (m *DefaultNodeInfo) GetChannels() []byte {
  208. if m != nil {
  209. return m.Channels
  210. }
  211. return nil
  212. }
  213. func (m *DefaultNodeInfo) GetMoniker() string {
  214. if m != nil {
  215. return m.Moniker
  216. }
  217. return ""
  218. }
  219. func (m *DefaultNodeInfo) GetOther() DefaultNodeInfoOther {
  220. if m != nil {
  221. return m.Other
  222. }
  223. return DefaultNodeInfoOther{}
  224. }
  225. type DefaultNodeInfoOther struct {
  226. TxIndex string `protobuf:"bytes,1,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
  227. RPCAdddress string `protobuf:"bytes,2,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"`
  228. }
  229. func (m *DefaultNodeInfoOther) Reset() { *m = DefaultNodeInfoOther{} }
  230. func (m *DefaultNodeInfoOther) String() string { return proto.CompactTextString(m) }
  231. func (*DefaultNodeInfoOther) ProtoMessage() {}
  232. func (*DefaultNodeInfoOther) Descriptor() ([]byte, []int) {
  233. return fileDescriptor_5c4320c1810ca85c, []int{3}
  234. }
  235. func (m *DefaultNodeInfoOther) XXX_Unmarshal(b []byte) error {
  236. return m.Unmarshal(b)
  237. }
  238. func (m *DefaultNodeInfoOther) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  239. if deterministic {
  240. return xxx_messageInfo_DefaultNodeInfoOther.Marshal(b, m, deterministic)
  241. } else {
  242. b = b[:cap(b)]
  243. n, err := m.MarshalToSizedBuffer(b)
  244. if err != nil {
  245. return nil, err
  246. }
  247. return b[:n], nil
  248. }
  249. }
  250. func (m *DefaultNodeInfoOther) XXX_Merge(src proto.Message) {
  251. xxx_messageInfo_DefaultNodeInfoOther.Merge(m, src)
  252. }
  253. func (m *DefaultNodeInfoOther) XXX_Size() int {
  254. return m.Size()
  255. }
  256. func (m *DefaultNodeInfoOther) XXX_DiscardUnknown() {
  257. xxx_messageInfo_DefaultNodeInfoOther.DiscardUnknown(m)
  258. }
  259. var xxx_messageInfo_DefaultNodeInfoOther proto.InternalMessageInfo
  260. func (m *DefaultNodeInfoOther) GetTxIndex() string {
  261. if m != nil {
  262. return m.TxIndex
  263. }
  264. return ""
  265. }
  266. func (m *DefaultNodeInfoOther) GetRPCAdddress() string {
  267. if m != nil {
  268. return m.RPCAdddress
  269. }
  270. return ""
  271. }
  272. func init() {
  273. proto.RegisterType((*NetAddress)(nil), "tendermint.proto.p2p.NetAddress")
  274. proto.RegisterType((*ProtocolVersion)(nil), "tendermint.proto.p2p.ProtocolVersion")
  275. proto.RegisterType((*DefaultNodeInfo)(nil), "tendermint.proto.p2p.DefaultNodeInfo")
  276. proto.RegisterType((*DefaultNodeInfoOther)(nil), "tendermint.proto.p2p.DefaultNodeInfoOther")
  277. }
  278. func init() { proto.RegisterFile("proto/p2p/types.proto", fileDescriptor_5c4320c1810ca85c) }
  279. var fileDescriptor_5c4320c1810ca85c = []byte{
  280. // 498 bytes of a gzipped FileDescriptorProto
  281. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0xcf, 0x6e, 0x1a, 0x3f,
  282. 0x18, 0x64, 0x97, 0xe5, 0x4f, 0x3e, 0x7e, 0x88, 0xfc, 0x2c, 0x5a, 0x6d, 0x72, 0xd8, 0x45, 0x48,
  283. 0xad, 0x50, 0x0e, 0x50, 0xd1, 0x53, 0x8f, 0xa1, 0xa8, 0x12, 0x97, 0x14, 0x59, 0x55, 0x0e, 0xbd,
  284. 0xac, 0x60, 0xed, 0x80, 0x05, 0xd8, 0x96, 0xd7, 0x69, 0xc9, 0x5b, 0xf4, 0xb1, 0x72, 0xcc, 0xb1,
  285. 0x27, 0x54, 0x2d, 0x0f, 0xd1, 0x6b, 0x65, 0x7b, 0x93, 0x20, 0xc4, 0x6d, 0x66, 0xec, 0xd9, 0xf9,
  286. 0xbe, 0x91, 0x17, 0xde, 0x48, 0x25, 0xb4, 0x18, 0xc8, 0xa1, 0x1c, 0xe8, 0x07, 0x49, 0xb3, 0xbe,
  287. 0xe5, 0xa8, 0xad, 0x29, 0x27, 0x54, 0x6d, 0x18, 0xd7, 0x4e, 0xe9, 0xcb, 0xa1, 0xbc, 0x7c, 0xaf,
  288. 0x97, 0x4c, 0x91, 0x44, 0xce, 0x94, 0x7e, 0x18, 0x38, 0xe3, 0x42, 0x2c, 0xc4, 0x2b, 0x72, 0x77,
  289. 0xbb, 0x73, 0x80, 0x1b, 0xaa, 0xaf, 0x09, 0x51, 0x34, 0xcb, 0xd0, 0x5b, 0xf0, 0x19, 0x09, 0xbd,
  290. 0x8e, 0xd7, 0x3b, 0x1b, 0x55, 0xf3, 0x5d, 0xec, 0x4f, 0xc6, 0xd8, 0x67, 0xc4, 0xea, 0x32, 0xf4,
  291. 0x0f, 0xf4, 0x29, 0xf6, 0x99, 0x44, 0x08, 0x02, 0x29, 0x94, 0x0e, 0xcb, 0x1d, 0xaf, 0xd7, 0xc4,
  292. 0x16, 0xa3, 0x73, 0x28, 0x67, 0x5a, 0x85, 0x81, 0xb9, 0x8c, 0x0d, 0xec, 0x7e, 0x83, 0xd6, 0xd4,
  293. 0x84, 0xa5, 0x62, 0x7d, 0x4b, 0x55, 0xc6, 0x04, 0x47, 0x17, 0x50, 0x96, 0x43, 0x69, 0x93, 0x82,
  294. 0x51, 0x2d, 0xdf, 0xc5, 0xe5, 0xe9, 0x70, 0x8a, 0x8d, 0x86, 0xda, 0x50, 0x99, 0xaf, 0x45, 0xba,
  295. 0xb2, 0x71, 0x01, 0x76, 0xc4, 0x7c, 0x75, 0x26, 0xa5, 0x0d, 0x0a, 0xb0, 0x81, 0xdd, 0xbf, 0x3e,
  296. 0xb4, 0xc6, 0xf4, 0x6e, 0x76, 0xbf, 0xd6, 0x37, 0x82, 0xd0, 0x09, 0xbf, 0x13, 0xe8, 0x16, 0xce,
  297. 0x65, 0x91, 0x94, 0xfc, 0x70, 0x51, 0x36, 0xa3, 0x31, 0x7c, 0xd7, 0x3f, 0x55, 0x53, 0xff, 0x68,
  298. 0xae, 0x51, 0xf0, 0xb8, 0x8b, 0x4b, 0xb8, 0x25, 0x8f, 0xc6, 0xfd, 0x04, 0x2d, 0xe2, 0xa2, 0x12,
  299. 0x2e, 0x08, 0x4d, 0x18, 0x29, 0xca, 0xf8, 0x3f, 0xdf, 0xc5, 0xcd, 0xc3, 0x29, 0xc6, 0xb8, 0x49,
  300. 0x0e, 0x28, 0x41, 0x31, 0x34, 0xd6, 0x2c, 0xd3, 0x94, 0x27, 0x33, 0x42, 0x94, 0x5d, 0xe0, 0x0c,
  301. 0x83, 0x93, 0x4c, 0xed, 0x28, 0x84, 0x1a, 0xa7, 0xfa, 0xa7, 0x50, 0xab, 0xa2, 0xb3, 0x67, 0x6a,
  302. 0x4e, 0x9e, 0x97, 0xa8, 0xb8, 0x93, 0x82, 0xa2, 0x4b, 0xa8, 0xa7, 0xcb, 0x19, 0xe7, 0x74, 0x9d,
  303. 0x85, 0xd5, 0x8e, 0xd7, 0xfb, 0x0f, 0xbf, 0x70, 0xe3, 0xda, 0x08, 0xce, 0x56, 0x54, 0x85, 0x35,
  304. 0xe7, 0x2a, 0x28, 0xfa, 0x02, 0x15, 0xa1, 0x97, 0x54, 0x85, 0x75, 0x5b, 0xc9, 0xd5, 0xe9, 0x4a,
  305. 0x8e, 0x3a, 0xfd, 0x6a, 0x1c, 0x45, 0x2f, 0xce, 0xde, 0x4d, 0xa1, 0x7d, 0xea, 0x12, 0xba, 0x80,
  306. 0xba, 0xde, 0x26, 0x8c, 0x13, 0xba, 0x75, 0x6f, 0x08, 0xd7, 0xf4, 0x76, 0x62, 0x28, 0xfa, 0x00,
  307. 0x0d, 0x25, 0x53, 0x5b, 0x01, 0xcd, 0xb2, 0xa2, 0xbc, 0x56, 0xbe, 0x8b, 0x1b, 0x78, 0xfa, 0xf9,
  308. 0x9a, 0x38, 0x19, 0x83, 0x92, 0x69, 0xf1, 0x14, 0x47, 0xe3, 0xc7, 0x3c, 0xf2, 0x9e, 0xf2, 0xc8,
  309. 0xfb, 0x93, 0x47, 0xde, 0xaf, 0x7d, 0x54, 0x7a, 0xda, 0x47, 0xa5, 0xdf, 0xfb, 0xa8, 0xf4, 0xfd,
  310. 0x6a, 0xc1, 0xf4, 0xf2, 0x7e, 0xde, 0x4f, 0xc5, 0x66, 0xf0, 0xba, 0xc1, 0x21, 0x7c, 0xf9, 0x51,
  311. 0xe6, 0x55, 0x0b, 0x3f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x48, 0x04, 0xbe, 0xde, 0x3c, 0x03,
  312. 0x00, 0x00,
  313. }
  314. func (m *NetAddress) Marshal() (dAtA []byte, err error) {
  315. size := m.Size()
  316. dAtA = make([]byte, size)
  317. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  318. if err != nil {
  319. return nil, err
  320. }
  321. return dAtA[:n], nil
  322. }
  323. func (m *NetAddress) MarshalTo(dAtA []byte) (int, error) {
  324. size := m.Size()
  325. return m.MarshalToSizedBuffer(dAtA[:size])
  326. }
  327. func (m *NetAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  328. i := len(dAtA)
  329. _ = i
  330. var l int
  331. _ = l
  332. if len(m.Str) > 0 {
  333. i -= len(m.Str)
  334. copy(dAtA[i:], m.Str)
  335. i = encodeVarintTypes(dAtA, i, uint64(len(m.Str)))
  336. i--
  337. dAtA[i] = 0x22
  338. }
  339. if m.Port != 0 {
  340. i = encodeVarintTypes(dAtA, i, uint64(m.Port))
  341. i--
  342. dAtA[i] = 0x18
  343. }
  344. if len(m.IP) > 0 {
  345. i -= len(m.IP)
  346. copy(dAtA[i:], m.IP)
  347. i = encodeVarintTypes(dAtA, i, uint64(len(m.IP)))
  348. i--
  349. dAtA[i] = 0x12
  350. }
  351. if len(m.ID) > 0 {
  352. i -= len(m.ID)
  353. copy(dAtA[i:], m.ID)
  354. i = encodeVarintTypes(dAtA, i, uint64(len(m.ID)))
  355. i--
  356. dAtA[i] = 0xa
  357. }
  358. return len(dAtA) - i, nil
  359. }
  360. func (m *ProtocolVersion) Marshal() (dAtA []byte, err error) {
  361. size := m.Size()
  362. dAtA = make([]byte, size)
  363. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  364. if err != nil {
  365. return nil, err
  366. }
  367. return dAtA[:n], nil
  368. }
  369. func (m *ProtocolVersion) MarshalTo(dAtA []byte) (int, error) {
  370. size := m.Size()
  371. return m.MarshalToSizedBuffer(dAtA[:size])
  372. }
  373. func (m *ProtocolVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  374. i := len(dAtA)
  375. _ = i
  376. var l int
  377. _ = l
  378. if m.App != 0 {
  379. i = encodeVarintTypes(dAtA, i, uint64(m.App))
  380. i--
  381. dAtA[i] = 0x18
  382. }
  383. if m.Block != 0 {
  384. i = encodeVarintTypes(dAtA, i, uint64(m.Block))
  385. i--
  386. dAtA[i] = 0x10
  387. }
  388. if m.P2P != 0 {
  389. i = encodeVarintTypes(dAtA, i, uint64(m.P2P))
  390. i--
  391. dAtA[i] = 0x8
  392. }
  393. return len(dAtA) - i, nil
  394. }
  395. func (m *DefaultNodeInfo) Marshal() (dAtA []byte, err error) {
  396. size := m.Size()
  397. dAtA = make([]byte, size)
  398. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  399. if err != nil {
  400. return nil, err
  401. }
  402. return dAtA[:n], nil
  403. }
  404. func (m *DefaultNodeInfo) MarshalTo(dAtA []byte) (int, error) {
  405. size := m.Size()
  406. return m.MarshalToSizedBuffer(dAtA[:size])
  407. }
  408. func (m *DefaultNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  409. i := len(dAtA)
  410. _ = i
  411. var l int
  412. _ = l
  413. {
  414. size, err := m.Other.MarshalToSizedBuffer(dAtA[:i])
  415. if err != nil {
  416. return 0, err
  417. }
  418. i -= size
  419. i = encodeVarintTypes(dAtA, i, uint64(size))
  420. }
  421. i--
  422. dAtA[i] = 0x42
  423. if len(m.Moniker) > 0 {
  424. i -= len(m.Moniker)
  425. copy(dAtA[i:], m.Moniker)
  426. i = encodeVarintTypes(dAtA, i, uint64(len(m.Moniker)))
  427. i--
  428. dAtA[i] = 0x3a
  429. }
  430. if len(m.Channels) > 0 {
  431. i -= len(m.Channels)
  432. copy(dAtA[i:], m.Channels)
  433. i = encodeVarintTypes(dAtA, i, uint64(len(m.Channels)))
  434. i--
  435. dAtA[i] = 0x32
  436. }
  437. if len(m.Version) > 0 {
  438. i -= len(m.Version)
  439. copy(dAtA[i:], m.Version)
  440. i = encodeVarintTypes(dAtA, i, uint64(len(m.Version)))
  441. i--
  442. dAtA[i] = 0x2a
  443. }
  444. if len(m.Network) > 0 {
  445. i -= len(m.Network)
  446. copy(dAtA[i:], m.Network)
  447. i = encodeVarintTypes(dAtA, i, uint64(len(m.Network)))
  448. i--
  449. dAtA[i] = 0x22
  450. }
  451. if len(m.ListenAddr) > 0 {
  452. i -= len(m.ListenAddr)
  453. copy(dAtA[i:], m.ListenAddr)
  454. i = encodeVarintTypes(dAtA, i, uint64(len(m.ListenAddr)))
  455. i--
  456. dAtA[i] = 0x1a
  457. }
  458. if len(m.DefaultNodeID) > 0 {
  459. i -= len(m.DefaultNodeID)
  460. copy(dAtA[i:], m.DefaultNodeID)
  461. i = encodeVarintTypes(dAtA, i, uint64(len(m.DefaultNodeID)))
  462. i--
  463. dAtA[i] = 0x12
  464. }
  465. {
  466. size, err := m.ProtocolVersion.MarshalToSizedBuffer(dAtA[:i])
  467. if err != nil {
  468. return 0, err
  469. }
  470. i -= size
  471. i = encodeVarintTypes(dAtA, i, uint64(size))
  472. }
  473. i--
  474. dAtA[i] = 0xa
  475. return len(dAtA) - i, nil
  476. }
  477. func (m *DefaultNodeInfoOther) Marshal() (dAtA []byte, err error) {
  478. size := m.Size()
  479. dAtA = make([]byte, size)
  480. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  481. if err != nil {
  482. return nil, err
  483. }
  484. return dAtA[:n], nil
  485. }
  486. func (m *DefaultNodeInfoOther) MarshalTo(dAtA []byte) (int, error) {
  487. size := m.Size()
  488. return m.MarshalToSizedBuffer(dAtA[:size])
  489. }
  490. func (m *DefaultNodeInfoOther) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  491. i := len(dAtA)
  492. _ = i
  493. var l int
  494. _ = l
  495. if len(m.RPCAdddress) > 0 {
  496. i -= len(m.RPCAdddress)
  497. copy(dAtA[i:], m.RPCAdddress)
  498. i = encodeVarintTypes(dAtA, i, uint64(len(m.RPCAdddress)))
  499. i--
  500. dAtA[i] = 0x12
  501. }
  502. if len(m.TxIndex) > 0 {
  503. i -= len(m.TxIndex)
  504. copy(dAtA[i:], m.TxIndex)
  505. i = encodeVarintTypes(dAtA, i, uint64(len(m.TxIndex)))
  506. i--
  507. dAtA[i] = 0xa
  508. }
  509. return len(dAtA) - i, nil
  510. }
  511. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  512. offset -= sovTypes(v)
  513. base := offset
  514. for v >= 1<<7 {
  515. dAtA[offset] = uint8(v&0x7f | 0x80)
  516. v >>= 7
  517. offset++
  518. }
  519. dAtA[offset] = uint8(v)
  520. return base
  521. }
  522. func (m *NetAddress) Size() (n int) {
  523. if m == nil {
  524. return 0
  525. }
  526. var l int
  527. _ = l
  528. l = len(m.ID)
  529. if l > 0 {
  530. n += 1 + l + sovTypes(uint64(l))
  531. }
  532. l = len(m.IP)
  533. if l > 0 {
  534. n += 1 + l + sovTypes(uint64(l))
  535. }
  536. if m.Port != 0 {
  537. n += 1 + sovTypes(uint64(m.Port))
  538. }
  539. l = len(m.Str)
  540. if l > 0 {
  541. n += 1 + l + sovTypes(uint64(l))
  542. }
  543. return n
  544. }
  545. func (m *ProtocolVersion) Size() (n int) {
  546. if m == nil {
  547. return 0
  548. }
  549. var l int
  550. _ = l
  551. if m.P2P != 0 {
  552. n += 1 + sovTypes(uint64(m.P2P))
  553. }
  554. if m.Block != 0 {
  555. n += 1 + sovTypes(uint64(m.Block))
  556. }
  557. if m.App != 0 {
  558. n += 1 + sovTypes(uint64(m.App))
  559. }
  560. return n
  561. }
  562. func (m *DefaultNodeInfo) Size() (n int) {
  563. if m == nil {
  564. return 0
  565. }
  566. var l int
  567. _ = l
  568. l = m.ProtocolVersion.Size()
  569. n += 1 + l + sovTypes(uint64(l))
  570. l = len(m.DefaultNodeID)
  571. if l > 0 {
  572. n += 1 + l + sovTypes(uint64(l))
  573. }
  574. l = len(m.ListenAddr)
  575. if l > 0 {
  576. n += 1 + l + sovTypes(uint64(l))
  577. }
  578. l = len(m.Network)
  579. if l > 0 {
  580. n += 1 + l + sovTypes(uint64(l))
  581. }
  582. l = len(m.Version)
  583. if l > 0 {
  584. n += 1 + l + sovTypes(uint64(l))
  585. }
  586. l = len(m.Channels)
  587. if l > 0 {
  588. n += 1 + l + sovTypes(uint64(l))
  589. }
  590. l = len(m.Moniker)
  591. if l > 0 {
  592. n += 1 + l + sovTypes(uint64(l))
  593. }
  594. l = m.Other.Size()
  595. n += 1 + l + sovTypes(uint64(l))
  596. return n
  597. }
  598. func (m *DefaultNodeInfoOther) Size() (n int) {
  599. if m == nil {
  600. return 0
  601. }
  602. var l int
  603. _ = l
  604. l = len(m.TxIndex)
  605. if l > 0 {
  606. n += 1 + l + sovTypes(uint64(l))
  607. }
  608. l = len(m.RPCAdddress)
  609. if l > 0 {
  610. n += 1 + l + sovTypes(uint64(l))
  611. }
  612. return n
  613. }
  614. func sovTypes(x uint64) (n int) {
  615. return (math_bits.Len64(x|1) + 6) / 7
  616. }
  617. func sozTypes(x uint64) (n int) {
  618. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  619. }
  620. func (m *NetAddress) Unmarshal(dAtA []byte) error {
  621. l := len(dAtA)
  622. iNdEx := 0
  623. for iNdEx < l {
  624. preIndex := iNdEx
  625. var wire uint64
  626. for shift := uint(0); ; shift += 7 {
  627. if shift >= 64 {
  628. return ErrIntOverflowTypes
  629. }
  630. if iNdEx >= l {
  631. return io.ErrUnexpectedEOF
  632. }
  633. b := dAtA[iNdEx]
  634. iNdEx++
  635. wire |= uint64(b&0x7F) << shift
  636. if b < 0x80 {
  637. break
  638. }
  639. }
  640. fieldNum := int32(wire >> 3)
  641. wireType := int(wire & 0x7)
  642. if wireType == 4 {
  643. return fmt.Errorf("proto: NetAddress: wiretype end group for non-group")
  644. }
  645. if fieldNum <= 0 {
  646. return fmt.Errorf("proto: NetAddress: illegal tag %d (wire type %d)", fieldNum, wire)
  647. }
  648. switch fieldNum {
  649. case 1:
  650. if wireType != 2 {
  651. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  652. }
  653. var stringLen uint64
  654. for shift := uint(0); ; shift += 7 {
  655. if shift >= 64 {
  656. return ErrIntOverflowTypes
  657. }
  658. if iNdEx >= l {
  659. return io.ErrUnexpectedEOF
  660. }
  661. b := dAtA[iNdEx]
  662. iNdEx++
  663. stringLen |= uint64(b&0x7F) << shift
  664. if b < 0x80 {
  665. break
  666. }
  667. }
  668. intStringLen := int(stringLen)
  669. if intStringLen < 0 {
  670. return ErrInvalidLengthTypes
  671. }
  672. postIndex := iNdEx + intStringLen
  673. if postIndex < 0 {
  674. return ErrInvalidLengthTypes
  675. }
  676. if postIndex > l {
  677. return io.ErrUnexpectedEOF
  678. }
  679. m.ID = string(dAtA[iNdEx:postIndex])
  680. iNdEx = postIndex
  681. case 2:
  682. if wireType != 2 {
  683. return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType)
  684. }
  685. var stringLen uint64
  686. for shift := uint(0); ; shift += 7 {
  687. if shift >= 64 {
  688. return ErrIntOverflowTypes
  689. }
  690. if iNdEx >= l {
  691. return io.ErrUnexpectedEOF
  692. }
  693. b := dAtA[iNdEx]
  694. iNdEx++
  695. stringLen |= uint64(b&0x7F) << shift
  696. if b < 0x80 {
  697. break
  698. }
  699. }
  700. intStringLen := int(stringLen)
  701. if intStringLen < 0 {
  702. return ErrInvalidLengthTypes
  703. }
  704. postIndex := iNdEx + intStringLen
  705. if postIndex < 0 {
  706. return ErrInvalidLengthTypes
  707. }
  708. if postIndex > l {
  709. return io.ErrUnexpectedEOF
  710. }
  711. m.IP = string(dAtA[iNdEx:postIndex])
  712. iNdEx = postIndex
  713. case 3:
  714. if wireType != 0 {
  715. return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
  716. }
  717. m.Port = 0
  718. for shift := uint(0); ; shift += 7 {
  719. if shift >= 64 {
  720. return ErrIntOverflowTypes
  721. }
  722. if iNdEx >= l {
  723. return io.ErrUnexpectedEOF
  724. }
  725. b := dAtA[iNdEx]
  726. iNdEx++
  727. m.Port |= uint32(b&0x7F) << shift
  728. if b < 0x80 {
  729. break
  730. }
  731. }
  732. case 4:
  733. if wireType != 2 {
  734. return fmt.Errorf("proto: wrong wireType = %d for field Str", wireType)
  735. }
  736. var stringLen uint64
  737. for shift := uint(0); ; shift += 7 {
  738. if shift >= 64 {
  739. return ErrIntOverflowTypes
  740. }
  741. if iNdEx >= l {
  742. return io.ErrUnexpectedEOF
  743. }
  744. b := dAtA[iNdEx]
  745. iNdEx++
  746. stringLen |= uint64(b&0x7F) << shift
  747. if b < 0x80 {
  748. break
  749. }
  750. }
  751. intStringLen := int(stringLen)
  752. if intStringLen < 0 {
  753. return ErrInvalidLengthTypes
  754. }
  755. postIndex := iNdEx + intStringLen
  756. if postIndex < 0 {
  757. return ErrInvalidLengthTypes
  758. }
  759. if postIndex > l {
  760. return io.ErrUnexpectedEOF
  761. }
  762. m.Str = string(dAtA[iNdEx:postIndex])
  763. iNdEx = postIndex
  764. default:
  765. iNdEx = preIndex
  766. skippy, err := skipTypes(dAtA[iNdEx:])
  767. if err != nil {
  768. return err
  769. }
  770. if skippy < 0 {
  771. return ErrInvalidLengthTypes
  772. }
  773. if (iNdEx + skippy) < 0 {
  774. return ErrInvalidLengthTypes
  775. }
  776. if (iNdEx + skippy) > l {
  777. return io.ErrUnexpectedEOF
  778. }
  779. iNdEx += skippy
  780. }
  781. }
  782. if iNdEx > l {
  783. return io.ErrUnexpectedEOF
  784. }
  785. return nil
  786. }
  787. func (m *ProtocolVersion) Unmarshal(dAtA []byte) error {
  788. l := len(dAtA)
  789. iNdEx := 0
  790. for iNdEx < l {
  791. preIndex := iNdEx
  792. var wire uint64
  793. for shift := uint(0); ; shift += 7 {
  794. if shift >= 64 {
  795. return ErrIntOverflowTypes
  796. }
  797. if iNdEx >= l {
  798. return io.ErrUnexpectedEOF
  799. }
  800. b := dAtA[iNdEx]
  801. iNdEx++
  802. wire |= uint64(b&0x7F) << shift
  803. if b < 0x80 {
  804. break
  805. }
  806. }
  807. fieldNum := int32(wire >> 3)
  808. wireType := int(wire & 0x7)
  809. if wireType == 4 {
  810. return fmt.Errorf("proto: ProtocolVersion: wiretype end group for non-group")
  811. }
  812. if fieldNum <= 0 {
  813. return fmt.Errorf("proto: ProtocolVersion: illegal tag %d (wire type %d)", fieldNum, wire)
  814. }
  815. switch fieldNum {
  816. case 1:
  817. if wireType != 0 {
  818. return fmt.Errorf("proto: wrong wireType = %d for field P2P", wireType)
  819. }
  820. m.P2P = 0
  821. for shift := uint(0); ; shift += 7 {
  822. if shift >= 64 {
  823. return ErrIntOverflowTypes
  824. }
  825. if iNdEx >= l {
  826. return io.ErrUnexpectedEOF
  827. }
  828. b := dAtA[iNdEx]
  829. iNdEx++
  830. m.P2P |= uint64(b&0x7F) << shift
  831. if b < 0x80 {
  832. break
  833. }
  834. }
  835. case 2:
  836. if wireType != 0 {
  837. return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType)
  838. }
  839. m.Block = 0
  840. for shift := uint(0); ; shift += 7 {
  841. if shift >= 64 {
  842. return ErrIntOverflowTypes
  843. }
  844. if iNdEx >= l {
  845. return io.ErrUnexpectedEOF
  846. }
  847. b := dAtA[iNdEx]
  848. iNdEx++
  849. m.Block |= uint64(b&0x7F) << shift
  850. if b < 0x80 {
  851. break
  852. }
  853. }
  854. case 3:
  855. if wireType != 0 {
  856. return fmt.Errorf("proto: wrong wireType = %d for field App", wireType)
  857. }
  858. m.App = 0
  859. for shift := uint(0); ; shift += 7 {
  860. if shift >= 64 {
  861. return ErrIntOverflowTypes
  862. }
  863. if iNdEx >= l {
  864. return io.ErrUnexpectedEOF
  865. }
  866. b := dAtA[iNdEx]
  867. iNdEx++
  868. m.App |= uint64(b&0x7F) << shift
  869. if b < 0x80 {
  870. break
  871. }
  872. }
  873. default:
  874. iNdEx = preIndex
  875. skippy, err := skipTypes(dAtA[iNdEx:])
  876. if err != nil {
  877. return err
  878. }
  879. if skippy < 0 {
  880. return ErrInvalidLengthTypes
  881. }
  882. if (iNdEx + skippy) < 0 {
  883. return ErrInvalidLengthTypes
  884. }
  885. if (iNdEx + skippy) > l {
  886. return io.ErrUnexpectedEOF
  887. }
  888. iNdEx += skippy
  889. }
  890. }
  891. if iNdEx > l {
  892. return io.ErrUnexpectedEOF
  893. }
  894. return nil
  895. }
  896. func (m *DefaultNodeInfo) Unmarshal(dAtA []byte) error {
  897. l := len(dAtA)
  898. iNdEx := 0
  899. for iNdEx < l {
  900. preIndex := iNdEx
  901. var wire uint64
  902. for shift := uint(0); ; shift += 7 {
  903. if shift >= 64 {
  904. return ErrIntOverflowTypes
  905. }
  906. if iNdEx >= l {
  907. return io.ErrUnexpectedEOF
  908. }
  909. b := dAtA[iNdEx]
  910. iNdEx++
  911. wire |= uint64(b&0x7F) << shift
  912. if b < 0x80 {
  913. break
  914. }
  915. }
  916. fieldNum := int32(wire >> 3)
  917. wireType := int(wire & 0x7)
  918. if wireType == 4 {
  919. return fmt.Errorf("proto: DefaultNodeInfo: wiretype end group for non-group")
  920. }
  921. if fieldNum <= 0 {
  922. return fmt.Errorf("proto: DefaultNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire)
  923. }
  924. switch fieldNum {
  925. case 1:
  926. if wireType != 2 {
  927. return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType)
  928. }
  929. var msglen int
  930. for shift := uint(0); ; shift += 7 {
  931. if shift >= 64 {
  932. return ErrIntOverflowTypes
  933. }
  934. if iNdEx >= l {
  935. return io.ErrUnexpectedEOF
  936. }
  937. b := dAtA[iNdEx]
  938. iNdEx++
  939. msglen |= int(b&0x7F) << shift
  940. if b < 0x80 {
  941. break
  942. }
  943. }
  944. if msglen < 0 {
  945. return ErrInvalidLengthTypes
  946. }
  947. postIndex := iNdEx + msglen
  948. if postIndex < 0 {
  949. return ErrInvalidLengthTypes
  950. }
  951. if postIndex > l {
  952. return io.ErrUnexpectedEOF
  953. }
  954. if err := m.ProtocolVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  955. return err
  956. }
  957. iNdEx = postIndex
  958. case 2:
  959. if wireType != 2 {
  960. return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeID", wireType)
  961. }
  962. var stringLen uint64
  963. for shift := uint(0); ; shift += 7 {
  964. if shift >= 64 {
  965. return ErrIntOverflowTypes
  966. }
  967. if iNdEx >= l {
  968. return io.ErrUnexpectedEOF
  969. }
  970. b := dAtA[iNdEx]
  971. iNdEx++
  972. stringLen |= uint64(b&0x7F) << shift
  973. if b < 0x80 {
  974. break
  975. }
  976. }
  977. intStringLen := int(stringLen)
  978. if intStringLen < 0 {
  979. return ErrInvalidLengthTypes
  980. }
  981. postIndex := iNdEx + intStringLen
  982. if postIndex < 0 {
  983. return ErrInvalidLengthTypes
  984. }
  985. if postIndex > l {
  986. return io.ErrUnexpectedEOF
  987. }
  988. m.DefaultNodeID = string(dAtA[iNdEx:postIndex])
  989. iNdEx = postIndex
  990. case 3:
  991. if wireType != 2 {
  992. return fmt.Errorf("proto: wrong wireType = %d for field ListenAddr", wireType)
  993. }
  994. var stringLen uint64
  995. for shift := uint(0); ; shift += 7 {
  996. if shift >= 64 {
  997. return ErrIntOverflowTypes
  998. }
  999. if iNdEx >= l {
  1000. return io.ErrUnexpectedEOF
  1001. }
  1002. b := dAtA[iNdEx]
  1003. iNdEx++
  1004. stringLen |= uint64(b&0x7F) << shift
  1005. if b < 0x80 {
  1006. break
  1007. }
  1008. }
  1009. intStringLen := int(stringLen)
  1010. if intStringLen < 0 {
  1011. return ErrInvalidLengthTypes
  1012. }
  1013. postIndex := iNdEx + intStringLen
  1014. if postIndex < 0 {
  1015. return ErrInvalidLengthTypes
  1016. }
  1017. if postIndex > l {
  1018. return io.ErrUnexpectedEOF
  1019. }
  1020. m.ListenAddr = string(dAtA[iNdEx:postIndex])
  1021. iNdEx = postIndex
  1022. case 4:
  1023. if wireType != 2 {
  1024. return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType)
  1025. }
  1026. var stringLen uint64
  1027. for shift := uint(0); ; shift += 7 {
  1028. if shift >= 64 {
  1029. return ErrIntOverflowTypes
  1030. }
  1031. if iNdEx >= l {
  1032. return io.ErrUnexpectedEOF
  1033. }
  1034. b := dAtA[iNdEx]
  1035. iNdEx++
  1036. stringLen |= uint64(b&0x7F) << shift
  1037. if b < 0x80 {
  1038. break
  1039. }
  1040. }
  1041. intStringLen := int(stringLen)
  1042. if intStringLen < 0 {
  1043. return ErrInvalidLengthTypes
  1044. }
  1045. postIndex := iNdEx + intStringLen
  1046. if postIndex < 0 {
  1047. return ErrInvalidLengthTypes
  1048. }
  1049. if postIndex > l {
  1050. return io.ErrUnexpectedEOF
  1051. }
  1052. m.Network = string(dAtA[iNdEx:postIndex])
  1053. iNdEx = postIndex
  1054. case 5:
  1055. if wireType != 2 {
  1056. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1057. }
  1058. var stringLen uint64
  1059. for shift := uint(0); ; shift += 7 {
  1060. if shift >= 64 {
  1061. return ErrIntOverflowTypes
  1062. }
  1063. if iNdEx >= l {
  1064. return io.ErrUnexpectedEOF
  1065. }
  1066. b := dAtA[iNdEx]
  1067. iNdEx++
  1068. stringLen |= uint64(b&0x7F) << shift
  1069. if b < 0x80 {
  1070. break
  1071. }
  1072. }
  1073. intStringLen := int(stringLen)
  1074. if intStringLen < 0 {
  1075. return ErrInvalidLengthTypes
  1076. }
  1077. postIndex := iNdEx + intStringLen
  1078. if postIndex < 0 {
  1079. return ErrInvalidLengthTypes
  1080. }
  1081. if postIndex > l {
  1082. return io.ErrUnexpectedEOF
  1083. }
  1084. m.Version = string(dAtA[iNdEx:postIndex])
  1085. iNdEx = postIndex
  1086. case 6:
  1087. if wireType != 2 {
  1088. return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType)
  1089. }
  1090. var byteLen int
  1091. for shift := uint(0); ; shift += 7 {
  1092. if shift >= 64 {
  1093. return ErrIntOverflowTypes
  1094. }
  1095. if iNdEx >= l {
  1096. return io.ErrUnexpectedEOF
  1097. }
  1098. b := dAtA[iNdEx]
  1099. iNdEx++
  1100. byteLen |= int(b&0x7F) << shift
  1101. if b < 0x80 {
  1102. break
  1103. }
  1104. }
  1105. if byteLen < 0 {
  1106. return ErrInvalidLengthTypes
  1107. }
  1108. postIndex := iNdEx + byteLen
  1109. if postIndex < 0 {
  1110. return ErrInvalidLengthTypes
  1111. }
  1112. if postIndex > l {
  1113. return io.ErrUnexpectedEOF
  1114. }
  1115. m.Channels = append(m.Channels[:0], dAtA[iNdEx:postIndex]...)
  1116. if m.Channels == nil {
  1117. m.Channels = []byte{}
  1118. }
  1119. iNdEx = postIndex
  1120. case 7:
  1121. if wireType != 2 {
  1122. return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType)
  1123. }
  1124. var stringLen uint64
  1125. for shift := uint(0); ; shift += 7 {
  1126. if shift >= 64 {
  1127. return ErrIntOverflowTypes
  1128. }
  1129. if iNdEx >= l {
  1130. return io.ErrUnexpectedEOF
  1131. }
  1132. b := dAtA[iNdEx]
  1133. iNdEx++
  1134. stringLen |= uint64(b&0x7F) << shift
  1135. if b < 0x80 {
  1136. break
  1137. }
  1138. }
  1139. intStringLen := int(stringLen)
  1140. if intStringLen < 0 {
  1141. return ErrInvalidLengthTypes
  1142. }
  1143. postIndex := iNdEx + intStringLen
  1144. if postIndex < 0 {
  1145. return ErrInvalidLengthTypes
  1146. }
  1147. if postIndex > l {
  1148. return io.ErrUnexpectedEOF
  1149. }
  1150. m.Moniker = string(dAtA[iNdEx:postIndex])
  1151. iNdEx = postIndex
  1152. case 8:
  1153. if wireType != 2 {
  1154. return fmt.Errorf("proto: wrong wireType = %d for field Other", wireType)
  1155. }
  1156. var msglen int
  1157. for shift := uint(0); ; shift += 7 {
  1158. if shift >= 64 {
  1159. return ErrIntOverflowTypes
  1160. }
  1161. if iNdEx >= l {
  1162. return io.ErrUnexpectedEOF
  1163. }
  1164. b := dAtA[iNdEx]
  1165. iNdEx++
  1166. msglen |= int(b&0x7F) << shift
  1167. if b < 0x80 {
  1168. break
  1169. }
  1170. }
  1171. if msglen < 0 {
  1172. return ErrInvalidLengthTypes
  1173. }
  1174. postIndex := iNdEx + msglen
  1175. if postIndex < 0 {
  1176. return ErrInvalidLengthTypes
  1177. }
  1178. if postIndex > l {
  1179. return io.ErrUnexpectedEOF
  1180. }
  1181. if err := m.Other.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1182. return err
  1183. }
  1184. iNdEx = postIndex
  1185. default:
  1186. iNdEx = preIndex
  1187. skippy, err := skipTypes(dAtA[iNdEx:])
  1188. if err != nil {
  1189. return err
  1190. }
  1191. if skippy < 0 {
  1192. return ErrInvalidLengthTypes
  1193. }
  1194. if (iNdEx + skippy) < 0 {
  1195. return ErrInvalidLengthTypes
  1196. }
  1197. if (iNdEx + skippy) > l {
  1198. return io.ErrUnexpectedEOF
  1199. }
  1200. iNdEx += skippy
  1201. }
  1202. }
  1203. if iNdEx > l {
  1204. return io.ErrUnexpectedEOF
  1205. }
  1206. return nil
  1207. }
  1208. func (m *DefaultNodeInfoOther) Unmarshal(dAtA []byte) error {
  1209. l := len(dAtA)
  1210. iNdEx := 0
  1211. for iNdEx < l {
  1212. preIndex := iNdEx
  1213. var wire uint64
  1214. for shift := uint(0); ; shift += 7 {
  1215. if shift >= 64 {
  1216. return ErrIntOverflowTypes
  1217. }
  1218. if iNdEx >= l {
  1219. return io.ErrUnexpectedEOF
  1220. }
  1221. b := dAtA[iNdEx]
  1222. iNdEx++
  1223. wire |= uint64(b&0x7F) << shift
  1224. if b < 0x80 {
  1225. break
  1226. }
  1227. }
  1228. fieldNum := int32(wire >> 3)
  1229. wireType := int(wire & 0x7)
  1230. if wireType == 4 {
  1231. return fmt.Errorf("proto: DefaultNodeInfoOther: wiretype end group for non-group")
  1232. }
  1233. if fieldNum <= 0 {
  1234. return fmt.Errorf("proto: DefaultNodeInfoOther: illegal tag %d (wire type %d)", fieldNum, wire)
  1235. }
  1236. switch fieldNum {
  1237. case 1:
  1238. if wireType != 2 {
  1239. return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType)
  1240. }
  1241. var stringLen uint64
  1242. for shift := uint(0); ; shift += 7 {
  1243. if shift >= 64 {
  1244. return ErrIntOverflowTypes
  1245. }
  1246. if iNdEx >= l {
  1247. return io.ErrUnexpectedEOF
  1248. }
  1249. b := dAtA[iNdEx]
  1250. iNdEx++
  1251. stringLen |= uint64(b&0x7F) << shift
  1252. if b < 0x80 {
  1253. break
  1254. }
  1255. }
  1256. intStringLen := int(stringLen)
  1257. if intStringLen < 0 {
  1258. return ErrInvalidLengthTypes
  1259. }
  1260. postIndex := iNdEx + intStringLen
  1261. if postIndex < 0 {
  1262. return ErrInvalidLengthTypes
  1263. }
  1264. if postIndex > l {
  1265. return io.ErrUnexpectedEOF
  1266. }
  1267. m.TxIndex = string(dAtA[iNdEx:postIndex])
  1268. iNdEx = postIndex
  1269. case 2:
  1270. if wireType != 2 {
  1271. return fmt.Errorf("proto: wrong wireType = %d for field RPCAdddress", wireType)
  1272. }
  1273. var stringLen uint64
  1274. for shift := uint(0); ; shift += 7 {
  1275. if shift >= 64 {
  1276. return ErrIntOverflowTypes
  1277. }
  1278. if iNdEx >= l {
  1279. return io.ErrUnexpectedEOF
  1280. }
  1281. b := dAtA[iNdEx]
  1282. iNdEx++
  1283. stringLen |= uint64(b&0x7F) << shift
  1284. if b < 0x80 {
  1285. break
  1286. }
  1287. }
  1288. intStringLen := int(stringLen)
  1289. if intStringLen < 0 {
  1290. return ErrInvalidLengthTypes
  1291. }
  1292. postIndex := iNdEx + intStringLen
  1293. if postIndex < 0 {
  1294. return ErrInvalidLengthTypes
  1295. }
  1296. if postIndex > l {
  1297. return io.ErrUnexpectedEOF
  1298. }
  1299. m.RPCAdddress = string(dAtA[iNdEx:postIndex])
  1300. iNdEx = postIndex
  1301. default:
  1302. iNdEx = preIndex
  1303. skippy, err := skipTypes(dAtA[iNdEx:])
  1304. if err != nil {
  1305. return err
  1306. }
  1307. if skippy < 0 {
  1308. return ErrInvalidLengthTypes
  1309. }
  1310. if (iNdEx + skippy) < 0 {
  1311. return ErrInvalidLengthTypes
  1312. }
  1313. if (iNdEx + skippy) > l {
  1314. return io.ErrUnexpectedEOF
  1315. }
  1316. iNdEx += skippy
  1317. }
  1318. }
  1319. if iNdEx > l {
  1320. return io.ErrUnexpectedEOF
  1321. }
  1322. return nil
  1323. }
  1324. func skipTypes(dAtA []byte) (n int, err error) {
  1325. l := len(dAtA)
  1326. iNdEx := 0
  1327. depth := 0
  1328. for iNdEx < l {
  1329. var wire uint64
  1330. for shift := uint(0); ; shift += 7 {
  1331. if shift >= 64 {
  1332. return 0, ErrIntOverflowTypes
  1333. }
  1334. if iNdEx >= l {
  1335. return 0, io.ErrUnexpectedEOF
  1336. }
  1337. b := dAtA[iNdEx]
  1338. iNdEx++
  1339. wire |= (uint64(b) & 0x7F) << shift
  1340. if b < 0x80 {
  1341. break
  1342. }
  1343. }
  1344. wireType := int(wire & 0x7)
  1345. switch wireType {
  1346. case 0:
  1347. for shift := uint(0); ; shift += 7 {
  1348. if shift >= 64 {
  1349. return 0, ErrIntOverflowTypes
  1350. }
  1351. if iNdEx >= l {
  1352. return 0, io.ErrUnexpectedEOF
  1353. }
  1354. iNdEx++
  1355. if dAtA[iNdEx-1] < 0x80 {
  1356. break
  1357. }
  1358. }
  1359. case 1:
  1360. iNdEx += 8
  1361. case 2:
  1362. var length int
  1363. for shift := uint(0); ; shift += 7 {
  1364. if shift >= 64 {
  1365. return 0, ErrIntOverflowTypes
  1366. }
  1367. if iNdEx >= l {
  1368. return 0, io.ErrUnexpectedEOF
  1369. }
  1370. b := dAtA[iNdEx]
  1371. iNdEx++
  1372. length |= (int(b) & 0x7F) << shift
  1373. if b < 0x80 {
  1374. break
  1375. }
  1376. }
  1377. if length < 0 {
  1378. return 0, ErrInvalidLengthTypes
  1379. }
  1380. iNdEx += length
  1381. case 3:
  1382. depth++
  1383. case 4:
  1384. if depth == 0 {
  1385. return 0, ErrUnexpectedEndOfGroupTypes
  1386. }
  1387. depth--
  1388. case 5:
  1389. iNdEx += 4
  1390. default:
  1391. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1392. }
  1393. if iNdEx < 0 {
  1394. return 0, ErrInvalidLengthTypes
  1395. }
  1396. if depth == 0 {
  1397. return iNdEx, nil
  1398. }
  1399. }
  1400. return 0, io.ErrUnexpectedEOF
  1401. }
  1402. var (
  1403. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  1404. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  1405. ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
  1406. )