From e8c9da46b6844f244ed78b86b3200a4fed0630e1 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Thu, 19 Mar 2015 16:10:57 -0400 Subject: [PATCH 1/3] fix tests --- test/mocks/db.js | 6 +++++- test/mocks/info.js | 3 ++- test/mocks/wallet.js | 2 -- test/plugins.js | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/mocks/db.js b/test/mocks/db.js index dfbd2eeb..66ca37e7 100644 --- a/test/mocks/db.js +++ b/test/mocks/db.js @@ -29,7 +29,11 @@ module.exports = { completeTransaction: function(tx, txHash) { calls.status = true; }, - recordBill: function(fingerprint, trade) { } + recordBill: function(fingerprint, trade) { }, + addOutgoingTx: function(session, tx, cb) { + cb(null, {satoshis: tx.satoshis}); + }, + sentCoins: function() {} }; diff --git a/test/mocks/info.js b/test/mocks/info.js index 9aeb14b4..ba96e4cb 100644 --- a/test/mocks/info.js +++ b/test/mocks/info.js @@ -6,5 +6,6 @@ module.exports = { config: function config() {}, getAddressLastTx: function verifyUser() {}, - getTx: function verifyTransaction() {} + getTx: function verifyTransaction() {}, + checkAddress: function checkAddress() {} }; diff --git a/test/mocks/wallet.js b/test/mocks/wallet.js index 28882ca5..ed73e2ae 100644 --- a/test/mocks/wallet.js +++ b/test/mocks/wallet.js @@ -42,5 +42,3 @@ module.exports.getBalanceCalls = function() { module.exports.wasSendCalled = function() { return calls.send; }; - - diff --git a/test/plugins.js b/test/plugins.js index c1761e89..bf8aeaa4 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -209,7 +209,7 @@ describe('Plugins', function() { /* jshint expr: true */ response.should.be.an.Object; response.should.have.property('statusCode'); - response.statusCode.should.equal(204); + response.statusCode.should.equal(201); /* jshint expr: false */ done(); From 5bc47bccc707c3b3c813cc0cdcfe6e5fa75df985 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Thu, 19 Mar 2015 16:22:44 -0400 Subject: [PATCH 2/3] add poll request logging back in --- lib/routes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/routes.js b/lib/routes.js index 851059dd..c2f1958f 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -21,6 +21,8 @@ function poll(req, res) { var rateRec = plugins.getDeviceRate(); var balanceRec = plugins.getBalance(); + logger.debug('poll request from: %s', getFingerprint(req)); + // `rateRec` and `balanceRec` are both objects, so there's no danger // of misinterpreting rate or balance === 0 as 'Server initializing'. if (!rateRec || !balanceRec) { From 815f46c6ab40daaaffd086d6139ef5453631635f Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Thu, 19 Mar 2015 16:22:53 -0400 Subject: [PATCH 3/3] 2.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 02be41c4..981defa0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lamassu-server", "description": "bitcoin atm client server protocol module", "keywords": [], - "version": "2.2.3", + "version": "2.2.4", "license": "unlicense", "author": "Lamassu (https://lamassu.is)", "engines": {