Merge pull request #279 from Bucko13/check-for-id-param

check in http client that an id is passed to create wallet
This commit is contained in:
Christopher Jeffrey (JJ) 2017-08-17 17:23:47 -07:00 committed by GitHub
commit d44d93486f

View File

@ -6,7 +6,7 @@
*/ */
'use strict'; 'use strict';
const assert = require('assert');
const Network = require('../protocol/network'); const Network = require('../protocol/network');
const AsyncObject = require('../utils/asyncobject'); const AsyncObject = require('../utils/asyncobject');
const RPCClient = require('./rpcclient'); const RPCClient = require('./rpcclient');
@ -493,6 +493,7 @@ HTTPClient.prototype.getWallets = function getWallets() {
*/ */
HTTPClient.prototype.createWallet = function createWallet(options) { HTTPClient.prototype.createWallet = function createWallet(options) {
assert(options.id, 'Must pass an id parameter')
return this._put(`/wallet/${options.id}`, options); return this._put(`/wallet/${options.id}`, options);
}; };