Skip to content

Commit f4e3b52

Browse files
karelbilekdcousens
authored andcommitted
Testing virtualSize and weight
1 parent 4f03a5d commit f4e3b52

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/transaction.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,24 @@ describe('Transaction', function () {
129129
})
130130
})
131131

132+
describe('weight/virtualSize', function () {
133+
it('computes virtual size', function () {
134+
fixtures.valid.forEach(function (f) {
135+
var transaction = Transaction.fromHex(f.whex ? f.whex : f.hex)
136+
137+
assert.strictEqual(transaction.virtualSize(), f.virtualSize)
138+
})
139+
})
140+
141+
it('computes weight', function () {
142+
fixtures.valid.forEach(function (f) {
143+
var transaction = Transaction.fromHex(f.whex ? f.whex : f.hex)
144+
145+
assert.strictEqual(transaction.weight(), f.weight)
146+
})
147+
})
148+
})
149+
132150
describe('addInput', function () {
133151
var prevTxHash
134152
beforeEach(function () {

0 commit comments

Comments
 (0)