diff --git a/lib/client/api.js b/lib/client/api.js index b13c361..9fa5bf8 100644 --- a/lib/client/api.js +++ b/lib/client/api.js @@ -10,7 +10,7 @@ log.debug = log.verbose; var Bitcore = require('bitcore') var SignUtils = require('../signutils'); var Verifier = require('./verifier'); -var ServerCompromissedError = require('./servercompromissederror') +var ServerCompromisedError = require('./servercompromisederror') var BASE_URL = 'http://localhost:3001/copay/api'; @@ -293,7 +293,7 @@ API.prototype.createAddress = function(cb) { return cb('Wallet Incomplete, cannot derive address.') if (!Verifier.checkAddress(data, address)) { - return cb(new ServerCompromissedError('Server sent fake address')); + return cb(new ServerCompromisedError('Server sent fake address')); } return cb(null, address); diff --git a/lib/client/servercompromisederror.js b/lib/client/servercompromisederror.js new file mode 100644 index 0000000..7c4df64 --- /dev/null +++ b/lib/client/servercompromisederror.js @@ -0,0 +1,6 @@ +function ServerCompromisedError(message) { + this.code = 'SERVERCOMPROMISED'; + this.message = message; +}; + +module.exports = ServerCompromisedError; diff --git a/lib/client/servercompromissederror.js b/lib/client/servercompromissederror.js deleted file mode 100644 index d11ec91..0000000 --- a/lib/client/servercompromissederror.js +++ /dev/null @@ -1,6 +0,0 @@ -function ServerCompromissedError(message) { - this.code = 'SERVERCOMPROMISSED'; - this.message = message; -}; - -module.exports = ServerCompromissedError; diff --git a/test/integration/clientApi.js b/test/integration/clientApi.js index 4918f56..d39bada 100644 --- a/test/integration/clientApi.js +++ b/test/integration/clientApi.js @@ -73,7 +73,7 @@ describe('client API', function() { }, response); client.request = request; client.createAddress(function(err, x) { - err.code.should.equal('SERVERCOMPROMISSED'); + err.code.should.equal('SERVERCOMPROMISED'); err.message.should.contain('fake address'); done(); });