Skip to content

Commit

Permalink
user badgerdb on mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
dreacot committed Oct 24, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
commjoen Jeroen Willemsen
1 parent 7ddc8df commit c26512f
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
@@ -38,6 +38,9 @@ const LogFilename = "cryptopower.log"
// assetIdentifier use for listen balance of all wallet changed
const assetIdentifier = "assets_manager"

const BOLT_DB = "bdb" // Bolt db driver

Check failure on line 41 in libwallet/assets_manager.go

GitHub Actions / Build

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)

Check warning on line 41 in libwallet/assets_manager.go

GitHub Actions / Build

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)
const BADGER_DB = "badgerdb" // Badger db driver

Check failure on line 42 in libwallet/assets_manager.go

GitHub Actions / Build

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)

Check warning on line 42 in libwallet/assets_manager.go

GitHub Actions / Build

var-naming: don't use ALL_CAPS in Go names; use CamelCase (revive)

// Assets is a struct that holds all the assets supported by the wallet.
type Assets struct {
DCR struct {
@@ -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
if appos.Current().IsMobile() {
dbDriver = BADGER_DB
}
mgr, err := initializeAssetsFields(rootDir, dbDriver, logDir, netType, dexTestAddr)
if err != nil {
return nil, err

0 comments on commit c26512f

Please sign in to comment.