Skip to content

feat: merge elections crate into service crate as a module#126

Merged
mrnkslv merged 3 commits into
release/nodectl/v0.5.0from
feature/sma-86-merge-elections-crate-into-service-crate-as-a-module
May 4, 2026
Merged

feat: merge elections crate into service crate as a module#126
mrnkslv merged 3 commits into
release/nodectl/v0.5.0from
feature/sma-86-merge-elections-crate-into-service-crate-as-a-module

Conversation

@mrnkslv
Copy link
Copy Markdown
Contributor

@mrnkslv mrnkslv commented Apr 29, 2026

Summary

refactor(node-control): merge elections crate into service as a module

Changes

  • Move all former elections crate code under service as the elections module (service/src/elections/).
  • Remove the standalone node-control/elections workspace member and drop the elections dependency from service and commands.
  • Adjust in-module imports (super::…; runner tests use super::super::providers::…); add mockall to service dev-dependencies for the migrated tests.
  • Point commands at service::elections::providers::… instead of the old elections crate.
  • Update src/Makefile (fmt manifest list) and src/node-control/Makefile (package list) to drop elections.
  • No intentional behavior change; existing tests remain and pass for service and commands.

Copilot AI review requested due to automatic review settings April 29, 2026 07:44
@linear
Copy link
Copy Markdown

linear Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the node-control workspace by folding the former standalone elections crate into the service crate as an internal service::elections module, updating all call-sites and build/workspace wiring accordingly.

Changes:

  • Moved elections implementation under src/node-control/service/src/elections/ and exposed it via service::elections.
  • Updated service/commands imports and dependencies to stop using the standalone elections crate.
  • Removed node-control/elections from workspace members and adjusted Makefiles / lockfile accordingly.

Reviewed changes

Copilot reviewed 16 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/node-control/service/src/task/mod.rs Switch elections task integration from external crate to crate::elections module.
src/node-control/service/src/service_main_task.rs Update BindingStatusCallback import to the new module path.
src/node-control/service/src/lib.rs Export new elections module from service crate.
src/node-control/service/src/http/config_handlers.rs Use elections providers via crate::elections::providers instead of the removed crate.
src/node-control/service/src/elections/runner_tests.rs Adjust test imports to reflect new module nesting.
src/node-control/service/src/elections/runner.rs Update intra-module imports (super::...) and ensure runner tests are still compiled.
src/node-control/service/src/elections/providers/traits.rs Introduce elections provider trait/types inside service.
src/node-control/service/src/elections/providers/mod.rs Re-export provider types from the elections module.
src/node-control/service/src/elections/providers/default.rs Update provider implementation to use local trait/types.
src/node-control/service/src/elections/mod.rs Define elections module structure within service.
src/node-control/service/src/elections/election_task.rs Update imports to use sibling modules (now inside service::elections).
src/node-control/service/src/elections/election_emulator.rs Add/migrate election emulation logic and its unit tests into the module.
src/node-control/service/src/elections/adaptive_strategy.rs Update emulator import path for in-module usage.
src/node-control/service/Cargo.toml Remove elections dependency; add mockall dev-dependency for migrated tests.
src/node-control/elections/Cargo.toml Remove standalone elections crate manifest (crate deleted).
src/node-control/commands/src/commands/nodectl/config_wallet_cmd.rs Point nodectl to service::elections::providers.
src/node-control/commands/Cargo.toml Drop dependency on standalone elections crate.
src/node-control/Makefile Remove elections from package/test list.
src/Makefile Remove formatting target for the deleted elections crate manifest.
src/Cargo.toml Remove node-control/elections from workspace members.
src/Cargo.lock Remove elections package entry and update dependency graph (adds mockall to service).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mrnkslv mrnkslv requested a review from Keshoid May 1, 2026 11:37
@mrnkslv mrnkslv merged commit 99ed8f6 into release/nodectl/v0.5.0 May 4, 2026
5 checks passed
@mrnkslv mrnkslv deleted the feature/sma-86-merge-elections-crate-into-service-crate-as-a-module branch May 4, 2026 18:25
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