From b28c99aabb08728d2fbdcd7646a19c211c3debdb Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Sat, 20 May 2017 16:03:04 +0300 Subject: [PATCH] fix lamassu-cancel --- lib/cash-out-tx.js | 4 +-- migrations/034-add_cash_out_error_code.js | 8 ++++++ public/elm.js | 30 +++++++++++++++-------- 3 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 migrations/034-add_cash_out_error_code.js diff --git a/lib/cash-out-tx.js b/lib/cash-out-tx.js index 904e9d3b..7698a4fb 100644 --- a/lib/cash-out-tx.js +++ b/lib/cash-out-tx.js @@ -215,8 +215,6 @@ function preProcess (oldTx, newTx, pi) { return Promise.resolve(updateStatus(oldTx, newTx)) .then(updatedTx => { - if (!oldTx) return updatedTx - if (updatedTx.status !== oldTx.status) { const isZeroConf = pi.isZeroConf(updatedTx) if (wasJustAuthorized(oldTx, updatedTx, isZeroConf)) pi.sell(updatedTx) @@ -351,8 +349,8 @@ function monitorUnnotified (settings) { function cancel (txId) { const updateRec = { - 'dispense_time': 'now()^', error: 'Operator cancel', + error_code: 'operatorCancel', dispense: true } diff --git a/migrations/034-add_cash_out_error_code.js b/migrations/034-add_cash_out_error_code.js new file mode 100644 index 00000000..939238c6 --- /dev/null +++ b/migrations/034-add_cash_out_error_code.js @@ -0,0 +1,8 @@ + +exports.up = function(next){ + next(); +}; + +exports.down = function(next){ + next(); +}; diff --git a/public/elm.js b/public/elm.js index d89c4328..e0108007 100644 --- a/public/elm.js +++ b/public/elm.js @@ -30492,8 +30492,8 @@ var _user$project$Config$updateSelectize = F3( return _elm_lang$core$Native_Utils.crashCase( 'Config', { - start: {line: 1329, column: 17}, - end: {line: 1334, column: 56} + start: {line: 1330, column: 17}, + end: {line: 1335, column: 56} }, _p4)('Shouldn\'t be here'); } @@ -30668,8 +30668,8 @@ var _user$project$Config$isField = function (fieldValue) { return _elm_lang$core$Native_Utils.crashCase( 'Config', { - start: {line: 1025, column: 5}, - end: {line: 1030, column: 59} + start: {line: 1026, column: 5}, + end: {line: 1031, column: 59} }, _p12)('Referenced field must be boolean'); } @@ -30888,18 +30888,28 @@ var _user$project$Config$checkEnabled = F3( var outGroup = _p17._1; var enabledInstances = A2( _elm_lang$core$Basics_ops['++'], - A3(_user$project$Config$referenceFields, fieldScope, configGroup.values, outGroup), - A4(_user$project$Config$referenceFieldInstances, configGroup, fieldScope, fieldInstances, inGroup)); - var _p18 = _elm_lang$core$Native_Utils.eq(fieldInstance.fieldLocator.code, 'cashOutTransactionLimit') ? A2( + A3( + _user$project$Config$referenceFields, + fieldScope, + A2(_elm_lang$core$Debug$log, 'DEBUG104', configGroup.values), + A2(_elm_lang$core$Debug$log, 'DEBUG101', outGroup)), + A4( + _user$project$Config$referenceFieldInstances, + configGroup, + fieldScope, + fieldInstances, + A2(_elm_lang$core$Debug$log, 'DEBUG102', outGroup))); + var _p18 = _elm_lang$core$Native_Utils.eq(fieldInstance.fieldLocator.code, 'cashOutCommission') ? A2( _elm_lang$core$Basics$always, {ctor: '_Tuple0'}, A2( _elm_lang$core$Debug$log, 'DEBUG100', { - ctor: '_Tuple2', - _0: A3(_user$project$Config$referenceFields, fieldScope, configGroup.values, outGroup), - _1: A4(_user$project$Config$referenceFieldInstances, configGroup, fieldScope, fieldInstances, inGroup) + ctor: '_Tuple3', + _0: fieldInstance.fieldLocator, + _1: A3(_user$project$Config$referenceFields, fieldScope, configGroup.values, outGroup), + _2: A4(_user$project$Config$referenceFieldInstances, configGroup, fieldScope, fieldInstances, inGroup) })) : {ctor: '_Tuple0'}; return A2(_elm_lang$core$List$any, _user$project$Config$isField, enabledInstances); }