Browse Source

fix tests

activeAddress
Ivan Socolsky 9 years ago
parent
commit
cd82017845
  1. 4
      lib/server.js
  2. 3
      test/integration/server.js

4
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
});

3
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 = {

Loading…
Cancel
Save