refactor(contract): factor out shared gen_authenticated_participants helper - #3654
Conversation
|
PR title type suggestion: This PR refactors code to use a shared helper, so the type prefix should be Suggested title: |
Pull request overviewFactors out the per-test Changes:
Reviewed changesPer-file summary
FindingsNo blocking issues. Non-blocking (nits, follow-ups, suggestions):
✅ Approved |
There was a problem hiding this comment.
Pull request overview
This PR reduces duplication across mpc-contract unit tests by extracting a shared helper that generates a participant set and pre-authenticates each participant, then updates several test modules to use it.
Changes:
- Added
gen_authenticated_participants(n)to the shared contract test utilities. - Replaced locally-defined “setup/authenticate participants” helpers in multiple test modules with the shared helper.
- Simplified test-only imports now that per-module authentication loops are removed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/contract/src/tee/verifier_votes.rs | Replaces local participant-auth setup with shared gen_authenticated_participants. |
| crates/contract/src/primitives/test_utils.rs | Introduces gen_authenticated_participants helper for reuse across tests. |
| crates/contract/src/primitives/domain.rs | Removes duplicated test setup helper; uses shared authenticated-participant generator. |
| crates/contract/src/foreign_chain_rpc.rs | Removes duplicated test setup helper; uses shared authenticated-participant generator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
PR title type suggestion: This PR modifies source code files, not test files only. Since you're factoring out a shared helper across multiple source modules, the type prefix should probably be Suggested title: |
gen_authenticated_participants helper
…icated_participants
…tor-out-shared-participant-authentication-setup-helper
Closes #3650