move to sha-256 fingerprints

This commit is contained in:
Josh Harvey 2017-04-24 14:08:12 +03:00
parent 8674816d27
commit 91e1077daa
4 changed files with 39 additions and 65 deletions

View file

@ -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
}