github.com/annchain/OG@v0.0.9/consensus/dkg/message_gen.go (about)

     1  package dkg
     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 *DkgBasicInfo) 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  	z.TermId, err = dc.ReadUint32()
    22  	if err != nil {
    23  		err = msgp.WrapError(err, "TermId")
    24  		return
    25  	}
    26  	return
    27  }
    28  
    29  // EncodeMsg implements msgp.Encodable
    30  func (z DkgBasicInfo) EncodeMsg(en *msgp.Writer) (err error) {
    31  	// array header, size 1
    32  	err = en.Append(0x91)
    33  	if err != nil {
    34  		return
    35  	}
    36  	err = en.WriteUint32(z.TermId)
    37  	if err != nil {
    38  		err = msgp.WrapError(err, "TermId")
    39  		return
    40  	}
    41  	return
    42  }
    43  
    44  // MarshalMsg implements msgp.Marshaler
    45  func (z DkgBasicInfo) MarshalMsg(b []byte) (o []byte, err error) {
    46  	o = msgp.Require(b, z.Msgsize())
    47  	// array header, size 1
    48  	o = append(o, 0x91)
    49  	o = msgp.AppendUint32(o, z.TermId)
    50  	return
    51  }
    52  
    53  // UnmarshalMsg implements msgp.Unmarshaler
    54  func (z *DkgBasicInfo) UnmarshalMsg(bts []byte) (o []byte, err error) {
    55  	var zb0001 uint32
    56  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
    57  	if err != nil {
    58  		err = msgp.WrapError(err)
    59  		return
    60  	}
    61  	if zb0001 != 1 {
    62  		err = msgp.ArrayError{Wanted: 1, Got: zb0001}
    63  		return
    64  	}
    65  	z.TermId, bts, err = msgp.ReadUint32Bytes(bts)
    66  	if err != nil {
    67  		err = msgp.WrapError(err, "TermId")
    68  		return
    69  	}
    70  	o = bts
    71  	return
    72  }
    73  
    74  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
    75  func (z DkgBasicInfo) Msgsize() (s int) {
    76  	s = 1 + msgp.Uint32Size
    77  	return
    78  }
    79  
    80  // DecodeMsg implements msgp.Decodable
    81  func (z *DkgMessageType) DecodeMsg(dc *msgp.Reader) (err error) {
    82  	{
    83  		var zb0001 uint16
    84  		zb0001, err = dc.ReadUint16()
    85  		if err != nil {
    86  			err = msgp.WrapError(err)
    87  			return
    88  		}
    89  		(*z) = DkgMessageType(zb0001)
    90  	}
    91  	return
    92  }
    93  
    94  // EncodeMsg implements msgp.Encodable
    95  func (z DkgMessageType) EncodeMsg(en *msgp.Writer) (err error) {
    96  	err = en.WriteUint16(uint16(z))
    97  	if err != nil {
    98  		err = msgp.WrapError(err)
    99  		return
   100  	}
   101  	return
   102  }
   103  
   104  // MarshalMsg implements msgp.Marshaler
   105  func (z DkgMessageType) MarshalMsg(b []byte) (o []byte, err error) {
   106  	o = msgp.Require(b, z.Msgsize())
   107  	o = msgp.AppendUint16(o, uint16(z))
   108  	return
   109  }
   110  
   111  // UnmarshalMsg implements msgp.Unmarshaler
   112  func (z *DkgMessageType) UnmarshalMsg(bts []byte) (o []byte, err error) {
   113  	{
   114  		var zb0001 uint16
   115  		zb0001, bts, err = msgp.ReadUint16Bytes(bts)
   116  		if err != nil {
   117  			err = msgp.WrapError(err)
   118  			return
   119  		}
   120  		(*z) = DkgMessageType(zb0001)
   121  	}
   122  	o = bts
   123  	return
   124  }
   125  
   126  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   127  func (z DkgMessageType) Msgsize() (s int) {
   128  	s = msgp.Uint16Size
   129  	return
   130  }
   131  
   132  // DecodeMsg implements msgp.Decodable
   133  func (z *MessageDkgDeal) DecodeMsg(dc *msgp.Reader) (err error) {
   134  	var zb0001 uint32
   135  	zb0001, err = dc.ReadArrayHeader()
   136  	if err != nil {
   137  		err = msgp.WrapError(err)
   138  		return
   139  	}
   140  	if zb0001 != 2 {
   141  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   142  		return
   143  	}
   144  	var zb0002 uint32
   145  	zb0002, err = dc.ReadArrayHeader()
   146  	if err != nil {
   147  		err = msgp.WrapError(err, "DkgBasicInfo")
   148  		return
   149  	}
   150  	if zb0002 != 1 {
   151  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   152  		return
   153  	}
   154  	z.DkgBasicInfo.TermId, err = dc.ReadUint32()
   155  	if err != nil {
   156  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   157  		return
   158  	}
   159  	z.Data, err = dc.ReadBytes(z.Data)
   160  	if err != nil {
   161  		err = msgp.WrapError(err, "Data")
   162  		return
   163  	}
   164  	return
   165  }
   166  
   167  // EncodeMsg implements msgp.Encodable
   168  func (z *MessageDkgDeal) EncodeMsg(en *msgp.Writer) (err error) {
   169  	// array header, size 2
   170  	// array header, size 1
   171  	err = en.Append(0x92, 0x91)
   172  	if err != nil {
   173  		return
   174  	}
   175  	err = en.WriteUint32(z.DkgBasicInfo.TermId)
   176  	if err != nil {
   177  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   178  		return
   179  	}
   180  	err = en.WriteBytes(z.Data)
   181  	if err != nil {
   182  		err = msgp.WrapError(err, "Data")
   183  		return
   184  	}
   185  	return
   186  }
   187  
   188  // MarshalMsg implements msgp.Marshaler
   189  func (z *MessageDkgDeal) MarshalMsg(b []byte) (o []byte, err error) {
   190  	o = msgp.Require(b, z.Msgsize())
   191  	// array header, size 2
   192  	// array header, size 1
   193  	o = append(o, 0x92, 0x91)
   194  	o = msgp.AppendUint32(o, z.DkgBasicInfo.TermId)
   195  	o = msgp.AppendBytes(o, z.Data)
   196  	return
   197  }
   198  
   199  // UnmarshalMsg implements msgp.Unmarshaler
   200  func (z *MessageDkgDeal) UnmarshalMsg(bts []byte) (o []byte, err error) {
   201  	var zb0001 uint32
   202  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
   203  	if err != nil {
   204  		err = msgp.WrapError(err)
   205  		return
   206  	}
   207  	if zb0001 != 2 {
   208  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   209  		return
   210  	}
   211  	var zb0002 uint32
   212  	zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
   213  	if err != nil {
   214  		err = msgp.WrapError(err, "DkgBasicInfo")
   215  		return
   216  	}
   217  	if zb0002 != 1 {
   218  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   219  		return
   220  	}
   221  	z.DkgBasicInfo.TermId, bts, err = msgp.ReadUint32Bytes(bts)
   222  	if err != nil {
   223  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   224  		return
   225  	}
   226  	z.Data, bts, err = msgp.ReadBytesBytes(bts, z.Data)
   227  	if err != nil {
   228  		err = msgp.WrapError(err, "Data")
   229  		return
   230  	}
   231  	o = bts
   232  	return
   233  }
   234  
   235  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   236  func (z *MessageDkgDeal) Msgsize() (s int) {
   237  	s = 1 + 1 + msgp.Uint32Size + msgp.BytesPrefixSize + len(z.Data)
   238  	return
   239  }
   240  
   241  // DecodeMsg implements msgp.Decodable
   242  func (z *MessageDkgDealResponse) DecodeMsg(dc *msgp.Reader) (err error) {
   243  	var zb0001 uint32
   244  	zb0001, err = dc.ReadArrayHeader()
   245  	if err != nil {
   246  		err = msgp.WrapError(err)
   247  		return
   248  	}
   249  	if zb0001 != 2 {
   250  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   251  		return
   252  	}
   253  	var zb0002 uint32
   254  	zb0002, err = dc.ReadArrayHeader()
   255  	if err != nil {
   256  		err = msgp.WrapError(err, "DkgBasicInfo")
   257  		return
   258  	}
   259  	if zb0002 != 1 {
   260  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   261  		return
   262  	}
   263  	z.DkgBasicInfo.TermId, err = dc.ReadUint32()
   264  	if err != nil {
   265  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   266  		return
   267  	}
   268  	z.Data, err = dc.ReadBytes(z.Data)
   269  	if err != nil {
   270  		err = msgp.WrapError(err, "Data")
   271  		return
   272  	}
   273  	return
   274  }
   275  
   276  // EncodeMsg implements msgp.Encodable
   277  func (z *MessageDkgDealResponse) EncodeMsg(en *msgp.Writer) (err error) {
   278  	// array header, size 2
   279  	// array header, size 1
   280  	err = en.Append(0x92, 0x91)
   281  	if err != nil {
   282  		return
   283  	}
   284  	err = en.WriteUint32(z.DkgBasicInfo.TermId)
   285  	if err != nil {
   286  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   287  		return
   288  	}
   289  	err = en.WriteBytes(z.Data)
   290  	if err != nil {
   291  		err = msgp.WrapError(err, "Data")
   292  		return
   293  	}
   294  	return
   295  }
   296  
   297  // MarshalMsg implements msgp.Marshaler
   298  func (z *MessageDkgDealResponse) MarshalMsg(b []byte) (o []byte, err error) {
   299  	o = msgp.Require(b, z.Msgsize())
   300  	// array header, size 2
   301  	// array header, size 1
   302  	o = append(o, 0x92, 0x91)
   303  	o = msgp.AppendUint32(o, z.DkgBasicInfo.TermId)
   304  	o = msgp.AppendBytes(o, z.Data)
   305  	return
   306  }
   307  
   308  // UnmarshalMsg implements msgp.Unmarshaler
   309  func (z *MessageDkgDealResponse) UnmarshalMsg(bts []byte) (o []byte, err error) {
   310  	var zb0001 uint32
   311  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
   312  	if err != nil {
   313  		err = msgp.WrapError(err)
   314  		return
   315  	}
   316  	if zb0001 != 2 {
   317  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   318  		return
   319  	}
   320  	var zb0002 uint32
   321  	zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
   322  	if err != nil {
   323  		err = msgp.WrapError(err, "DkgBasicInfo")
   324  		return
   325  	}
   326  	if zb0002 != 1 {
   327  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   328  		return
   329  	}
   330  	z.DkgBasicInfo.TermId, bts, err = msgp.ReadUint32Bytes(bts)
   331  	if err != nil {
   332  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   333  		return
   334  	}
   335  	z.Data, bts, err = msgp.ReadBytesBytes(bts, z.Data)
   336  	if err != nil {
   337  		err = msgp.WrapError(err, "Data")
   338  		return
   339  	}
   340  	o = bts
   341  	return
   342  }
   343  
   344  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   345  func (z *MessageDkgDealResponse) Msgsize() (s int) {
   346  	s = 1 + 1 + msgp.Uint32Size + msgp.BytesPrefixSize + len(z.Data)
   347  	return
   348  }
   349  
   350  // DecodeMsg implements msgp.Decodable
   351  func (z *MessageDkgGenesisPublicKey) DecodeMsg(dc *msgp.Reader) (err error) {
   352  	var zb0001 uint32
   353  	zb0001, err = dc.ReadArrayHeader()
   354  	if err != nil {
   355  		err = msgp.WrapError(err)
   356  		return
   357  	}
   358  	if zb0001 != 2 {
   359  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   360  		return
   361  	}
   362  	var zb0002 uint32
   363  	zb0002, err = dc.ReadArrayHeader()
   364  	if err != nil {
   365  		err = msgp.WrapError(err, "DkgBasicInfo")
   366  		return
   367  	}
   368  	if zb0002 != 1 {
   369  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   370  		return
   371  	}
   372  	z.DkgBasicInfo.TermId, err = dc.ReadUint32()
   373  	if err != nil {
   374  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   375  		return
   376  	}
   377  	z.PublicKeyBytes, err = dc.ReadBytes(z.PublicKeyBytes)
   378  	if err != nil {
   379  		err = msgp.WrapError(err, "PublicKeyBytes")
   380  		return
   381  	}
   382  	return
   383  }
   384  
   385  // EncodeMsg implements msgp.Encodable
   386  func (z *MessageDkgGenesisPublicKey) EncodeMsg(en *msgp.Writer) (err error) {
   387  	// array header, size 2
   388  	// array header, size 1
   389  	err = en.Append(0x92, 0x91)
   390  	if err != nil {
   391  		return
   392  	}
   393  	err = en.WriteUint32(z.DkgBasicInfo.TermId)
   394  	if err != nil {
   395  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   396  		return
   397  	}
   398  	err = en.WriteBytes(z.PublicKeyBytes)
   399  	if err != nil {
   400  		err = msgp.WrapError(err, "PublicKeyBytes")
   401  		return
   402  	}
   403  	return
   404  }
   405  
   406  // MarshalMsg implements msgp.Marshaler
   407  func (z *MessageDkgGenesisPublicKey) MarshalMsg(b []byte) (o []byte, err error) {
   408  	o = msgp.Require(b, z.Msgsize())
   409  	// array header, size 2
   410  	// array header, size 1
   411  	o = append(o, 0x92, 0x91)
   412  	o = msgp.AppendUint32(o, z.DkgBasicInfo.TermId)
   413  	o = msgp.AppendBytes(o, z.PublicKeyBytes)
   414  	return
   415  }
   416  
   417  // UnmarshalMsg implements msgp.Unmarshaler
   418  func (z *MessageDkgGenesisPublicKey) UnmarshalMsg(bts []byte) (o []byte, err error) {
   419  	var zb0001 uint32
   420  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
   421  	if err != nil {
   422  		err = msgp.WrapError(err)
   423  		return
   424  	}
   425  	if zb0001 != 2 {
   426  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   427  		return
   428  	}
   429  	var zb0002 uint32
   430  	zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
   431  	if err != nil {
   432  		err = msgp.WrapError(err, "DkgBasicInfo")
   433  		return
   434  	}
   435  	if zb0002 != 1 {
   436  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   437  		return
   438  	}
   439  	z.DkgBasicInfo.TermId, bts, err = msgp.ReadUint32Bytes(bts)
   440  	if err != nil {
   441  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   442  		return
   443  	}
   444  	z.PublicKeyBytes, bts, err = msgp.ReadBytesBytes(bts, z.PublicKeyBytes)
   445  	if err != nil {
   446  		err = msgp.WrapError(err, "PublicKeyBytes")
   447  		return
   448  	}
   449  	o = bts
   450  	return
   451  }
   452  
   453  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   454  func (z *MessageDkgGenesisPublicKey) Msgsize() (s int) {
   455  	s = 1 + 1 + msgp.Uint32Size + msgp.BytesPrefixSize + len(z.PublicKeyBytes)
   456  	return
   457  }
   458  
   459  // DecodeMsg implements msgp.Decodable
   460  func (z *MessageDkgSigSets) DecodeMsg(dc *msgp.Reader) (err error) {
   461  	var zb0001 uint32
   462  	zb0001, err = dc.ReadArrayHeader()
   463  	if err != nil {
   464  		err = msgp.WrapError(err)
   465  		return
   466  	}
   467  	if zb0001 != 2 {
   468  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   469  		return
   470  	}
   471  	var zb0002 uint32
   472  	zb0002, err = dc.ReadArrayHeader()
   473  	if err != nil {
   474  		err = msgp.WrapError(err, "DkgBasicInfo")
   475  		return
   476  	}
   477  	if zb0002 != 1 {
   478  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   479  		return
   480  	}
   481  	z.DkgBasicInfo.TermId, err = dc.ReadUint32()
   482  	if err != nil {
   483  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   484  		return
   485  	}
   486  	z.PkBls, err = dc.ReadBytes(z.PkBls)
   487  	if err != nil {
   488  		err = msgp.WrapError(err, "PkBls")
   489  		return
   490  	}
   491  	return
   492  }
   493  
   494  // EncodeMsg implements msgp.Encodable
   495  func (z *MessageDkgSigSets) EncodeMsg(en *msgp.Writer) (err error) {
   496  	// array header, size 2
   497  	// array header, size 1
   498  	err = en.Append(0x92, 0x91)
   499  	if err != nil {
   500  		return
   501  	}
   502  	err = en.WriteUint32(z.DkgBasicInfo.TermId)
   503  	if err != nil {
   504  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   505  		return
   506  	}
   507  	err = en.WriteBytes(z.PkBls)
   508  	if err != nil {
   509  		err = msgp.WrapError(err, "PkBls")
   510  		return
   511  	}
   512  	return
   513  }
   514  
   515  // MarshalMsg implements msgp.Marshaler
   516  func (z *MessageDkgSigSets) MarshalMsg(b []byte) (o []byte, err error) {
   517  	o = msgp.Require(b, z.Msgsize())
   518  	// array header, size 2
   519  	// array header, size 1
   520  	o = append(o, 0x92, 0x91)
   521  	o = msgp.AppendUint32(o, z.DkgBasicInfo.TermId)
   522  	o = msgp.AppendBytes(o, z.PkBls)
   523  	return
   524  }
   525  
   526  // UnmarshalMsg implements msgp.Unmarshaler
   527  func (z *MessageDkgSigSets) UnmarshalMsg(bts []byte) (o []byte, err error) {
   528  	var zb0001 uint32
   529  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
   530  	if err != nil {
   531  		err = msgp.WrapError(err)
   532  		return
   533  	}
   534  	if zb0001 != 2 {
   535  		err = msgp.ArrayError{Wanted: 2, Got: zb0001}
   536  		return
   537  	}
   538  	var zb0002 uint32
   539  	zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
   540  	if err != nil {
   541  		err = msgp.WrapError(err, "DkgBasicInfo")
   542  		return
   543  	}
   544  	if zb0002 != 1 {
   545  		err = msgp.ArrayError{Wanted: 1, Got: zb0002}
   546  		return
   547  	}
   548  	z.DkgBasicInfo.TermId, bts, err = msgp.ReadUint32Bytes(bts)
   549  	if err != nil {
   550  		err = msgp.WrapError(err, "DkgBasicInfo", "TermId")
   551  		return
   552  	}
   553  	z.PkBls, bts, err = msgp.ReadBytesBytes(bts, z.PkBls)
   554  	if err != nil {
   555  		err = msgp.WrapError(err, "PkBls")
   556  		return
   557  	}
   558  	o = bts
   559  	return
   560  }
   561  
   562  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   563  func (z *MessageDkgSigSets) Msgsize() (s int) {
   564  	s = 1 + 1 + msgp.Uint32Size + msgp.BytesPrefixSize + len(z.PkBls)
   565  	return
   566  }