package tokenpool

// Code generated by github.com/tinylib/msgp DO NOT EDIT.

import (
	"github.com/tinylib/msgp/msgp"
)

// MarshalMsg implements msgp.Marshaler
func (z *TokenPool) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 2
	// string "ID"
	o = append(o, 0x82, 0xa2, 0x49, 0x44)
	o = msgp.AppendString(o, z.ID)
	// string "Balance"
	o = append(o, 0xa7, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65)
	o, err = z.Balance.MarshalMsg(o)
	if err != nil {
		err = msgp.WrapError(err, "Balance")
		return
	}
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *TokenPool) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var zb0001 uint32
	zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "ID":
			z.ID, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ID")
				return
			}
		case "Balance":
			bts, err = z.Balance.UnmarshalMsg(bts)
			if err != nil {
				err = msgp.WrapError(err, "Balance")
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *TokenPool) Msgsize() (s int) {
	s = 1 + 3 + msgp.StringPrefixSize + len(z.ID) + 8 + z.Balance.Msgsize()
	return
}

// MarshalMsg implements msgp.Marshaler
func (z *TokenPoolTransferResponse) MarshalMsg(b []byte) (o []byte, err error) {
	o = msgp.Require(b, z.Msgsize())
	// map header, size 6
	// string "TxnHash"
	o = append(o, 0x86, 0xa7, 0x54, 0x78, 0x6e, 0x48, 0x61, 0x73, 0x68)
	o = msgp.AppendString(o, z.TxnHash)
	// string "FromPool"
	o = append(o, 0xa8, 0x46, 0x72, 0x6f, 0x6d, 0x50, 0x6f, 0x6f, 0x6c)
	o = msgp.AppendString(o, z.FromPool)
	// string "ToPool"
	o = append(o, 0xa6, 0x54, 0x6f, 0x50, 0x6f, 0x6f, 0x6c)
	o = msgp.AppendString(o, z.ToPool)
	// string "Value"
	o = append(o, 0xa5, 0x56, 0x61, 0x6c, 0x75, 0x65)
	o, err = z.Value.MarshalMsg(o)
	if err != nil {
		err = msgp.WrapError(err, "Value")
		return
	}
	// string "FromClient"
	o = append(o, 0xaa, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74)
	o = msgp.AppendString(o, z.FromClient)
	// string "ToClient"
	o = append(o, 0xa8, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74)
	o = msgp.AppendString(o, z.ToClient)
	return
}

// UnmarshalMsg implements msgp.Unmarshaler
func (z *TokenPoolTransferResponse) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var zb0001 uint32
	zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		err = msgp.WrapError(err)
		return
	}
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			err = msgp.WrapError(err)
			return
		}
		switch msgp.UnsafeString(field) {
		case "TxnHash":
			z.TxnHash, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "TxnHash")
				return
			}
		case "FromPool":
			z.FromPool, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "FromPool")
				return
			}
		case "ToPool":
			z.ToPool, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ToPool")
				return
			}
		case "Value":
			bts, err = z.Value.UnmarshalMsg(bts)
			if err != nil {
				err = msgp.WrapError(err, "Value")
				return
			}
		case "FromClient":
			z.FromClient, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "FromClient")
				return
			}
		case "ToClient":
			z.ToClient, bts, err = msgp.ReadStringBytes(bts)
			if err != nil {
				err = msgp.WrapError(err, "ToClient")
				return
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				err = msgp.WrapError(err)
				return
			}
		}
	}
	o = bts
	return
}

// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *TokenPoolTransferResponse) Msgsize() (s int) {
	s = 1 + 8 + msgp.StringPrefixSize + len(z.TxnHash) + 9 + msgp.StringPrefixSize + len(z.FromPool) + 7 + msgp.StringPrefixSize + len(z.ToPool) + 6 + z.Value.Msgsize() + 11 + msgp.StringPrefixSize + len(z.FromClient) + 9 + msgp.StringPrefixSize + len(z.ToClient)
	return
}
