Merge PR #119: Upgrade go to 1.13 & Latest SDK Master
This commit is contained in:
committed by
GitHub
parent
d624ca1980
commit
6fa5988730
35
app/utils.go
35
app/utils.go
@@ -2,38 +2,29 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
bam "github.com/cosmos/cosmos-sdk/baseapp"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||
)
|
||||
|
||||
var (
|
||||
genesisFile string
|
||||
paramsFile string
|
||||
exportParamsPath string
|
||||
exportParamsHeight int
|
||||
exportStatePath string
|
||||
exportStatsPath string
|
||||
seed int64
|
||||
initialBlockHeight int
|
||||
numBlocks int
|
||||
blockSize int
|
||||
enabled bool
|
||||
verbose bool
|
||||
lean bool
|
||||
commit bool
|
||||
period int
|
||||
onOperation bool // TODO Remove in favor of binary search for invariant violation
|
||||
allInvariants bool
|
||||
genesisTime int64
|
||||
)
|
||||
// ExportStateToJSON util function to export the app state to JSON
|
||||
func ExportStateToJSON(app *GaiaApp, path string) error {
|
||||
fmt.Println("exporting app state...")
|
||||
appState, _, err := app.ExportAppStateAndValidators(false, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// DONTCOVER
|
||||
return ioutil.WriteFile(path, []byte(appState), 0644)
|
||||
}
|
||||
|
||||
// NewGaiaAppUNSAFE is used for debugging purposes only.
|
||||
//
|
||||
@@ -43,5 +34,5 @@ func NewGaiaAppUNSAFE(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLa
|
||||
) (gapp *GaiaApp, keyMain, keyStaking *sdk.KVStoreKey, stakingKeeper staking.Keeper) {
|
||||
|
||||
gapp = NewGaiaApp(logger, db, traceStore, loadLatest, invCheckPeriod, baseAppOptions...)
|
||||
return gapp, gapp.keys[baseapp.MainStoreKey], gapp.keys[staking.StoreKey], gapp.stakingKeeper
|
||||
return gapp, gapp.keys[bam.MainStoreKey], gapp.keys[staking.StoreKey], gapp.stakingKeeper
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user