From bc4297ce3c24dbb68b81d52bd9ba1f527f4ca528 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 9 Nov 2016 12:12:20 +1100 Subject: [PATCH] tests: add assertion for witness default to EMPTY_WITNESS --- test/transaction.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/transaction.js b/test/transaction.js index e787333..30b3d74 100644 --- a/test/transaction.js +++ b/test/transaction.js @@ -118,30 +118,19 @@ describe('Transaction', function () { prevTxHash = new Buffer('ffffffff00ffff000000000000000000000000000000000000000000101010ff', 'hex') }) - it('accepts a transaction hash', function () { - var tx = new Transaction() - tx.addInput(prevTxHash, 0) - assert.deepEqual(tx.ins[0].hash, prevTxHash) - }) - it('returns an index', function () { var tx = new Transaction() assert.strictEqual(tx.addInput(prevTxHash, 0), 0) assert.strictEqual(tx.addInput(prevTxHash, 0), 1) }) - it('defaults to DEFAULT_SEQUENCE', function () { - var tx = new Transaction() - tx.addInput(prevTxHash, 0) - - assert.strictEqual(tx.ins[0].sequence, Transaction.DEFAULT_SEQUENCE) - }) - - it('defaults to empty script', function () { + it('defaults to empty script, witness and 0xffffffff SEQUENCE number', function () { var tx = new Transaction() tx.addInput(prevTxHash, 0) assert.strictEqual(tx.ins[0].script.length, 0) + assert.strictEqual(tx.ins[0].witness.length, 0) + assert.strictEqual(tx.ins[0].sequence, 0xffffffff) }) fixtures.invalid.addInput.forEach(function (f) {