move to sha-256 fingerprints
This commit is contained in:
parent
8674816d27
commit
91e1077daa
4 changed files with 39 additions and 65 deletions
|
|
@ -15,7 +15,6 @@ const wallet = require('./wallet')
|
|||
const exchange = require('./exchange')
|
||||
const sms = require('./sms')
|
||||
const email = require('./email')
|
||||
const settingsLoader = require('./settings-loader')
|
||||
|
||||
const mapValuesWithKey = _.mapValues.convert({cap: false})
|
||||
|
||||
|
|
@ -510,56 +509,6 @@ function plugins (settings, deviceId) {
|
|||
.catch(err => logger.error(err))
|
||||
}
|
||||
|
||||
function updateCassettes (tx) {
|
||||
// Note: This is the only place we update config from outside admin,
|
||||
// so should be safe even though it's not an atomic operation.
|
||||
//
|
||||
// However, we should make all config changes atomic in the future.
|
||||
const config = configManager.machineScoped(deviceId, settings.config)
|
||||
const topCashOutDenomination = config.topCashOutDenomination -
|
||||
(tx.bills[0].dispensed + tx.bills[0].rejected)
|
||||
const bottomCashOutDenomination = config.bottomCashOutDenomination -
|
||||
(tx.bills[1].dispensed + tx.bills[1].rejected)
|
||||
|
||||
const newFields = [
|
||||
{
|
||||
fieldLocator: {
|
||||
fieldScope: {
|
||||
crypto: 'global',
|
||||
machine: deviceId
|
||||
},
|
||||
code: 'topCashOutDenomination',
|
||||
fieldType: 'integer',
|
||||
fieldClass: null
|
||||
},
|
||||
fieldValue: {
|
||||
fieldType: 'integer',
|
||||
value: topCashOutDenomination
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldLocator: {
|
||||
fieldScope: {
|
||||
crypto: 'global',
|
||||
machine: deviceId
|
||||
},
|
||||
code: 'bottomCashOutDenomination',
|
||||
fieldType: 'integer',
|
||||
fieldClass: null
|
||||
},
|
||||
fieldValue: {
|
||||
fieldType: 'integer',
|
||||
value: bottomCashOutDenomination
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
return settingsLoader.loadLatest()
|
||||
.then(settings => {
|
||||
return settingsLoader.save({config: settingsLoader.mergeValues(settings.config, newFields)})
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
pollQueries,
|
||||
sendCoins,
|
||||
|
|
@ -576,7 +525,6 @@ function plugins (settings, deviceId) {
|
|||
sendMessage,
|
||||
checkBalances,
|
||||
buildCassettes,
|
||||
updateCassettes,
|
||||
buy,
|
||||
sell
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue