Merge pull request #1113 from josepfo/fix/fee-priority-selector-up-to-spec

feat: advanced wallet settings up to spec
This commit is contained in:
Rafael Taranto 2022-02-18 16:59:53 +00:00 committed by GitHub
commit 6f0c735be8
11 changed files with 263 additions and 153 deletions

View file

@ -1,21 +0,0 @@
const _ = require('lodash/fp')
const { migrationSaveConfig, loadLatest } = require('../lib/new-settings-loader')
const { getCryptosFromWalletNamespace } = require('../lib/new-config-manager')
exports.up = function (next) {
const newConfig = {}
return loadLatest()
.then(config => {
const coins = getCryptosFromWalletNamespace(config)
_.map(coin => { newConfig[`wallets_${coin}_feeMultiplier`] = '1' }, coins)
return migrationSaveConfig(newConfig)
})
.then(next)
.catch(err => {
return next(err)
})
}
module.exports.down = function (next) {
next()
}

View file

@ -0,0 +1,22 @@
const uuid = require('uuid')
const { saveConfig, loadLatest } = require('../lib/new-settings-loader')
exports.up = function (next) {
const newConfig = {}
return loadLatest()
.then(config => {
newConfig[`wallets_advanced_feeMultiplier`] = '1'
newConfig[`wallets_advanced_cryptoUnits`] = 'full'
newConfig[`wallets_advanced_allowTransactionBatching`] = false
newConfig[`wallets_advanced_id`] = uuid.v4()
return saveConfig(newConfig)
})
.then(next)
.catch(err => {
return next(err)
})
}
module.exports.down = function (next) {
next()
}