-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add tests for scalarMult and parsePubKey in crypto.secp256k1.c…
…urve.KoblitzCurve (#76) * Convert ./tests/unit/crypto/secp256k1/test_curve.py to pytest format. * Add NAF tests to curve.py . Also move randBytes to util.helpers. * Added tests for curve.splitK, fixed a double bug in it. * Run black and isort. * Use a dictionary instead of dataclasses to keep supporting Python 3.6. * Remove the redundant dataclasses import too. * Moved comments per review. * Added two tests for KoblitzCurve.scalarMult . Also: - fixed two bugs in KoblitzCurve.scalarMult; - renamed curve.curve in test_curve.py; - edited several docstrings in curve.py . * Changes per review: - test helpers "randBytes" and "sign" removed from util/helpers.py and moved to a conftest.py file in the tests/ root directory, as pytest fixtures; - test_curve.py changed to use the new fixtures; - unit/util/test_database.py restored to its original state. * Add tests for curve.PublicKey. Also: - implement PublicKey.__eq__; - use ValueError instead of Exception in KoblitzCurve.parsePubKey . * Add missing space char in docstring.
- Loading branch information
Showing
2 changed files
with
350 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.