diff --git a/lib/cash-in/cash-in-tx.js b/lib/cash-in/cash-in-tx.js index 85c4b619..6e3c0ae2 100644 --- a/lib/cash-in/cash-in-tx.js +++ b/lib/cash-in/cash-in-tx.js @@ -113,7 +113,8 @@ function postProcess (r, pi, isBlacklisted, addressReuse, walletScore) { return Promise.resolve({ walletScore: walletScore.score, operatorCompleted: true, - error: 'Ciphertrace score is above defined threshold' + error: 'Ciphertrace score is above defined threshold', + errorCode: 'scoreThresholdReached' }) } diff --git a/lib/cash-out/cash-out-tx.js b/lib/cash-out/cash-out-tx.js index 0835ffb8..b36135db 100644 --- a/lib/cash-out/cash-out-tx.js +++ b/lib/cash-out/cash-out-tx.js @@ -138,7 +138,7 @@ function getWalletScore (tx, pi) { ? _.assign(tx, { walletScore: highestScore.score }) : _.assign(tx, { walletScore: highestScore.score, - error: 'Address score is above defined threshold', + error: 'Ciphertrace score is above defined threshold', errorCode: 'scoreThresholdReached', dispense: true }) diff --git a/new-lamassu-admin/src/pages/Transactions/DetailsCard.js b/new-lamassu-admin/src/pages/Transactions/DetailsCard.js index 83a7734a..392ccdb0 100644 --- a/new-lamassu-admin/src/pages/Transactions/DetailsCard.js +++ b/new-lamassu-admin/src/pages/Transactions/DetailsCard.js @@ -169,6 +169,10 @@ const DetailsRow = ({ it: tx, timezone }) => { FileSaver.saveAs(content, zipFilename) } + const hasCiphertraceError = tx => + !R.isNil(tx.errorCode) && + R.includes(tx.errorCode, ['scoreThresholdReached', 'ciphertraceError']) + const errorElements = ( <> @@ -187,10 +191,10 @@ const DetailsRow = ({ it: tx, timezone }) => { r={3.5} fill={ it < tx.walletScore - ? R.isNil(tx.hasError) + ? !hasCiphertraceError(tx) ? primaryColor : errorColor - : R.isNil(tx.hasError) + : !hasCiphertraceError(tx) ? subheaderColor : offErrorColor } @@ -203,7 +207,7 @@ const DetailsRow = ({ it: tx, timezone }) => { noMargin className={classNames({ [classes.bold]: true, - [classes.error]: !R.isNil(tx.hasError) + [classes.error]: hasCiphertraceError(tx) })}> {tx.walletScore}

diff --git a/new-lamassu-admin/src/pages/Transactions/Transactions.js b/new-lamassu-admin/src/pages/Transactions/Transactions.js index 7a8758da..54a95f27 100644 --- a/new-lamassu-admin/src/pages/Transactions/Transactions.js +++ b/new-lamassu-admin/src/pages/Transactions/Transactions.js @@ -101,6 +101,7 @@ const GET_TRANSACTIONS = gql` sendConfirmed dispense hasError: error + errorCode deviceId fiat cashInFee