github.com/annchain/OG@v0.0.9/consensus_interface/model_gen.go (about) 1 package consensus_interface 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 *Block) 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 "Round": 28 z.Round, err = dc.ReadInt64() 29 if err != nil { 30 err = msgp.WrapError(err, "Round") 31 return 32 } 33 case "Payload": 34 z.Payload, err = dc.ReadString() 35 if err != nil { 36 err = msgp.WrapError(err, "Payload") 37 return 38 } 39 case "ParentQC": 40 if dc.IsNil() { 41 err = dc.ReadNil() 42 if err != nil { 43 err = msgp.WrapError(err, "ParentQC") 44 return 45 } 46 z.ParentQC = nil 47 } else { 48 if z.ParentQC == nil { 49 z.ParentQC = new(QC) 50 } 51 var zb0002 uint32 52 zb0002, err = dc.ReadMapHeader() 53 if err != nil { 54 err = msgp.WrapError(err, "ParentQC") 55 return 56 } 57 for zb0002 > 0 { 58 zb0002-- 59 field, err = dc.ReadMapKeyPtr() 60 if err != nil { 61 err = msgp.WrapError(err, "ParentQC") 62 return 63 } 64 switch msgp.UnsafeString(field) { 65 case "VoteData": 66 err = z.ParentQC.VoteData.DecodeMsg(dc) 67 if err != nil { 68 err = msgp.WrapError(err, "ParentQC", "VoteData") 69 return 70 } 71 case "JointSignature": 72 { 73 var zb0003 []byte 74 zb0003, err = dc.ReadBytes([]byte(z.ParentQC.JointSignature)) 75 if err != nil { 76 err = msgp.WrapError(err, "ParentQC", "JointSignature") 77 return 78 } 79 z.ParentQC.JointSignature = JointSignature(zb0003) 80 } 81 default: 82 err = dc.Skip() 83 if err != nil { 84 err = msgp.WrapError(err, "ParentQC") 85 return 86 } 87 } 88 } 89 } 90 case "Id": 91 z.Id, err = dc.ReadString() 92 if err != nil { 93 err = msgp.WrapError(err, "Id") 94 return 95 } 96 default: 97 err = dc.Skip() 98 if err != nil { 99 err = msgp.WrapError(err) 100 return 101 } 102 } 103 } 104 return 105 } 106 107 // EncodeMsg implements msgp.Encodable 108 func (z *Block) EncodeMsg(en *msgp.Writer) (err error) { 109 // map header, size 4 110 // write "Round" 111 err = en.Append(0x84, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 112 if err != nil { 113 return 114 } 115 err = en.WriteInt64(z.Round) 116 if err != nil { 117 err = msgp.WrapError(err, "Round") 118 return 119 } 120 // write "Payload" 121 err = en.Append(0xa7, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) 122 if err != nil { 123 return 124 } 125 err = en.WriteString(z.Payload) 126 if err != nil { 127 err = msgp.WrapError(err, "Payload") 128 return 129 } 130 // write "ParentQC" 131 err = en.Append(0xa8, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x51, 0x43) 132 if err != nil { 133 return 134 } 135 if z.ParentQC == nil { 136 err = en.WriteNil() 137 if err != nil { 138 return 139 } 140 } else { 141 // map header, size 2 142 // write "VoteData" 143 err = en.Append(0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 144 if err != nil { 145 return 146 } 147 err = z.ParentQC.VoteData.EncodeMsg(en) 148 if err != nil { 149 err = msgp.WrapError(err, "ParentQC", "VoteData") 150 return 151 } 152 // write "JointSignature" 153 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 154 if err != nil { 155 return 156 } 157 err = en.WriteBytes([]byte(z.ParentQC.JointSignature)) 158 if err != nil { 159 err = msgp.WrapError(err, "ParentQC", "JointSignature") 160 return 161 } 162 } 163 // write "Id" 164 err = en.Append(0xa2, 0x49, 0x64) 165 if err != nil { 166 return 167 } 168 err = en.WriteString(z.Id) 169 if err != nil { 170 err = msgp.WrapError(err, "Id") 171 return 172 } 173 return 174 } 175 176 // MarshalMsg implements msgp.Marshaler 177 func (z *Block) MarshalMsg(b []byte) (o []byte, err error) { 178 o = msgp.Require(b, z.Msgsize()) 179 // map header, size 4 180 // string "Round" 181 o = append(o, 0x84, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 182 o = msgp.AppendInt64(o, z.Round) 183 // string "Payload" 184 o = append(o, 0xa7, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) 185 o = msgp.AppendString(o, z.Payload) 186 // string "ParentQC" 187 o = append(o, 0xa8, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x51, 0x43) 188 if z.ParentQC == nil { 189 o = msgp.AppendNil(o) 190 } else { 191 // map header, size 2 192 // string "VoteData" 193 o = append(o, 0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 194 o, err = z.ParentQC.VoteData.MarshalMsg(o) 195 if err != nil { 196 err = msgp.WrapError(err, "ParentQC", "VoteData") 197 return 198 } 199 // string "JointSignature" 200 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 201 o = msgp.AppendBytes(o, []byte(z.ParentQC.JointSignature)) 202 } 203 // string "Id" 204 o = append(o, 0xa2, 0x49, 0x64) 205 o = msgp.AppendString(o, z.Id) 206 return 207 } 208 209 // UnmarshalMsg implements msgp.Unmarshaler 210 func (z *Block) UnmarshalMsg(bts []byte) (o []byte, err error) { 211 var field []byte 212 _ = field 213 var zb0001 uint32 214 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 215 if err != nil { 216 err = msgp.WrapError(err) 217 return 218 } 219 for zb0001 > 0 { 220 zb0001-- 221 field, bts, err = msgp.ReadMapKeyZC(bts) 222 if err != nil { 223 err = msgp.WrapError(err) 224 return 225 } 226 switch msgp.UnsafeString(field) { 227 case "Round": 228 z.Round, bts, err = msgp.ReadInt64Bytes(bts) 229 if err != nil { 230 err = msgp.WrapError(err, "Round") 231 return 232 } 233 case "Payload": 234 z.Payload, bts, err = msgp.ReadStringBytes(bts) 235 if err != nil { 236 err = msgp.WrapError(err, "Payload") 237 return 238 } 239 case "ParentQC": 240 if msgp.IsNil(bts) { 241 bts, err = msgp.ReadNilBytes(bts) 242 if err != nil { 243 return 244 } 245 z.ParentQC = nil 246 } else { 247 if z.ParentQC == nil { 248 z.ParentQC = new(QC) 249 } 250 var zb0002 uint32 251 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 252 if err != nil { 253 err = msgp.WrapError(err, "ParentQC") 254 return 255 } 256 for zb0002 > 0 { 257 zb0002-- 258 field, bts, err = msgp.ReadMapKeyZC(bts) 259 if err != nil { 260 err = msgp.WrapError(err, "ParentQC") 261 return 262 } 263 switch msgp.UnsafeString(field) { 264 case "VoteData": 265 bts, err = z.ParentQC.VoteData.UnmarshalMsg(bts) 266 if err != nil { 267 err = msgp.WrapError(err, "ParentQC", "VoteData") 268 return 269 } 270 case "JointSignature": 271 { 272 var zb0003 []byte 273 zb0003, bts, err = msgp.ReadBytesBytes(bts, []byte(z.ParentQC.JointSignature)) 274 if err != nil { 275 err = msgp.WrapError(err, "ParentQC", "JointSignature") 276 return 277 } 278 z.ParentQC.JointSignature = JointSignature(zb0003) 279 } 280 default: 281 bts, err = msgp.Skip(bts) 282 if err != nil { 283 err = msgp.WrapError(err, "ParentQC") 284 return 285 } 286 } 287 } 288 } 289 case "Id": 290 z.Id, bts, err = msgp.ReadStringBytes(bts) 291 if err != nil { 292 err = msgp.WrapError(err, "Id") 293 return 294 } 295 default: 296 bts, err = msgp.Skip(bts) 297 if err != nil { 298 err = msgp.WrapError(err) 299 return 300 } 301 } 302 } 303 o = bts 304 return 305 } 306 307 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 308 func (z *Block) Msgsize() (s int) { 309 s = 1 + 6 + msgp.Int64Size + 8 + msgp.StringPrefixSize + len(z.Payload) + 9 310 if z.ParentQC == nil { 311 s += msgp.NilSize 312 } else { 313 s += 1 + 9 + z.ParentQC.VoteData.Msgsize() + 15 + msgp.BytesPrefixSize + len([]byte(z.ParentQC.JointSignature)) 314 } 315 s += 3 + msgp.StringPrefixSize + len(z.Id) 316 return 317 } 318 319 // DecodeMsg implements msgp.Decodable 320 func (z *ContentProposal) DecodeMsg(dc *msgp.Reader) (err error) { 321 var field []byte 322 _ = field 323 var zb0001 uint32 324 zb0001, err = dc.ReadMapHeader() 325 if err != nil { 326 err = msgp.WrapError(err) 327 return 328 } 329 for zb0001 > 0 { 330 zb0001-- 331 field, err = dc.ReadMapKeyPtr() 332 if err != nil { 333 err = msgp.WrapError(err) 334 return 335 } 336 switch msgp.UnsafeString(field) { 337 case "Proposal": 338 err = z.Proposal.DecodeMsg(dc) 339 if err != nil { 340 err = msgp.WrapError(err, "Proposal") 341 return 342 } 343 case "TC": 344 if dc.IsNil() { 345 err = dc.ReadNil() 346 if err != nil { 347 err = msgp.WrapError(err, "TC") 348 return 349 } 350 z.TC = nil 351 } else { 352 if z.TC == nil { 353 z.TC = new(TC) 354 } 355 var zb0002 uint32 356 zb0002, err = dc.ReadMapHeader() 357 if err != nil { 358 err = msgp.WrapError(err, "TC") 359 return 360 } 361 for zb0002 > 0 { 362 zb0002-- 363 field, err = dc.ReadMapKeyPtr() 364 if err != nil { 365 err = msgp.WrapError(err, "TC") 366 return 367 } 368 switch msgp.UnsafeString(field) { 369 case "Round": 370 z.TC.Round, err = dc.ReadInt64() 371 if err != nil { 372 err = msgp.WrapError(err, "TC", "Round") 373 return 374 } 375 case "JointSignature": 376 { 377 var zb0003 []byte 378 zb0003, err = dc.ReadBytes([]byte(z.TC.JointSignature)) 379 if err != nil { 380 err = msgp.WrapError(err, "TC", "JointSignature") 381 return 382 } 383 z.TC.JointSignature = JointSignature(zb0003) 384 } 385 default: 386 err = dc.Skip() 387 if err != nil { 388 err = msgp.WrapError(err, "TC") 389 return 390 } 391 } 392 } 393 } 394 default: 395 err = dc.Skip() 396 if err != nil { 397 err = msgp.WrapError(err) 398 return 399 } 400 } 401 } 402 return 403 } 404 405 // EncodeMsg implements msgp.Encodable 406 func (z *ContentProposal) EncodeMsg(en *msgp.Writer) (err error) { 407 // map header, size 2 408 // write "Proposal" 409 err = en.Append(0x82, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c) 410 if err != nil { 411 return 412 } 413 err = z.Proposal.EncodeMsg(en) 414 if err != nil { 415 err = msgp.WrapError(err, "Proposal") 416 return 417 } 418 // write "TC" 419 err = en.Append(0xa2, 0x54, 0x43) 420 if err != nil { 421 return 422 } 423 if z.TC == nil { 424 err = en.WriteNil() 425 if err != nil { 426 return 427 } 428 } else { 429 // map header, size 2 430 // write "Round" 431 err = en.Append(0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 432 if err != nil { 433 return 434 } 435 err = en.WriteInt64(z.TC.Round) 436 if err != nil { 437 err = msgp.WrapError(err, "TC", "Round") 438 return 439 } 440 // write "JointSignature" 441 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 442 if err != nil { 443 return 444 } 445 err = en.WriteBytes([]byte(z.TC.JointSignature)) 446 if err != nil { 447 err = msgp.WrapError(err, "TC", "JointSignature") 448 return 449 } 450 } 451 return 452 } 453 454 // MarshalMsg implements msgp.Marshaler 455 func (z *ContentProposal) MarshalMsg(b []byte) (o []byte, err error) { 456 o = msgp.Require(b, z.Msgsize()) 457 // map header, size 2 458 // string "Proposal" 459 o = append(o, 0x82, 0xa8, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c) 460 o, err = z.Proposal.MarshalMsg(o) 461 if err != nil { 462 err = msgp.WrapError(err, "Proposal") 463 return 464 } 465 // string "TC" 466 o = append(o, 0xa2, 0x54, 0x43) 467 if z.TC == nil { 468 o = msgp.AppendNil(o) 469 } else { 470 // map header, size 2 471 // string "Round" 472 o = append(o, 0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 473 o = msgp.AppendInt64(o, z.TC.Round) 474 // string "JointSignature" 475 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 476 o = msgp.AppendBytes(o, []byte(z.TC.JointSignature)) 477 } 478 return 479 } 480 481 // UnmarshalMsg implements msgp.Unmarshaler 482 func (z *ContentProposal) UnmarshalMsg(bts []byte) (o []byte, err error) { 483 var field []byte 484 _ = field 485 var zb0001 uint32 486 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 487 if err != nil { 488 err = msgp.WrapError(err) 489 return 490 } 491 for zb0001 > 0 { 492 zb0001-- 493 field, bts, err = msgp.ReadMapKeyZC(bts) 494 if err != nil { 495 err = msgp.WrapError(err) 496 return 497 } 498 switch msgp.UnsafeString(field) { 499 case "Proposal": 500 bts, err = z.Proposal.UnmarshalMsg(bts) 501 if err != nil { 502 err = msgp.WrapError(err, "Proposal") 503 return 504 } 505 case "TC": 506 if msgp.IsNil(bts) { 507 bts, err = msgp.ReadNilBytes(bts) 508 if err != nil { 509 return 510 } 511 z.TC = nil 512 } else { 513 if z.TC == nil { 514 z.TC = new(TC) 515 } 516 var zb0002 uint32 517 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 518 if err != nil { 519 err = msgp.WrapError(err, "TC") 520 return 521 } 522 for zb0002 > 0 { 523 zb0002-- 524 field, bts, err = msgp.ReadMapKeyZC(bts) 525 if err != nil { 526 err = msgp.WrapError(err, "TC") 527 return 528 } 529 switch msgp.UnsafeString(field) { 530 case "Round": 531 z.TC.Round, bts, err = msgp.ReadInt64Bytes(bts) 532 if err != nil { 533 err = msgp.WrapError(err, "TC", "Round") 534 return 535 } 536 case "JointSignature": 537 { 538 var zb0003 []byte 539 zb0003, bts, err = msgp.ReadBytesBytes(bts, []byte(z.TC.JointSignature)) 540 if err != nil { 541 err = msgp.WrapError(err, "TC", "JointSignature") 542 return 543 } 544 z.TC.JointSignature = JointSignature(zb0003) 545 } 546 default: 547 bts, err = msgp.Skip(bts) 548 if err != nil { 549 err = msgp.WrapError(err, "TC") 550 return 551 } 552 } 553 } 554 } 555 default: 556 bts, err = msgp.Skip(bts) 557 if err != nil { 558 err = msgp.WrapError(err) 559 return 560 } 561 } 562 } 563 o = bts 564 return 565 } 566 567 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 568 func (z *ContentProposal) Msgsize() (s int) { 569 s = 1 + 9 + z.Proposal.Msgsize() + 3 570 if z.TC == nil { 571 s += msgp.NilSize 572 } else { 573 s += 1 + 6 + msgp.Int64Size + 15 + msgp.BytesPrefixSize + len([]byte(z.TC.JointSignature)) 574 } 575 return 576 } 577 578 // DecodeMsg implements msgp.Decodable 579 func (z *ContentString) DecodeMsg(dc *msgp.Reader) (err error) { 580 var field []byte 581 _ = field 582 var zb0001 uint32 583 zb0001, err = dc.ReadMapHeader() 584 if err != nil { 585 err = msgp.WrapError(err) 586 return 587 } 588 for zb0001 > 0 { 589 zb0001-- 590 field, err = dc.ReadMapKeyPtr() 591 if err != nil { 592 err = msgp.WrapError(err) 593 return 594 } 595 switch msgp.UnsafeString(field) { 596 case "Content": 597 z.Content, err = dc.ReadString() 598 if err != nil { 599 err = msgp.WrapError(err, "Content") 600 return 601 } 602 default: 603 err = dc.Skip() 604 if err != nil { 605 err = msgp.WrapError(err) 606 return 607 } 608 } 609 } 610 return 611 } 612 613 // EncodeMsg implements msgp.Encodable 614 func (z ContentString) EncodeMsg(en *msgp.Writer) (err error) { 615 // map header, size 1 616 // write "Content" 617 err = en.Append(0x81, 0xa7, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74) 618 if err != nil { 619 return 620 } 621 err = en.WriteString(z.Content) 622 if err != nil { 623 err = msgp.WrapError(err, "Content") 624 return 625 } 626 return 627 } 628 629 // MarshalMsg implements msgp.Marshaler 630 func (z ContentString) MarshalMsg(b []byte) (o []byte, err error) { 631 o = msgp.Require(b, z.Msgsize()) 632 // map header, size 1 633 // string "Content" 634 o = append(o, 0x81, 0xa7, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74) 635 o = msgp.AppendString(o, z.Content) 636 return 637 } 638 639 // UnmarshalMsg implements msgp.Unmarshaler 640 func (z *ContentString) UnmarshalMsg(bts []byte) (o []byte, err error) { 641 var field []byte 642 _ = field 643 var zb0001 uint32 644 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 645 if err != nil { 646 err = msgp.WrapError(err) 647 return 648 } 649 for zb0001 > 0 { 650 zb0001-- 651 field, bts, err = msgp.ReadMapKeyZC(bts) 652 if err != nil { 653 err = msgp.WrapError(err) 654 return 655 } 656 switch msgp.UnsafeString(field) { 657 case "Content": 658 z.Content, bts, err = msgp.ReadStringBytes(bts) 659 if err != nil { 660 err = msgp.WrapError(err, "Content") 661 return 662 } 663 default: 664 bts, err = msgp.Skip(bts) 665 if err != nil { 666 err = msgp.WrapError(err) 667 return 668 } 669 } 670 } 671 o = bts 672 return 673 } 674 675 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 676 func (z ContentString) Msgsize() (s int) { 677 s = 1 + 8 + msgp.StringPrefixSize + len(z.Content) 678 return 679 } 680 681 // DecodeMsg implements msgp.Decodable 682 func (z *ContentTimeout) DecodeMsg(dc *msgp.Reader) (err error) { 683 var field []byte 684 _ = field 685 var zb0001 uint32 686 zb0001, err = dc.ReadMapHeader() 687 if err != nil { 688 err = msgp.WrapError(err) 689 return 690 } 691 for zb0001 > 0 { 692 zb0001-- 693 field, err = dc.ReadMapKeyPtr() 694 if err != nil { 695 err = msgp.WrapError(err) 696 return 697 } 698 switch msgp.UnsafeString(field) { 699 case "Round": 700 z.Round, err = dc.ReadInt64() 701 if err != nil { 702 err = msgp.WrapError(err, "Round") 703 return 704 } 705 case "HighQC": 706 if dc.IsNil() { 707 err = dc.ReadNil() 708 if err != nil { 709 err = msgp.WrapError(err, "HighQC") 710 return 711 } 712 z.HighQC = nil 713 } else { 714 if z.HighQC == nil { 715 z.HighQC = new(QC) 716 } 717 var zb0002 uint32 718 zb0002, err = dc.ReadMapHeader() 719 if err != nil { 720 err = msgp.WrapError(err, "HighQC") 721 return 722 } 723 for zb0002 > 0 { 724 zb0002-- 725 field, err = dc.ReadMapKeyPtr() 726 if err != nil { 727 err = msgp.WrapError(err, "HighQC") 728 return 729 } 730 switch msgp.UnsafeString(field) { 731 case "VoteData": 732 err = z.HighQC.VoteData.DecodeMsg(dc) 733 if err != nil { 734 err = msgp.WrapError(err, "HighQC", "VoteData") 735 return 736 } 737 case "JointSignature": 738 { 739 var zb0003 []byte 740 zb0003, err = dc.ReadBytes([]byte(z.HighQC.JointSignature)) 741 if err != nil { 742 err = msgp.WrapError(err, "HighQC", "JointSignature") 743 return 744 } 745 z.HighQC.JointSignature = JointSignature(zb0003) 746 } 747 default: 748 err = dc.Skip() 749 if err != nil { 750 err = msgp.WrapError(err, "HighQC") 751 return 752 } 753 } 754 } 755 } 756 case "TC": 757 if dc.IsNil() { 758 err = dc.ReadNil() 759 if err != nil { 760 err = msgp.WrapError(err, "TC") 761 return 762 } 763 z.TC = nil 764 } else { 765 if z.TC == nil { 766 z.TC = new(TC) 767 } 768 var zb0004 uint32 769 zb0004, err = dc.ReadMapHeader() 770 if err != nil { 771 err = msgp.WrapError(err, "TC") 772 return 773 } 774 for zb0004 > 0 { 775 zb0004-- 776 field, err = dc.ReadMapKeyPtr() 777 if err != nil { 778 err = msgp.WrapError(err, "TC") 779 return 780 } 781 switch msgp.UnsafeString(field) { 782 case "Round": 783 z.TC.Round, err = dc.ReadInt64() 784 if err != nil { 785 err = msgp.WrapError(err, "TC", "Round") 786 return 787 } 788 case "JointSignature": 789 { 790 var zb0005 []byte 791 zb0005, err = dc.ReadBytes([]byte(z.TC.JointSignature)) 792 if err != nil { 793 err = msgp.WrapError(err, "TC", "JointSignature") 794 return 795 } 796 z.TC.JointSignature = JointSignature(zb0005) 797 } 798 default: 799 err = dc.Skip() 800 if err != nil { 801 err = msgp.WrapError(err, "TC") 802 return 803 } 804 } 805 } 806 } 807 default: 808 err = dc.Skip() 809 if err != nil { 810 err = msgp.WrapError(err) 811 return 812 } 813 } 814 } 815 return 816 } 817 818 // EncodeMsg implements msgp.Encodable 819 func (z *ContentTimeout) EncodeMsg(en *msgp.Writer) (err error) { 820 // map header, size 3 821 // write "Round" 822 err = en.Append(0x83, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 823 if err != nil { 824 return 825 } 826 err = en.WriteInt64(z.Round) 827 if err != nil { 828 err = msgp.WrapError(err, "Round") 829 return 830 } 831 // write "HighQC" 832 err = en.Append(0xa6, 0x48, 0x69, 0x67, 0x68, 0x51, 0x43) 833 if err != nil { 834 return 835 } 836 if z.HighQC == nil { 837 err = en.WriteNil() 838 if err != nil { 839 return 840 } 841 } else { 842 // map header, size 2 843 // write "VoteData" 844 err = en.Append(0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 845 if err != nil { 846 return 847 } 848 err = z.HighQC.VoteData.EncodeMsg(en) 849 if err != nil { 850 err = msgp.WrapError(err, "HighQC", "VoteData") 851 return 852 } 853 // write "JointSignature" 854 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 855 if err != nil { 856 return 857 } 858 err = en.WriteBytes([]byte(z.HighQC.JointSignature)) 859 if err != nil { 860 err = msgp.WrapError(err, "HighQC", "JointSignature") 861 return 862 } 863 } 864 // write "TC" 865 err = en.Append(0xa2, 0x54, 0x43) 866 if err != nil { 867 return 868 } 869 if z.TC == nil { 870 err = en.WriteNil() 871 if err != nil { 872 return 873 } 874 } else { 875 // map header, size 2 876 // write "Round" 877 err = en.Append(0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 878 if err != nil { 879 return 880 } 881 err = en.WriteInt64(z.TC.Round) 882 if err != nil { 883 err = msgp.WrapError(err, "TC", "Round") 884 return 885 } 886 // write "JointSignature" 887 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 888 if err != nil { 889 return 890 } 891 err = en.WriteBytes([]byte(z.TC.JointSignature)) 892 if err != nil { 893 err = msgp.WrapError(err, "TC", "JointSignature") 894 return 895 } 896 } 897 return 898 } 899 900 // MarshalMsg implements msgp.Marshaler 901 func (z *ContentTimeout) MarshalMsg(b []byte) (o []byte, err error) { 902 o = msgp.Require(b, z.Msgsize()) 903 // map header, size 3 904 // string "Round" 905 o = append(o, 0x83, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 906 o = msgp.AppendInt64(o, z.Round) 907 // string "HighQC" 908 o = append(o, 0xa6, 0x48, 0x69, 0x67, 0x68, 0x51, 0x43) 909 if z.HighQC == nil { 910 o = msgp.AppendNil(o) 911 } else { 912 // map header, size 2 913 // string "VoteData" 914 o = append(o, 0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 915 o, err = z.HighQC.VoteData.MarshalMsg(o) 916 if err != nil { 917 err = msgp.WrapError(err, "HighQC", "VoteData") 918 return 919 } 920 // string "JointSignature" 921 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 922 o = msgp.AppendBytes(o, []byte(z.HighQC.JointSignature)) 923 } 924 // string "TC" 925 o = append(o, 0xa2, 0x54, 0x43) 926 if z.TC == nil { 927 o = msgp.AppendNil(o) 928 } else { 929 // map header, size 2 930 // string "Round" 931 o = append(o, 0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 932 o = msgp.AppendInt64(o, z.TC.Round) 933 // string "JointSignature" 934 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 935 o = msgp.AppendBytes(o, []byte(z.TC.JointSignature)) 936 } 937 return 938 } 939 940 // UnmarshalMsg implements msgp.Unmarshaler 941 func (z *ContentTimeout) UnmarshalMsg(bts []byte) (o []byte, err error) { 942 var field []byte 943 _ = field 944 var zb0001 uint32 945 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 946 if err != nil { 947 err = msgp.WrapError(err) 948 return 949 } 950 for zb0001 > 0 { 951 zb0001-- 952 field, bts, err = msgp.ReadMapKeyZC(bts) 953 if err != nil { 954 err = msgp.WrapError(err) 955 return 956 } 957 switch msgp.UnsafeString(field) { 958 case "Round": 959 z.Round, bts, err = msgp.ReadInt64Bytes(bts) 960 if err != nil { 961 err = msgp.WrapError(err, "Round") 962 return 963 } 964 case "HighQC": 965 if msgp.IsNil(bts) { 966 bts, err = msgp.ReadNilBytes(bts) 967 if err != nil { 968 return 969 } 970 z.HighQC = nil 971 } else { 972 if z.HighQC == nil { 973 z.HighQC = new(QC) 974 } 975 var zb0002 uint32 976 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 977 if err != nil { 978 err = msgp.WrapError(err, "HighQC") 979 return 980 } 981 for zb0002 > 0 { 982 zb0002-- 983 field, bts, err = msgp.ReadMapKeyZC(bts) 984 if err != nil { 985 err = msgp.WrapError(err, "HighQC") 986 return 987 } 988 switch msgp.UnsafeString(field) { 989 case "VoteData": 990 bts, err = z.HighQC.VoteData.UnmarshalMsg(bts) 991 if err != nil { 992 err = msgp.WrapError(err, "HighQC", "VoteData") 993 return 994 } 995 case "JointSignature": 996 { 997 var zb0003 []byte 998 zb0003, bts, err = msgp.ReadBytesBytes(bts, []byte(z.HighQC.JointSignature)) 999 if err != nil { 1000 err = msgp.WrapError(err, "HighQC", "JointSignature") 1001 return 1002 } 1003 z.HighQC.JointSignature = JointSignature(zb0003) 1004 } 1005 default: 1006 bts, err = msgp.Skip(bts) 1007 if err != nil { 1008 err = msgp.WrapError(err, "HighQC") 1009 return 1010 } 1011 } 1012 } 1013 } 1014 case "TC": 1015 if msgp.IsNil(bts) { 1016 bts, err = msgp.ReadNilBytes(bts) 1017 if err != nil { 1018 return 1019 } 1020 z.TC = nil 1021 } else { 1022 if z.TC == nil { 1023 z.TC = new(TC) 1024 } 1025 var zb0004 uint32 1026 zb0004, bts, err = msgp.ReadMapHeaderBytes(bts) 1027 if err != nil { 1028 err = msgp.WrapError(err, "TC") 1029 return 1030 } 1031 for zb0004 > 0 { 1032 zb0004-- 1033 field, bts, err = msgp.ReadMapKeyZC(bts) 1034 if err != nil { 1035 err = msgp.WrapError(err, "TC") 1036 return 1037 } 1038 switch msgp.UnsafeString(field) { 1039 case "Round": 1040 z.TC.Round, bts, err = msgp.ReadInt64Bytes(bts) 1041 if err != nil { 1042 err = msgp.WrapError(err, "TC", "Round") 1043 return 1044 } 1045 case "JointSignature": 1046 { 1047 var zb0005 []byte 1048 zb0005, bts, err = msgp.ReadBytesBytes(bts, []byte(z.TC.JointSignature)) 1049 if err != nil { 1050 err = msgp.WrapError(err, "TC", "JointSignature") 1051 return 1052 } 1053 z.TC.JointSignature = JointSignature(zb0005) 1054 } 1055 default: 1056 bts, err = msgp.Skip(bts) 1057 if err != nil { 1058 err = msgp.WrapError(err, "TC") 1059 return 1060 } 1061 } 1062 } 1063 } 1064 default: 1065 bts, err = msgp.Skip(bts) 1066 if err != nil { 1067 err = msgp.WrapError(err) 1068 return 1069 } 1070 } 1071 } 1072 o = bts 1073 return 1074 } 1075 1076 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1077 func (z *ContentTimeout) Msgsize() (s int) { 1078 s = 1 + 6 + msgp.Int64Size + 7 1079 if z.HighQC == nil { 1080 s += msgp.NilSize 1081 } else { 1082 s += 1 + 9 + z.HighQC.VoteData.Msgsize() + 15 + msgp.BytesPrefixSize + len([]byte(z.HighQC.JointSignature)) 1083 } 1084 s += 3 1085 if z.TC == nil { 1086 s += msgp.NilSize 1087 } else { 1088 s += 1 + 6 + msgp.Int64Size + 15 + msgp.BytesPrefixSize + len([]byte(z.TC.JointSignature)) 1089 } 1090 return 1091 } 1092 1093 // DecodeMsg implements msgp.Decodable 1094 func (z *ContentVote) DecodeMsg(dc *msgp.Reader) (err error) { 1095 var field []byte 1096 _ = field 1097 var zb0001 uint32 1098 zb0001, err = dc.ReadMapHeader() 1099 if err != nil { 1100 err = msgp.WrapError(err) 1101 return 1102 } 1103 for zb0001 > 0 { 1104 zb0001-- 1105 field, err = dc.ReadMapKeyPtr() 1106 if err != nil { 1107 err = msgp.WrapError(err) 1108 return 1109 } 1110 switch msgp.UnsafeString(field) { 1111 case "VoteInfo": 1112 err = z.VoteInfo.DecodeMsg(dc) 1113 if err != nil { 1114 err = msgp.WrapError(err, "VoteInfo") 1115 return 1116 } 1117 case "LedgerCommitInfo": 1118 var zb0002 uint32 1119 zb0002, err = dc.ReadMapHeader() 1120 if err != nil { 1121 err = msgp.WrapError(err, "LedgerCommitInfo") 1122 return 1123 } 1124 for zb0002 > 0 { 1125 zb0002-- 1126 field, err = dc.ReadMapKeyPtr() 1127 if err != nil { 1128 err = msgp.WrapError(err, "LedgerCommitInfo") 1129 return 1130 } 1131 switch msgp.UnsafeString(field) { 1132 case "CommitStateId": 1133 z.LedgerCommitInfo.CommitStateId, err = dc.ReadString() 1134 if err != nil { 1135 err = msgp.WrapError(err, "LedgerCommitInfo", "CommitStateId") 1136 return 1137 } 1138 case "VoteInfoHash": 1139 z.LedgerCommitInfo.VoteInfoHash, err = dc.ReadString() 1140 if err != nil { 1141 err = msgp.WrapError(err, "LedgerCommitInfo", "VoteInfoHash") 1142 return 1143 } 1144 default: 1145 err = dc.Skip() 1146 if err != nil { 1147 err = msgp.WrapError(err, "LedgerCommitInfo") 1148 return 1149 } 1150 } 1151 } 1152 case "QC": 1153 if dc.IsNil() { 1154 err = dc.ReadNil() 1155 if err != nil { 1156 err = msgp.WrapError(err, "QC") 1157 return 1158 } 1159 z.QC = nil 1160 } else { 1161 if z.QC == nil { 1162 z.QC = new(QC) 1163 } 1164 var zb0003 uint32 1165 zb0003, err = dc.ReadMapHeader() 1166 if err != nil { 1167 err = msgp.WrapError(err, "QC") 1168 return 1169 } 1170 for zb0003 > 0 { 1171 zb0003-- 1172 field, err = dc.ReadMapKeyPtr() 1173 if err != nil { 1174 err = msgp.WrapError(err, "QC") 1175 return 1176 } 1177 switch msgp.UnsafeString(field) { 1178 case "VoteData": 1179 err = z.QC.VoteData.DecodeMsg(dc) 1180 if err != nil { 1181 err = msgp.WrapError(err, "QC", "VoteData") 1182 return 1183 } 1184 case "JointSignature": 1185 { 1186 var zb0004 []byte 1187 zb0004, err = dc.ReadBytes([]byte(z.QC.JointSignature)) 1188 if err != nil { 1189 err = msgp.WrapError(err, "QC", "JointSignature") 1190 return 1191 } 1192 z.QC.JointSignature = JointSignature(zb0004) 1193 } 1194 default: 1195 err = dc.Skip() 1196 if err != nil { 1197 err = msgp.WrapError(err, "QC") 1198 return 1199 } 1200 } 1201 } 1202 } 1203 case "TC": 1204 if dc.IsNil() { 1205 err = dc.ReadNil() 1206 if err != nil { 1207 err = msgp.WrapError(err, "TC") 1208 return 1209 } 1210 z.TC = nil 1211 } else { 1212 if z.TC == nil { 1213 z.TC = new(TC) 1214 } 1215 var zb0005 uint32 1216 zb0005, err = dc.ReadMapHeader() 1217 if err != nil { 1218 err = msgp.WrapError(err, "TC") 1219 return 1220 } 1221 for zb0005 > 0 { 1222 zb0005-- 1223 field, err = dc.ReadMapKeyPtr() 1224 if err != nil { 1225 err = msgp.WrapError(err, "TC") 1226 return 1227 } 1228 switch msgp.UnsafeString(field) { 1229 case "Round": 1230 z.TC.Round, err = dc.ReadInt64() 1231 if err != nil { 1232 err = msgp.WrapError(err, "TC", "Round") 1233 return 1234 } 1235 case "JointSignature": 1236 { 1237 var zb0006 []byte 1238 zb0006, err = dc.ReadBytes([]byte(z.TC.JointSignature)) 1239 if err != nil { 1240 err = msgp.WrapError(err, "TC", "JointSignature") 1241 return 1242 } 1243 z.TC.JointSignature = JointSignature(zb0006) 1244 } 1245 default: 1246 err = dc.Skip() 1247 if err != nil { 1248 err = msgp.WrapError(err, "TC") 1249 return 1250 } 1251 } 1252 } 1253 } 1254 default: 1255 err = dc.Skip() 1256 if err != nil { 1257 err = msgp.WrapError(err) 1258 return 1259 } 1260 } 1261 } 1262 return 1263 } 1264 1265 // EncodeMsg implements msgp.Encodable 1266 func (z *ContentVote) EncodeMsg(en *msgp.Writer) (err error) { 1267 // map header, size 4 1268 // write "VoteInfo" 1269 err = en.Append(0x84, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f) 1270 if err != nil { 1271 return 1272 } 1273 err = z.VoteInfo.EncodeMsg(en) 1274 if err != nil { 1275 err = msgp.WrapError(err, "VoteInfo") 1276 return 1277 } 1278 // write "LedgerCommitInfo" 1279 // map header, size 2 1280 // write "CommitStateId" 1281 err = en.Append(0xb0, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x82, 0xad, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 1282 if err != nil { 1283 return 1284 } 1285 err = en.WriteString(z.LedgerCommitInfo.CommitStateId) 1286 if err != nil { 1287 err = msgp.WrapError(err, "LedgerCommitInfo", "CommitStateId") 1288 return 1289 } 1290 // write "VoteInfoHash" 1291 err = en.Append(0xac, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x61, 0x73, 0x68) 1292 if err != nil { 1293 return 1294 } 1295 err = en.WriteString(z.LedgerCommitInfo.VoteInfoHash) 1296 if err != nil { 1297 err = msgp.WrapError(err, "LedgerCommitInfo", "VoteInfoHash") 1298 return 1299 } 1300 // write "QC" 1301 err = en.Append(0xa2, 0x51, 0x43) 1302 if err != nil { 1303 return 1304 } 1305 if z.QC == nil { 1306 err = en.WriteNil() 1307 if err != nil { 1308 return 1309 } 1310 } else { 1311 // map header, size 2 1312 // write "VoteData" 1313 err = en.Append(0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 1314 if err != nil { 1315 return 1316 } 1317 err = z.QC.VoteData.EncodeMsg(en) 1318 if err != nil { 1319 err = msgp.WrapError(err, "QC", "VoteData") 1320 return 1321 } 1322 // write "JointSignature" 1323 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1324 if err != nil { 1325 return 1326 } 1327 err = en.WriteBytes([]byte(z.QC.JointSignature)) 1328 if err != nil { 1329 err = msgp.WrapError(err, "QC", "JointSignature") 1330 return 1331 } 1332 } 1333 // write "TC" 1334 err = en.Append(0xa2, 0x54, 0x43) 1335 if err != nil { 1336 return 1337 } 1338 if z.TC == nil { 1339 err = en.WriteNil() 1340 if err != nil { 1341 return 1342 } 1343 } else { 1344 // map header, size 2 1345 // write "Round" 1346 err = en.Append(0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 1347 if err != nil { 1348 return 1349 } 1350 err = en.WriteInt64(z.TC.Round) 1351 if err != nil { 1352 err = msgp.WrapError(err, "TC", "Round") 1353 return 1354 } 1355 // write "JointSignature" 1356 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1357 if err != nil { 1358 return 1359 } 1360 err = en.WriteBytes([]byte(z.TC.JointSignature)) 1361 if err != nil { 1362 err = msgp.WrapError(err, "TC", "JointSignature") 1363 return 1364 } 1365 } 1366 return 1367 } 1368 1369 // MarshalMsg implements msgp.Marshaler 1370 func (z *ContentVote) MarshalMsg(b []byte) (o []byte, err error) { 1371 o = msgp.Require(b, z.Msgsize()) 1372 // map header, size 4 1373 // string "VoteInfo" 1374 o = append(o, 0x84, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f) 1375 o, err = z.VoteInfo.MarshalMsg(o) 1376 if err != nil { 1377 err = msgp.WrapError(err, "VoteInfo") 1378 return 1379 } 1380 // string "LedgerCommitInfo" 1381 // map header, size 2 1382 // string "CommitStateId" 1383 o = append(o, 0xb0, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x82, 0xad, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 1384 o = msgp.AppendString(o, z.LedgerCommitInfo.CommitStateId) 1385 // string "VoteInfoHash" 1386 o = append(o, 0xac, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x61, 0x73, 0x68) 1387 o = msgp.AppendString(o, z.LedgerCommitInfo.VoteInfoHash) 1388 // string "QC" 1389 o = append(o, 0xa2, 0x51, 0x43) 1390 if z.QC == nil { 1391 o = msgp.AppendNil(o) 1392 } else { 1393 // map header, size 2 1394 // string "VoteData" 1395 o = append(o, 0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 1396 o, err = z.QC.VoteData.MarshalMsg(o) 1397 if err != nil { 1398 err = msgp.WrapError(err, "QC", "VoteData") 1399 return 1400 } 1401 // string "JointSignature" 1402 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1403 o = msgp.AppendBytes(o, []byte(z.QC.JointSignature)) 1404 } 1405 // string "TC" 1406 o = append(o, 0xa2, 0x54, 0x43) 1407 if z.TC == nil { 1408 o = msgp.AppendNil(o) 1409 } else { 1410 // map header, size 2 1411 // string "Round" 1412 o = append(o, 0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 1413 o = msgp.AppendInt64(o, z.TC.Round) 1414 // string "JointSignature" 1415 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1416 o = msgp.AppendBytes(o, []byte(z.TC.JointSignature)) 1417 } 1418 return 1419 } 1420 1421 // UnmarshalMsg implements msgp.Unmarshaler 1422 func (z *ContentVote) UnmarshalMsg(bts []byte) (o []byte, err error) { 1423 var field []byte 1424 _ = field 1425 var zb0001 uint32 1426 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1427 if err != nil { 1428 err = msgp.WrapError(err) 1429 return 1430 } 1431 for zb0001 > 0 { 1432 zb0001-- 1433 field, bts, err = msgp.ReadMapKeyZC(bts) 1434 if err != nil { 1435 err = msgp.WrapError(err) 1436 return 1437 } 1438 switch msgp.UnsafeString(field) { 1439 case "VoteInfo": 1440 bts, err = z.VoteInfo.UnmarshalMsg(bts) 1441 if err != nil { 1442 err = msgp.WrapError(err, "VoteInfo") 1443 return 1444 } 1445 case "LedgerCommitInfo": 1446 var zb0002 uint32 1447 zb0002, bts, err = msgp.ReadMapHeaderBytes(bts) 1448 if err != nil { 1449 err = msgp.WrapError(err, "LedgerCommitInfo") 1450 return 1451 } 1452 for zb0002 > 0 { 1453 zb0002-- 1454 field, bts, err = msgp.ReadMapKeyZC(bts) 1455 if err != nil { 1456 err = msgp.WrapError(err, "LedgerCommitInfo") 1457 return 1458 } 1459 switch msgp.UnsafeString(field) { 1460 case "CommitStateId": 1461 z.LedgerCommitInfo.CommitStateId, bts, err = msgp.ReadStringBytes(bts) 1462 if err != nil { 1463 err = msgp.WrapError(err, "LedgerCommitInfo", "CommitStateId") 1464 return 1465 } 1466 case "VoteInfoHash": 1467 z.LedgerCommitInfo.VoteInfoHash, bts, err = msgp.ReadStringBytes(bts) 1468 if err != nil { 1469 err = msgp.WrapError(err, "LedgerCommitInfo", "VoteInfoHash") 1470 return 1471 } 1472 default: 1473 bts, err = msgp.Skip(bts) 1474 if err != nil { 1475 err = msgp.WrapError(err, "LedgerCommitInfo") 1476 return 1477 } 1478 } 1479 } 1480 case "QC": 1481 if msgp.IsNil(bts) { 1482 bts, err = msgp.ReadNilBytes(bts) 1483 if err != nil { 1484 return 1485 } 1486 z.QC = nil 1487 } else { 1488 if z.QC == nil { 1489 z.QC = new(QC) 1490 } 1491 var zb0003 uint32 1492 zb0003, bts, err = msgp.ReadMapHeaderBytes(bts) 1493 if err != nil { 1494 err = msgp.WrapError(err, "QC") 1495 return 1496 } 1497 for zb0003 > 0 { 1498 zb0003-- 1499 field, bts, err = msgp.ReadMapKeyZC(bts) 1500 if err != nil { 1501 err = msgp.WrapError(err, "QC") 1502 return 1503 } 1504 switch msgp.UnsafeString(field) { 1505 case "VoteData": 1506 bts, err = z.QC.VoteData.UnmarshalMsg(bts) 1507 if err != nil { 1508 err = msgp.WrapError(err, "QC", "VoteData") 1509 return 1510 } 1511 case "JointSignature": 1512 { 1513 var zb0004 []byte 1514 zb0004, bts, err = msgp.ReadBytesBytes(bts, []byte(z.QC.JointSignature)) 1515 if err != nil { 1516 err = msgp.WrapError(err, "QC", "JointSignature") 1517 return 1518 } 1519 z.QC.JointSignature = JointSignature(zb0004) 1520 } 1521 default: 1522 bts, err = msgp.Skip(bts) 1523 if err != nil { 1524 err = msgp.WrapError(err, "QC") 1525 return 1526 } 1527 } 1528 } 1529 } 1530 case "TC": 1531 if msgp.IsNil(bts) { 1532 bts, err = msgp.ReadNilBytes(bts) 1533 if err != nil { 1534 return 1535 } 1536 z.TC = nil 1537 } else { 1538 if z.TC == nil { 1539 z.TC = new(TC) 1540 } 1541 var zb0005 uint32 1542 zb0005, bts, err = msgp.ReadMapHeaderBytes(bts) 1543 if err != nil { 1544 err = msgp.WrapError(err, "TC") 1545 return 1546 } 1547 for zb0005 > 0 { 1548 zb0005-- 1549 field, bts, err = msgp.ReadMapKeyZC(bts) 1550 if err != nil { 1551 err = msgp.WrapError(err, "TC") 1552 return 1553 } 1554 switch msgp.UnsafeString(field) { 1555 case "Round": 1556 z.TC.Round, bts, err = msgp.ReadInt64Bytes(bts) 1557 if err != nil { 1558 err = msgp.WrapError(err, "TC", "Round") 1559 return 1560 } 1561 case "JointSignature": 1562 { 1563 var zb0006 []byte 1564 zb0006, bts, err = msgp.ReadBytesBytes(bts, []byte(z.TC.JointSignature)) 1565 if err != nil { 1566 err = msgp.WrapError(err, "TC", "JointSignature") 1567 return 1568 } 1569 z.TC.JointSignature = JointSignature(zb0006) 1570 } 1571 default: 1572 bts, err = msgp.Skip(bts) 1573 if err != nil { 1574 err = msgp.WrapError(err, "TC") 1575 return 1576 } 1577 } 1578 } 1579 } 1580 default: 1581 bts, err = msgp.Skip(bts) 1582 if err != nil { 1583 err = msgp.WrapError(err) 1584 return 1585 } 1586 } 1587 } 1588 o = bts 1589 return 1590 } 1591 1592 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1593 func (z *ContentVote) Msgsize() (s int) { 1594 s = 1 + 9 + z.VoteInfo.Msgsize() + 17 + 1 + 14 + msgp.StringPrefixSize + len(z.LedgerCommitInfo.CommitStateId) + 13 + msgp.StringPrefixSize + len(z.LedgerCommitInfo.VoteInfoHash) + 3 1595 if z.QC == nil { 1596 s += msgp.NilSize 1597 } else { 1598 s += 1 + 9 + z.QC.VoteData.Msgsize() + 15 + msgp.BytesPrefixSize + len([]byte(z.QC.JointSignature)) 1599 } 1600 s += 3 1601 if z.TC == nil { 1602 s += msgp.NilSize 1603 } else { 1604 s += 1 + 6 + msgp.Int64Size + 15 + msgp.BytesPrefixSize + len([]byte(z.TC.JointSignature)) 1605 } 1606 return 1607 } 1608 1609 // DecodeMsg implements msgp.Decodable 1610 func (z *HotStuffMessageType) DecodeMsg(dc *msgp.Reader) (err error) { 1611 { 1612 var zb0001 int 1613 zb0001, err = dc.ReadInt() 1614 if err != nil { 1615 err = msgp.WrapError(err) 1616 return 1617 } 1618 (*z) = HotStuffMessageType(zb0001) 1619 } 1620 return 1621 } 1622 1623 // EncodeMsg implements msgp.Encodable 1624 func (z HotStuffMessageType) EncodeMsg(en *msgp.Writer) (err error) { 1625 err = en.WriteInt(int(z)) 1626 if err != nil { 1627 err = msgp.WrapError(err) 1628 return 1629 } 1630 return 1631 } 1632 1633 // MarshalMsg implements msgp.Marshaler 1634 func (z HotStuffMessageType) MarshalMsg(b []byte) (o []byte, err error) { 1635 o = msgp.Require(b, z.Msgsize()) 1636 o = msgp.AppendInt(o, int(z)) 1637 return 1638 } 1639 1640 // UnmarshalMsg implements msgp.Unmarshaler 1641 func (z *HotStuffMessageType) UnmarshalMsg(bts []byte) (o []byte, err error) { 1642 { 1643 var zb0001 int 1644 zb0001, bts, err = msgp.ReadIntBytes(bts) 1645 if err != nil { 1646 err = msgp.WrapError(err) 1647 return 1648 } 1649 (*z) = HotStuffMessageType(zb0001) 1650 } 1651 o = bts 1652 return 1653 } 1654 1655 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1656 func (z HotStuffMessageType) Msgsize() (s int) { 1657 s = msgp.IntSize 1658 return 1659 } 1660 1661 // DecodeMsg implements msgp.Decodable 1662 func (z *HotStuffSignedMessage) DecodeMsg(dc *msgp.Reader) (err error) { 1663 var field []byte 1664 _ = field 1665 var zb0001 uint32 1666 zb0001, err = dc.ReadMapHeader() 1667 if err != nil { 1668 err = msgp.WrapError(err) 1669 return 1670 } 1671 for zb0001 > 0 { 1672 zb0001-- 1673 field, err = dc.ReadMapKeyPtr() 1674 if err != nil { 1675 err = msgp.WrapError(err) 1676 return 1677 } 1678 switch msgp.UnsafeString(field) { 1679 case "HotStuffMessageType": 1680 z.HotStuffMessageType, err = dc.ReadInt() 1681 if err != nil { 1682 err = msgp.WrapError(err, "HotStuffMessageType") 1683 return 1684 } 1685 case "ContentBytes": 1686 z.ContentBytes, err = dc.ReadBytes(z.ContentBytes) 1687 if err != nil { 1688 err = msgp.WrapError(err, "ContentBytes") 1689 return 1690 } 1691 case "SenderMemberId": 1692 z.SenderMemberId, err = dc.ReadString() 1693 if err != nil { 1694 err = msgp.WrapError(err, "SenderMemberId") 1695 return 1696 } 1697 case "Signature": 1698 z.Signature, err = dc.ReadBytes(z.Signature) 1699 if err != nil { 1700 err = msgp.WrapError(err, "Signature") 1701 return 1702 } 1703 default: 1704 err = dc.Skip() 1705 if err != nil { 1706 err = msgp.WrapError(err) 1707 return 1708 } 1709 } 1710 } 1711 return 1712 } 1713 1714 // EncodeMsg implements msgp.Encodable 1715 func (z *HotStuffSignedMessage) EncodeMsg(en *msgp.Writer) (err error) { 1716 // map header, size 4 1717 // write "HotStuffMessageType" 1718 err = en.Append(0x84, 0xb3, 0x48, 0x6f, 0x74, 0x53, 0x74, 0x75, 0x66, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 1719 if err != nil { 1720 return 1721 } 1722 err = en.WriteInt(z.HotStuffMessageType) 1723 if err != nil { 1724 err = msgp.WrapError(err, "HotStuffMessageType") 1725 return 1726 } 1727 // write "ContentBytes" 1728 err = en.Append(0xac, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73) 1729 if err != nil { 1730 return 1731 } 1732 err = en.WriteBytes(z.ContentBytes) 1733 if err != nil { 1734 err = msgp.WrapError(err, "ContentBytes") 1735 return 1736 } 1737 // write "SenderMemberId" 1738 err = en.Append(0xae, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64) 1739 if err != nil { 1740 return 1741 } 1742 err = en.WriteString(z.SenderMemberId) 1743 if err != nil { 1744 err = msgp.WrapError(err, "SenderMemberId") 1745 return 1746 } 1747 // write "Signature" 1748 err = en.Append(0xa9, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1749 if err != nil { 1750 return 1751 } 1752 err = en.WriteBytes(z.Signature) 1753 if err != nil { 1754 err = msgp.WrapError(err, "Signature") 1755 return 1756 } 1757 return 1758 } 1759 1760 // MarshalMsg implements msgp.Marshaler 1761 func (z *HotStuffSignedMessage) MarshalMsg(b []byte) (o []byte, err error) { 1762 o = msgp.Require(b, z.Msgsize()) 1763 // map header, size 4 1764 // string "HotStuffMessageType" 1765 o = append(o, 0x84, 0xb3, 0x48, 0x6f, 0x74, 0x53, 0x74, 0x75, 0x66, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65) 1766 o = msgp.AppendInt(o, z.HotStuffMessageType) 1767 // string "ContentBytes" 1768 o = append(o, 0xac, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73) 1769 o = msgp.AppendBytes(o, z.ContentBytes) 1770 // string "SenderMemberId" 1771 o = append(o, 0xae, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64) 1772 o = msgp.AppendString(o, z.SenderMemberId) 1773 // string "Signature" 1774 o = append(o, 0xa9, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 1775 o = msgp.AppendBytes(o, z.Signature) 1776 return 1777 } 1778 1779 // UnmarshalMsg implements msgp.Unmarshaler 1780 func (z *HotStuffSignedMessage) UnmarshalMsg(bts []byte) (o []byte, err error) { 1781 var field []byte 1782 _ = field 1783 var zb0001 uint32 1784 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1785 if err != nil { 1786 err = msgp.WrapError(err) 1787 return 1788 } 1789 for zb0001 > 0 { 1790 zb0001-- 1791 field, bts, err = msgp.ReadMapKeyZC(bts) 1792 if err != nil { 1793 err = msgp.WrapError(err) 1794 return 1795 } 1796 switch msgp.UnsafeString(field) { 1797 case "HotStuffMessageType": 1798 z.HotStuffMessageType, bts, err = msgp.ReadIntBytes(bts) 1799 if err != nil { 1800 err = msgp.WrapError(err, "HotStuffMessageType") 1801 return 1802 } 1803 case "ContentBytes": 1804 z.ContentBytes, bts, err = msgp.ReadBytesBytes(bts, z.ContentBytes) 1805 if err != nil { 1806 err = msgp.WrapError(err, "ContentBytes") 1807 return 1808 } 1809 case "SenderMemberId": 1810 z.SenderMemberId, bts, err = msgp.ReadStringBytes(bts) 1811 if err != nil { 1812 err = msgp.WrapError(err, "SenderMemberId") 1813 return 1814 } 1815 case "Signature": 1816 z.Signature, bts, err = msgp.ReadBytesBytes(bts, z.Signature) 1817 if err != nil { 1818 err = msgp.WrapError(err, "Signature") 1819 return 1820 } 1821 default: 1822 bts, err = msgp.Skip(bts) 1823 if err != nil { 1824 err = msgp.WrapError(err) 1825 return 1826 } 1827 } 1828 } 1829 o = bts 1830 return 1831 } 1832 1833 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1834 func (z *HotStuffSignedMessage) Msgsize() (s int) { 1835 s = 1 + 20 + msgp.IntSize + 13 + msgp.BytesPrefixSize + len(z.ContentBytes) + 15 + msgp.StringPrefixSize + len(z.SenderMemberId) + 10 + msgp.BytesPrefixSize + len(z.Signature) 1836 return 1837 } 1838 1839 // DecodeMsg implements msgp.Decodable 1840 func (z *JointSignature) DecodeMsg(dc *msgp.Reader) (err error) { 1841 { 1842 var zb0001 []byte 1843 zb0001, err = dc.ReadBytes([]byte((*z))) 1844 if err != nil { 1845 err = msgp.WrapError(err) 1846 return 1847 } 1848 (*z) = JointSignature(zb0001) 1849 } 1850 return 1851 } 1852 1853 // EncodeMsg implements msgp.Encodable 1854 func (z JointSignature) EncodeMsg(en *msgp.Writer) (err error) { 1855 err = en.WriteBytes([]byte(z)) 1856 if err != nil { 1857 err = msgp.WrapError(err) 1858 return 1859 } 1860 return 1861 } 1862 1863 // MarshalMsg implements msgp.Marshaler 1864 func (z JointSignature) MarshalMsg(b []byte) (o []byte, err error) { 1865 o = msgp.Require(b, z.Msgsize()) 1866 o = msgp.AppendBytes(o, []byte(z)) 1867 return 1868 } 1869 1870 // UnmarshalMsg implements msgp.Unmarshaler 1871 func (z *JointSignature) UnmarshalMsg(bts []byte) (o []byte, err error) { 1872 { 1873 var zb0001 []byte 1874 zb0001, bts, err = msgp.ReadBytesBytes(bts, []byte((*z))) 1875 if err != nil { 1876 err = msgp.WrapError(err) 1877 return 1878 } 1879 (*z) = JointSignature(zb0001) 1880 } 1881 o = bts 1882 return 1883 } 1884 1885 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1886 func (z JointSignature) Msgsize() (s int) { 1887 s = msgp.BytesPrefixSize + len([]byte(z)) 1888 return 1889 } 1890 1891 // DecodeMsg implements msgp.Decodable 1892 func (z *LedgerCommitInfo) DecodeMsg(dc *msgp.Reader) (err error) { 1893 var field []byte 1894 _ = field 1895 var zb0001 uint32 1896 zb0001, err = dc.ReadMapHeader() 1897 if err != nil { 1898 err = msgp.WrapError(err) 1899 return 1900 } 1901 for zb0001 > 0 { 1902 zb0001-- 1903 field, err = dc.ReadMapKeyPtr() 1904 if err != nil { 1905 err = msgp.WrapError(err) 1906 return 1907 } 1908 switch msgp.UnsafeString(field) { 1909 case "CommitStateId": 1910 z.CommitStateId, err = dc.ReadString() 1911 if err != nil { 1912 err = msgp.WrapError(err, "CommitStateId") 1913 return 1914 } 1915 case "VoteInfoHash": 1916 z.VoteInfoHash, err = dc.ReadString() 1917 if err != nil { 1918 err = msgp.WrapError(err, "VoteInfoHash") 1919 return 1920 } 1921 default: 1922 err = dc.Skip() 1923 if err != nil { 1924 err = msgp.WrapError(err) 1925 return 1926 } 1927 } 1928 } 1929 return 1930 } 1931 1932 // EncodeMsg implements msgp.Encodable 1933 func (z LedgerCommitInfo) EncodeMsg(en *msgp.Writer) (err error) { 1934 // map header, size 2 1935 // write "CommitStateId" 1936 err = en.Append(0x82, 0xad, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 1937 if err != nil { 1938 return 1939 } 1940 err = en.WriteString(z.CommitStateId) 1941 if err != nil { 1942 err = msgp.WrapError(err, "CommitStateId") 1943 return 1944 } 1945 // write "VoteInfoHash" 1946 err = en.Append(0xac, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x61, 0x73, 0x68) 1947 if err != nil { 1948 return 1949 } 1950 err = en.WriteString(z.VoteInfoHash) 1951 if err != nil { 1952 err = msgp.WrapError(err, "VoteInfoHash") 1953 return 1954 } 1955 return 1956 } 1957 1958 // MarshalMsg implements msgp.Marshaler 1959 func (z LedgerCommitInfo) MarshalMsg(b []byte) (o []byte, err error) { 1960 o = msgp.Require(b, z.Msgsize()) 1961 // map header, size 2 1962 // string "CommitStateId" 1963 o = append(o, 0x82, 0xad, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 1964 o = msgp.AppendString(o, z.CommitStateId) 1965 // string "VoteInfoHash" 1966 o = append(o, 0xac, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x61, 0x73, 0x68) 1967 o = msgp.AppendString(o, z.VoteInfoHash) 1968 return 1969 } 1970 1971 // UnmarshalMsg implements msgp.Unmarshaler 1972 func (z *LedgerCommitInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 1973 var field []byte 1974 _ = field 1975 var zb0001 uint32 1976 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 1977 if err != nil { 1978 err = msgp.WrapError(err) 1979 return 1980 } 1981 for zb0001 > 0 { 1982 zb0001-- 1983 field, bts, err = msgp.ReadMapKeyZC(bts) 1984 if err != nil { 1985 err = msgp.WrapError(err) 1986 return 1987 } 1988 switch msgp.UnsafeString(field) { 1989 case "CommitStateId": 1990 z.CommitStateId, bts, err = msgp.ReadStringBytes(bts) 1991 if err != nil { 1992 err = msgp.WrapError(err, "CommitStateId") 1993 return 1994 } 1995 case "VoteInfoHash": 1996 z.VoteInfoHash, bts, err = msgp.ReadStringBytes(bts) 1997 if err != nil { 1998 err = msgp.WrapError(err, "VoteInfoHash") 1999 return 2000 } 2001 default: 2002 bts, err = msgp.Skip(bts) 2003 if err != nil { 2004 err = msgp.WrapError(err) 2005 return 2006 } 2007 } 2008 } 2009 o = bts 2010 return 2011 } 2012 2013 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2014 func (z LedgerCommitInfo) Msgsize() (s int) { 2015 s = 1 + 14 + msgp.StringPrefixSize + len(z.CommitStateId) + 13 + msgp.StringPrefixSize + len(z.VoteInfoHash) 2016 return 2017 } 2018 2019 // DecodeMsg implements msgp.Decodable 2020 func (z *QC) DecodeMsg(dc *msgp.Reader) (err error) { 2021 var field []byte 2022 _ = field 2023 var zb0001 uint32 2024 zb0001, err = dc.ReadMapHeader() 2025 if err != nil { 2026 err = msgp.WrapError(err) 2027 return 2028 } 2029 for zb0001 > 0 { 2030 zb0001-- 2031 field, err = dc.ReadMapKeyPtr() 2032 if err != nil { 2033 err = msgp.WrapError(err) 2034 return 2035 } 2036 switch msgp.UnsafeString(field) { 2037 case "VoteData": 2038 err = z.VoteData.DecodeMsg(dc) 2039 if err != nil { 2040 err = msgp.WrapError(err, "VoteData") 2041 return 2042 } 2043 case "JointSignature": 2044 { 2045 var zb0002 []byte 2046 zb0002, err = dc.ReadBytes([]byte(z.JointSignature)) 2047 if err != nil { 2048 err = msgp.WrapError(err, "JointSignature") 2049 return 2050 } 2051 z.JointSignature = JointSignature(zb0002) 2052 } 2053 default: 2054 err = dc.Skip() 2055 if err != nil { 2056 err = msgp.WrapError(err) 2057 return 2058 } 2059 } 2060 } 2061 return 2062 } 2063 2064 // EncodeMsg implements msgp.Encodable 2065 func (z *QC) EncodeMsg(en *msgp.Writer) (err error) { 2066 // map header, size 2 2067 // write "VoteData" 2068 err = en.Append(0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 2069 if err != nil { 2070 return 2071 } 2072 err = z.VoteData.EncodeMsg(en) 2073 if err != nil { 2074 err = msgp.WrapError(err, "VoteData") 2075 return 2076 } 2077 // write "JointSignature" 2078 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 2079 if err != nil { 2080 return 2081 } 2082 err = en.WriteBytes([]byte(z.JointSignature)) 2083 if err != nil { 2084 err = msgp.WrapError(err, "JointSignature") 2085 return 2086 } 2087 return 2088 } 2089 2090 // MarshalMsg implements msgp.Marshaler 2091 func (z *QC) MarshalMsg(b []byte) (o []byte, err error) { 2092 o = msgp.Require(b, z.Msgsize()) 2093 // map header, size 2 2094 // string "VoteData" 2095 o = append(o, 0x82, 0xa8, 0x56, 0x6f, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61) 2096 o, err = z.VoteData.MarshalMsg(o) 2097 if err != nil { 2098 err = msgp.WrapError(err, "VoteData") 2099 return 2100 } 2101 // string "JointSignature" 2102 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 2103 o = msgp.AppendBytes(o, []byte(z.JointSignature)) 2104 return 2105 } 2106 2107 // UnmarshalMsg implements msgp.Unmarshaler 2108 func (z *QC) UnmarshalMsg(bts []byte) (o []byte, err error) { 2109 var field []byte 2110 _ = field 2111 var zb0001 uint32 2112 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 2113 if err != nil { 2114 err = msgp.WrapError(err) 2115 return 2116 } 2117 for zb0001 > 0 { 2118 zb0001-- 2119 field, bts, err = msgp.ReadMapKeyZC(bts) 2120 if err != nil { 2121 err = msgp.WrapError(err) 2122 return 2123 } 2124 switch msgp.UnsafeString(field) { 2125 case "VoteData": 2126 bts, err = z.VoteData.UnmarshalMsg(bts) 2127 if err != nil { 2128 err = msgp.WrapError(err, "VoteData") 2129 return 2130 } 2131 case "JointSignature": 2132 { 2133 var zb0002 []byte 2134 zb0002, bts, err = msgp.ReadBytesBytes(bts, []byte(z.JointSignature)) 2135 if err != nil { 2136 err = msgp.WrapError(err, "JointSignature") 2137 return 2138 } 2139 z.JointSignature = JointSignature(zb0002) 2140 } 2141 default: 2142 bts, err = msgp.Skip(bts) 2143 if err != nil { 2144 err = msgp.WrapError(err) 2145 return 2146 } 2147 } 2148 } 2149 o = bts 2150 return 2151 } 2152 2153 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2154 func (z *QC) Msgsize() (s int) { 2155 s = 1 + 9 + z.VoteData.Msgsize() + 15 + msgp.BytesPrefixSize + len([]byte(z.JointSignature)) 2156 return 2157 } 2158 2159 // DecodeMsg implements msgp.Decodable 2160 func (z *Signature) DecodeMsg(dc *msgp.Reader) (err error) { 2161 { 2162 var zb0001 []byte 2163 zb0001, err = dc.ReadBytes([]byte((*z))) 2164 if err != nil { 2165 err = msgp.WrapError(err) 2166 return 2167 } 2168 (*z) = Signature(zb0001) 2169 } 2170 return 2171 } 2172 2173 // EncodeMsg implements msgp.Encodable 2174 func (z Signature) EncodeMsg(en *msgp.Writer) (err error) { 2175 err = en.WriteBytes([]byte(z)) 2176 if err != nil { 2177 err = msgp.WrapError(err) 2178 return 2179 } 2180 return 2181 } 2182 2183 // MarshalMsg implements msgp.Marshaler 2184 func (z Signature) MarshalMsg(b []byte) (o []byte, err error) { 2185 o = msgp.Require(b, z.Msgsize()) 2186 o = msgp.AppendBytes(o, []byte(z)) 2187 return 2188 } 2189 2190 // UnmarshalMsg implements msgp.Unmarshaler 2191 func (z *Signature) UnmarshalMsg(bts []byte) (o []byte, err error) { 2192 { 2193 var zb0001 []byte 2194 zb0001, bts, err = msgp.ReadBytesBytes(bts, []byte((*z))) 2195 if err != nil { 2196 err = msgp.WrapError(err) 2197 return 2198 } 2199 (*z) = Signature(zb0001) 2200 } 2201 o = bts 2202 return 2203 } 2204 2205 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2206 func (z Signature) Msgsize() (s int) { 2207 s = msgp.BytesPrefixSize + len([]byte(z)) 2208 return 2209 } 2210 2211 // DecodeMsg implements msgp.Decodable 2212 func (z *TC) DecodeMsg(dc *msgp.Reader) (err error) { 2213 var field []byte 2214 _ = field 2215 var zb0001 uint32 2216 zb0001, err = dc.ReadMapHeader() 2217 if err != nil { 2218 err = msgp.WrapError(err) 2219 return 2220 } 2221 for zb0001 > 0 { 2222 zb0001-- 2223 field, err = dc.ReadMapKeyPtr() 2224 if err != nil { 2225 err = msgp.WrapError(err) 2226 return 2227 } 2228 switch msgp.UnsafeString(field) { 2229 case "Round": 2230 z.Round, err = dc.ReadInt64() 2231 if err != nil { 2232 err = msgp.WrapError(err, "Round") 2233 return 2234 } 2235 case "JointSignature": 2236 { 2237 var zb0002 []byte 2238 zb0002, err = dc.ReadBytes([]byte(z.JointSignature)) 2239 if err != nil { 2240 err = msgp.WrapError(err, "JointSignature") 2241 return 2242 } 2243 z.JointSignature = JointSignature(zb0002) 2244 } 2245 default: 2246 err = dc.Skip() 2247 if err != nil { 2248 err = msgp.WrapError(err) 2249 return 2250 } 2251 } 2252 } 2253 return 2254 } 2255 2256 // EncodeMsg implements msgp.Encodable 2257 func (z *TC) EncodeMsg(en *msgp.Writer) (err error) { 2258 // map header, size 2 2259 // write "Round" 2260 err = en.Append(0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2261 if err != nil { 2262 return 2263 } 2264 err = en.WriteInt64(z.Round) 2265 if err != nil { 2266 err = msgp.WrapError(err, "Round") 2267 return 2268 } 2269 // write "JointSignature" 2270 err = en.Append(0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 2271 if err != nil { 2272 return 2273 } 2274 err = en.WriteBytes([]byte(z.JointSignature)) 2275 if err != nil { 2276 err = msgp.WrapError(err, "JointSignature") 2277 return 2278 } 2279 return 2280 } 2281 2282 // MarshalMsg implements msgp.Marshaler 2283 func (z *TC) MarshalMsg(b []byte) (o []byte, err error) { 2284 o = msgp.Require(b, z.Msgsize()) 2285 // map header, size 2 2286 // string "Round" 2287 o = append(o, 0x82, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2288 o = msgp.AppendInt64(o, z.Round) 2289 // string "JointSignature" 2290 o = append(o, 0xae, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65) 2291 o = msgp.AppendBytes(o, []byte(z.JointSignature)) 2292 return 2293 } 2294 2295 // UnmarshalMsg implements msgp.Unmarshaler 2296 func (z *TC) UnmarshalMsg(bts []byte) (o []byte, err error) { 2297 var field []byte 2298 _ = field 2299 var zb0001 uint32 2300 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 2301 if err != nil { 2302 err = msgp.WrapError(err) 2303 return 2304 } 2305 for zb0001 > 0 { 2306 zb0001-- 2307 field, bts, err = msgp.ReadMapKeyZC(bts) 2308 if err != nil { 2309 err = msgp.WrapError(err) 2310 return 2311 } 2312 switch msgp.UnsafeString(field) { 2313 case "Round": 2314 z.Round, bts, err = msgp.ReadInt64Bytes(bts) 2315 if err != nil { 2316 err = msgp.WrapError(err, "Round") 2317 return 2318 } 2319 case "JointSignature": 2320 { 2321 var zb0002 []byte 2322 zb0002, bts, err = msgp.ReadBytesBytes(bts, []byte(z.JointSignature)) 2323 if err != nil { 2324 err = msgp.WrapError(err, "JointSignature") 2325 return 2326 } 2327 z.JointSignature = JointSignature(zb0002) 2328 } 2329 default: 2330 bts, err = msgp.Skip(bts) 2331 if err != nil { 2332 err = msgp.WrapError(err) 2333 return 2334 } 2335 } 2336 } 2337 o = bts 2338 return 2339 } 2340 2341 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2342 func (z *TC) Msgsize() (s int) { 2343 s = 1 + 6 + msgp.Int64Size + 15 + msgp.BytesPrefixSize + len([]byte(z.JointSignature)) 2344 return 2345 } 2346 2347 // DecodeMsg implements msgp.Decodable 2348 func (z *VoteInfo) DecodeMsg(dc *msgp.Reader) (err error) { 2349 var field []byte 2350 _ = field 2351 var zb0001 uint32 2352 zb0001, err = dc.ReadMapHeader() 2353 if err != nil { 2354 err = msgp.WrapError(err) 2355 return 2356 } 2357 for zb0001 > 0 { 2358 zb0001-- 2359 field, err = dc.ReadMapKeyPtr() 2360 if err != nil { 2361 err = msgp.WrapError(err) 2362 return 2363 } 2364 switch msgp.UnsafeString(field) { 2365 case "Id": 2366 z.Id, err = dc.ReadString() 2367 if err != nil { 2368 err = msgp.WrapError(err, "Id") 2369 return 2370 } 2371 case "Round": 2372 z.Round, err = dc.ReadInt64() 2373 if err != nil { 2374 err = msgp.WrapError(err, "Round") 2375 return 2376 } 2377 case "ParentId": 2378 z.ParentId, err = dc.ReadString() 2379 if err != nil { 2380 err = msgp.WrapError(err, "ParentId") 2381 return 2382 } 2383 case "ParentRound": 2384 z.ParentRound, err = dc.ReadInt64() 2385 if err != nil { 2386 err = msgp.WrapError(err, "ParentRound") 2387 return 2388 } 2389 case "GrandParentId": 2390 z.GrandParentId, err = dc.ReadString() 2391 if err != nil { 2392 err = msgp.WrapError(err, "GrandParentId") 2393 return 2394 } 2395 case "GrandParentRound": 2396 z.GrandParentRound, err = dc.ReadInt64() 2397 if err != nil { 2398 err = msgp.WrapError(err, "GrandParentRound") 2399 return 2400 } 2401 case "ExecStateId": 2402 z.ExecStateId, err = dc.ReadString() 2403 if err != nil { 2404 err = msgp.WrapError(err, "ExecStateId") 2405 return 2406 } 2407 default: 2408 err = dc.Skip() 2409 if err != nil { 2410 err = msgp.WrapError(err) 2411 return 2412 } 2413 } 2414 } 2415 return 2416 } 2417 2418 // EncodeMsg implements msgp.Encodable 2419 func (z *VoteInfo) EncodeMsg(en *msgp.Writer) (err error) { 2420 // map header, size 7 2421 // write "Id" 2422 err = en.Append(0x87, 0xa2, 0x49, 0x64) 2423 if err != nil { 2424 return 2425 } 2426 err = en.WriteString(z.Id) 2427 if err != nil { 2428 err = msgp.WrapError(err, "Id") 2429 return 2430 } 2431 // write "Round" 2432 err = en.Append(0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2433 if err != nil { 2434 return 2435 } 2436 err = en.WriteInt64(z.Round) 2437 if err != nil { 2438 err = msgp.WrapError(err, "Round") 2439 return 2440 } 2441 // write "ParentId" 2442 err = en.Append(0xa8, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64) 2443 if err != nil { 2444 return 2445 } 2446 err = en.WriteString(z.ParentId) 2447 if err != nil { 2448 err = msgp.WrapError(err, "ParentId") 2449 return 2450 } 2451 // write "ParentRound" 2452 err = en.Append(0xab, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2453 if err != nil { 2454 return 2455 } 2456 err = en.WriteInt64(z.ParentRound) 2457 if err != nil { 2458 err = msgp.WrapError(err, "ParentRound") 2459 return 2460 } 2461 // write "GrandParentId" 2462 err = en.Append(0xad, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64) 2463 if err != nil { 2464 return 2465 } 2466 err = en.WriteString(z.GrandParentId) 2467 if err != nil { 2468 err = msgp.WrapError(err, "GrandParentId") 2469 return 2470 } 2471 // write "GrandParentRound" 2472 err = en.Append(0xb0, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2473 if err != nil { 2474 return 2475 } 2476 err = en.WriteInt64(z.GrandParentRound) 2477 if err != nil { 2478 err = msgp.WrapError(err, "GrandParentRound") 2479 return 2480 } 2481 // write "ExecStateId" 2482 err = en.Append(0xab, 0x45, 0x78, 0x65, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 2483 if err != nil { 2484 return 2485 } 2486 err = en.WriteString(z.ExecStateId) 2487 if err != nil { 2488 err = msgp.WrapError(err, "ExecStateId") 2489 return 2490 } 2491 return 2492 } 2493 2494 // MarshalMsg implements msgp.Marshaler 2495 func (z *VoteInfo) MarshalMsg(b []byte) (o []byte, err error) { 2496 o = msgp.Require(b, z.Msgsize()) 2497 // map header, size 7 2498 // string "Id" 2499 o = append(o, 0x87, 0xa2, 0x49, 0x64) 2500 o = msgp.AppendString(o, z.Id) 2501 // string "Round" 2502 o = append(o, 0xa5, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2503 o = msgp.AppendInt64(o, z.Round) 2504 // string "ParentId" 2505 o = append(o, 0xa8, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64) 2506 o = msgp.AppendString(o, z.ParentId) 2507 // string "ParentRound" 2508 o = append(o, 0xab, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2509 o = msgp.AppendInt64(o, z.ParentRound) 2510 // string "GrandParentId" 2511 o = append(o, 0xad, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64) 2512 o = msgp.AppendString(o, z.GrandParentId) 2513 // string "GrandParentRound" 2514 o = append(o, 0xb0, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64) 2515 o = msgp.AppendInt64(o, z.GrandParentRound) 2516 // string "ExecStateId" 2517 o = append(o, 0xab, 0x45, 0x78, 0x65, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x64) 2518 o = msgp.AppendString(o, z.ExecStateId) 2519 return 2520 } 2521 2522 // UnmarshalMsg implements msgp.Unmarshaler 2523 func (z *VoteInfo) UnmarshalMsg(bts []byte) (o []byte, err error) { 2524 var field []byte 2525 _ = field 2526 var zb0001 uint32 2527 zb0001, bts, err = msgp.ReadMapHeaderBytes(bts) 2528 if err != nil { 2529 err = msgp.WrapError(err) 2530 return 2531 } 2532 for zb0001 > 0 { 2533 zb0001-- 2534 field, bts, err = msgp.ReadMapKeyZC(bts) 2535 if err != nil { 2536 err = msgp.WrapError(err) 2537 return 2538 } 2539 switch msgp.UnsafeString(field) { 2540 case "Id": 2541 z.Id, bts, err = msgp.ReadStringBytes(bts) 2542 if err != nil { 2543 err = msgp.WrapError(err, "Id") 2544 return 2545 } 2546 case "Round": 2547 z.Round, bts, err = msgp.ReadInt64Bytes(bts) 2548 if err != nil { 2549 err = msgp.WrapError(err, "Round") 2550 return 2551 } 2552 case "ParentId": 2553 z.ParentId, bts, err = msgp.ReadStringBytes(bts) 2554 if err != nil { 2555 err = msgp.WrapError(err, "ParentId") 2556 return 2557 } 2558 case "ParentRound": 2559 z.ParentRound, bts, err = msgp.ReadInt64Bytes(bts) 2560 if err != nil { 2561 err = msgp.WrapError(err, "ParentRound") 2562 return 2563 } 2564 case "GrandParentId": 2565 z.GrandParentId, bts, err = msgp.ReadStringBytes(bts) 2566 if err != nil { 2567 err = msgp.WrapError(err, "GrandParentId") 2568 return 2569 } 2570 case "GrandParentRound": 2571 z.GrandParentRound, bts, err = msgp.ReadInt64Bytes(bts) 2572 if err != nil { 2573 err = msgp.WrapError(err, "GrandParentRound") 2574 return 2575 } 2576 case "ExecStateId": 2577 z.ExecStateId, bts, err = msgp.ReadStringBytes(bts) 2578 if err != nil { 2579 err = msgp.WrapError(err, "ExecStateId") 2580 return 2581 } 2582 default: 2583 bts, err = msgp.Skip(bts) 2584 if err != nil { 2585 err = msgp.WrapError(err) 2586 return 2587 } 2588 } 2589 } 2590 o = bts 2591 return 2592 } 2593 2594 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 2595 func (z *VoteInfo) Msgsize() (s int) { 2596 s = 1 + 3 + msgp.StringPrefixSize + len(z.Id) + 6 + msgp.Int64Size + 9 + msgp.StringPrefixSize + len(z.ParentId) + 12 + msgp.Int64Size + 14 + msgp.StringPrefixSize + len(z.GrandParentId) + 17 + msgp.Int64Size + 12 + msgp.StringPrefixSize + len(z.ExecStateId) 2597 return 2598 }