26 lines
648 B
JavaScript
26 lines
648 B
JavaScript
const { loadConfig, removeFromConfig } = require('./settings')
|
|
const {
|
|
getCryptosFromWalletNamespace,
|
|
} = require('../lib/new-config-manager.js')
|
|
const _ = require('lodash/fp')
|
|
|
|
exports.up = function (next) {
|
|
loadConfig()
|
|
.then(config => {
|
|
const configuredCryptos = getCryptosFromWalletNamespace(config)
|
|
if (!configuredCryptos.length) return Promise.resolve()
|
|
|
|
return removeFromConfig(
|
|
_.map(it => `wallets_${it}_cryptoUnits`, configuredCryptos),
|
|
)
|
|
})
|
|
.then(() => next())
|
|
.catch(err => {
|
|
console.log(err.message)
|
|
return next(err)
|
|
})
|
|
}
|
|
|
|
exports.down = function (next) {
|
|
next()
|
|
}
|