fix: remove unreachable fallback value for score threshold
This commit is contained in:
parent
01f85c82f9
commit
09d594461e
1 changed files with 2 additions and 4 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
const axios = require('axios')
|
const axios = require('axios')
|
||||||
const _ = require('lodash/fp')
|
const _ = require('lodash/fp')
|
||||||
|
|
||||||
const { WALLET_SCORE_THRESHOLD } = require('../../../constants')
|
|
||||||
|
|
||||||
const NAME = 'CipherTrace'
|
const NAME = 'CipherTrace'
|
||||||
const SUPPORTED_COINS = ['BTC', 'ETH', 'BCH', 'LTC', 'BNB', 'RSK']
|
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)
|
if (!_.includes(_.toUpper(cryptoCode), SUPPORTED_COINS) || _.isNil(client)) return Promise.resolve(null)
|
||||||
|
|
||||||
const { apiVersion, authHeader } = client
|
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}`, {
|
return axios.get(`https://rest.ciphertrace.com/aml/${apiVersion}/${_.toLower(cryptoCode)}/risk?address=${address}`, {
|
||||||
headers: authHeader
|
headers: authHeader
|
||||||
|
|
@ -38,7 +36,7 @@ function isValidWalletScore(account, score) {
|
||||||
const client = getClient(account)
|
const client = getClient(account)
|
||||||
if (_.isNil(client)) return Promise.resolve(true)
|
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)
|
return Promise.resolve(score < threshold)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue