Skip to content

Commit

Permalink
Merge pull request cosmos#259 from celestiaorg/adlerjohn/default-db-enum
Browse files Browse the repository at this point in the history
Use enum instead of strings for DB type
  • Loading branch information
adlerjohn authored Jan 26, 2022
2 parents 5bdc6d3 + 283c59f commit 2d7db8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ func createAndStartIndexerService(

func DefaultDBProvider(ctx *DBContext) (dbm.DB, error) {
if ctx.Config.RootDir == "" && ctx.Config.DBPath == "" { // this is used for testing
dbType := dbm.BackendType("memdb")
dbType := dbm.MemDBBackend
return dbm.NewDB(ctx.ID, dbType, "memdb")
}
dbType := dbm.BackendType("badgerdb")
dbType := dbm.BadgerDBBackend
return dbm.NewDB(ctx.ID, dbType, ctx.Config.RootDir+ctx.Config.DBPath+"index")
}

0 comments on commit 2d7db8b

Please sign in to comment.