Merge pull request #175 from pnagurny/bug/timestamp

Timestamp should be a number not a string
This commit is contained in:
Braydon Fuller 2015-09-01 18:30:35 -04:00
commit 28beb92e45
2 changed files with 5 additions and 3 deletions

View File

@ -343,7 +343,7 @@ AddressService.prototype.getOutputs = function(addressStr, queryMempool, callbac
address: addressStr,
txid: key[3],
outputIndex: Number(key[4]),
timestamp: key[2],
timestamp: Number(key[2]),
satoshis: Number(value[0]),
script: value[1],
blockHeight: Number(value[2]),

View File

@ -469,12 +469,14 @@ describe('Address Service', function() {
outputs[0].satoshis.should.equal(4527773864);
outputs[0].script.should.equal('OP_DUP OP_HASH160 038a213afdfc551fc658e9a2a58a86e98d69b687 OP_EQUALVERIFY OP_CHECKSIG');
outputs[0].blockHeight.should.equal(345000);
outputs[0].timestamp.should.equal(1424835319000);
outputs[1].address.should.equal(address);
outputs[1].txid.should.equal('3b6bc2939d1a70ce04bc4f619ee32608fbff5e565c1f9b02e4eaa97959c59ae7');
outputs[1].outputIndex.should.equal(2);
outputs[1].satoshis.should.equal(10000);
outputs[1].script.should.equal('OP_DUP OP_HASH160 038a213afdfc551fc658e9a2a58a86e98d69b687 OP_EQUALVERIFY OP_CHECKSIG');
outputs[1].blockHeight.should.equal(345004);
outputs[1].timestamp.should.equal(1424837300000);
outputs[2].address.should.equal(address);
outputs[2].txid.should.equal('aa2db23f670596e96ed94c405fd11848c8f236d266ee96da37ecd919e53b4371');
outputs[2].script.should.equal('OP_DUP OP_HASH160 f6db95c81dea3d10f0ff8d890927751bf7b203c1 OP_EQUALVERIFY OP_CHECKSIG');
@ -483,12 +485,12 @@ describe('Address Service', function() {
});
var data1 = {
key: ['outs', address, '1424835319000', '125dd0e50fc732d67c37b6c56be7f9dc00b6859cebf982ee2cc83ed2d604bf87', '1'].join('-'),
key: ['outs', address, 1424835319000, '125dd0e50fc732d67c37b6c56be7f9dc00b6859cebf982ee2cc83ed2d604bf87', '1'].join('-'),
value: ['4527773864', 'OP_DUP OP_HASH160 038a213afdfc551fc658e9a2a58a86e98d69b687 OP_EQUALVERIFY OP_CHECKSIG', '345000'].join(':')
};
var data2 = {
key: ['outs', address, '1424837300000', '3b6bc2939d1a70ce04bc4f619ee32608fbff5e565c1f9b02e4eaa97959c59ae7', '2'].join('-'),
key: ['outs', address, 1424837300000, '3b6bc2939d1a70ce04bc4f619ee32608fbff5e565c1f9b02e4eaa97959c59ae7', '2'].join('-'),
value: ['10000', 'OP_DUP OP_HASH160 038a213afdfc551fc658e9a2a58a86e98d69b687 OP_EQUALVERIFY OP_CHECKSIG', '345004'].join(':')
};