Skip to content

Conversation

jnewbery
Copy link
Contributor

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

@DrahtBot DrahtBot added the Tests label Jun 11, 2020
@decentclock
Copy link

I ran test_runner.py on mac os 10.15.5 and all the tests changed in this PR passed!

I did fail wallet_keypool_topup.py --descriptors See the logs below. I am not sure if this related to the changes in this PR.
test38failure.txt

I reviewed all the changes, and it all looks good to me, except for a small detail, please see question inline.

Copy link
Member

@jonatack jonatack left a 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.

@jnewbery jnewbery force-pushed the 2020-06-addr-unit-tests branch from b450389 to ecb74db Compare July 1, 2020 15:48
@jnewbery
Copy link
Contributor Author

jnewbery commented Jul 1, 2020

I did fail wallet_keypool_topup.py --descriptors See the logs below. I am not sure if this related to the changes in this PR.

I don't think it's related. I'm able to run that test successfully on this branch.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 1, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@jnewbery
Copy link
Contributor Author

jnewbery commented Sep 3, 2020

rebased

@jnewbery jnewbery force-pushed the 2020-06-addr-unit-tests branch from ecb74db to 7edcdcd Compare September 3, 2020 10:36
Copy link
Member

@jonatack jonatack left a 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().
@jnewbery jnewbery force-pushed the 2020-06-addr-unit-tests branch from 7edcdcd to 825fcae Compare September 3, 2020 15:48
@jonatack
Copy link
Member

jonatack commented Sep 3, 2020

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.

Good catch, Marco, on the p2wpkh address test.

Copy link
Member

@fanquake fanquake left a 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.

@maflcko
Copy link
Member

maflcko commented Oct 1, 2020

ACK 825fcae

@maflcko maflcko merged commit 40aab35 into bitcoin:master Oct 1, 2020
@jnewbery jnewbery deleted the 2020-06-addr-unit-tests branch October 1, 2020 07:50
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 4, 2020
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 3, 2021
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 3, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants