Repository navigation
test: make script_combineSigs and spends_witness_prog cases independent - #36794
alexanderwiederin wants to merge 2 commits into
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
9b8e6b4 to
85497da
Compare
|
Concept ACK |
85497da to
1f9802c
Compare
The P2PKH, P2SH and multisig cases shared one funding transaction, whose scriptPubKey was modified between them, and one keystore. Give each case its own test with its own keys, keystore and const funding transaction. The checks are unchanged.
1f9802c to
26d2f76
Compare
|
ACK 26d2f76 |
| combined = CombineSignatures(txFrom.vout[0], txTo, empty, scriptSig); | ||
| BOOST_CHECK_EQUAL(combined.scriptSig, scriptSig.scriptSig); | ||
| SignatureData scriptSigCopy = scriptSig; | ||
| // Signing again will give a different, valid signature: |
There was a problem hiding this comment.
Note: Old problem but this comment is not correct. Easy to check;
BOOST_CHECK_EQUAL(scriptSig.scriptSig, scriptSigCopy.scriptSig);
Not something I suggest to fix in this PR.
There was a problem hiding this comment.
Thanks - good catch!
The test reused funding transaction, spending transaction and coins view for every output type, modifying them between checks. The P2SH-wrapped cases relied on the scriptPubkey left by the previous case, and each one had to clear the scriptSig it set. Give each output type its own test case with its own key and scripts, and check each spend with a helper that builds fresh transactions and a fresh coins view. The checks are unchanged.
26d2f76 to
7358d35
Compare
|
re-ACK 7358d35 Show signature```bash -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512re-ACK 7358d35 iJEEARYKADkWIQRxIqfV4fHauqeDZkLHO83HCSJ4EQUCavPzBhsUgAAAAAAEAA5t |

Part of #36692: remove test state that is shared and modified across cases.
script_combineSigs: The P2PKH, P2SH and multisig cases shared one funding transaction, whosescriptPubkeywas modified between them, and one keystore. Each case is now its own test with its own keys, keystore and funding transaction.spends_witness_prog: every output type reused the same transactions and coins view. The P2SH-wrapped cases relied on thescriptPubkeyleft by the previous case and had to clear thescriptSigthey set. Each check now builds fresh state, and the scripts are named.The checks are unchanged.