func (a GenesisState) Equal(b GenesisState) bool {
	aJSON, err := json.Marshal(a)
	if err != nil {
		return false
	}
	bJSON, err := json.Marshal(b)
	if err != nil {
		return false
	}
	aJSONSorted, err := sdk.SortJSON(aJSON)
	if err != nil {
		return false
	}
	bJSONSorted, err := sdk.SortJSON(bJSON)
	if err != nil {
		return false
	}
	return string(aJSONSorted) == string(bJSONSorted)
}
Equal judge GenesisState equal
package types
import (
	"encoding/json"
	"github.com/Dipper-Labs/Dipper-Protocol/hexutil"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
)
type (
	GenesisState struct {
		Params  Params              `json:"params"`
		Storage []Storage           `json:"storage"`
		Codes   map[string]sdk.Code `json:"codes"`
		VMLogs  VMLogs              `json:"vm_logs"`
	}
	Storage struct {
		Key   hexutil.Bytes `json:"k"`
		Value hexutil.Bytes `json:"v"`
	}
	VMLogs struct {
		Logs     map[string]string `json:"logs"`
		LogIndex int64             `json:"log_index"`
	}
)
func DefaultGenesisState() GenesisState {
	return GenesisState{
		Params:  DefaultParams(),
		Storage: make([]Storage, 0),
	}
}
func NewGenesisState(params Params) GenesisState {
	return GenesisState{Params: params}
}
func ValidateGenesis(data GenesisState) error {
	if err := validateMaxCodeSize(data.Params.MaxCodeSize); err != nil {
		return err
	}
	if err := validateMaxCallCreateDepth(data.Params.MaxCallCreateDepth); err != nil {
		return err
	}
	vmOpGasParams := data.Params.VMOpGasParams
	if err := validateVMOpGasParams(vmOpGasParams); err != nil {
		return err
	}
	return validateVMCommonGasParams(data.Params.VMContractCreationGasParams)
}