lamassu-server/migrations/1645010873828-add-advanced-wallet-settings.js
2022-02-17 01:40:02 +00:00

22 lines
596 B
JavaScript

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()
}