Browse Source

debug Travis issue

activeAddress
Gregg Zigler 10 years ago
parent
commit
fb34eaf75b
  1. 25
      test/integration/server.js

25
test/integration/server.js

@ -1662,7 +1662,7 @@ describe('Wallet service', function() {
}); });
}); });
it('should create tx for type multiple_outputs', function(done) { xit('should create tx for type multiple_outputs', function(done) {
helpers.stubUtxos(server, wallet, [100, 200], function() { helpers.stubUtxos(server, wallet, [100, 200], function() {
var outputs = [ var outputs = [
{ toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', amount: 75, message: 'message #1' }, { toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', amount: 75, message: 'message #1' },
@ -1677,7 +1677,7 @@ describe('Wallet service', function() {
}); });
}); });
it('should fail to create tx for type multiple_outputs with invalid output argument', function(done) { xit('should fail to create tx for type multiple_outputs with invalid output argument', function(done) {
helpers.stubUtxos(server, wallet, [100, 200], function() { helpers.stubUtxos(server, wallet, [100, 200], function() {
var outputs = [ var outputs = [
{ toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', amount: 80, message: 'message #1', foo: 'bar' }, { toAddress: '18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', amount: 80, message: 'message #1', foo: 'bar' },
@ -1692,7 +1692,7 @@ describe('Wallet service', function() {
}); });
}); });
it('should fail to create tx for unsupported proposal type', function(done) { xit('should fail to create tx for unsupported proposal type', function(done) {
helpers.stubUtxos(server, wallet, [100, 200], function() { helpers.stubUtxos(server, wallet, [100, 200], function() {
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 80, 'some message', TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 80, 'some message', TestData.copayers[0].privKey_1H_0);
txOpts.type = 'bogus'; txOpts.type = 'bogus';
@ -1770,17 +1770,12 @@ describe('Wallet service', function() {
}); });
it('should follow backoff time after consecutive rejections', function(done) { it('should follow backoff time after consecutive rejections', function(done) {
function logTime(i, j) {
console.log('createTx backoff ' + i + ' ' + j + ' ' + (Date.now()));
};
async.series([ async.series([
function(next) { function(next) {
async.each(_.range(3), function(i, next) { async.each(_.range(3), function(i, next) {
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0);
logTime('' + (i + 1), 'a');
server.createTx(txOpts, function(err, tx) { server.createTx(txOpts, function(err, tx) {
logTime('' + (i + 1), 'b');
should.not.exist(err); should.not.exist(err);
server.rejectTx({ server.rejectTx({
txProposalId: tx.id, txProposalId: tx.id,
@ -1793,9 +1788,7 @@ describe('Wallet service', function() {
function(next) { function(next) {
// Allow a 4th tx // Allow a 4th tx
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0);
logTime('4', 'a');
server.createTx(txOpts, function(err, tx) { server.createTx(txOpts, function(err, tx) {
logTime('4', 'b');
server.rejectTx({ server.rejectTx({
txProposalId: tx.id, txProposalId: tx.id,
reason: 'some reason', reason: 'some reason',
@ -1805,24 +1798,17 @@ describe('Wallet service', function() {
function(next) { function(next) {
// Do not allow before backoff time // Do not allow before backoff time
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0);
logTime('5a', 'b');
server.createTx(txOpts, function(err, tx) { server.createTx(txOpts, function(err, tx) {
logTime('5a', 'b');
should.exist(err); should.exist(err);
err.code.should.equal('NOTALLOWEDTOCREATETX'); err.code.should.equal('NOTALLOWEDTOCREATETX');
next(); next();
}); });
}, },
function(next) { function(next) {
logTime('5', 'a');
var clock = sinon.useFakeTimers(Date.now() + (WalletService.backoffTimeMinutes + 2) * 60 * 1000); var clock = sinon.useFakeTimers(Date.now() + (WalletService.backoffTimeMinutes + 2) * 60 * 1000);
logTime('5', 'b');
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0);
logTime('5', 'c');
server.createTx(txOpts, function(err, tx) { server.createTx(txOpts, function(err, tx) {
logTime('5', 'd');
clock.restore(); clock.restore();
logTime('5', 'e');
server.rejectTx({ server.rejectTx({
txProposalId: tx.id, txProposalId: tx.id,
reason: 'some reason', reason: 'some reason',
@ -1831,15 +1817,10 @@ describe('Wallet service', function() {
}, },
function(next) { function(next) {
// Do not allow a 5th tx before backoff time // Do not allow a 5th tx before backoff time
logTime('6', 'a');
var clock = sinon.useFakeTimers(Date.now() + (WalletService.backoffTimeMinutes + 2) * 60 * 1000 + 1); var clock = sinon.useFakeTimers(Date.now() + (WalletService.backoffTimeMinutes + 2) * 60 * 1000 + 1);
logTime('6', 'b');
var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0); var txOpts = helpers.createProposalOpts('18PzpUFkFZE8zKWUPvfykkTxmB9oMR8qP7', 1, null, TestData.copayers[0].privKey_1H_0);
logTime('6', 'c');
server.createTx(txOpts, function(err, tx) { server.createTx(txOpts, function(err, tx) {
logTime('6', 'd');
clock.restore(); clock.restore();
logTime('6', 'e');
should.exist(err); should.exist(err);
err.code.should.equal('NOTALLOWEDTOCREATETX'); err.code.should.equal('NOTALLOWEDTOCREATETX');
next(); next();

Loading…
Cancel
Save