tests: avoid deepEqual, hex is easier to debug

This commit is contained in:
Daniel Cousens 2016-06-22 13:58:49 +10:00
parent 0d0f7c9f00
commit 07628ff034

View file

@ -201,9 +201,7 @@ describe('Bitcoin-core', function () {
var scriptHex = f[1]
var inIndex = f[2]
var hashType = f[3]
// reverse because test data is reversed
var expectedHash = [].reverse.call(new Buffer(f[4], 'hex'))
var expectedHash = f[4]
var hashTypes = []
if ((hashType & 0x1f) === bitcoin.Transaction.SIGHASH_NONE) hashTypes.push('SIGHASH_NONE')
@ -222,7 +220,9 @@ describe('Bitcoin-core', function () {
assert.strictEqual(bitcoin.script.compile(scriptChunks).toString('hex'), scriptHex)
var hash = transaction.hashForSignature(inIndex, script, hashType)
assert.deepEqual(hash, expectedHash)
// reverse because test data is reversed
assert.equal([].reverse.call(hash).toString('hex'), expectedHash)
})
})
})