Skip to content

Commit

Permalink
use badgerdb on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
dreacot committed Oct 24, 2024
1 parent 7ddc8df commit 489721e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libwallet/assets_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const LogFilename = "cryptopower.log"
// assetIdentifier use for listen balance of all wallet changed
const assetIdentifier = "assets_manager"

const BoltDB = "bdb" // Bolt db driver
const BadgerDB = "badgerdb" // Badger db driver

// Assets is a struct that holds all the assets supported by the wallet.
type Assets struct {
DCR struct {
Expand Down Expand Up @@ -139,7 +142,10 @@ func NewAssetsManager(rootDir, logDir string, netType utils.NetworkType, dexTest
}

// validate the network type before proceeding to initialize the othe fields.
dbDriver := "bdb" // TODO: Should be a constant.
dbDriver := BOLT_DB

Check failure on line 145 in libwallet/assets_manager.go

View workflow job for this annotation

GitHub Actions / Build

undefined: BOLT_DB

Check failure on line 145 in libwallet/assets_manager.go

View workflow job for this annotation

GitHub Actions / Build

undefined: BOLT_DB
if appos.Current().IsMobile() {
dbDriver = BADGER_DB

Check failure on line 147 in libwallet/assets_manager.go

View workflow job for this annotation

GitHub Actions / Build

undefined: BADGER_DB (typecheck)

Check failure on line 147 in libwallet/assets_manager.go

View workflow job for this annotation

GitHub Actions / Build

undefined: BADGER_DB) (typecheck)
}
mgr, err := initializeAssetsFields(rootDir, dbDriver, logDir, netType, dexTestAddr)
if err != nil {
return nil, err
Expand Down

0 comments on commit 489721e

Please sign in to comment.