Merge PR #3792: Use DBBackend set at compile time
* use DBBackend set at compile time Closes: #3719 * Refresh changelog * Tweak Makefile
This commit is contained in:
committed by
Christopher Goes
parent
c7f6a3e8c6
commit
3e82a8bbb8
@@ -305,7 +305,7 @@ func BenchmarkFullGaiaSimulation(b *testing.B) {
|
||||
|
||||
var db dbm.DB
|
||||
dir, _ := ioutil.TempDir("", "goleveldb-gaia-sim")
|
||||
db, _ = dbm.NewGoLevelDB("Simulation", dir)
|
||||
db, _ = sdk.NewLevelDB("Simulation", dir)
|
||||
defer func() {
|
||||
db.Close()
|
||||
os.RemoveAll(dir)
|
||||
@@ -347,7 +347,7 @@ func TestFullGaiaSimulation(t *testing.T) {
|
||||
}
|
||||
var db dbm.DB
|
||||
dir, _ := ioutil.TempDir("", "goleveldb-gaia-sim")
|
||||
db, _ = dbm.NewGoLevelDB("Simulation", dir)
|
||||
db, _ = sdk.NewLevelDB("Simulation", dir)
|
||||
defer func() {
|
||||
db.Close()
|
||||
os.RemoveAll(dir)
|
||||
@@ -388,7 +388,7 @@ func TestGaiaImportExport(t *testing.T) {
|
||||
}
|
||||
var db dbm.DB
|
||||
dir, _ := ioutil.TempDir("", "goleveldb-gaia-sim")
|
||||
db, _ = dbm.NewGoLevelDB("Simulation", dir)
|
||||
db, _ = sdk.NewLevelDB("Simulation", dir)
|
||||
defer func() {
|
||||
db.Close()
|
||||
os.RemoveAll(dir)
|
||||
@@ -421,7 +421,7 @@ func TestGaiaImportExport(t *testing.T) {
|
||||
fmt.Printf("Importing genesis...\n")
|
||||
|
||||
newDir, _ := ioutil.TempDir("", "goleveldb-gaia-sim-2")
|
||||
newDB, _ := dbm.NewGoLevelDB("Simulation-2", dir)
|
||||
newDB, _ := sdk.NewLevelDB("Simulation-2", dir)
|
||||
defer func() {
|
||||
newDB.Close()
|
||||
os.RemoveAll(newDir)
|
||||
@@ -483,7 +483,7 @@ func TestGaiaSimulationAfterImport(t *testing.T) {
|
||||
logger = log.NewNopLogger()
|
||||
}
|
||||
dir, _ := ioutil.TempDir("", "goleveldb-gaia-sim")
|
||||
db, _ := dbm.NewGoLevelDB("Simulation", dir)
|
||||
db, _ := sdk.NewLevelDB("Simulation", dir)
|
||||
defer func() {
|
||||
db.Close()
|
||||
os.RemoveAll(dir)
|
||||
@@ -525,7 +525,7 @@ func TestGaiaSimulationAfterImport(t *testing.T) {
|
||||
fmt.Printf("Importing genesis...\n")
|
||||
|
||||
newDir, _ := ioutil.TempDir("", "goleveldb-gaia-sim-2")
|
||||
newDB, _ := dbm.NewGoLevelDB("Simulation-2", dir)
|
||||
newDB, _ := sdk.NewLevelDB("Simulation-2", dir)
|
||||
defer func() {
|
||||
newDB.Close()
|
||||
os.RemoveAll(newDir)
|
||||
|
||||
@@ -45,7 +45,7 @@ func runHackCmd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
// load the app
|
||||
logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
db, err := dbm.NewGoLevelDB("gaia", dataDir)
|
||||
db, err := sdk.NewLevelDB("gaia", dataDir)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
bcm "github.com/tendermint/tendermint/blockchain"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
dbm "github.com/tendermint/tendermint/libs/db"
|
||||
"github.com/tendermint/tendermint/proxy"
|
||||
tmsm "github.com/tendermint/tendermint/state"
|
||||
tm "github.com/tendermint/tendermint/types"
|
||||
@@ -23,6 +22,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/cmd/gaia/app"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -72,7 +72,7 @@ func run(rootDir string) {
|
||||
// App DB
|
||||
// appDB := dbm.NewMemDB()
|
||||
fmt.Println("Opening app database")
|
||||
appDB, err := dbm.NewGoLevelDB("application", dataDir)
|
||||
appDB, err := sdk.NewLevelDB("application", dataDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -80,14 +80,14 @@ func run(rootDir string) {
|
||||
// TM DB
|
||||
// tmDB := dbm.NewMemDB()
|
||||
fmt.Println("Opening tendermint state database")
|
||||
tmDB, err := dbm.NewGoLevelDB("state", dataDir)
|
||||
tmDB, err := sdk.NewLevelDB("state", dataDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Blockchain DB
|
||||
fmt.Println("Opening blockstore database")
|
||||
bcDB, err := dbm.NewGoLevelDB("blockstore", dataDir)
|
||||
bcDB, err := sdk.NewLevelDB("blockstore", dataDir)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user