feat: merge elections crate into service crate as a module#126
Merged
mrnkslv merged 3 commits intoMay 4, 2026
Conversation
Contributor
There was a problem hiding this comment.
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 viaservice::elections. - Updated
service/commandsimports and dependencies to stop using the standaloneelectionscrate. - Removed
node-control/electionsfrom 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.
Keshoid
approved these changes
May 3, 2026
…ions-crate-into-service-crate-as-a-module
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
refactor(node-control): merge elections crate into service as a module
Changes
service/src/elections/).src/Makefile(fmt manifest list) andsrc/node-control/Makefile(package list) to drop elections.