func (state State) MakeBlock(
	height int64,
	txs []types.Tx,
	commit *types.Commit,
	evidence []types.Evidence,
) (*types.Block, *types.PartSet) {
	block := types.MakeBlock(height, txs, commit, evidence)
	block.ChainID = state.ChainID
	block.LastBlockID = state.LastBlockID
	block.TotalTxs = state.LastBlockTotalTx + block.NumTxs
	block.ValidatorsHash = state.Validators.Hash()
	block.ConsensusHash = state.ConsensusParams.Hash()
	block.AppHash = state.AppHash
	block.LastResultsHash = state.LastResultsHash
	return block, block.MakePartSet(state.ConsensusParams.BlockGossip.BlockPartSizeBytes)
}
------------------------------------------------------------------------
Create a block from the latest state
MakeBlock builds a block from the current state with the given txs, commit, and evidence.
package state
import (
	"bytes"
	"fmt"
	"io/ioutil"
	"time"
	"github.com/tendermint/tendermint/types"
)
var (
	stateKey = []byte("stateKey")
)
type State struct {
	ChainID string
	LastBlockHeight  int64
	LastBlockTotalTx int64
	LastBlockID      types.BlockID
	LastBlockTime    time.Time
	Validators                  *types.ValidatorSet
	LastValidators              *types.ValidatorSet
	LastHeightValidatorsChanged int64
	ConsensusParams                  types.ConsensusParams
	LastHeightConsensusParamsChanged int64
	LastResultsHash []byte
	AppHash []byte
}
func (state State) Copy() State {
	return State{
		ChainID: state.ChainID,
		LastBlockHeight:  state.LastBlockHeight,
		LastBlockTotalTx: state.LastBlockTotalTx,
		LastBlockID:      state.LastBlockID,
		LastBlockTime:    state.LastBlockTime,
		Validators:                  state.Validators.Copy(),
		LastValidators:              state.LastValidators.Copy(),
		LastHeightValidatorsChanged: state.LastHeightValidatorsChanged,
		ConsensusParams:                  state.ConsensusParams,
		LastHeightConsensusParamsChanged: state.LastHeightConsensusParamsChanged,
		AppHash: state.AppHash,
		LastResultsHash: state.LastResultsHash,
	}
}
func (state State) Equals(state2 State) bool {
	sbz, s2bz := state.Bytes(), state2.Bytes()
	return bytes.Equal(sbz, s2bz)
}
func (state State) Bytes() []byte {
	return cdc.MustMarshalBinaryBare(state)
}
func (state State) IsEmpty() bool {
	return state.Validators == nil  
}
func (state State) GetValidators() (last *types.ValidatorSet, current *types.ValidatorSet) {
	return state.LastValidators, state.Validators
}