-
Notifications
You must be signed in to change notification settings - Fork 2.2k
#373 clean up #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#373 clean up #378
Conversation
|
@rubensayshi on further testing, I was optimizing the Was there a reason for this? I thought we agreed to not include that since that would mean a client is incorrectly signing transactions. |
|
it actually does make use of the order of pubKeys and signatures a bit, just not for the pubKeys for which there's no signature yet. whenever a signature is matched it's then
I guess you want |
test/transaction_builder.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry for leaving that in
|
I'll have to read through it again. Thanks for the explanation.
|
src/transaction_builder.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tests are failing because with this change if a 2of3 is signed key1 and key2 (or a 2of2 with just key1) you won't have OP_0s for key3, imo you should stick to input.signatures = input.pubKeys.map to make sure that input.signatures.length == input.pubKeys.length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid battery died, charger at work. Will follow up tomorrow.
On 10 Mar 2015 8:46 pm, "Ruben de Vries" notifications@github.com wrote:
In src/transaction_builder.js
#378 (comment)
:
return signature || ops.OP_0allowed.some(function (signature) {if (!pubKey.verify(signatureHash, signature)) return
signatures[i] = signaturethe tests are failing because with this change if a 2of3 is signed key1
and key2 (or a 2of2 with just key1) you won't have OP_0s for key3, imo
you should stick to input.signatures = input.pubKeys.map to make sure
that input.signatures.length == input.pubKeys.length.—
Reply to this email directly or view it on GitHub
https://github.com/bitcoinjs/bitcoinjs-lib/pull/378/files#r26108461.
IMHO, yes. It overall means less verifies (faster), and should never be a valid case unless someone is using buggy software. |
|
@rubensayshi (ref 7cd60aa), please ACK If you feel these tests are beneficial, could you outline what they are testing, maybe we could add them to the scripts fixtures? In the end, anything really odd would be picked up by the final |
ada7e3e to
22e2f01
Compare
|
@rubensayshi I cleaned up the tests a lot, and there were a few comments I made along the way that may not make sense anymore, please verify by checking this thread (not your email haha). I have opted for 69eb58c instead of |
|
Perhaps for easy test transparency, instead of (or at least, in addition to) the final |
|
@rubensayshi probably easiest to review commit-by-commit. |
|
Tests are only failing because helloblock is experiencing technical difficulties. |
|
@dcousens we have a different taste for unittesting, but that's fine and the changes look okay |
#373 introduced some changes to
TransactionBuilderthat solved a few multisig bugs.Thanks to @rubensayshi :)
However, there a few things that just need to be cleaned up before publish :)
edit: WIP PR, ready for merge by tomorrow hopefully