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

Add MithrilFixture builder #670

Merged
merged 7 commits into from
Dec 22, 2022
Merged

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Dec 22, 2022

Content

This PR includes refactor the way to construct test signers by adding the MithrilFixtureBuilder that allow to generate them alongside a stake distribution.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Comments

This PR also reorganizes the test helpers in mithril common by moving the apispec & fake_data to the new test_utils module.
Also all mithril-common test helpers are now behind the test-only feature.

Issue(s)

Relates to #663

Alenar and others added 3 commits December 22, 2022 15:42
+ Remove tests_setup::setup_signers, it has been now completly superseded by the MithrilFixtureBuilder.

Co-authored-by: Jean-Philippe Raynaud <jpraynaud@users.noreply.github.com>
Co-authored-by: Grégoire HUBERT <ghubert@palo-it.com>
@Alenar Alenar force-pushed the ensemble/663/refactor_crypto_helpers branch from 8764ae5 to aecd616 Compare December 22, 2022 14:42
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@github-actions
Copy link

Test Results

    3 files  ±0    28 suites  ±0   3m 10s ⏱️ +9s
381 tests +4  381 ✔️ +4  0 💤 ±0  0 ±0 
442 runs  +4  442 ✔️ +4  0 💤 ±0  0 ±0 

Results for commit aecd616. ± Comparison against base commit 07b5e8b.

This pull request removes 3 and adds 7 tests. Note that renamed tests count towards both.
apispec::tests ‑ test_apispec_validate_errors
apispec::tests ‑ test_apispec_validate_ok
src/digesters/immutable_digester.rs - digesters::immutable_digester ‑ ImmutableDigester (line 13)
src/digesters/immutable_digester.rs - digesters::immutable_digester ‑ ImmutableDigester (line 12)
test_utils::apispec::tests ‑ test_apispec_validate_errors
test_utils::apispec::tests ‑ test_apispec_validate_ok
test_utils::fixture_builder::tests ‑ each_parties_generated_with_random_stake_distribution_have_different_stakes
test_utils::fixture_builder::tests ‑ random_stake_distribution_generates_as_many_signers_as_parties
test_utils::fixture_builder::tests ‑ with_protocol_params
test_utils::fixture_builder::tests ‑ with_signers

@Alenar Alenar temporarily deployed to testing-preview December 22, 2022 15:23 — with GitHub Actions Inactive
@Alenar Alenar merged commit a43b1b8 into main Dec 22, 2022
@Alenar Alenar deleted the ensemble/663/refactor_crypto_helpers branch December 22, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants