github.com/annchain/OG@v0.0.9/consensus/campaign/message_gen.go (about) 1 package campaign 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 *MessageCampaign) DecodeMsg(dc *msgp.Reader) (err error) { 11 var zb0001 uint32 12 zb0001, err = dc.ReadArrayHeader() 13 if err != nil { 14 err = msgp.WrapError(err) 15 return 16 } 17 if zb0001 != 1 { 18 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 19 return 20 } 21 if dc.IsNil() { 22 err = dc.ReadNil() 23 if err != nil { 24 err = msgp.WrapError(err, "RawCampaign") 25 return 26 } 27 z.RawCampaign = nil 28 } else { 29 if z.RawCampaign == nil { 30 z.RawCampaign = new(RawCampaign) 31 } 32 var zb0002 uint32 33 zb0002, err = dc.ReadArrayHeader() 34 if err != nil { 35 err = msgp.WrapError(err, "RawCampaign") 36 return 37 } 38 if zb0002 != 3 { 39 err = msgp.ArrayError{Wanted: 3, Got: zb0002} 40 return 41 } 42 err = z.RawCampaign.TxBase.DecodeMsg(dc) 43 if err != nil { 44 err = msgp.WrapError(err, "RawCampaign", "TxBase") 45 return 46 } 47 z.RawCampaign.DkgPublicKey, err = dc.ReadBytes(z.RawCampaign.DkgPublicKey) 48 if err != nil { 49 err = msgp.WrapError(err, "RawCampaign", "DkgPublicKey") 50 return 51 } 52 err = z.RawCampaign.Vrf.DecodeMsg(dc) 53 if err != nil { 54 err = msgp.WrapError(err, "RawCampaign", "Vrf") 55 return 56 } 57 } 58 return 59 } 60 61 // EncodeMsg implements msgp.Encodable 62 func (z *MessageCampaign) EncodeMsg(en *msgp.Writer) (err error) { 63 // array header, size 1 64 err = en.Append(0x91) 65 if err != nil { 66 return 67 } 68 if z.RawCampaign == nil { 69 err = en.WriteNil() 70 if err != nil { 71 return 72 } 73 } else { 74 // array header, size 3 75 err = en.Append(0x93) 76 if err != nil { 77 return 78 } 79 err = z.RawCampaign.TxBase.EncodeMsg(en) 80 if err != nil { 81 err = msgp.WrapError(err, "RawCampaign", "TxBase") 82 return 83 } 84 err = en.WriteBytes(z.RawCampaign.DkgPublicKey) 85 if err != nil { 86 err = msgp.WrapError(err, "RawCampaign", "DkgPublicKey") 87 return 88 } 89 err = z.RawCampaign.Vrf.EncodeMsg(en) 90 if err != nil { 91 err = msgp.WrapError(err, "RawCampaign", "Vrf") 92 return 93 } 94 } 95 return 96 } 97 98 // MarshalMsg implements msgp.Marshaler 99 func (z *MessageCampaign) MarshalMsg(b []byte) (o []byte, err error) { 100 o = msgp.Require(b, z.Msgsize()) 101 // array header, size 1 102 o = append(o, 0x91) 103 if z.RawCampaign == nil { 104 o = msgp.AppendNil(o) 105 } else { 106 // array header, size 3 107 o = append(o, 0x93) 108 o, err = z.RawCampaign.TxBase.MarshalMsg(o) 109 if err != nil { 110 err = msgp.WrapError(err, "RawCampaign", "TxBase") 111 return 112 } 113 o = msgp.AppendBytes(o, z.RawCampaign.DkgPublicKey) 114 o, err = z.RawCampaign.Vrf.MarshalMsg(o) 115 if err != nil { 116 err = msgp.WrapError(err, "RawCampaign", "Vrf") 117 return 118 } 119 } 120 return 121 } 122 123 // UnmarshalMsg implements msgp.Unmarshaler 124 func (z *MessageCampaign) UnmarshalMsg(bts []byte) (o []byte, err error) { 125 var zb0001 uint32 126 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 127 if err != nil { 128 err = msgp.WrapError(err) 129 return 130 } 131 if zb0001 != 1 { 132 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 133 return 134 } 135 if msgp.IsNil(bts) { 136 bts, err = msgp.ReadNilBytes(bts) 137 if err != nil { 138 return 139 } 140 z.RawCampaign = nil 141 } else { 142 if z.RawCampaign == nil { 143 z.RawCampaign = new(RawCampaign) 144 } 145 var zb0002 uint32 146 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 147 if err != nil { 148 err = msgp.WrapError(err, "RawCampaign") 149 return 150 } 151 if zb0002 != 3 { 152 err = msgp.ArrayError{Wanted: 3, Got: zb0002} 153 return 154 } 155 bts, err = z.RawCampaign.TxBase.UnmarshalMsg(bts) 156 if err != nil { 157 err = msgp.WrapError(err, "RawCampaign", "TxBase") 158 return 159 } 160 z.RawCampaign.DkgPublicKey, bts, err = msgp.ReadBytesBytes(bts, z.RawCampaign.DkgPublicKey) 161 if err != nil { 162 err = msgp.WrapError(err, "RawCampaign", "DkgPublicKey") 163 return 164 } 165 bts, err = z.RawCampaign.Vrf.UnmarshalMsg(bts) 166 if err != nil { 167 err = msgp.WrapError(err, "RawCampaign", "Vrf") 168 return 169 } 170 } 171 o = bts 172 return 173 } 174 175 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 176 func (z *MessageCampaign) Msgsize() (s int) { 177 s = 1 178 if z.RawCampaign == nil { 179 s += msgp.NilSize 180 } else { 181 s += 1 + z.RawCampaign.TxBase.Msgsize() + msgp.BytesPrefixSize + len(z.RawCampaign.DkgPublicKey) + z.RawCampaign.Vrf.Msgsize() 182 } 183 return 184 } 185 186 // DecodeMsg implements msgp.Decodable 187 func (z *MessageTermChange) DecodeMsg(dc *msgp.Reader) (err error) { 188 var zb0001 uint32 189 zb0001, err = dc.ReadArrayHeader() 190 if err != nil { 191 err = msgp.WrapError(err) 192 return 193 } 194 if zb0001 != 1 { 195 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 196 return 197 } 198 if dc.IsNil() { 199 err = dc.ReadNil() 200 if err != nil { 201 err = msgp.WrapError(err, "RawTermChange") 202 return 203 } 204 z.RawTermChange = nil 205 } else { 206 if z.RawTermChange == nil { 207 z.RawTermChange = new(RawTermChange) 208 } 209 err = z.RawTermChange.DecodeMsg(dc) 210 if err != nil { 211 err = msgp.WrapError(err, "RawTermChange") 212 return 213 } 214 } 215 return 216 } 217 218 // EncodeMsg implements msgp.Encodable 219 func (z *MessageTermChange) EncodeMsg(en *msgp.Writer) (err error) { 220 // array header, size 1 221 err = en.Append(0x91) 222 if err != nil { 223 return 224 } 225 if z.RawTermChange == nil { 226 err = en.WriteNil() 227 if err != nil { 228 return 229 } 230 } else { 231 err = z.RawTermChange.EncodeMsg(en) 232 if err != nil { 233 err = msgp.WrapError(err, "RawTermChange") 234 return 235 } 236 } 237 return 238 } 239 240 // MarshalMsg implements msgp.Marshaler 241 func (z *MessageTermChange) MarshalMsg(b []byte) (o []byte, err error) { 242 o = msgp.Require(b, z.Msgsize()) 243 // array header, size 1 244 o = append(o, 0x91) 245 if z.RawTermChange == nil { 246 o = msgp.AppendNil(o) 247 } else { 248 o, err = z.RawTermChange.MarshalMsg(o) 249 if err != nil { 250 err = msgp.WrapError(err, "RawTermChange") 251 return 252 } 253 } 254 return 255 } 256 257 // UnmarshalMsg implements msgp.Unmarshaler 258 func (z *MessageTermChange) UnmarshalMsg(bts []byte) (o []byte, err error) { 259 var zb0001 uint32 260 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 261 if err != nil { 262 err = msgp.WrapError(err) 263 return 264 } 265 if zb0001 != 1 { 266 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 267 return 268 } 269 if msgp.IsNil(bts) { 270 bts, err = msgp.ReadNilBytes(bts) 271 if err != nil { 272 return 273 } 274 z.RawTermChange = nil 275 } else { 276 if z.RawTermChange == nil { 277 z.RawTermChange = new(RawTermChange) 278 } 279 bts, err = z.RawTermChange.UnmarshalMsg(bts) 280 if err != nil { 281 err = msgp.WrapError(err, "RawTermChange") 282 return 283 } 284 } 285 o = bts 286 return 287 } 288 289 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 290 func (z *MessageTermChange) Msgsize() (s int) { 291 s = 1 292 if z.RawTermChange == nil { 293 s += msgp.NilSize 294 } else { 295 s += z.RawTermChange.Msgsize() 296 } 297 return 298 } 299 300 // DecodeMsg implements msgp.Decodable 301 func (z *MessageTermChangeRequest) DecodeMsg(dc *msgp.Reader) (err error) { 302 var zb0001 uint32 303 zb0001, err = dc.ReadArrayHeader() 304 if err != nil { 305 err = msgp.WrapError(err) 306 return 307 } 308 if zb0001 != 1 { 309 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 310 return 311 } 312 z.Id, err = dc.ReadUint32() 313 if err != nil { 314 err = msgp.WrapError(err, "Id") 315 return 316 } 317 return 318 } 319 320 // EncodeMsg implements msgp.Encodable 321 func (z MessageTermChangeRequest) EncodeMsg(en *msgp.Writer) (err error) { 322 // array header, size 1 323 err = en.Append(0x91) 324 if err != nil { 325 return 326 } 327 err = en.WriteUint32(z.Id) 328 if err != nil { 329 err = msgp.WrapError(err, "Id") 330 return 331 } 332 return 333 } 334 335 // MarshalMsg implements msgp.Marshaler 336 func (z MessageTermChangeRequest) MarshalMsg(b []byte) (o []byte, err error) { 337 o = msgp.Require(b, z.Msgsize()) 338 // array header, size 1 339 o = append(o, 0x91) 340 o = msgp.AppendUint32(o, z.Id) 341 return 342 } 343 344 // UnmarshalMsg implements msgp.Unmarshaler 345 func (z *MessageTermChangeRequest) UnmarshalMsg(bts []byte) (o []byte, err error) { 346 var zb0001 uint32 347 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 348 if err != nil { 349 err = msgp.WrapError(err) 350 return 351 } 352 if zb0001 != 1 { 353 err = msgp.ArrayError{Wanted: 1, Got: zb0001} 354 return 355 } 356 z.Id, bts, err = msgp.ReadUint32Bytes(bts) 357 if err != nil { 358 err = msgp.WrapError(err, "Id") 359 return 360 } 361 o = bts 362 return 363 } 364 365 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 366 func (z MessageTermChangeRequest) Msgsize() (s int) { 367 s = 1 + msgp.Uint32Size 368 return 369 } 370 371 // DecodeMsg implements msgp.Decodable 372 func (z *MessageTermChangeResponse) DecodeMsg(dc *msgp.Reader) (err error) { 373 var zb0001 uint32 374 zb0001, err = dc.ReadArrayHeader() 375 if err != nil { 376 err = msgp.WrapError(err) 377 return 378 } 379 if zb0001 != 2 { 380 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 381 return 382 } 383 if dc.IsNil() { 384 err = dc.ReadNil() 385 if err != nil { 386 err = msgp.WrapError(err, "TermChange") 387 return 388 } 389 z.TermChange = nil 390 } else { 391 if z.TermChange == nil { 392 z.TermChange = new(TermChange) 393 } 394 err = z.TermChange.DecodeMsg(dc) 395 if err != nil { 396 err = msgp.WrapError(err, "TermChange") 397 return 398 } 399 } 400 z.Id, err = dc.ReadUint32() 401 if err != nil { 402 err = msgp.WrapError(err, "Id") 403 return 404 } 405 return 406 } 407 408 // EncodeMsg implements msgp.Encodable 409 func (z *MessageTermChangeResponse) EncodeMsg(en *msgp.Writer) (err error) { 410 // array header, size 2 411 err = en.Append(0x92) 412 if err != nil { 413 return 414 } 415 if z.TermChange == nil { 416 err = en.WriteNil() 417 if err != nil { 418 return 419 } 420 } else { 421 err = z.TermChange.EncodeMsg(en) 422 if err != nil { 423 err = msgp.WrapError(err, "TermChange") 424 return 425 } 426 } 427 err = en.WriteUint32(z.Id) 428 if err != nil { 429 err = msgp.WrapError(err, "Id") 430 return 431 } 432 return 433 } 434 435 // MarshalMsg implements msgp.Marshaler 436 func (z *MessageTermChangeResponse) MarshalMsg(b []byte) (o []byte, err error) { 437 o = msgp.Require(b, z.Msgsize()) 438 // array header, size 2 439 o = append(o, 0x92) 440 if z.TermChange == nil { 441 o = msgp.AppendNil(o) 442 } else { 443 o, err = z.TermChange.MarshalMsg(o) 444 if err != nil { 445 err = msgp.WrapError(err, "TermChange") 446 return 447 } 448 } 449 o = msgp.AppendUint32(o, z.Id) 450 return 451 } 452 453 // UnmarshalMsg implements msgp.Unmarshaler 454 func (z *MessageTermChangeResponse) UnmarshalMsg(bts []byte) (o []byte, err error) { 455 var zb0001 uint32 456 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 457 if err != nil { 458 err = msgp.WrapError(err) 459 return 460 } 461 if zb0001 != 2 { 462 err = msgp.ArrayError{Wanted: 2, Got: zb0001} 463 return 464 } 465 if msgp.IsNil(bts) { 466 bts, err = msgp.ReadNilBytes(bts) 467 if err != nil { 468 return 469 } 470 z.TermChange = nil 471 } else { 472 if z.TermChange == nil { 473 z.TermChange = new(TermChange) 474 } 475 bts, err = z.TermChange.UnmarshalMsg(bts) 476 if err != nil { 477 err = msgp.WrapError(err, "TermChange") 478 return 479 } 480 } 481 z.Id, bts, err = msgp.ReadUint32Bytes(bts) 482 if err != nil { 483 err = msgp.WrapError(err, "Id") 484 return 485 } 486 o = bts 487 return 488 } 489 490 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 491 func (z *MessageTermChangeResponse) Msgsize() (s int) { 492 s = 1 493 if z.TermChange == nil { 494 s += msgp.NilSize 495 } else { 496 s += z.TermChange.Msgsize() 497 } 498 s += msgp.Uint32Size 499 return 500 } 501 502 // DecodeMsg implements msgp.Decodable 503 func (z *RawCampaign) DecodeMsg(dc *msgp.Reader) (err error) { 504 var zb0001 uint32 505 zb0001, err = dc.ReadArrayHeader() 506 if err != nil { 507 err = msgp.WrapError(err) 508 return 509 } 510 if zb0001 != 3 { 511 err = msgp.ArrayError{Wanted: 3, Got: zb0001} 512 return 513 } 514 err = z.TxBase.DecodeMsg(dc) 515 if err != nil { 516 err = msgp.WrapError(err, "TxBase") 517 return 518 } 519 z.DkgPublicKey, err = dc.ReadBytes(z.DkgPublicKey) 520 if err != nil { 521 err = msgp.WrapError(err, "DkgPublicKey") 522 return 523 } 524 err = z.Vrf.DecodeMsg(dc) 525 if err != nil { 526 err = msgp.WrapError(err, "Vrf") 527 return 528 } 529 return 530 } 531 532 // EncodeMsg implements msgp.Encodable 533 func (z *RawCampaign) EncodeMsg(en *msgp.Writer) (err error) { 534 // array header, size 3 535 err = en.Append(0x93) 536 if err != nil { 537 return 538 } 539 err = z.TxBase.EncodeMsg(en) 540 if err != nil { 541 err = msgp.WrapError(err, "TxBase") 542 return 543 } 544 err = en.WriteBytes(z.DkgPublicKey) 545 if err != nil { 546 err = msgp.WrapError(err, "DkgPublicKey") 547 return 548 } 549 err = z.Vrf.EncodeMsg(en) 550 if err != nil { 551 err = msgp.WrapError(err, "Vrf") 552 return 553 } 554 return 555 } 556 557 // MarshalMsg implements msgp.Marshaler 558 func (z *RawCampaign) MarshalMsg(b []byte) (o []byte, err error) { 559 o = msgp.Require(b, z.Msgsize()) 560 // array header, size 3 561 o = append(o, 0x93) 562 o, err = z.TxBase.MarshalMsg(o) 563 if err != nil { 564 err = msgp.WrapError(err, "TxBase") 565 return 566 } 567 o = msgp.AppendBytes(o, z.DkgPublicKey) 568 o, err = z.Vrf.MarshalMsg(o) 569 if err != nil { 570 err = msgp.WrapError(err, "Vrf") 571 return 572 } 573 return 574 } 575 576 // UnmarshalMsg implements msgp.Unmarshaler 577 func (z *RawCampaign) UnmarshalMsg(bts []byte) (o []byte, err error) { 578 var zb0001 uint32 579 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 580 if err != nil { 581 err = msgp.WrapError(err) 582 return 583 } 584 if zb0001 != 3 { 585 err = msgp.ArrayError{Wanted: 3, Got: zb0001} 586 return 587 } 588 bts, err = z.TxBase.UnmarshalMsg(bts) 589 if err != nil { 590 err = msgp.WrapError(err, "TxBase") 591 return 592 } 593 z.DkgPublicKey, bts, err = msgp.ReadBytesBytes(bts, z.DkgPublicKey) 594 if err != nil { 595 err = msgp.WrapError(err, "DkgPublicKey") 596 return 597 } 598 bts, err = z.Vrf.UnmarshalMsg(bts) 599 if err != nil { 600 err = msgp.WrapError(err, "Vrf") 601 return 602 } 603 o = bts 604 return 605 } 606 607 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 608 func (z *RawCampaign) Msgsize() (s int) { 609 s = 1 + z.TxBase.Msgsize() + msgp.BytesPrefixSize + len(z.DkgPublicKey) + z.Vrf.Msgsize() 610 return 611 } 612 613 // DecodeMsg implements msgp.Decodable 614 func (z *RawCampaigns) DecodeMsg(dc *msgp.Reader) (err error) { 615 var zb0002 uint32 616 zb0002, err = dc.ReadArrayHeader() 617 if err != nil { 618 err = msgp.WrapError(err) 619 return 620 } 621 if cap((*z)) >= int(zb0002) { 622 (*z) = (*z)[:zb0002] 623 } else { 624 (*z) = make(RawCampaigns, zb0002) 625 } 626 for zb0001 := range *z { 627 if dc.IsNil() { 628 err = dc.ReadNil() 629 if err != nil { 630 err = msgp.WrapError(err, zb0001) 631 return 632 } 633 (*z)[zb0001] = nil 634 } else { 635 if (*z)[zb0001] == nil { 636 (*z)[zb0001] = new(RawCampaign) 637 } 638 var zb0003 uint32 639 zb0003, err = dc.ReadArrayHeader() 640 if err != nil { 641 err = msgp.WrapError(err, zb0001) 642 return 643 } 644 if zb0003 != 3 { 645 err = msgp.ArrayError{Wanted: 3, Got: zb0003} 646 return 647 } 648 err = (*z)[zb0001].TxBase.DecodeMsg(dc) 649 if err != nil { 650 err = msgp.WrapError(err, zb0001, "TxBase") 651 return 652 } 653 (*z)[zb0001].DkgPublicKey, err = dc.ReadBytes((*z)[zb0001].DkgPublicKey) 654 if err != nil { 655 err = msgp.WrapError(err, zb0001, "DkgPublicKey") 656 return 657 } 658 err = (*z)[zb0001].Vrf.DecodeMsg(dc) 659 if err != nil { 660 err = msgp.WrapError(err, zb0001, "Vrf") 661 return 662 } 663 } 664 } 665 return 666 } 667 668 // EncodeMsg implements msgp.Encodable 669 func (z RawCampaigns) EncodeMsg(en *msgp.Writer) (err error) { 670 err = en.WriteArrayHeader(uint32(len(z))) 671 if err != nil { 672 err = msgp.WrapError(err) 673 return 674 } 675 for zb0004 := range z { 676 if z[zb0004] == nil { 677 err = en.WriteNil() 678 if err != nil { 679 return 680 } 681 } else { 682 // array header, size 3 683 err = en.Append(0x93) 684 if err != nil { 685 return 686 } 687 err = z[zb0004].TxBase.EncodeMsg(en) 688 if err != nil { 689 err = msgp.WrapError(err, zb0004, "TxBase") 690 return 691 } 692 err = en.WriteBytes(z[zb0004].DkgPublicKey) 693 if err != nil { 694 err = msgp.WrapError(err, zb0004, "DkgPublicKey") 695 return 696 } 697 err = z[zb0004].Vrf.EncodeMsg(en) 698 if err != nil { 699 err = msgp.WrapError(err, zb0004, "Vrf") 700 return 701 } 702 } 703 } 704 return 705 } 706 707 // MarshalMsg implements msgp.Marshaler 708 func (z RawCampaigns) MarshalMsg(b []byte) (o []byte, err error) { 709 o = msgp.Require(b, z.Msgsize()) 710 o = msgp.AppendArrayHeader(o, uint32(len(z))) 711 for zb0004 := range z { 712 if z[zb0004] == nil { 713 o = msgp.AppendNil(o) 714 } else { 715 // array header, size 3 716 o = append(o, 0x93) 717 o, err = z[zb0004].TxBase.MarshalMsg(o) 718 if err != nil { 719 err = msgp.WrapError(err, zb0004, "TxBase") 720 return 721 } 722 o = msgp.AppendBytes(o, z[zb0004].DkgPublicKey) 723 o, err = z[zb0004].Vrf.MarshalMsg(o) 724 if err != nil { 725 err = msgp.WrapError(err, zb0004, "Vrf") 726 return 727 } 728 } 729 } 730 return 731 } 732 733 // UnmarshalMsg implements msgp.Unmarshaler 734 func (z *RawCampaigns) UnmarshalMsg(bts []byte) (o []byte, err error) { 735 var zb0002 uint32 736 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 737 if err != nil { 738 err = msgp.WrapError(err) 739 return 740 } 741 if cap((*z)) >= int(zb0002) { 742 (*z) = (*z)[:zb0002] 743 } else { 744 (*z) = make(RawCampaigns, zb0002) 745 } 746 for zb0001 := range *z { 747 if msgp.IsNil(bts) { 748 bts, err = msgp.ReadNilBytes(bts) 749 if err != nil { 750 return 751 } 752 (*z)[zb0001] = nil 753 } else { 754 if (*z)[zb0001] == nil { 755 (*z)[zb0001] = new(RawCampaign) 756 } 757 var zb0003 uint32 758 zb0003, bts, err = msgp.ReadArrayHeaderBytes(bts) 759 if err != nil { 760 err = msgp.WrapError(err, zb0001) 761 return 762 } 763 if zb0003 != 3 { 764 err = msgp.ArrayError{Wanted: 3, Got: zb0003} 765 return 766 } 767 bts, err = (*z)[zb0001].TxBase.UnmarshalMsg(bts) 768 if err != nil { 769 err = msgp.WrapError(err, zb0001, "TxBase") 770 return 771 } 772 (*z)[zb0001].DkgPublicKey, bts, err = msgp.ReadBytesBytes(bts, (*z)[zb0001].DkgPublicKey) 773 if err != nil { 774 err = msgp.WrapError(err, zb0001, "DkgPublicKey") 775 return 776 } 777 bts, err = (*z)[zb0001].Vrf.UnmarshalMsg(bts) 778 if err != nil { 779 err = msgp.WrapError(err, zb0001, "Vrf") 780 return 781 } 782 } 783 } 784 o = bts 785 return 786 } 787 788 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 789 func (z RawCampaigns) Msgsize() (s int) { 790 s = msgp.ArrayHeaderSize 791 for zb0004 := range z { 792 if z[zb0004] == nil { 793 s += msgp.NilSize 794 } else { 795 s += 1 + z[zb0004].TxBase.Msgsize() + msgp.BytesPrefixSize + len(z[zb0004].DkgPublicKey) + z[zb0004].Vrf.Msgsize() 796 } 797 } 798 return 799 } 800 801 // DecodeMsg implements msgp.Decodable 802 func (z *RawTermChange) DecodeMsg(dc *msgp.Reader) (err error) { 803 var zb0001 uint32 804 zb0001, err = dc.ReadArrayHeader() 805 if err != nil { 806 err = msgp.WrapError(err) 807 return 808 } 809 if zb0001 != 4 { 810 err = msgp.ArrayError{Wanted: 4, Got: zb0001} 811 return 812 } 813 err = z.TxBase.DecodeMsg(dc) 814 if err != nil { 815 err = msgp.WrapError(err, "TxBase") 816 return 817 } 818 z.TermId, err = dc.ReadUint64() 819 if err != nil { 820 err = msgp.WrapError(err, "TermId") 821 return 822 } 823 z.PkBls, err = dc.ReadBytes(z.PkBls) 824 if err != nil { 825 err = msgp.WrapError(err, "PkBls") 826 return 827 } 828 var zb0002 uint32 829 zb0002, err = dc.ReadArrayHeader() 830 if err != nil { 831 err = msgp.WrapError(err, "SigSet") 832 return 833 } 834 if cap(z.SigSet) >= int(zb0002) { 835 z.SigSet = (z.SigSet)[:zb0002] 836 } else { 837 z.SigSet = make([]*SigSet, zb0002) 838 } 839 for za0001 := range z.SigSet { 840 if dc.IsNil() { 841 err = dc.ReadNil() 842 if err != nil { 843 err = msgp.WrapError(err, "SigSet", za0001) 844 return 845 } 846 z.SigSet[za0001] = nil 847 } else { 848 if z.SigSet[za0001] == nil { 849 z.SigSet[za0001] = new(SigSet) 850 } 851 err = z.SigSet[za0001].DecodeMsg(dc) 852 if err != nil { 853 err = msgp.WrapError(err, "SigSet", za0001) 854 return 855 } 856 } 857 } 858 return 859 } 860 861 // EncodeMsg implements msgp.Encodable 862 func (z *RawTermChange) EncodeMsg(en *msgp.Writer) (err error) { 863 // array header, size 4 864 err = en.Append(0x94) 865 if err != nil { 866 return 867 } 868 err = z.TxBase.EncodeMsg(en) 869 if err != nil { 870 err = msgp.WrapError(err, "TxBase") 871 return 872 } 873 err = en.WriteUint64(z.TermId) 874 if err != nil { 875 err = msgp.WrapError(err, "TermId") 876 return 877 } 878 err = en.WriteBytes(z.PkBls) 879 if err != nil { 880 err = msgp.WrapError(err, "PkBls") 881 return 882 } 883 err = en.WriteArrayHeader(uint32(len(z.SigSet))) 884 if err != nil { 885 err = msgp.WrapError(err, "SigSet") 886 return 887 } 888 for za0001 := range z.SigSet { 889 if z.SigSet[za0001] == nil { 890 err = en.WriteNil() 891 if err != nil { 892 return 893 } 894 } else { 895 err = z.SigSet[za0001].EncodeMsg(en) 896 if err != nil { 897 err = msgp.WrapError(err, "SigSet", za0001) 898 return 899 } 900 } 901 } 902 return 903 } 904 905 // MarshalMsg implements msgp.Marshaler 906 func (z *RawTermChange) MarshalMsg(b []byte) (o []byte, err error) { 907 o = msgp.Require(b, z.Msgsize()) 908 // array header, size 4 909 o = append(o, 0x94) 910 o, err = z.TxBase.MarshalMsg(o) 911 if err != nil { 912 err = msgp.WrapError(err, "TxBase") 913 return 914 } 915 o = msgp.AppendUint64(o, z.TermId) 916 o = msgp.AppendBytes(o, z.PkBls) 917 o = msgp.AppendArrayHeader(o, uint32(len(z.SigSet))) 918 for za0001 := range z.SigSet { 919 if z.SigSet[za0001] == nil { 920 o = msgp.AppendNil(o) 921 } else { 922 o, err = z.SigSet[za0001].MarshalMsg(o) 923 if err != nil { 924 err = msgp.WrapError(err, "SigSet", za0001) 925 return 926 } 927 } 928 } 929 return 930 } 931 932 // UnmarshalMsg implements msgp.Unmarshaler 933 func (z *RawTermChange) UnmarshalMsg(bts []byte) (o []byte, err error) { 934 var zb0001 uint32 935 zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts) 936 if err != nil { 937 err = msgp.WrapError(err) 938 return 939 } 940 if zb0001 != 4 { 941 err = msgp.ArrayError{Wanted: 4, Got: zb0001} 942 return 943 } 944 bts, err = z.TxBase.UnmarshalMsg(bts) 945 if err != nil { 946 err = msgp.WrapError(err, "TxBase") 947 return 948 } 949 z.TermId, bts, err = msgp.ReadUint64Bytes(bts) 950 if err != nil { 951 err = msgp.WrapError(err, "TermId") 952 return 953 } 954 z.PkBls, bts, err = msgp.ReadBytesBytes(bts, z.PkBls) 955 if err != nil { 956 err = msgp.WrapError(err, "PkBls") 957 return 958 } 959 var zb0002 uint32 960 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 961 if err != nil { 962 err = msgp.WrapError(err, "SigSet") 963 return 964 } 965 if cap(z.SigSet) >= int(zb0002) { 966 z.SigSet = (z.SigSet)[:zb0002] 967 } else { 968 z.SigSet = make([]*SigSet, zb0002) 969 } 970 for za0001 := range z.SigSet { 971 if msgp.IsNil(bts) { 972 bts, err = msgp.ReadNilBytes(bts) 973 if err != nil { 974 return 975 } 976 z.SigSet[za0001] = nil 977 } else { 978 if z.SigSet[za0001] == nil { 979 z.SigSet[za0001] = new(SigSet) 980 } 981 bts, err = z.SigSet[za0001].UnmarshalMsg(bts) 982 if err != nil { 983 err = msgp.WrapError(err, "SigSet", za0001) 984 return 985 } 986 } 987 } 988 o = bts 989 return 990 } 991 992 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 993 func (z *RawTermChange) Msgsize() (s int) { 994 s = 1 + z.TxBase.Msgsize() + msgp.Uint64Size + msgp.BytesPrefixSize + len(z.PkBls) + msgp.ArrayHeaderSize 995 for za0001 := range z.SigSet { 996 if z.SigSet[za0001] == nil { 997 s += msgp.NilSize 998 } else { 999 s += z.SigSet[za0001].Msgsize() 1000 } 1001 } 1002 return 1003 } 1004 1005 // DecodeMsg implements msgp.Decodable 1006 func (z *RawTermChanges) DecodeMsg(dc *msgp.Reader) (err error) { 1007 var zb0002 uint32 1008 zb0002, err = dc.ReadArrayHeader() 1009 if err != nil { 1010 err = msgp.WrapError(err) 1011 return 1012 } 1013 if cap((*z)) >= int(zb0002) { 1014 (*z) = (*z)[:zb0002] 1015 } else { 1016 (*z) = make(RawTermChanges, zb0002) 1017 } 1018 for zb0001 := range *z { 1019 if dc.IsNil() { 1020 err = dc.ReadNil() 1021 if err != nil { 1022 err = msgp.WrapError(err, zb0001) 1023 return 1024 } 1025 (*z)[zb0001] = nil 1026 } else { 1027 if (*z)[zb0001] == nil { 1028 (*z)[zb0001] = new(RawTermChange) 1029 } 1030 err = (*z)[zb0001].DecodeMsg(dc) 1031 if err != nil { 1032 err = msgp.WrapError(err, zb0001) 1033 return 1034 } 1035 } 1036 } 1037 return 1038 } 1039 1040 // EncodeMsg implements msgp.Encodable 1041 func (z RawTermChanges) EncodeMsg(en *msgp.Writer) (err error) { 1042 err = en.WriteArrayHeader(uint32(len(z))) 1043 if err != nil { 1044 err = msgp.WrapError(err) 1045 return 1046 } 1047 for zb0003 := range z { 1048 if z[zb0003] == nil { 1049 err = en.WriteNil() 1050 if err != nil { 1051 return 1052 } 1053 } else { 1054 err = z[zb0003].EncodeMsg(en) 1055 if err != nil { 1056 err = msgp.WrapError(err, zb0003) 1057 return 1058 } 1059 } 1060 } 1061 return 1062 } 1063 1064 // MarshalMsg implements msgp.Marshaler 1065 func (z RawTermChanges) MarshalMsg(b []byte) (o []byte, err error) { 1066 o = msgp.Require(b, z.Msgsize()) 1067 o = msgp.AppendArrayHeader(o, uint32(len(z))) 1068 for zb0003 := range z { 1069 if z[zb0003] == nil { 1070 o = msgp.AppendNil(o) 1071 } else { 1072 o, err = z[zb0003].MarshalMsg(o) 1073 if err != nil { 1074 err = msgp.WrapError(err, zb0003) 1075 return 1076 } 1077 } 1078 } 1079 return 1080 } 1081 1082 // UnmarshalMsg implements msgp.Unmarshaler 1083 func (z *RawTermChanges) UnmarshalMsg(bts []byte) (o []byte, err error) { 1084 var zb0002 uint32 1085 zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts) 1086 if err != nil { 1087 err = msgp.WrapError(err) 1088 return 1089 } 1090 if cap((*z)) >= int(zb0002) { 1091 (*z) = (*z)[:zb0002] 1092 } else { 1093 (*z) = make(RawTermChanges, zb0002) 1094 } 1095 for zb0001 := range *z { 1096 if msgp.IsNil(bts) { 1097 bts, err = msgp.ReadNilBytes(bts) 1098 if err != nil { 1099 return 1100 } 1101 (*z)[zb0001] = nil 1102 } else { 1103 if (*z)[zb0001] == nil { 1104 (*z)[zb0001] = new(RawTermChange) 1105 } 1106 bts, err = (*z)[zb0001].UnmarshalMsg(bts) 1107 if err != nil { 1108 err = msgp.WrapError(err, zb0001) 1109 return 1110 } 1111 } 1112 } 1113 o = bts 1114 return 1115 } 1116 1117 // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message 1118 func (z RawTermChanges) Msgsize() (s int) { 1119 s = msgp.ArrayHeaderSize 1120 for zb0003 := range z { 1121 if z[zb0003] == nil { 1122 s += msgp.NilSize 1123 } else { 1124 s += z[zb0003].Msgsize() 1125 } 1126 } 1127 return 1128 }