fix: remove unreachable fallback value for score threshold

This commit is contained in:
Sérgio Salgado 2022-01-24 22:24:24 +00:00
parent 01f85c82f9
commit 09d594461e

View file

@ -1,8 +1,6 @@
const axios = require('axios')
const _ = require('lodash/fp')
const { WALLET_SCORE_THRESHOLD } = require('../../../constants')
const NAME = 'CipherTrace'
const SUPPORTED_COINS = ['BTC', 'ETH', 'BCH', 'LTC', 'BNB', 'RSK']
@ -26,7 +24,7 @@ function rateWallet(account, cryptoCode, address) {
if (!_.includes(_.toUpper(cryptoCode), SUPPORTED_COINS) || _.isNil(client)) return Promise.resolve(null)
const { apiVersion, authHeader } = client
const threshold = _.isNil(account) ? WALLET_SCORE_THRESHOLD : account.scoreThreshold
const threshold = account.scoreThreshold
return axios.get(`https://rest.ciphertrace.com/aml/${apiVersion}/${_.toLower(cryptoCode)}/risk?address=${address}`, {
headers: authHeader
@ -38,7 +36,7 @@ function isValidWalletScore(account, score) {
const client = getClient(account)
if (_.isNil(client)) return Promise.resolve(true)
const threshold = _.isNil(account) ? WALLET_SCORE_THRESHOLD : account.scoreThreshold
const threshold = account.scoreThreshold
return Promise.resolve(score < threshold)
}