test when getTransaction fails

This commit is contained in:
Ivan Socolsky 2015-05-28 12:58:17 -03:00
parent 83b65193af
commit b7f96da25a
1 changed files with 21 additions and 0 deletions

View File

@ -1736,6 +1736,27 @@ describe('Wallet service', function() {
});
});
});
it('should keep tx as accepted if broadcast fails and cannot check tx in blockchain', function(done) {
helpers.stubBroadcastFail();
blockchainExplorer.getTransaction = sinon.stub().callsArgWith(1, 'bc check error');
server.broadcastTx({
txProposalId: txpid
}, function(err) {
should.exist(err);
err.code.should.equal('BLOCKCHAINERROR');
server.getTx({
txProposalId: txpid
}, function(err, txp) {
should.not.exist(err);
should.not.exist(txp.txid);
txp.isBroadcasted().should.be.false;
should.not.exist(txp.broadcastedOn);
txp.isAccepted().should.be.true;
done();
});
});
});
});
describe('Tx proposal workflow', function() {