Preliminary test for P2shsign #152
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Fixes #143.
Adheres to #139, and another small nudge towards #106.
This pull request removes
Transaction.prototype.applyMultisigsas it was a misleading function with a very singular purpose; and adds tests forTransaction.prototype.p2shsignusing a pay-to-scriptHash multisig transaction.Transaction.prototype.setScriptSigwas added to replaceapplyMultisigsin a more general fashion, with thecreateP2SHMultisigScriptSigstep 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
redeemScriptand 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
p2shsignandvalidateSig.Thanks to @juliustayl for helping with this.