From 57c029a8214c49fd2637ea0dd05e0d6849c526b0 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Mon, 22 Oct 2018 16:29:24 -0300 Subject: [PATCH] Change size of operatorId (#190) Server was expecting 32 characters and the code was generating 64. --- lib/coinatmradar/coinatmradar.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/coinatmradar/coinatmradar.js b/lib/coinatmradar/coinatmradar.js index 7474ae7f..fa023029 100644 --- a/lib/coinatmradar/coinatmradar.js +++ b/lib/coinatmradar/coinatmradar.js @@ -16,21 +16,19 @@ const MAX_CONTENT_LENGTH = 2000 // How long a machine can be down before it's considered offline const STALE_INTERVAL = '2 minutes' -module.exports = {update, mapRecord} +module.exports = { update, mapRecord } function mapCoin (info, deviceId, cryptoCode) { const config = info.config - const rates = info.rates[cryptoCode] || {cashIn: null, cashOut: null} + const rates = info.rates[cryptoCode] || { cashIn: null, cashOut: null } const cryptoConfig = configManager.scoped(cryptoCode, deviceId, config) const unscoped = configManager.unscoped(config) const showRates = unscoped.coinAtmRadarShowRates const cashInFee = showRates ? cryptoConfig.cashInCommission / 100 : null const cashOutFee = showRates ? cryptoConfig.cashOutCommission / 100 : null - const cashInRate = showRates ? _.invoke('cashIn.toNumber', rates) : null + const cashInRate = showRates ? _.invoke('cashIn.toNumber', rates) : null const cashOutRate = showRates ? _.invoke('cashOut.toNumber', rates) : null - - return { cryptoCode, @@ -155,5 +153,5 @@ function update (info) { } function computeOperatorId (masterSeed) { - return hkdf(masterSeed, 32, {salt: 'lamassu-server-salt', info: 'operator-id'}).toString('hex') + return hkdf(masterSeed, 16, { salt: 'lamassu-server-salt', info: 'operator-id' }).toString('hex') }