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

     1  package hexutil
     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 *Bytes) DecodeMsg(dc *msgp.Reader) (err error) {
    11  	{
    12  		var zb0001 []byte
    13  		zb0001, err = dc.ReadBytes([]byte((*z)))
    14  		if err != nil {
    15  			return
    16  		}
    17  		(*z) = Bytes(zb0001)
    18  	}
    19  	return
    20  }
    21  
    22  // EncodeMsg implements msgp.Encodable
    23  func (z Bytes) EncodeMsg(en *msgp.Writer) (err error) {
    24  	err = en.WriteBytes([]byte(z))
    25  	if err != nil {
    26  		return
    27  	}
    28  	return
    29  }
    30  
    31  // MarshalMsg implements msgp.Marshaler
    32  func (z Bytes) MarshalMsg(b []byte) (o []byte, err error) {
    33  	o = msgp.Require(b, z.Msgsize())
    34  	o = msgp.AppendBytes(o, []byte(z))
    35  	return
    36  }
    37  
    38  // UnmarshalMsg implements msgp.Unmarshaler
    39  func (z *Bytes) UnmarshalMsg(bts []byte) (o []byte, err error) {
    40  	{
    41  		var zb0001 []byte
    42  		zb0001, bts, err = msgp.ReadBytesBytes(bts, []byte((*z)))
    43  		if err != nil {
    44  			return
    45  		}
    46  		(*z) = Bytes(zb0001)
    47  	}
    48  	o = bts
    49  	return
    50  }
    51  
    52  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
    53  func (z Bytes) Msgsize() (s int) {
    54  	s = msgp.BytesPrefixSize + len([]byte(z))
    55  	return
    56  }
    57  
    58  // DecodeMsg implements msgp.Decodable
    59  func (z *Uint) DecodeMsg(dc *msgp.Reader) (err error) {
    60  	{
    61  		var zb0001 uint
    62  		zb0001, err = dc.ReadUint()
    63  		if err != nil {
    64  			return
    65  		}
    66  		(*z) = Uint(zb0001)
    67  	}
    68  	return
    69  }
    70  
    71  // EncodeMsg implements msgp.Encodable
    72  func (z Uint) EncodeMsg(en *msgp.Writer) (err error) {
    73  	err = en.WriteUint(uint(z))
    74  	if err != nil {
    75  		return
    76  	}
    77  	return
    78  }
    79  
    80  // MarshalMsg implements msgp.Marshaler
    81  func (z Uint) MarshalMsg(b []byte) (o []byte, err error) {
    82  	o = msgp.Require(b, z.Msgsize())
    83  	o = msgp.AppendUint(o, uint(z))
    84  	return
    85  }
    86  
    87  // UnmarshalMsg implements msgp.Unmarshaler
    88  func (z *Uint) UnmarshalMsg(bts []byte) (o []byte, err error) {
    89  	{
    90  		var zb0001 uint
    91  		zb0001, bts, err = msgp.ReadUintBytes(bts)
    92  		if err != nil {
    93  			return
    94  		}
    95  		(*z) = Uint(zb0001)
    96  	}
    97  	o = bts
    98  	return
    99  }
   100  
   101  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   102  func (z Uint) Msgsize() (s int) {
   103  	s = msgp.UintSize
   104  	return
   105  }
   106  
   107  // DecodeMsg implements msgp.Decodable
   108  func (z *Uint64) DecodeMsg(dc *msgp.Reader) (err error) {
   109  	{
   110  		var zb0001 uint64
   111  		zb0001, err = dc.ReadUint64()
   112  		if err != nil {
   113  			return
   114  		}
   115  		(*z) = Uint64(zb0001)
   116  	}
   117  	return
   118  }
   119  
   120  // EncodeMsg implements msgp.Encodable
   121  func (z Uint64) EncodeMsg(en *msgp.Writer) (err error) {
   122  	err = en.WriteUint64(uint64(z))
   123  	if err != nil {
   124  		return
   125  	}
   126  	return
   127  }
   128  
   129  // MarshalMsg implements msgp.Marshaler
   130  func (z Uint64) MarshalMsg(b []byte) (o []byte, err error) {
   131  	o = msgp.Require(b, z.Msgsize())
   132  	o = msgp.AppendUint64(o, uint64(z))
   133  	return
   134  }
   135  
   136  // UnmarshalMsg implements msgp.Unmarshaler
   137  func (z *Uint64) UnmarshalMsg(bts []byte) (o []byte, err error) {
   138  	{
   139  		var zb0001 uint64
   140  		zb0001, bts, err = msgp.ReadUint64Bytes(bts)
   141  		if err != nil {
   142  			return
   143  		}
   144  		(*z) = Uint64(zb0001)
   145  	}
   146  	o = bts
   147  	return
   148  }
   149  
   150  // Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
   151  func (z Uint64) Msgsize() (s int) {
   152  	s = msgp.Uint64Size
   153  	return
   154  }