Merge pull request #283 from isocolsky/first_seen
Use firstSeenTs when available
This commit is contained in:
commit
281012fae2
|
@ -1457,7 +1457,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) {
|
||||||
action: action,
|
action: action,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
fees: tx.fees,
|
fees: tx.fees,
|
||||||
time: tx.time || now,
|
time: tx.firstSeenTs || tx.time || now,
|
||||||
addressTo: addressTo,
|
addressTo: addressTo,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
};
|
};
|
||||||
|
|
|
@ -3363,7 +3363,8 @@ describe('Wallet service', function() {
|
||||||
txid: '1',
|
txid: '1',
|
||||||
confirmations: 1,
|
confirmations: 1,
|
||||||
fees: 100,
|
fees: 100,
|
||||||
time: 1,
|
time: 20,
|
||||||
|
firstSeenTs: 2,
|
||||||
inputs: [{
|
inputs: [{
|
||||||
address: 'external',
|
address: 'external',
|
||||||
amount: 500,
|
amount: 500,
|
||||||
|
@ -3382,6 +3383,7 @@ describe('Wallet service', function() {
|
||||||
tx.action.should.equal('received');
|
tx.action.should.equal('received');
|
||||||
tx.amount.should.equal(200);
|
tx.amount.should.equal(200);
|
||||||
tx.fees.should.equal(100);
|
tx.fees.should.equal(100);
|
||||||
|
tx.time.should.equal(2);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3410,6 +3412,7 @@ describe('Wallet service', function() {
|
||||||
tx.action.should.equal('sent');
|
tx.action.should.equal('sent');
|
||||||
tx.amount.should.equal(400);
|
tx.amount.should.equal(400);
|
||||||
tx.fees.should.equal(100);
|
tx.fees.should.equal(100);
|
||||||
|
tx.time.should.equal(1);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3594,7 +3597,9 @@ describe('Wallet service', function() {
|
||||||
});
|
});
|
||||||
it('should handle invalid tx in history ', function(done) {
|
it('should handle invalid tx in history ', function(done) {
|
||||||
var h = _.clone(TestData.history);
|
var h = _.clone(TestData.history);
|
||||||
h.push({txid:'xx'})
|
h.push({
|
||||||
|
txid: 'xx'
|
||||||
|
})
|
||||||
helpers.stubHistory(h);
|
helpers.stubHistory(h);
|
||||||
|
|
||||||
server.getTxHistory({}, function(err, txs) {
|
server.getTxHistory({}, function(err, txs) {
|
||||||
|
|
Loading…
Reference in New Issue