block: adds getUTCDate function

This commit is contained in:
Daniel Cousens 2014-10-29 12:12:12 +11:00
parent 2214ccfdd8
commit 9897fa2876
2 changed files with 27 additions and 4 deletions

View file

@ -69,4 +69,20 @@ describe('Block', function() {
})
})
})
describe('getUTCDate', function() {
fixtures.valid.forEach(function(f) {
var block
beforeEach(function() {
block = Block.fromHex(f.hex)
})
it('returns UTC date of ' + f.id, function() {
var utcDate = block.getUTCDate().getTime()
assert.equal(utcDate, f.timestamp * 1e3)
})
})
})
})