add TX_NOT_FOUND

This commit is contained in:
Ivan Socolsky 2015-08-05 10:48:36 -03:00
parent 76c545b110
commit e4e138e139
3 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ var errors = {
TX_CANNOT_CREATE: 'Cannot create TX proposal during backoff time',
TX_CANNOT_REMOVE: 'Cannot remove this tx proposal during locktime',
TX_NOT_ACCEPTED: 'The transaction proposal is not accepted',
TX_NOT_FOUND: 'Transaction proposal not found',
TX_NOT_PENDING: 'The transaction proposal is not pending',
UPGRADE_NEEDED: 'Client app needs to be upgraded',
WALLET_ALREADY_EXISTS: 'Wallet already exists',

View File

@ -1085,7 +1085,7 @@ WalletService.prototype.getTx = function(opts, cb) {
self.storage.fetchTx(self.walletId, opts.txProposalId, function(err, txp) {
if (err) return cb(err);
if (!txp) return cb(new ClientError('Transaction proposal not found'));
if (!txp) return cb(Errors.TX_NOT_FOUND);
return cb(null, txp);
});
};

View File

@ -2907,7 +2907,8 @@ describe('Wallet service', function() {
}, function(err, txp) {
should.exist(err);
should.not.exist(txp);
err.message.should.contain('not found');
err.code.should.equal('TX_NOT_FOUND')
err.message.should.equal('Transaction proposal not found');
done();
});
});