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

tests: Tidy the util functions #1491

Open
real-or-random opened this issue Feb 1, 2024 · 0 comments
Open

tests: Tidy the util functions #1491

real-or-random opened this issue Feb 1, 2024 · 0 comments

Comments

@real-or-random
Copy link
Contributor

When I look at all the helper functions near the top of tests.c, there are still some things that could be improved:

  • A lot of these functions could be moved to testutil or testrand, also functions like random_fe, random_fe_magnitude. They're currently only in tests.c but they're utils in the end.
  • We have functions with group_element and field_element, but they should just be ge and fe.
  • The ones in testutil should probably also get a secp256k1_testutil prefix then. You could say it's good that they stand out currently, but at least that's inconsistent with the ones in testrand, which have a prefix. Or perhaps better: we use prefixes testutil_ and testrand_, dropping the additional secp256k1_ for test functions. Then they still stand out. (The main purpose of secp256k1_ is to avoid namespace collisions if someone uses the library by just including it, but that doesn't matter in test-only code.)

Noticed when looking into #1489.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant