Testing virtualSize and weight

This commit is contained in:
Karel Bilek 2017-06-20 15:39:47 +02:00 committed by Daniel Cousens
parent 4f03a5d32e
commit f4e3b52325

View file

@ -129,6 +129,24 @@ describe('Transaction', function () {
}) })
}) })
describe('weight/virtualSize', function () {
it('computes virtual size', function () {
fixtures.valid.forEach(function (f) {
var transaction = Transaction.fromHex(f.whex ? f.whex : f.hex)
assert.strictEqual(transaction.virtualSize(), f.virtualSize)
})
})
it('computes weight', function () {
fixtures.valid.forEach(function (f) {
var transaction = Transaction.fromHex(f.whex ? f.whex : f.hex)
assert.strictEqual(transaction.weight(), f.weight)
})
})
})
describe('addInput', function () { describe('addInput', function () {
var prevTxHash var prevTxHash
beforeEach(function () { beforeEach(function () {