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
bitcoin-tx: Require that input amount is provided for witness transactions #23784
bitcoin-tx: Require that input amount is provided for witness transactions #23784
Conversation
02842dc
to
8dc5fa1
Compare
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.
Concept ACK
+1 for adding the tests! I don't think printing nValue=21000000.00000000
is a great idea, so I left a suggestion inline
One other suggestion: add a test with a 0 amount as that is a good (edge?) case to have tested. |
…ions Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
8dc5fa1
to
8bd34dc
Compare
Thanks for the valuable review @josibake! Rebased on master and force-pushed with the following adaptions:
( |
ACK 8bd34dc |
Needs OP adjusted before merge? |
Thanks, done. |
…d for witness transactions 8bd34dc test: check that bitcoin-tx detects missing input amount for segwit transactions (Sebastian Falbesoner) c337b27 Require that input amount is provided for bitcoin-tx witness transactions (Ben Woosley) Pull request description: This PR picks up the obviously abandoned PR bitcoin#13608 (last activity was three and a half years ago) by rebasing it on master and adding missing tests. Original PR description: "_Applies fix from bitcoin#12458 / bitcoin#13547 to bitcoin-tx._" The private key is the compressed version of the one used in most other util tests (5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf, corresponds to the scalar value k=1 in big endian), since segwit signing refuses uncompressed keys. The error message from the picked up PR is changed to not include the amount, as showing any value would be just confusing. ACKs for top commit: josibake: ACK bitcoin@8bd34dc Tree-SHA512: 334b418f89527363ad7e3326b4126e86a05fd64876c49a8280de38e64cfac52cb62c4b24b83603dd68b6bcebbe57c64161832edffb1cac7e9c68426f6b6eae1f
This PR picks up the obviously abandoned PR #13608 (last activity was three and a half years ago) by rebasing it on master and adding missing tests. Original PR description: "Applies fix from #12458 / #13547 to bitcoin-tx."
The private key is the compressed version of the one used in most other util tests (5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf, corresponds to the scalar value k=1 in big endian), since segwit signing refuses uncompressed keys.
The error message from the picked up PR is changed to not include the amount, as showing any value would be just confusing.