Transaction and block versions are signed integers
This commit is contained in:
parent
3de754a9a2
commit
7b1167708a
4 changed files with 39 additions and 4 deletions
test
|
@ -6,6 +6,15 @@ var Block = require('../src/block')
|
|||
var fixtures = require('./fixtures/block')
|
||||
|
||||
describe('Block', function () {
|
||||
describe('version', function () {
|
||||
it('should be interpreted as an int32le', function () {
|
||||
var blockHex = 'ffffffff0000000000000000000000000000000000000000000000000000000000000000414141414141414141414141414141414141414141414141414141414141414101000000020000000300000000'
|
||||
var block = Block.fromHex(blockHex)
|
||||
assert.equal(-1, block.version)
|
||||
assert.equal(1, block.timestamp)
|
||||
})
|
||||
})
|
||||
|
||||
describe('calculateTarget', function () {
|
||||
fixtures.targets.forEach(function (f) {
|
||||
it('returns ' + f.expected + ' for 0x' + f.bits, function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue