Browse Source

tests: avoid deepEqual, hex is easier to debug

hk-custom-address
Daniel Cousens 8 years ago
parent
commit
07628ff034
  1. 8
      test/bitcoin.core.js

8
test/bitcoin.core.js

@ -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)
})
})
})

Loading…
Cancel
Save