func SetupSimulation(dirPrefix, dbName string) (simulation.Config, dbm.DB, string, log.Logger, bool, error) {
	if !FlagEnabledValue {
		return simulation.Config{}, nil, "", nil, true, nil
	}
	config := NewConfigFromFlags()
	config.ChainID = helpers.SimAppChainID
	var logger log.Logger
	if FlagVerboseValue {
		logger = log.TestingLogger()
	} else {
		logger = log.NewNopLogger()
	}
	dir, err := ioutil.TempDir("", dirPrefix)
	if err != nil {
		return simulation.Config{}, nil, "", nil, false, err
	}
	db, err := sdk.NewLevelDB(dbName, dir)
	if err != nil {
		return simulation.Config{}, nil, "", nil, false, err
	}
	return config, db, dir, logger, false, nil
}
SetupSimulation creates the config, db (levelDB), temporary directory and logger for
the simulation tests. If `FlagEnabledValue` is false it skips the current test.
Returns error on an invalid db instantiation or temp dir creation.
package simapp
import (
	"encoding/json"
	"fmt"
	. "github.com/smartystreets/goconvey/convey"
	tmkv "github.com/tendermint/tendermint/libs/kv"
	"github.com/tendermint/tendermint/libs/log"
	dbm "github.com/tendermint/tm-db"
	"io/ioutil"
	"os"
	"testing"
	"github.com/KuChainNetwork/kuchain/test/simulation"
	"github.com/cosmos/cosmos-sdk/codec"
	"github.com/cosmos/cosmos-sdk/simapp/helpers"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/cosmos/cosmos-sdk/types/module"
)