fix txProposal#isPending

This commit is contained in:
Ivan Socolsky 2015-02-08 11:20:22 -03:00
parent 4ce51b2e39
commit 7726a69ae5
2 changed files with 6 additions and 9 deletions

View File

@ -147,7 +147,7 @@ TxProposal.prototype.reject = function(copayerId) {
}; };
TxProposal.prototype.isPending = function() { TxProposal.prototype.isPending = function() {
return this.status === 'pending'; return !_.any(['boradcasted', 'rejected'], this.status);
}; };
TxProposal.prototype.isAccepted = function() { TxProposal.prototype.isAccepted = function() {

View File

@ -978,14 +978,11 @@ describe('Copay server', function() {
server.getPendingTxs({}, function(err, txps) { server.getPendingTxs({}, function(err, txps) {
should.not.exist(err); should.not.exist(err);
txps.length.should.equal(0); txps.length.should.equal(1);
server.getTx({ var txp = txps[0];
id: txpid txp.status.should.equal('accepted');
}, function(err, txp) { should.not.exist(txp.txid);
txp.status.should.equal('accepted'); done();
should.not.exist(txp.txid);
done();
});
}); });
}); });
}); });