func (app *SimApp) AccountKeeper() *account.Keeper {
	return &app.accountKeeper
}
AccountKeeper get account keeper
package simapp
import (
	"io"
	"os"
	bam "github.com/cosmos/cosmos-sdk/baseapp"
	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/types/module"
	"github.com/cosmos/cosmos-sdk/version"
	abci "github.com/tendermint/tendermint/abci/types"
	"github.com/tendermint/tendermint/libs/log"
	tmos "github.com/tendermint/tendermint/libs/os"
	dbm "github.com/tendermint/tm-db"
	"github.com/KuChainNetwork/kuchain/chain/ante"
	"github.com/KuChainNetwork/kuchain/chain/client/txutil"
	"github.com/KuChainNetwork/kuchain/chain/constants"
	"github.com/KuChainNetwork/kuchain/chain/fee"
	chainTypes "github.com/KuChainNetwork/kuchain/chain/types"
	"github.com/KuChainNetwork/kuchain/x/account"
	"github.com/KuChainNetwork/kuchain/x/asset"
	distr "github.com/KuChainNetwork/kuchain/x/distribution"
	"github.com/KuChainNetwork/kuchain/x/evidence"
	"github.com/KuChainNetwork/kuchain/x/genutil"
	"github.com/KuChainNetwork/kuchain/x/gov"
	"github.com/KuChainNetwork/kuchain/x/mint"
	"github.com/KuChainNetwork/kuchain/x/params"
	paramsclient "github.com/KuChainNetwork/kuchain/x/params/client"
	paramproposal "github.com/KuChainNetwork/kuchain/x/params/types/proposal"
	"github.com/KuChainNetwork/kuchain/x/plugin"
	"github.com/KuChainNetwork/kuchain/x/slashing"
	"github.com/KuChainNetwork/kuchain/x/staking"
	"github.com/KuChainNetwork/kuchain/x/supply"
)
const appName = "SimApp"
var (
	DefaultCLIHome = os.ExpandEnv("$HOME/.kuchain/simapp")
	DefaultNodeHome = os.ExpandEnv("$HOME/.kuchain/simapp")
	ModuleBasics = module.NewBasicManager(
		genutil.AppModuleBasic{},
		account.NewAppModuleBasic(),
		asset.NewAppModuleBasic(),
		params.AppModuleBasic{},
		distr.NewAppModuleBasic(),
		supply.NewAppModuleBasic(),
		staking.NewAppModuleBasic(),
		slashing.NewAppModuleBasic(),
		evidence.NewAppModuleBasic(),
		gov.NewAppModuleBasic(paramsclient.ProposalHandler, distr.ProposalHandler),
		mint.NewAppModuleBasic(),
		params.NewAppModuleBasic(),
		plugin.NewAppModuleBasic(),
	)
	maccPerms = map[string][]string{
		fee.CollectorName:         nil,
		distr.ModuleName:          nil,
		supply.BlackHole:          nil,
		staking.BondedPoolName:    {supply.Burner, supply.Staking},
		staking.NotBondedPoolName: {supply.Burner, supply.Staking},
		gov.ModuleName:            {supply.Burner},
		mint.ModuleName:           {supply.Minter},
	}
	allowedReceivingModAcc = map[string]bool{
		distr.ModuleName: true,
	}
)
func MakeCodec() *codec.Codec {
	var cdc = codec.New()
	chainTypes.RegisterCodec(cdc)
	ModuleBasics.RegisterCodec(cdc)
	sdk.RegisterCodec(cdc)
	codec.RegisterCrypto(cdc)
	codec.RegisterEvidences(cdc)
	cdc.Seal()
	return cdc
}
var _ App = (*SimApp)(nil)
type SimApp struct {
	*bam.BaseApp
	cdc *codec.Codec
	invCheckPeriod uint
	keys  map[string]*sdk.KVStoreKey
	tKeys map[string]*sdk.TransientStoreKey
	subspaces map[string]params.Subspace
	accountKeeper  account.Keeper
	assetKeeper    asset.Keeper
	supplyKeeper   supply.Keeper
	distrKeeper    distr.Keeper
	mintKeeper     mint.Keeper
	paramsKeeper   params.Keeper
	stakingKeeper  staking.Keeper
	slashingKeeper slashing.Keeper
	evidenceKeeper evidence.Keeper
	govKeeper      gov.Keeper
	mm *module.Manager
	sm *module.SimulationManager
	stakingFuncManager staking.FuncManager
}
func NewSimApp(
	logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool,
	invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp),
) *SimApp {
	cdc := MakeCodec()
	bApp := bam.NewBaseApp(appName, logger, db, txutil.DefaultTxDecoder(cdc), baseAppOptions...)
	bApp.SetCommitMultiStoreTracer(traceStore)
	bApp.SetAppVersion(version.Version)
	keys := sdk.NewKVStoreKeys(
		bam.MainStoreKey, staking.StoreKey, slashing.StoreKey, evidence.StoreKey, gov.StoreKey,
		account.StoreKey, asset.StoreKey, supply.StoreKey, params.StoreKey, mint.StoreKey, distr.StoreKey, params.StoreKey,
	)
	tKeys := sdk.NewTransientStoreKeys(params.TStoreKey, staking.TStoreKey, params.TStoreKey)
	app := &SimApp{
		BaseApp:        bApp,
		cdc:            cdc,
		invCheckPeriod: invCheckPeriod,
		keys:           keys,
		tKeys:          tKeys,
		subspaces:      make(map[string]params.Subspace),
	}
	app.paramsKeeper = params.NewKeeper(cdc, keys[params.StoreKey], tKeys[params.TStoreKey])
	app.subspaces[account.ModuleName] = app.paramsKeeper.Subspace(account.DefaultParamspace)
	app.subspaces[distr.ModuleName] = app.paramsKeeper.Subspace(distr.DefaultParamspace)
	app.subspaces[staking.ModuleName] = app.paramsKeeper.Subspace(staking.DefaultParamspace)
	app.subspaces[slashing.ModuleName] = app.paramsKeeper.Subspace(slashing.DefaultParamspace)
	app.subspaces[evidence.ModuleName] = app.paramsKeeper.Subspace(evidence.DefaultParamspace)
	app.subspaces[mint.ModuleName] = app.paramsKeeper.Subspace(mint.DefaultParamspace)
	app.subspaces[gov.ModuleName] = app.paramsKeeper.Subspace(gov.DefaultParamspace).WithKeyTable(gov.ParamKeyTable())
	app.accountKeeper = account.NewAccountKeeper(cdc, keys[account.StoreKey])
	app.assetKeeper = asset.NewAssetKeeper(cdc, keys[asset.StoreKey], app.accountKeeper)
	app.supplyKeeper = supply.NewKeeper(
		cdc, keys[supply.StoreKey], app.accountKeeper, app.assetKeeper, maccPerms,
	)
	stakingKeeper := staking.NewKeeper(
		app.cdc, keys[staking.StoreKey], app.assetKeeper, app.supplyKeeper, app.subspaces[staking.ModuleName], app.accountKeeper,
	)
	app.stakingFuncManager = staking.NewFuncManager()
	app.distrKeeper = distr.NewKeeper(
		cdc, keys[distr.StoreKey], app.subspaces[distr.ModuleName],
		app.assetKeeper,
		&app.stakingKeeper,
		app.supplyKeeper,
		app.accountKeeper,
		fee.CollectorName,
		app.ModuleAccountAddrs())
	app.slashingKeeper = slashing.NewKeeper(
		cdc, keys[slashing.StoreKey], &stakingKeeper, app.subspaces[slashing.ModuleName],
	)
	evidenceKeeper := evidence.NewKeeper(
		keys[evidence.StoreKey], app.subspaces[evidence.ModuleName], &stakingKeeper, app.slashingKeeper,
	)
	evidenceRouter := evidence.NewRouter()
	app.evidenceKeeper = *evidenceKeeper
	govRouter := gov.NewRouter()
	govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler).
		AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper))
	app.govKeeper = gov.NewKeeper(cdc,
		keys[gov.StoreKey], app.subspaces[gov.ModuleName],
		app.supplyKeeper, &stakingKeeper, app.distrKeeper, govRouter,
	)
	app.stakingKeeper = *stakingKeeper.SetHooks(
		staking.NewMultiStakingHooks(app.distrKeeper.Hooks(), app.slashingKeeper.Hooks()),
	)
	evidenceKeeper.SetRouter(evidenceRouter)
	app.mintKeeper = mint.NewKeeper(
		cdc, keys[mint.StoreKey], app.subspaces[mint.ModuleName], &app.stakingKeeper,
		app.supplyKeeper, constants.FeeSystemAccountStr,
	)
	app.mm = module.NewManager(
		account.NewAppModule(app.accountKeeper, app.assetKeeper),
		genutil.NewAppModule(app.accountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx, app.stakingFuncManager),
		asset.NewAppModule(app.accountKeeper, app.assetKeeper),
		supply.NewAppModule(app.supplyKeeper, app.assetKeeper, app.accountKeeper),
		distr.NewAppModule(app.distrKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper, app.stakingKeeper),
		slashing.NewAppModule(app.slashingKeeper, app.accountKeeper, app.assetKeeper, app.stakingKeeper),
		staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper),
		mint.NewAppModule(app.mintKeeper, app.supplyKeeper),
		evidence.NewAppModule(app.evidenceKeeper, app.accountKeeper, app.assetKeeper),
		gov.NewAppModule(app.govKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper),
		plugin.NewAppModule(),
	)
	app.mm.SetOrderBeginBlockers(mint.ModuleName, distr.ModuleName, slashing.ModuleName, evidence.ModuleName, plugin.ModuleName)
	app.mm.SetOrderEndBlockers(staking.ModuleName, gov.ModuleName, plugin.ModuleName)
	app.mm.SetOrderInitGenesis(
		account.ModuleName,
		asset.ModuleName,
		distr.ModuleName,
		staking.ModuleName,
		slashing.ModuleName, evidence.ModuleName, gov.ModuleName,
		supply.ModuleName,
		genutil.ModuleName,
		mint.ModuleName,
	)
	app.mm.RegisterRoutes(app.Router(), app.QueryRouter())
	app.sm = module.NewSimulationManager(
		account.NewAppModule(app.accountKeeper, app.assetKeeper),
		supply.NewAppModule(app.supplyKeeper, app.assetKeeper, app.accountKeeper),
		distr.NewAppModule(app.distrKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper, app.stakingKeeper),
		staking.NewAppModule(app.stakingKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper),
		slashing.NewAppModule(app.slashingKeeper, app.accountKeeper, app.assetKeeper, app.stakingKeeper),
		mint.NewAppModule(app.mintKeeper, app.supplyKeeper),
		gov.NewAppModule(app.govKeeper, app.accountKeeper, app.assetKeeper, app.supplyKeeper),
	)
	app.sm.RegisterStoreDecoders()
	app.MountKVStores(keys)
	app.MountTransientStores(tKeys)
	app.SetInitChainer(app.InitChainer)
	app.SetBeginBlocker(app.BeginBlocker)
	app.SetAnteHandler(ante.NewHandler(app.accountKeeper, app.assetKeeper))
	app.SetEndBlocker(app.EndBlocker)
	if loadLatest {
		err := app.LoadLatestVersion(app.keys[bam.MainStoreKey])
		if err != nil {
			tmos.Exit(err.Error())
		}
	}
	constants.LogVersion(app.Logger())
	return app
}
func (app *SimApp) Name() string { return app.BaseApp.Name() }
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
	return app.mm.BeginBlock(ctx, req)
}
func (app *SimApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
	return app.mm.EndBlock(ctx, req)
}
func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
	var genesisState GenesisState
	app.cdc.MustUnmarshalJSON(req.AppStateBytes, &genesisState)
	return app.mm.InitGenesis(ctx, genesisState)
}
func (app *SimApp) LoadHeight(height int64) error {
	return app.LoadVersion(height, app.keys[bam.MainStoreKey])
}
func (app *SimApp) ModuleAccountAddrs() map[string]bool {
	modAccAddrs := make(map[string]bool)
	for acc := range maccPerms {
		modAccAddrs[supply.NewModuleAddress(acc).String()] = true
	}
	return modAccAddrs
}
func (app *SimApp) BlacklistedAccAddrs() map[string]bool {
	blacklistedAddrs := make(map[string]bool)
	for acc := range maccPerms {
		blacklistedAddrs[supply.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc]
	}
	return blacklistedAddrs
}
func (app *SimApp) Codec() *codec.Codec {
	return app.cdc
}
func (app *SimApp) GetKey(storeKey string) *sdk.KVStoreKey {
	return app.keys[storeKey]
}
func (app *SimApp) GetTKey(storeKey string) *sdk.TransientStoreKey {
	return app.tKeys[storeKey]
}
func (app *SimApp) GetSubspace(moduleName string) params.Subspace {
	return app.subspaces[moduleName]
}
func (app *SimApp) SimulationManager() *module.SimulationManager {
	return app.sm
}