func (m *StdTxFee) UnmarshalBinary(b []byte) error {
	var res StdTxFee
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
UnmarshalBinary interface implementation
package models
import (
	"strconv"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
type StdTx struct {
	Fee *StdTxFee `json:"fee,omitempty"`
	Memo string `json:"memo,omitempty"`
	Msg []*Msg `json:"msg"`
	Signatures []*TxSignature `json:"signatures"`
}
func (m *StdTx) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateFee(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateMsg(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateSignatures(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *StdTx) validateFee(formats strfmt.Registry) error {
	if swag.IsZero(m.Fee) {  
		return nil
	}
	if m.Fee != nil {
		if err := m.Fee.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("fee")
			}
			return err
		}
	}
	return nil
}
func (m *StdTx) validateMsg(formats strfmt.Registry) error {
	if swag.IsZero(m.Msg) {  
		return nil
	}
	for i := 0; i < len(m.Msg); i++ {
		if swag.IsZero(m.Msg[i]) {  
			continue
		}
		if m.Msg[i] != nil {
			if err := m.Msg[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("msg" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *StdTx) validateSignatures(formats strfmt.Registry) error {
	if swag.IsZero(m.Signatures) {  
		return nil
	}
	for i := 0; i < len(m.Signatures); i++ {
		if swag.IsZero(m.Signatures[i]) {  
			continue
		}
		if m.Signatures[i] != nil {
			if err := m.Signatures[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("signatures" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *StdTx) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
func (m *StdTx) UnmarshalBinary(b []byte) error {
	var res StdTx
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
type StdTxFee struct {
	Amount []*Coin `json:"amount"`
	Gas string `json:"gas,omitempty"`
}
func (m *StdTxFee) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateAmount(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *StdTxFee) validateAmount(formats strfmt.Registry) error {
	if swag.IsZero(m.Amount) {  
		return nil
	}
	for i := 0; i < len(m.Amount); i++ {
		if swag.IsZero(m.Amount[i]) {  
			continue
		}
		if m.Amount[i] != nil {
			if err := m.Amount[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("fee" + "." + "amount" + "." + strconv.Itoa(i))
				}
				return err
			}
		}
	}
	return nil
}
func (m *StdTxFee) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}