github.com/annchain/OG@v0.0.9/types/statistic_gen.go (about)

     1  package types
     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 *ConfirmTime) DecodeMsg(dc *msgp.Reader) (err error) {
    11  	var zb0001 uint32
    12  	zb0001, err = dc.ReadArrayHeader()
    13  	if err != nil {
    14  		return
    15  	}
    16  	if zb0001 != 3 {
    17  		err = msgp.ArrayError{Wanted: 3, Got: zb0001}
    18  		return
    19  	}
    20  	z.SeqHeight, err = dc.ReadUint64()
    21  	if err != nil {
    22  		return
    23  	}
    24  	z.TxNum, err = dc.ReadUint64()
    25  	if err != nil {
    26  		return
    27  	}
    28  	z.ConfirmTime, err = dc.ReadString()
    29  	if err != nil {
    30  		return
    31  	}
    32  	return
    33  }
    34  
    35  // EncodeMsg implements msgp.Encodable
    36  func (z ConfirmTime) EncodeMsg(en *msgp.Writer) (err error) {
    37  	// array header, size 3
    38  	err = en.Append(0x93)
    39  	if err != nil {
    40  		return
    41  	}
    42  	err = en.WriteUint64(z.SeqHeight)
    43  	if err != nil {
    44  		return
    45  	}
    46  	err = en.WriteUint64(z.TxNum)
    47  	if err != nil {
    48  		return
    49  	}
    50  	err = en.WriteString(z.ConfirmTime)
    51  	if err != nil {
    52  		return
    53  	}
    54  	return
    55  }
    56  
    57  // MarshalMsg implements msgp.Marshaler
    58  func (z ConfirmTime) MarshalMsg(b []byte) (o []byte, err error) {
    59  	o = msgp.Require(b, z.Msgsize())
    60  	// array header, size 3
    61  	o = append(o, 0x93)
    62  	o = msgp.AppendUint64(o, z.SeqHeight)
    63  	o = msgp.AppendUint64(o, z.TxNum)
    64  	o = msgp.AppendString(o, z.ConfirmTime)
    65  	return
    66  }
    67  
    68  // UnmarshalMsg implements msgp.Unmarshaler
    69  func (z *ConfirmTime) UnmarshalMsg(bts []byte) (o []byte, err error) {
    70  	var zb0001 uint32
    71  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
    72  	if err != nil {
    73  		return
    74  	}
    75  	if zb0001 != 3 {
    76  		err = msgp.ArrayError{Wanted: 3, Got: zb0001}
    77  		return
    78  	}
    79  	z.SeqHeight, bts, err = msgp.ReadUint64Bytes(bts)
    80  	if err != nil {
    81  		return
    82  	}
    83  	z.TxNum, bts, err = msgp.ReadUint64Bytes(bts)
    84  	if err != nil {
    85  		return
    86  	}
    87  	z.ConfirmTime, bts, err = msgp.ReadStringBytes(bts)
    88  	if err != nil {
    89  		return
    90  	}
    91  	o = bts
    92  	return
    93  }
    94  
    95  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
    96  func (z ConfirmTime) Msgsize() (s int) {
    97  	s = 1 + msgp.Uint64Size + msgp.Uint64Size + msgp.StringPrefixSize + len(z.ConfirmTime)
    98  	return
    99  }