Skip to content

Conversation

@dcousens
Copy link
Contributor

Fixes #143.
Adheres to #139, and another small nudge towards #106.

This pull request removes Transaction.prototype.applyMultisigs as it was a misleading function with a very singular purpose; and adds tests for Transaction.prototype.p2shsign using a pay-to-scriptHash multisig transaction.

Transaction.prototype.setScriptSig was added to replace applyMultisigs in a more general fashion, with the createP2SHMultisigScriptSig step moved outside of the TX implementation into user land.
This adds a smaller burden on the user space code, but provides better flexibility and API coherency.
This is especially true given that the user already has to generate the redeemScript and signatures in a very specific order; why hide the final step behind some unnecessary function.

It is probably not ideal by any means; but I feel it is a step in a better direction.

Some minor fixes in relation to #139 and a stricter API in general meant removing the automatic lifting of types in p2shsign and validateSig.

Thanks to @juliustayl for helping with this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this. p2shsign => p2shSign shall we?

@dcousens
Copy link
Contributor Author

Rebased, added some basic types checking in signScriptSig, and renamed createInputScript to createPubKeyHashScriptSig.

@kyledrake
Copy link
Contributor

+1

@kyledrake
Copy link
Contributor

@weilu look ok?

weilu added a commit that referenced this pull request Apr 26, 2014
Preliminary test for P2shsign
@weilu weilu merged commit 6833aca into bitcoinjs:master Apr 26, 2014
@dcousens dcousens deleted the p2shsign branch April 26, 2014 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants