Clean up bctest.py and bitcoin-util-test.py #9069

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:btutiltestcleanup changing 2 files +101 −81
  1. jnewbery commented at 10:58 PM on November 2, 2016: member

    Apologies for code churn, but I've updated almost all of the code in these files, so I thought I might as well tidy up the code:

    • remove newlines
    • change tabs for spaces, to align with convention in other py files
    • add comments
    • add 'Bitcoin Core Developers' copyright notice
  2. MarcoFalke added the label Refactoring on Nov 3, 2016
  3. MarcoFalke added the label Tests on Nov 3, 2016
  4. laanwj commented at 9:09 AM on November 3, 2016: member

    change tabs for spaces, to align with convention in other py files

    Oh yes that was irking me, had to change editor settings all the time just for that file. utACK https://github.com/bitcoin/bitcoin/pull/9069/commits/dd76c14977eafc7f09f98f4b40475970c7c74845

  5. in src/test/bitcoin-util-test.py:None in dd76c14977 outdated
      16 | @@ -16,11 +17,13 @@
      17 |  
      18 |  Can also be run manually from the src directory by specifiying the source directory:
      19 |  
      20 | -test/bitcoin-util-test.py --src=[srcdir]
      21 | +test/bitcoin-util-test.py --src='srcdir' [--verbose]
    


    laanwj commented at 9:10 AM on November 3, 2016:

    I think this comment is wrong, too? It looks for --srcdir not --src.


    jnewbery commented at 2:50 PM on November 3, 2016:

    Good spot. Thanks.

  6. Clean up bctest.py and bitcoin-util-test.py
    - remove newlines
    - change tabs for spaces, to align with convention in other py files
    - add comments
    - add 'Bitcoin Core Developers' copyright notice
    2b175d4b01
  7. in src/test/bctest.py:None in dd76c14977 outdated
      16 | -		return json.loads(a)
      17 | -	elif fmt == 'hex': # hex: parse and compare binary data
      18 | -		return binascii.a2b_hex(a.strip())
      19 | -	else:
      20 | -		raise NotImplementedError("Don't know how to compare %s" % fmt)
      21 | +    """Parse the output a with format fmt. fmt can either be hex or json.
    


    MarcoFalke commented at 9:13 AM on November 3, 2016:

    µNit: no need to mention what fmt can be, when it is mentioned in the code just a line below.


    jnewbery commented at 2:51 PM on November 3, 2016:

    µACK. Comment shortened.

  8. jnewbery force-pushed on Nov 3, 2016
  9. jnewbery commented at 2:50 PM on November 3, 2016: member

    Nits addressed and commits squashed.

  10. fanquake commented at 7:14 AM on November 4, 2016: member
  11. laanwj merged this on Nov 4, 2016
  12. laanwj closed this on Nov 4, 2016

  13. laanwj referenced this in commit ed64bcec2d on Nov 4, 2016
  14. jnewbery deleted the branch on Nov 4, 2016
  15. codablock referenced this in commit 92f0f67c0c on Jan 13, 2018
  16. dagurval cross-referenced this on Apr 27, 2018 from issue bitcoin-tx JSON tests + test util improvements by dagurval
  17. andvgal referenced this in commit cc189c47e1 on Jan 6, 2019
  18. CryptoCentric referenced this in commit 13ed0a5fd0 on Feb 15, 2019
  19. str4d cross-referenced this on Oct 28, 2020 from issue bitcoin-util-test.py backports by str4d
  20. zkbot referenced this in commit 44f5ef7c9d on Nov 9, 2020
  21. zkbot referenced this in commit bd5ff7c889 on Nov 9, 2020
  22. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:55 UTC