I'm using bitcoinjs with browserify and babelify, and I'm getting strange errors when I try to import an unsigned transaction from its hex:
Error: redeemScript.equals is not a function
expandInput@http://localhost:8000/app.js:84056:12
[172]</TransactionBuilder.prototype.__addInputUnsafe@http://localhost:8000/app.js:84521:13
[172]</TransactionBuilder.fromTransaction/<@http://localhost:8000/app.js:84466:5
[172]</TransactionBuilder.fromTransaction@http://localhost:8000/app.js:84465:3
Going deeper in the bitcoinjs code, I found that the error arise here: https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/transaction_builder.js#L131
Inspecting the variable redeemScript I found that is an Uint8Array, which does not contains the 'equals' method. Am I missing something?
Can you provide the problematic code in question?
And can you provide the environment details?
It sounds like we won't be able to reproduce this in Node.
I just found the problem, was a babel replacing the safebuffer.Buffer with an Uint8Array. Sorry for that
Thanks for posting your problem and solution @dakk, no doubt this will help others too :)
Most helpful comment
I just found the problem, was a babel replacing the safebuffer.Buffer with an Uint8Array. Sorry for that