Skip to content

Split mithril-common crate by extracting some modules #2304

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

Merged
merged 7 commits into from
Feb 17, 2025

Conversation

sfauvel
Copy link
Collaborator

@sfauvel sfauvel commented Feb 12, 2025

Content

Extract the following crates from the mithril-common crate:

  • resource_pool in internal
  • mithril_signed_entity_lock in internal/signed-entity
  • mithril-signed-entity-preloader in internal/signed-entity

✋ In cardano_signed-entity_preloader.rs, we replace MockChainObserver by FakeObserver to avoid to recreate a mock in the crate. Doing that, we do not verify anymore that the observer was not call. We only check that the import was not call.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • 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
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #2294

Copy link

github-actions bot commented Feb 12, 2025

Test Results

    4 files  ±0     59 suites  +3   10m 41s ⏱️ -7s
1 598 tests ±0  1 598 ✅ +1  0 💤 ±0  0 ❌  - 1 
1 902 runs  ±0  1 902 ✅ +1  0 💤 ±0  0 ❌  - 1 

Results for commit b211e38. ± Comparison against base commit 568d45d.

This pull request removes 26 and adds 26 tests. Note that renamed tests count towards both.
mithril-common ‑ cardano_transactions_preloader::tests::call_its_inner_importer_when_is_activated
mithril-common ‑ cardano_transactions_preloader::tests::do_not_call_its_inner_importer_when_is_not_activated
mithril-common ‑ cardano_transactions_preloader::tests::fail_if_chain_point_is_not_available
mithril-common ‑ cardano_transactions_preloader::tests::return_error_when_is_activated_return_error
mithril-common ‑ cardano_transactions_preloader::tests::should_lock_entity_type_while_preloading
mithril-common ‑ cardano_transactions_preloader::tests::should_release_locked_entity_type_when_preloading_fail
mithril-common ‑ resource_pool::tests::test_resource_pool_acquire_locks_until_timeout_when_no_resource_available
mithril-common ‑ resource_pool::tests::test_resource_pool_acquire_returns_resource_when_available
mithril-common ‑ resource_pool::tests::test_resource_pool_clears_successfully
mithril-common ‑ resource_pool::tests::test_resource_pool_does_not_give_back_fresh_resource_pool_item_if_already_taken
…
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_acquire_locks_until_timeout_when_no_resource_available
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_acquire_returns_resource_when_available
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_clears_successfully
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_does_not_give_back_fresh_resource_pool_item_if_already_taken
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_does_not_give_back_resource_when_pool_is_full
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_does_not_give_back_stale_resource
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_gives_back_fresh_resource
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_gives_back_fresh_resource_pool_item_if_not_taken_yet
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_gives_back_resource_automatically
mithril-resource-pool ‑ resource_pool::tests::test_resource_pool_is_reset_when_given_back
…

♻️ This comment has been updated with latest results.

@sfauvel sfauvel force-pushed the sfa/2294/extract_modules_from_mithril_common branch 7 times, most recently from a5f3056 to f8b22f1 Compare February 13, 2025 14:29
@sfauvel sfauvel force-pushed the sfa/2294/extract_modules_from_mithril_common branch from f8b22f1 to 280021e Compare February 13, 2025 14:32
@sfauvel sfauvel marked this pull request as ready for review February 13, 2025 14:38
@sfauvel sfauvel force-pushed the sfa/2294/extract_modules_from_mithril_common branch from 280021e to 7017ff3 Compare February 13, 2025 14:42
@sfauvel sfauvel temporarily deployed to testing-sanchonet February 13, 2025 14:53 — with GitHub Actions Inactive
Copy link
Collaborator

@dlachaume dlachaume left a comment

Choose a reason for hiding this comment

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

LGTM 👍.
Should we rename the mithril-transaction-preloader crate to mithril-transactions-preloader (plural)?

Copy link
Collaborator

@Alenar Alenar left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

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 👍

@sfauvel sfauvel force-pushed the sfa/2294/extract_modules_from_mithril_common branch from 276ef76 to 67d3a7d Compare February 17, 2025 09:51
@sfauvel sfauvel temporarily deployed to testing-sanchonet February 17, 2025 10:04 — with GitHub Actions Inactive
* mithril-persistence from `0.2.45` to `0.2.46`
* mithril-aggregator from `0.7.5` to `0.7.6`
* mithril-common from `0.5.1` to `0.5.2`
* mithril-signer from `0.2.229` to `0.2.230`
@sfauvel sfauvel temporarily deployed to testing-sanchonet February 17, 2025 10:32 — with GitHub Actions Inactive
@sfauvel sfauvel merged commit 46e0915 into main Feb 17, 2025
38 of 42 checks passed
@sfauvel sfauvel deleted the sfa/2294/extract_modules_from_mithril_common branch February 17, 2025 10:34
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.

Split mithril-common crate - Phase 1
4 participants