func (m *BlockData) UnmarshalBinary(b []byte) error {
	var res BlockData
	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 Block struct {
	Data *BlockData `json:"data,omitempty"`
	Evidence interface{} `json:"evidence,omitempty"`
	Header *BlockHeader `json:"header,omitempty"`
	LastCommit *BlockLastCommit `json:"last_commit,omitempty"`
}
func (m *Block) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateData(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateHeader(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateLastCommit(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *Block) validateData(formats strfmt.Registry) error {
	if swag.IsZero(m.Data) {  
		return nil
	}
	if m.Data != nil {
		if err := m.Data.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("data")
			}
			return err
		}
	}
	return nil
}
func (m *Block) validateHeader(formats strfmt.Registry) error {
	if swag.IsZero(m.Header) {  
		return nil
	}
	if m.Header != nil {
		if err := m.Header.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("header")
			}
			return err
		}
	}
	return nil
}
func (m *Block) validateLastCommit(formats strfmt.Registry) error {
	if swag.IsZero(m.LastCommit) {  
		return nil
	}
	if m.LastCommit != nil {
		if err := m.LastCommit.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("last_commit")
			}
			return err
		}
	}
	return nil
}
func (m *Block) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
func (m *Block) UnmarshalBinary(b []byte) error {
	var res Block
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
type BlockData struct {
	Txs []string `json:"txs"`
}
func (m *BlockData) Validate(formats strfmt.Registry) error {
	return nil
}
func (m *BlockData) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}