Skip to content
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

contrib: Adjust output to current test format #13935

Merged
merged 1 commit into from Aug 27, 2018

Conversation

Projects
None yet
4 participants
@AkioNak
Copy link
Contributor

commented Aug 10, 2018

This PR makes the output of gen_base58_test_vectors.py to fit to current test format.
The test has already been changed(separated) from base58_test to key_io_test, so change the file name of this script as well.

(This will solve #13553 )

@AkioNak AkioNak force-pushed the AkioNak:testgen_for_key_io_tests branch Aug 10, 2018

@laanwj laanwj added the Tests label Aug 10, 2018

@AkioNak

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2018

This script requires segwit_addr.py known as BIP173 Reference implementations for Python.
(See https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#Reference_implementations )
Since it is included in test_framework, we can execute as follows:

$ PYTHONPATH=../../test/functional/test_framework ./gen_key_io_test_vectors.py valid 50 > ../../src/test/data/key_io_keys_valid.json

@MarcoFalke MarcoFalke added this to the 0.18.0 milestone Aug 12, 2018

@kallewoof
Copy link
Member

left a comment

utACK c7cbd2cd9eb6f8df4348643f0a02d2dbc487197c

contrib/testgen/gen_base58_test_vectors.py Outdated
n = random.randint(0, len(val))
val = val[0:n] + random.choice(b58chars) + val[n+1:]
for template, gen_invalid_vector in [(t, g) for g, l in zip(glist, tlist) for t in l]:
val = gen_invalid_vector(template)

This comment has been minimized.

Copy link
@kallewoof

kallewoof Aug 14, 2018

Member

A bit long, but maybe call it invalid_vector_generator, since it is very close to the function names above. I thought for a moment it was referring to the function called gen_invalid_vectors but it had an s, I realized.

@AkioNak AkioNak force-pushed the AkioNak:testgen_for_key_io_tests branch Aug 14, 2018

@AkioNak

This comment has been minimized.

Copy link
Contributor Author

commented Aug 14, 2018

@kallewoof fixed. -- renamed as below:

  1. from gen_valid_vector to valid_vector_generator
  2. from gen_invalid_vector to invalid_vector_generator
@kallewoof
Copy link
Member

left a comment

re-utACK 512c25f2348dc01e5dc92e84698ba61c66fcfb5a

@laanwj

This comment has been minimized.

Copy link
Member

commented Aug 16, 2018

utACK 512c25f2348dc01e5dc92e84698ba61c66fcfb5a after squash

@laanwj

This comment has been minimized.

Copy link
Member

commented Aug 27, 2018

utACK 512c25f after squash

a reminder to squash this according to the workflow in CONTRIBUTING.md
(otherwise, this could be merged)

contrib: Adjust output to current test format
Ajust the outputs of gen_base58_test_vectors.py to current test format.

1. Add bech32 vector generation.
2. Add Script-fragments to hexrepr in the format expected by the test.
3. Modify the metadata.
  1) Change 'isTestnet' to 'chain' (main/test/regtest)
  2) Remove 'addrType'
  3) Add 'tryCaseFlip' (True/False on bech32)

@AkioNak AkioNak force-pushed the AkioNak:testgen_for_key_io_tests branch to a9910d8 Aug 27, 2018

@AkioNak

This comment has been minimized.

Copy link
Contributor Author

commented Aug 27, 2018

@laanwj thanks. squashed.

MarcoFalke added a commit to MarcoFalke/bitcoin that referenced this pull request Aug 27, 2018

Merge bitcoin#13935: contrib: Adjust output to current test format
a9910d8 contrib: Adjust output to current test format (Akio Nakamura)

Pull request description:

  This PR makes  the output of ```gen_base58_test_vectors.py``` to fit to current test format.
  The test has already been changed(separated) from ```base58_test``` to ```key_io_test```, so change the file name of this script as well.

  (This will solve bitcoin#13553 )

Tree-SHA512: 2986009acd734edd5b6ee0a5efed9e8d156c99b1919a0e9f6ffdd4c863f52f4d1c6bfdaca359937ea380e311dda559d96449fc6a7224092c1fb2517ee5b83369

@MarcoFalke MarcoFalke merged commit a9910d8 into bitcoin:master Aug 27, 2018

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@AkioNak AkioNak deleted the AkioNak:testgen_for_key_io_tests branch Aug 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.