lamassu-server/migrations/1661125970289-eth-zero-conf-value.js
2022-08-22 00:58:51 +01:00

22 lines
539 B
JavaScript

const _ = require('lodash/fp')
const { saveConfig, loadLatest } = require('../lib/new-settings-loader')
exports.up = function (next) {
const newConfig = {}
return loadLatest()
.then(config => {
if (!_.isNil(config.config.wallets_ETH_zeroConfLimit) && config.config.wallets_ETH_zeroConfLimit !== 0) {
newConfig[`wallets_ETH_zeroConfLimit`] = 0
return saveConfig(newConfig)
}
})
.then(next)
.catch(err => {
return next(err)
})
}
module.exports.down = function (next) {
next()
}