From e4d7f3ee7b4ccf6ccebeacb5a10cce59133d3a6e Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 2 Nov 2017 07:50:22 -0300 Subject: [PATCH 1/2] adds JSHint --- .jshintrc | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..844dac3 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,44 @@ +{ + "bitwise": true, + "camelcase": true, + "curly": true, + "devel": false, + "eqeqeq": true, + "eqnull": false, + "freeze": true, + "funcscope": false, + "immed": true, + "indent": 2, + "latedef": "nofunc", + "maxcomplexity": 10, + "maxdepth": 4, + "maxerr": 99999, + "maxlen": 120, + "maxparams": 4, + "maxstatements": 15, + "mocha": true, + "newcap": true, + "noarg": true, + "node": true, + "noempty": true, + "nonew": true, + "quotmark": "single", + "regexp": true, + "smarttabs": false, + "strict": true, + "trailing": true, + "undef": true, + "unused": true, + "predef": [ + "after", + "afterEach", + "before", + "beforeEach", + "describe", + "exports", + "it", + "xit", + "module", + "require" + ] +} From 0d839a1c74676b5a990d789c284beadc20a1d921 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Thu, 2 Nov 2017 07:54:30 -0300 Subject: [PATCH 2/2] adds new DB index --- lib/storage.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/storage.js b/lib/storage.js index cc0bcaf..94fe4a2 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -40,6 +40,9 @@ Storage.prototype._createIndexes = function() { this.db.collection(collections.COPAYERS_LOOKUP).createIndex({ copayerId: 1 }); + this.db.collection(collections.COPAYERS_LOOKUP).createIndex({ + walletId: 1 + }); this.db.collection(collections.TXS).createIndex({ walletId: 1, id: 1, @@ -53,6 +56,9 @@ Storage.prototype._createIndexes = function() { walletId: 1, createdOn: -1, }); + this.db.collection(collections.TXS).createIndex({ + txid: 1 + }); this.db.collection(collections.NOTIFICATIONS).createIndex({ walletId: 1, id: 1, @@ -79,6 +85,14 @@ Storage.prototype._createIndexes = function() { walletId: 1, txid: 1, }); + this.db.collection(collections.PREFERENCES).createIndex({ + walletId: 1 + }); + this.db.collection(collections.FIAT_RATES).createIndex({ + provider: 1, + code: 1, + ts: 1 + }); this.db.collection(collections.PUSH_NOTIFICATION_SUBS).createIndex({ copayerId: 1, });