github.com/annchain/OG@v0.0.9/consensus/annsensus/message_gen.go (about) 1 package annsensus 2 3 // Code generated by github.com/tinylib/msgp DO NOT EDIT. 4 5 import ( 6 "github.com/tinylib/msgp/msgp" 7 ) 8 9 // DecodeMsg implements msgp.Decodable 10 func (z *AnnsensusMessageBftEncrypted) DecodeMsg(dc *msgp.Reader) (err error) { 11 var field []byte 12 _ = field 13 var zb0001 uint32 14 zb0001, err = dc.ReadMapHeader() 15 if err != nil { 16 err = msgp.WrapError(err) 17 return 18 } 19 for zb0001 > 0 { 20 zb0001-- 21 field, err = dc.ReadMapKeyPtr() 22 if err != nil { 23 err = msgp.WrapError(err) 24 return 25 } 26 switch msgp.UnsafeString(field) { 27 case "InnerMessageType": 28 z.InnerMessageType, err = dc.ReadUint16() 29 if err != nil { 30 err = msgp.WrapError(err, "InnerMessageType") 31 return 32 } 33 case "InnerMessageEncrypted": 34 z.InnerMessageEncrypted, err = dc.ReadBytes(z.InnerMessageEncrypted) 35 if err != nil { 36 err = msgp.WrapError(err, "InnerMessageEncrypted") 37 return 38 } 39 case "PublicKey": 40 err = z.PublicKey.DecodeMsg(dc) 41 if err != nil { 42 err = msgp.WrapError(err, "PublicKey") 43 return 44 } 45 default: 46 err = dc.Skip() 47 if err != nil { 48 err = msgp.WrapError(err) 49 return 50 } 51 } 52 } 53 return 54 } 55 56 // EncodeMsg implements msgp.Encodable 57 func (z *AnnsensusMessageBftEncrypted) EncodeMsg(en *msgp.Writer) (err error) { 58 // map header, size 3 59 // write "InnerMessageType" 60 err = en.Append(0x83, 0xb0, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 61 if err != nil { 62 return 63 } 64 err = en.WriteUint16(z.InnerMessageType) 65 if err != nil { 66 err = msgp.WrapError(err, "InnerMessageType") 67 return 68 } 69 // write "InnerMessageEncrypted" 70 err = en.Append(0xb5, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64) 71 if err != nil { 72 return 73 } 74 err = en.WriteBytes(z.InnerMessageEncrypted) 75 if err != nil { 76 err = msgp.WrapError(err, "InnerMessageEncrypted") 77 return 78 } 79 // write "PublicKey" 80 err = en.Append(0xa9, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79) 81 if err != nil { 82 return 83 } 84 err = z.PublicKey.EncodeMsg(en) 85 if err != nil { 86 err = msgp.WrapError(err, "PublicKey") 87 return 88 } 89 return 90 } 91 92 // MarshalMsg implements msgp.Marshaler 93 func (z *AnnsensusMessageBftEncrypted) MarshalMsg(b []byte) (o []byte, err error) { 94 o = msgp.Require(b, z.Msgsize()) 95 // map header, size 3 96 // string "InnerMessageType" 97 o = append(o, 0x83, 0xb0, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 98 o = msgp.AppendUint16(o, z.InnerMessageType) 99 // string "InnerMessageEncrypted" 100 o = append(o, 0xb5, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64) 101 o = msgp.AppendBytes(o, z.InnerMessageEncrypted) 102 // string "PublicKey" 103 o = append(o, 0xa9, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79) 104 o, err = z.PublicKey.MarshalMsg(o) 105 if err != nil { 106 err = msgp.WrapError(err, "PublicKey") 107 return 108 } 109 return 110 } 111 112 // UnmarshalMsg implements msgp.Unmarshaler 113 func (z *AnnsensusMessageBftEncrypted) UnmarshalMsg(bts []byte) (o []byte, err error) { 114 var field []byte 115 _ = field 116 var zb0001 uint32 117 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 118 if err != nil { 119 err = msgp.WrapError(err) 120 return 121 } 122 for zb0001 > 0 { 123 zb0001-- 124 field, bts, err = msgp.ReadMapKeyZC(bts) 125 if err != nil { 126 err = msgp.WrapError(err) 127 return 128 } 129 switch msgp.UnsafeString(field) { 130 case "InnerMessageType": 131 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 132 if err != nil { 133 err = msgp.WrapError(err, "InnerMessageType") 134 return 135 } 136 case "InnerMessageEncrypted": 137 z.InnerMessageEncrypted, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessageEncrypted) 138 if err != nil { 139 err = msgp.WrapError(err, "InnerMessageEncrypted") 140 return 141 } 142 case "PublicKey": 143 bts, err = z.PublicKey.UnmarshalMsg(bts) 144 if err != nil { 145 err = msgp.WrapError(err, "PublicKey") 146 return 147 } 148 default: 149 bts, err = msgp.Skip(bts) 150 if err != nil { 151 err = msgp.WrapError(err) 152 return 153 } 154 } 155 } 156 o = bts 157 return 158 } 159 160 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 161 func (z *AnnsensusMessageBftEncrypted) Msgsize() (s int) { 162 s = 1 + 17 + msgp.Uint16Size + 22 + msgp.BytesPrefixSize + len(z.InnerMessageEncrypted) + 10 + z.PublicKey.Msgsize() 163 return 164 } 165 166 // DecodeMsg implements msgp.Decodable 167 func (z *AnnsensusMessageBftPlain) DecodeMsg(dc *msgp.Reader) (err error) { 168 var zb0001 uint32 169 zb0001, err = dc.ReadArrayHeader() 170 if err != nil { 171 err = msgp.WrapError(err) 172 return 173 } 174 if zb0001 != 2 { 175 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 176 return 177 } 178 z.InnerMessageType, err = dc.ReadUint16() 179 if err != nil { 180 err = msgp.WrapError(err, "InnerMessageType") 181 return 182 } 183 z.InnerMessage, err = dc.ReadBytes(z.InnerMessage) 184 if err != nil { 185 err = msgp.WrapError(err, "InnerMessage") 186 return 187 } 188 return 189 } 190 191 // EncodeMsg implements msgp.Encodable 192 func (z *AnnsensusMessageBftPlain) EncodeMsg(en *msgp.Writer) (err error) { 193 // array header, size 2 194 err = en.Append(0x92) 195 if err != nil { 196 return 197 } 198 err = en.WriteUint16(z.InnerMessageType) 199 if err != nil { 200 err = msgp.WrapError(err, "InnerMessageType") 201 return 202 } 203 err = en.WriteBytes(z.InnerMessage) 204 if err != nil { 205 err = msgp.WrapError(err, "InnerMessage") 206 return 207 } 208 return 209 } 210 211 // MarshalMsg implements msgp.Marshaler 212 func (z *AnnsensusMessageBftPlain) MarshalMsg(b []byte) (o []byte, err error) { 213 o = msgp.Require(b, z.Msgsize()) 214 // array header, size 2 215 o = append(o, 0x92) 216 o = msgp.AppendUint16(o, z.InnerMessageType) 217 o = msgp.AppendBytes(o, z.InnerMessage) 218 return 219 } 220 221 // UnmarshalMsg implements msgp.Unmarshaler 222 func (z *AnnsensusMessageBftPlain) UnmarshalMsg(bts []byte) (o []byte, err error) { 223 var zb0001 uint32 224 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 225 if err != nil { 226 err = msgp.WrapError(err) 227 return 228 } 229 if zb0001 != 2 { 230 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 231 return 232 } 233 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 234 if err != nil { 235 err = msgp.WrapError(err, "InnerMessageType") 236 return 237 } 238 z.InnerMessage, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessage) 239 if err != nil { 240 err = msgp.WrapError(err, "InnerMessage") 241 return 242 } 243 o = bts 244 return 245 } 246 247 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 248 func (z *AnnsensusMessageBftPlain) Msgsize() (s int) { 249 s = 1 + msgp.Uint16Size + msgp.BytesPrefixSize + len(z.InnerMessage) 250 return 251 } 252 253 // DecodeMsg implements msgp.Decodable 254 func (z *AnnsensusMessageBftSigned) DecodeMsg(dc *msgp.Reader) (err error) { 255 var zb0001 uint32 256 zb0001, err = dc.ReadArrayHeader() 257 if err != nil { 258 err = msgp.WrapError(err) 259 return 260 } 261 if zb0001 != 5 { 262 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 263 return 264 } 265 z.InnerMessageType, err = dc.ReadUint16() 266 if err != nil { 267 err = msgp.WrapError(err, "InnerMessageType") 268 return 269 } 270 z.InnerMessage, err = dc.ReadBytes(z.InnerMessage) 271 if err != nil { 272 err = msgp.WrapError(err, "InnerMessage") 273 return 274 } 275 err = z.Signature.DecodeMsg(dc) 276 if err != nil { 277 err = msgp.WrapError(err, "Signature") 278 return 279 } 280 err = z.PublicKey.DecodeMsg(dc) 281 if err != nil { 282 err = msgp.WrapError(err, "PublicKey") 283 return 284 } 285 z.TermId, err = dc.ReadUint32() 286 if err != nil { 287 err = msgp.WrapError(err, "TermId") 288 return 289 } 290 return 291 } 292 293 // EncodeMsg implements msgp.Encodable 294 func (z *AnnsensusMessageBftSigned) EncodeMsg(en *msgp.Writer) (err error) { 295 // array header, size 5 296 err = en.Append(0x95) 297 if err != nil { 298 return 299 } 300 err = en.WriteUint16(z.InnerMessageType) 301 if err != nil { 302 err = msgp.WrapError(err, "InnerMessageType") 303 return 304 } 305 err = en.WriteBytes(z.InnerMessage) 306 if err != nil { 307 err = msgp.WrapError(err, "InnerMessage") 308 return 309 } 310 err = z.Signature.EncodeMsg(en) 311 if err != nil { 312 err = msgp.WrapError(err, "Signature") 313 return 314 } 315 err = z.PublicKey.EncodeMsg(en) 316 if err != nil { 317 err = msgp.WrapError(err, "PublicKey") 318 return 319 } 320 err = en.WriteUint32(z.TermId) 321 if err != nil { 322 err = msgp.WrapError(err, "TermId") 323 return 324 } 325 return 326 } 327 328 // MarshalMsg implements msgp.Marshaler 329 func (z *AnnsensusMessageBftSigned) MarshalMsg(b []byte) (o []byte, err error) { 330 o = msgp.Require(b, z.Msgsize()) 331 // array header, size 5 332 o = append(o, 0x95) 333 o = msgp.AppendUint16(o, z.InnerMessageType) 334 o = msgp.AppendBytes(o, z.InnerMessage) 335 o, err = z.Signature.MarshalMsg(o) 336 if err != nil { 337 err = msgp.WrapError(err, "Signature") 338 return 339 } 340 o, err = z.PublicKey.MarshalMsg(o) 341 if err != nil { 342 err = msgp.WrapError(err, "PublicKey") 343 return 344 } 345 o = msgp.AppendUint32(o, z.TermId) 346 return 347 } 348 349 // UnmarshalMsg implements msgp.Unmarshaler 350 func (z *AnnsensusMessageBftSigned) UnmarshalMsg(bts []byte) (o []byte, err error) { 351 var zb0001 uint32 352 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 353 if err != nil { 354 err = msgp.WrapError(err) 355 return 356 } 357 if zb0001 != 5 { 358 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 359 return 360 } 361 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 362 if err != nil { 363 err = msgp.WrapError(err, "InnerMessageType") 364 return 365 } 366 z.InnerMessage, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessage) 367 if err != nil { 368 err = msgp.WrapError(err, "InnerMessage") 369 return 370 } 371 bts, err = z.Signature.UnmarshalMsg(bts) 372 if err != nil { 373 err = msgp.WrapError(err, "Signature") 374 return 375 } 376 bts, err = z.PublicKey.UnmarshalMsg(bts) 377 if err != nil { 378 err = msgp.WrapError(err, "PublicKey") 379 return 380 } 381 z.TermId, bts, err = msgp.ReadUint32Bytes(bts) 382 if err != nil { 383 err = msgp.WrapError(err, "TermId") 384 return 385 } 386 o = bts 387 return 388 } 389 390 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 391 func (z *AnnsensusMessageBftSigned) Msgsize() (s int) { 392 s = 1 + msgp.Uint16Size + msgp.BytesPrefixSize + len(z.InnerMessage) + z.Signature.Msgsize() + z.PublicKey.Msgsize() + msgp.Uint32Size 393 return 394 } 395 396 // DecodeMsg implements msgp.Decodable 397 func (z *AnnsensusMessageDkgEncrypted) DecodeMsg(dc *msgp.Reader) (err error) { 398 var field []byte 399 _ = field 400 var zb0001 uint32 401 zb0001, err = dc.ReadMapHeader() 402 if err != nil { 403 err = msgp.WrapError(err) 404 return 405 } 406 for zb0001 > 0 { 407 zb0001-- 408 field, err = dc.ReadMapKeyPtr() 409 if err != nil { 410 err = msgp.WrapError(err) 411 return 412 } 413 switch msgp.UnsafeString(field) { 414 case "InnerMessageType": 415 z.InnerMessageType, err = dc.ReadUint16() 416 if err != nil { 417 err = msgp.WrapError(err, "InnerMessageType") 418 return 419 } 420 case "InnerMessageEncrypted": 421 z.InnerMessageEncrypted, err = dc.ReadBytes(z.InnerMessageEncrypted) 422 if err != nil { 423 err = msgp.WrapError(err, "InnerMessageEncrypted") 424 return 425 } 426 case "PublicKey": 427 err = z.PublicKey.DecodeMsg(dc) 428 if err != nil { 429 err = msgp.WrapError(err, "PublicKey") 430 return 431 } 432 default: 433 err = dc.Skip() 434 if err != nil { 435 err = msgp.WrapError(err) 436 return 437 } 438 } 439 } 440 return 441 } 442 443 // EncodeMsg implements msgp.Encodable 444 func (z *AnnsensusMessageDkgEncrypted) EncodeMsg(en *msgp.Writer) (err error) { 445 // map header, size 3 446 // write "InnerMessageType" 447 err = en.Append(0x83, 0xb0, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 448 if err != nil { 449 return 450 } 451 err = en.WriteUint16(z.InnerMessageType) 452 if err != nil { 453 err = msgp.WrapError(err, "InnerMessageType") 454 return 455 } 456 // write "InnerMessageEncrypted" 457 err = en.Append(0xb5, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64) 458 if err != nil { 459 return 460 } 461 err = en.WriteBytes(z.InnerMessageEncrypted) 462 if err != nil { 463 err = msgp.WrapError(err, "InnerMessageEncrypted") 464 return 465 } 466 // write "PublicKey" 467 err = en.Append(0xa9, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79) 468 if err != nil { 469 return 470 } 471 err = z.PublicKey.EncodeMsg(en) 472 if err != nil { 473 err = msgp.WrapError(err, "PublicKey") 474 return 475 } 476 return 477 } 478 479 // MarshalMsg implements msgp.Marshaler 480 func (z *AnnsensusMessageDkgEncrypted) MarshalMsg(b []byte) (o []byte, err error) { 481 o = msgp.Require(b, z.Msgsize()) 482 // map header, size 3 483 // string "InnerMessageType" 484 o = append(o, 0x83, 0xb0, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 485 o = msgp.AppendUint16(o, z.InnerMessageType) 486 // string "InnerMessageEncrypted" 487 o = append(o, 0xb5, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64) 488 o = msgp.AppendBytes(o, z.InnerMessageEncrypted) 489 // string "PublicKey" 490 o = append(o, 0xa9, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79) 491 o, err = z.PublicKey.MarshalMsg(o) 492 if err != nil { 493 err = msgp.WrapError(err, "PublicKey") 494 return 495 } 496 return 497 } 498 499 // UnmarshalMsg implements msgp.Unmarshaler 500 func (z *AnnsensusMessageDkgEncrypted) UnmarshalMsg(bts []byte) (o []byte, err error) { 501 var field []byte 502 _ = field 503 var zb0001 uint32 504 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 505 if err != nil { 506 err = msgp.WrapError(err) 507 return 508 } 509 for zb0001 > 0 { 510 zb0001-- 511 field, bts, err = msgp.ReadMapKeyZC(bts) 512 if err != nil { 513 err = msgp.WrapError(err) 514 return 515 } 516 switch msgp.UnsafeString(field) { 517 case "InnerMessageType": 518 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 519 if err != nil { 520 err = msgp.WrapError(err, "InnerMessageType") 521 return 522 } 523 case "InnerMessageEncrypted": 524 z.InnerMessageEncrypted, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessageEncrypted) 525 if err != nil { 526 err = msgp.WrapError(err, "InnerMessageEncrypted") 527 return 528 } 529 case "PublicKey": 530 bts, err = z.PublicKey.UnmarshalMsg(bts) 531 if err != nil { 532 err = msgp.WrapError(err, "PublicKey") 533 return 534 } 535 default: 536 bts, err = msgp.Skip(bts) 537 if err != nil { 538 err = msgp.WrapError(err) 539 return 540 } 541 } 542 } 543 o = bts 544 return 545 } 546 547 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 548 func (z *AnnsensusMessageDkgEncrypted) Msgsize() (s int) { 549 s = 1 + 17 + msgp.Uint16Size + 22 + msgp.BytesPrefixSize + len(z.InnerMessageEncrypted) + 10 + z.PublicKey.Msgsize() 550 return 551 } 552 553 // DecodeMsg implements msgp.Decodable 554 func (z *AnnsensusMessageDkgPlain) DecodeMsg(dc *msgp.Reader) (err error) { 555 var zb0001 uint32 556 zb0001, err = dc.ReadArrayHeader() 557 if err != nil { 558 err = msgp.WrapError(err) 559 return 560 } 561 if zb0001 != 2 { 562 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 563 return 564 } 565 z.InnerMessageType, err = dc.ReadUint16() 566 if err != nil { 567 err = msgp.WrapError(err, "InnerMessageType") 568 return 569 } 570 z.InnerMessage, err = dc.ReadBytes(z.InnerMessage) 571 if err != nil { 572 err = msgp.WrapError(err, "InnerMessage") 573 return 574 } 575 return 576 } 577 578 // EncodeMsg implements msgp.Encodable 579 func (z *AnnsensusMessageDkgPlain) EncodeMsg(en *msgp.Writer) (err error) { 580 // array header, size 2 581 err = en.Append(0x92) 582 if err != nil { 583 return 584 } 585 err = en.WriteUint16(z.InnerMessageType) 586 if err != nil { 587 err = msgp.WrapError(err, "InnerMessageType") 588 return 589 } 590 err = en.WriteBytes(z.InnerMessage) 591 if err != nil { 592 err = msgp.WrapError(err, "InnerMessage") 593 return 594 } 595 return 596 } 597 598 // MarshalMsg implements msgp.Marshaler 599 func (z *AnnsensusMessageDkgPlain) MarshalMsg(b []byte) (o []byte, err error) { 600 o = msgp.Require(b, z.Msgsize()) 601 // array header, size 2 602 o = append(o, 0x92) 603 o = msgp.AppendUint16(o, z.InnerMessageType) 604 o = msgp.AppendBytes(o, z.InnerMessage) 605 return 606 } 607 608 // UnmarshalMsg implements msgp.Unmarshaler 609 func (z *AnnsensusMessageDkgPlain) UnmarshalMsg(bts []byte) (o []byte, err error) { 610 var zb0001 uint32 611 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 612 if err != nil { 613 err = msgp.WrapError(err) 614 return 615 } 616 if zb0001 != 2 { 617 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 618 return 619 } 620 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 621 if err != nil { 622 err = msgp.WrapError(err, "InnerMessageType") 623 return 624 } 625 z.InnerMessage, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessage) 626 if err != nil { 627 err = msgp.WrapError(err, "InnerMessage") 628 return 629 } 630 o = bts 631 return 632 } 633 634 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 635 func (z *AnnsensusMessageDkgPlain) Msgsize() (s int) { 636 s = 1 + msgp.Uint16Size + msgp.BytesPrefixSize + len(z.InnerMessage) 637 return 638 } 639 640 // DecodeMsg implements msgp.Decodable 641 func (z *AnnsensusMessageDkgSigned) DecodeMsg(dc *msgp.Reader) (err error) { 642 var zb0001 uint32 643 zb0001, err = dc.ReadArrayHeader() 644 if err != nil { 645 err = msgp.WrapError(err) 646 return 647 } 648 if zb0001 != 5 { 649 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 650 return 651 } 652 z.InnerMessageType, err = dc.ReadUint16() 653 if err != nil { 654 err = msgp.WrapError(err, "InnerMessageType") 655 return 656 } 657 z.InnerMessage, err = dc.ReadBytes(z.InnerMessage) 658 if err != nil { 659 err = msgp.WrapError(err, "InnerMessage") 660 return 661 } 662 err = z.Signature.DecodeMsg(dc) 663 if err != nil { 664 err = msgp.WrapError(err, "Signature") 665 return 666 } 667 err = z.PublicKey.DecodeMsg(dc) 668 if err != nil { 669 err = msgp.WrapError(err, "PublicKey") 670 return 671 } 672 z.TermId, err = dc.ReadUint32() 673 if err != nil { 674 err = msgp.WrapError(err, "TermId") 675 return 676 } 677 return 678 } 679 680 // EncodeMsg implements msgp.Encodable 681 func (z *AnnsensusMessageDkgSigned) EncodeMsg(en *msgp.Writer) (err error) { 682 // array header, size 5 683 err = en.Append(0x95) 684 if err != nil { 685 return 686 } 687 err = en.WriteUint16(z.InnerMessageType) 688 if err != nil { 689 err = msgp.WrapError(err, "InnerMessageType") 690 return 691 } 692 err = en.WriteBytes(z.InnerMessage) 693 if err != nil { 694 err = msgp.WrapError(err, "InnerMessage") 695 return 696 } 697 err = z.Signature.EncodeMsg(en) 698 if err != nil { 699 err = msgp.WrapError(err, "Signature") 700 return 701 } 702 err = z.PublicKey.EncodeMsg(en) 703 if err != nil { 704 err = msgp.WrapError(err, "PublicKey") 705 return 706 } 707 err = en.WriteUint32(z.TermId) 708 if err != nil { 709 err = msgp.WrapError(err, "TermId") 710 return 711 } 712 return 713 } 714 715 // MarshalMsg implements msgp.Marshaler 716 func (z *AnnsensusMessageDkgSigned) MarshalMsg(b []byte) (o []byte, err error) { 717 o = msgp.Require(b, z.Msgsize()) 718 // array header, size 5 719 o = append(o, 0x95) 720 o = msgp.AppendUint16(o, z.InnerMessageType) 721 o = msgp.AppendBytes(o, z.InnerMessage) 722 o, err = z.Signature.MarshalMsg(o) 723 if err != nil { 724 err = msgp.WrapError(err, "Signature") 725 return 726 } 727 o, err = z.PublicKey.MarshalMsg(o) 728 if err != nil { 729 err = msgp.WrapError(err, "PublicKey") 730 return 731 } 732 o = msgp.AppendUint32(o, z.TermId) 733 return 734 } 735 736 // UnmarshalMsg implements msgp.Unmarshaler 737 func (z *AnnsensusMessageDkgSigned) UnmarshalMsg(bts []byte) (o []byte, err error) { 738 var zb0001 uint32 739 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 740 if err != nil { 741 err = msgp.WrapError(err) 742 return 743 } 744 if zb0001 != 5 { 745 err = msgp.ArrayError{Wanted: 5, Got: zb0001} 746 return 747 } 748 z.InnerMessageType, bts, err = msgp.ReadUint16Bytes(bts) 749 if err != nil { 750 err = msgp.WrapError(err, "InnerMessageType") 751 return 752 } 753 z.InnerMessage, bts, err = msgp.ReadBytesBytes(bts, z.InnerMessage) 754 if err != nil { 755 err = msgp.WrapError(err, "InnerMessage") 756 return 757 } 758 bts, err = z.Signature.UnmarshalMsg(bts) 759 if err != nil { 760 err = msgp.WrapError(err, "Signature") 761 return 762 } 763 bts, err = z.PublicKey.UnmarshalMsg(bts) 764 if err != nil { 765 err = msgp.WrapError(err, "PublicKey") 766 return 767 } 768 z.TermId, bts, err = msgp.ReadUint32Bytes(bts) 769 if err != nil { 770 err = msgp.WrapError(err, "TermId") 771 return 772 } 773 o = bts 774 return 775 } 776 777 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 778 func (z *AnnsensusMessageDkgSigned) Msgsize() (s int) { 779 s = 1 + msgp.Uint16Size + msgp.BytesPrefixSize + len(z.InnerMessage) + z.Signature.Msgsize() + z.PublicKey.Msgsize() + msgp.Uint32Size 780 return 781 } 782 783 // DecodeMsg implements msgp.Decodable 784 func (z *AnnsensusMessageType) DecodeMsg(dc *msgp.Reader) (err error) { 785 { 786 var zb0001 uint16 787 zb0001, err = dc.ReadUint16() 788 if err != nil { 789 err = msgp.WrapError(err) 790 return 791 } 792 (*z) = AnnsensusMessageType(zb0001) 793 } 794 return 795 } 796 797 // EncodeMsg implements msgp.Encodable 798 func (z AnnsensusMessageType) EncodeMsg(en *msgp.Writer) (err error) { 799 err = en.WriteUint16(uint16(z)) 800 if err != nil { 801 err = msgp.WrapError(err) 802 return 803 } 804 return 805 } 806 807 // MarshalMsg implements msgp.Marshaler 808 func (z AnnsensusMessageType) MarshalMsg(b []byte) (o []byte, err error) { 809 o = msgp.Require(b, z.Msgsize()) 810 o = msgp.AppendUint16(o, uint16(z)) 811 return 812 } 813 814 // UnmarshalMsg implements msgp.Unmarshaler 815 func (z *AnnsensusMessageType) UnmarshalMsg(bts []byte) (o []byte, err error) { 816 { 817 var zb0001 uint16 818 zb0001, bts, err = msgp.ReadUint16Bytes(bts) 819 if err != nil { 820 err = msgp.WrapError(err) 821 return 822 } 823 (*z) = AnnsensusMessageType(zb0001) 824 } 825 o = bts 826 return 827 } 828 829 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 830 func (z AnnsensusMessageType) Msgsize() (s int) { 831 s = msgp.Uint16Size 832 return 833 }