tests: add getId/getHash tests due to default segwit serialization (failing)

This commit is contained in:
Daniel Cousens 2016-11-14 14:01:08 +11:00 committed by Daniel Cousens
parent 29422b584d
commit de5cf261e6

View file

@ -2,10 +2,8 @@
var assert = require('assert') var assert = require('assert')
var bscript = require('../src/script') var bscript = require('../src/script')
var Transaction = require('../src/transaction')
var fixtures = require('./fixtures/transaction') var fixtures = require('./fixtures/transaction')
var Transaction = require('../src/transaction')
describe('Transaction', function () { describe('Transaction', function () {
function fromRaw (raw) { function fromRaw (raw) {
@ -180,7 +178,7 @@ describe('Transaction', function () {
describe('getHash/getId', function () { describe('getHash/getId', function () {
function verify (f) { function verify (f) {
it('should return the id for ' + f.id, function () { it('should return the id for ' + f.id, function () {
var tx = Transaction.fromHex(f.hex) var tx = Transaction.fromHex(f.whex || f.hex)
assert.strictEqual(tx.getHash().toString('hex'), f.hash) assert.strictEqual(tx.getHash().toString('hex'), f.hash)
assert.strictEqual(tx.getId(), f.id) assert.strictEqual(tx.getId(), f.id)