github.com/annchain/OG@v0.0.9/common/address_gen.go (about)

     1  package common
     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 *Address) 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 != 1 {
    17  		err = msgp.ArrayError{Wanted: 1, Got: zb0001}
    18  		return
    19  	}
    20  	err = dc.ReadExactBytes((z.Bytes)[:])
    21  	if err != nil {
    22  		return
    23  	}
    24  	return
    25  }
    26  
    27  // EncodeMsg implements msgp.Encodable
    28  func (z *Address) EncodeMsg(en *msgp.Writer) (err error) {
    29  	// array header, size 1
    30  	err = en.Append(0x91)
    31  	if err != nil {
    32  		return
    33  	}
    34  	err = en.WriteBytes((z.Bytes)[:])
    35  	if err != nil {
    36  		return
    37  	}
    38  	return
    39  }
    40  
    41  // MarshalMsg implements msgp.Marshaler
    42  func (z *Address) MarshalMsg(b []byte) (o []byte, err error) {
    43  	o = msgp.Require(b, z.Msgsize())
    44  	// array header, size 1
    45  	o = append(o, 0x91)
    46  	o = msgp.AppendBytes(o, (z.Bytes)[:])
    47  	return
    48  }
    49  
    50  // UnmarshalMsg implements msgp.Unmarshaler
    51  func (z *Address) UnmarshalMsg(bts []byte) (o []byte, err error) {
    52  	var zb0001 uint32
    53  	zb0001, bts, err = msgp.ReadArrayHeaderBytes(bts)
    54  	if err != nil {
    55  		return
    56  	}
    57  	if zb0001 != 1 {
    58  		err = msgp.ArrayError{Wanted: 1, Got: zb0001}
    59  		return
    60  	}
    61  	bts, err = msgp.ReadExactBytes(bts, (z.Bytes)[:])
    62  	if err != nil {
    63  		return
    64  	}
    65  	o = bts
    66  	return
    67  }
    68  
    69  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
    70  func (z *Address) Msgsize() (s int) {
    71  	s = 1 + msgp.ArrayHeaderSize + (AddressLength * (msgp.ByteSize))
    72  	return
    73  }