-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Tests: tidy up address.py and segwit_addr.py #19253
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
Conversation
I ran I did fail I reviewed all the changes, and it all looks good to me, except for a small detail, please see question inline. |
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.
ACK modulo #19253 (comment)
The pep8, docstring and imports tidy-ups can probably be one clean-up commit.
b450389
to
ecb74db
Compare
I don't think it's related. I'm able to run that test successfully on this branch. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
rebased |
ecb74db
to
7edcdcd
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.
utACK 7edcdcd
These functions can be exported to other modules, so be explicit that they're encoding and decoding segwit addresses
This optional parameter is never used, so remove it.
No need to import twice from util.py
It's almost impossible to read bytes literals in code, so replace them with the hex string literal and then convert them to a bytes object using bytes.fromhex().
7edcdcd
to
825fcae
Compare
re-ACK 825fcae per Good catch, Marco, on the p2wpkh address test. |
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.
ACK 825fcae - looks ok to me.
ACK 825fcae |
825fcae [tests] Replace bytes literals with hex literals (John Newbery) 64eca45 [tests] Fix pep8 style violations in address.py (John Newbery) b230f8b [tests] Correct docstring for address.py (John Newbery) ea70e6a [tests] Tidy up imports in address.py (John Newbery) 7f639df [tests] Remove unused optional verify_checksum parameter (John Newbery) 011e784 [tests] Rename segwit encode and decode functions (John Newbery) e455713 [tests] Move bech32 unit tests to test framework (John Newbery) Pull request description: Lots of small fixes: - moving unit tests to test_framework implementation files - renaming functions to be clearer - removing multiple imports - removing unreadable byte literals from the code - fixing pep8 violations - correcting out-of-date docstring ACKs for top commit: jonatack: re-ACK 825fcae per `git range-diff a0a422c 7edcdcd 825fcae` and verified `wallet_address_types.py` and `wallet_basic.py --descriptors` (the failure on one travis job) are green locally. MarcoFalke: ACK 825fcae fanquake: ACK 825fcae - looks ok to me. Tree-SHA512: aea509c27c1bcb94bef11205b6a79836c39c62249672815efc9822f411bc2e2336ceb3d72b3b861c3f4054a08e16edb28c6edd3aa5eff72eec1d60ea6ca82dc4
Summary: Commit description: > This optional parameter is never used, so remove it. PR description: > Lots of small fixes: > > moving unit tests to test_framework implementation files > renaming functions to be clearer > removing multiple imports > removing unreadable byte literals from the code > fixing pep8 violations > correcting out-of-date docstring Most of the PR is related to segwit or code style, so only 2 out of 7 commits are relevant. This is a backport of [[bitcoin/bitcoin#19253 | core#19253]] [1/2] bitcoin/bitcoin@7f639df Test Plan: `ninja check-functional` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Subscribers: majcosta Differential Revision: https://reviews.bitcoinabc.org/D10417
Summary: It's almost impossible to read bytes literals in code, so replace them with the hex string literal and then convert them to a bytes object using bytes.fromhex(). This is a backport of [[bitcoin/bitcoin#19253 | core#19253]] [2/2] bitcoin/bitcoin@825fcae Test Plan: `ninja check-functional` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D10418
Lots of small fixes: