refactor: use loadLatestConfig() in place of loadLatest() where applicable

This commit is contained in:
siiky 2024-09-17 15:38:35 +01:00
parent 5342e9a8be
commit cac88fda45
15 changed files with 52 additions and 56 deletions

View file

@ -1,16 +1,14 @@
const uuid = require('uuid')
const { saveConfig, loadLatest } = require('../lib/new-settings-loader')
const { saveConfig } = 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)
})
const newConfig = {
wallets_advanced_feeMultiplier: '1',
wallets_advanced_cryptoUnits: 'full',
wallets_advanced_allowTransactionBatching: false,
wallets_advanced_id: uuid.v4(),
}
return saveConfig(newConfig)
.then(next)
.catch(err => {
return next(err)