tests: enforce witness transactions use legacy txId

This commit is contained in:
Daniel Cousens 2016-11-14 13:22:30 +11:00 committed by Daniel Cousens
parent 87269fe73e
commit 5150e3c027
2 changed files with 105 additions and 111 deletions

View file

@ -170,24 +170,18 @@ describe('Transaction', function () {
})
})
describe('getId', function () {
fixtures.valid.forEach(function (f) {
describe('getHash/getId', function () {
function verify (f) {
it('should return the id for ' + f.id, function () {
var tx = Transaction.fromHex(f.hex)
assert.strictEqual(tx.getHash().toString('hex'), f.hash)
assert.strictEqual(tx.getId(), f.id)
})
})
})
}
describe('getHash', function () {
fixtures.valid.forEach(function (f) {
it('should return the hash for ' + f.id, function () {
var tx = Transaction.fromHex(f.hex)
assert.strictEqual(tx.getHash().toString('hex'), f.hash)
})
})
fixtures.valid.forEach(verify)
fixtures.witness.forEach(verify)
})
describe('isCoinbase', function () {