From cd820178457316e9e961c7779d5886b5d9f6227d Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Tue, 1 Mar 2016 14:54:02 -0300 Subject: [PATCH] fix tests --- lib/server.js | 4 ++-- test/integration/server.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/server.js b/lib/server.js index 49e2d89..24b8342 100644 --- a/lib/server.js +++ b/lib/server.js @@ -1477,7 +1477,7 @@ WalletService.prototype._selectTxInputs2 = function(txp, utxosToExclude, cb) { if (!_.isEmpty(inputs)) return false; }); - if (_.isEmpty(inputs)) return cb(Errors.INSUFFICIENT_FUNDS); + if (_.isEmpty(inputs)) return cb(Errors.INSUFFICIENT_FUNDS_FOR_FEE); txp.setInputs(inputs); if (txp.getEstimatedSize() / 1000 > Defaults.MAX_TX_SIZE_IN_KB) @@ -2378,7 +2378,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { } amount = Math.abs(amount); - if (action == 'sent' || xaction == 'moved') { + if (action == 'sent' || action == 'moved') { var firstExternalOutput = _.find(outputs, { isMine: false }); diff --git a/test/integration/server.js b/test/integration/server.js index 0fcba03..f2a7007 100644 --- a/test/integration/server.js +++ b/test/integration/server.js @@ -2355,7 +2355,7 @@ describe('Wallet service', function() { it('should fail to create a tx exceeding max size in kb', function(done) { helpers.stubUtxos(server, wallet, _.range(1, 10, 0), function() { - var txOpts = helpers.createSimpleProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 9, TestData.copayers[0].privKey_1H_0); + var txOpts = helpers.createSimpleProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 8, TestData.copayers[0].privKey_1H_0); var _oldDefault = Defaults.MAX_TX_SIZE_IN_KB; Defaults.MAX_TX_SIZE_IN_KB = 1; server.createTxLegacy(txOpts, function(err, tx) { @@ -5778,6 +5778,7 @@ describe('Wallet service', function() { }); }); it.skip('should select smallest big utxo if small utxos exceed maximum fee', function(done) {}); + it.skip('should not fail with tx exceeded max size if there is at least 1 big input', function(done) {}); it('should ignore utxos not contributing enough to cover increase in fee', function(done) { helpers.stubUtxos(server, wallet, [0.0001, 0.0001, 0.0001], function() { var txOpts = {