feat: add cryptoAtoms positive value sanity check

This commit is contained in:
Sérgio Salgado 2022-02-28 18:49:57 +00:00
parent 4339e58e6a
commit 2df54411c3

View file

@ -193,7 +193,9 @@ function getStatus (settings, tx, machineId) {
? 'published' ? 'published'
: 'rejected' : 'rejected'
const status = isAuthorized ? 'authorized' : unauthorizedStatus // Sanity check to confirm if there's any cryptoatoms for which to dispense bills
const authorizedStatus = isAuthorized ? 'authorized' : unauthorizedStatus
const status = BN(tx.cryptoAtoms).gt(0) ? authorizedStatus : 'rejected'
return { receivedCryptoAtoms: statusRec.receivedCryptoAtoms, status } return { receivedCryptoAtoms: statusRec.receivedCryptoAtoms, status }
}) })