From 07628ff034d14dc39ade1019a453898bcd63a622 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 22 Jun 2016 13:58:49 +1000 Subject: [PATCH] tests: avoid deepEqual, hex is easier to debug --- test/bitcoin.core.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/bitcoin.core.js b/test/bitcoin.core.js index 0833e3d..571db0e 100644 --- a/test/bitcoin.core.js +++ b/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) }) }) })