Merge pull request #1781 from RafaelTaranto/fix/increasing-discount-safeguard

LAM-1281 fix: increasing discount safeguard
This commit is contained in:
Rafael Taranto 2025-01-10 11:42:40 +00:00 committed by GitHub
commit e4c4dae293

View file

@ -102,8 +102,8 @@ function diff (oldTx, newTx) {
} }
function ensureRatchet (oldField, newField, fieldKey) { function ensureRatchet (oldField, newField, fieldKey) {
const monotonic = ['cryptoAtoms', 'fiat', 'send', 'sendConfirmed', 'operatorCompleted', 'timedout', 'txVersion', 'batched'] const monotonic = ['cryptoAtoms', 'fiat', 'send', 'sendConfirmed', 'operatorCompleted', 'timedout', 'txVersion', 'batched', 'discount']
const free = ['sendPending', 'error', 'errorCode', 'customerId'] const free = ['sendPending', 'error', 'errorCode', 'customerId', 'discountSource']
if (_.isNil(oldField)) return true if (_.isNil(oldField)) return true
if (_.includes(fieldKey, monotonic)) return isMonotonic(oldField, newField, fieldKey) if (_.includes(fieldKey, monotonic)) return isMonotonic(oldField, newField, fieldKey)