diff --git a/test/integration/advanced.js b/test/integration/advanced.js index 366c4f3..030bd38 100644 --- a/test/integration/advanced.js +++ b/test/integration/advanced.js @@ -55,7 +55,7 @@ describe('bitcoinjs-lib (advanced)', function () { var actual = bitcoin.Transaction.fromHex(transaction.txHex) var dataScript2 = actual.outs[0].script - var data2 = dataScript2.chunks[1] + var data2 = bitcoin.scripts.decompile(dataScript2)[1] assert.deepEqual(dataScript, dataScript2) assert.deepEqual(data, data2) diff --git a/test/integration/crypto.js b/test/integration/crypto.js index 7c97cd0..f4b4c88 100644 --- a/test/integration/crypto.js +++ b/test/integration/crypto.js @@ -121,7 +121,9 @@ describe('bitcoinjs-lib (crypto)', function () { inputs.forEach(function (input) { var transaction = transactions[input.txId] var script = transaction.ins[input.vout].script - assert(bitcoin.scripts.isPubKeyHashInput(script), 'Expected pubKeyHash script') + var scriptChunks = bitcoin.scripts.decompile(script) + + assert(bitcoin.scripts.isPubKeyHashInput(scriptChunks), 'Expected pubKeyHash script') var prevOutTxId = bitcoin.bufferutils.reverse(transaction.ins[input.vout].hash).toString('hex') var prevVout = transaction.ins[input.vout].index @@ -133,8 +135,8 @@ describe('bitcoinjs-lib (crypto)', function () { var prevOut = bitcoin.Transaction.fromHex(result.txHex) var prevOutScript = prevOut.outs[prevVout].script - var scriptSignature = bitcoin.ECSignature.parseScriptSignature(script.chunks[0]) - var publicKey = bitcoin.ECPair.fromPublicKeyBuffer(script.chunks[1]) + var scriptSignature = bitcoin.ECSignature.parseScriptSignature(scriptChunks[0]) + var publicKey = bitcoin.ECPair.fromPublicKeyBuffer(scriptChunks[1]) var m = transaction.hashForSignature(input.vout, prevOutScript, scriptSignature.hashType) assert(publicKey.verify(m, scriptSignature.signature), 'Invalid m')