diff --git a/.vscode/launch.json b/.vscode/launch.json index fd6e3809..c9759230 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "name": "Launch Program", "program": "${workspaceRoot}/bin/lamassu-server", "cwd": "${workspaceRoot}", - "args": ["--mockSms"] + "args": [""] }, { "type": "node", diff --git a/INSTALL-NIX.md b/INSTALL-NIX.md index 62a55a37..da3994b6 100644 --- a/INSTALL-NIX.md +++ b/INSTALL-NIX.md @@ -86,7 +86,7 @@ Go to all the required, unconfigured red fields and choose some values. Choose m ### Run lamassu-server ``` -node bin/lamassu-server --mockSms --mockScoring +node bin/lamassu-server --mockScoring ``` ### Add a lamassu-machine @@ -100,7 +100,7 @@ Now continue with lamassu-machine instructions from the ``INSTALL.md`` file in [ To start the Lamassu server run: ``` -node bin/lamassu-server --mockSms --mockScoring +node bin/lamassu-server --mockScoring ``` To start the Lamassu Admin run: diff --git a/INSTALL.md b/INSTALL.md index 5630adc4..d2a80ea7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -104,7 +104,7 @@ Go to all the required, unconfigured red fields and choose some values. Choose m ### Run lamassu-server ``` -node bin/lamassu-server --mockSms --mockScoring +node bin/lamassu-server --mockScoring ``` ### Add a lamassu-machine @@ -119,7 +119,7 @@ Now continue with lamassu-machine instructions from the ``INSTALL.md`` file in [ To start the Lamassu server run: ``` -node bin/lamassu-server --mockSms --mockScoring +node bin/lamassu-server --mockScoring ``` To start the Lamassu Admin run: diff --git a/README.md b/README.md index 22e62e79..3e555371 100644 --- a/README.md +++ b/README.md @@ -15,5 +15,5 @@ See [lamassu-remote-install/README.md](lamassu-remote-install/README.md). ## Running ```bash -node bin/lamassu-server --mockSms --mockScoring +node bin/lamassu-server --mockScoring ``` diff --git a/lib/plugins.js b/lib/plugins.js index 8fd79dbe..e8e4501f 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -1,5 +1,4 @@ const _ = require('lodash/fp') -const argv = require('minimist')(process.argv.slice(2)) const crypto = require('crypto') const pgp = require('pg-promise')() const dateFormat = require('dateformat') @@ -163,9 +162,7 @@ function plugins (settings, deviceId) { const virtualCassettes = [Math.max(...denominations) * 2] - const counts = argv.cassettes - ? argv.cassettes.split(',') - : rec.counts + const counts = rec.counts if (rec.counts.length !== denominations.length) { throw new Error('Denominations and respective counts do not match!') @@ -763,7 +760,9 @@ function plugins (settings, deviceId) { } function getPhoneCode (phone) { - const code = argv.mockSms + const notifications = configManager.getNotifications(settings.config) + + const code = notifications.thirdParty_sms === 'mock-sms' ? '123' : randomCode() diff --git a/lib/sms.js b/lib/sms.js index fd42d1bf..a4e24e78 100644 --- a/lib/sms.js +++ b/lib/sms.js @@ -2,7 +2,6 @@ const dateFormat = require('dateformat') const ph = require('./plugin-helper') -const argv = require('minimist')(process.argv.slice(2)) const { utils: coinUtils } = require('@lamassu/coins') const _ = require('lodash/fp') diff --git a/package.json b/package.json index 8b98a09c..411c4b1b 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "test": "mocha --recursive tests", "jtest": "jest --detectOpenHandles", "build-admin": "npm run build-admin:css && npm run build-admin:main && npm run build-admin:lamassu", - "server": "nodemon bin/lamassu-server --mockSms --mockScoring --logLevel silly", + "server": "nodemon bin/lamassu-server --mockScoring --logLevel silly", "admin-server": "nodemon bin/lamassu-admin-server --dev --logLevel silly", "graphql-server": "nodemon bin/new-graphql-dev-insecure", "watch": "concurrently \"npm:server\" \"npm:admin-server\" \"npm:graphql-server\"", diff --git a/test/stress/test-server.js b/test/stress/test-server.js index 8d9b1f5b..51569f7e 100644 --- a/test/stress/test-server.js +++ b/test/stress/test-server.js @@ -3,5 +3,5 @@ const cmd = require('./scripts') process.on('message', async (msg) => { console.log('Message from parent:', msg) - await cmd.execCommand(`node --prof LAMASSU_DB=STRESS_TEST ../../bin/lamassu-server --mockSms`) + await cmd.execCommand(`node --prof LAMASSU_DB=STRESS_TEST ../../bin/lamassu-server`) })