Merge pull request #1431 from josepfo/fix/mock-scoring-flag

Fix: mock scoring flag
This commit is contained in:
Rafael Taranto 2022-11-10 13:31:43 +01:00 committed by GitHub
commit d0b57cfded
7 changed files with 80 additions and 38 deletions

View file

@ -179,16 +179,20 @@ function doesTxReuseAddress (tx) {
}
function getWalletScore (tx, pi) {
if (!tx.fiat || tx.fiat.isZero()) {
return pi.rateWallet(tx.cryptoCode, tx.toAddress)
}
// Passthrough the previous result
return pi.isValidWalletScore(tx.walletScore)
.then(isValid => ({
address: tx.toAddress,
score: tx.walletScore,
isValid
}))
pi.isWalletScoringEnabled(tx)
.then(isEnabled => {
if(!isEnabled) return null
if (!tx.fiat || tx.fiat.isZero()) {
return pi.rateWallet(tx.cryptoCode, tx.toAddress)
}
// Passthrough the previous result
return pi.isValidWalletScore(tx.walletScore)
.then(isValid => ({
address: tx.toAddress,
score: tx.walletScore,
isValid
}))
})
}
function monitorPending (settings) {