refactor: Enforcing strong typing in governance.rs - #4238
Conversation
Pull request overviewTest-only refactor in Changes:
Reviewed changesPer-file summary
FindingsNo blocking issues. Verified that Non-blocking (nits, follow-ups, suggestions):
✅ Approved |
| fn setup_running_contract_with_domain( | ||
| num_participants: usize, | ||
| threshold: u64, | ||
| reconstruction_threshold: u64, | ||
| governance_threshold: GovernanceThreshold, | ||
| reconstruction_threshold: ReconstructionThreshold, |
There was a problem hiding this comment.
nit: it is a bit arguable if we should use the strong type here, in the sense that this is a test helper, so receiving u64 and converting internally makes life easier for the caller.
There was a problem hiding this comment.
I know, but I seriously wanted to get rid of the loose types. It's ok if strong typing is enforced here
| first_participant_id: &AccountId, | ||
| participants: Participants, | ||
| threshold: GovernanceThreshold, | ||
| governance_threshold: GovernanceThreshold, |
There was a problem hiding this comment.
nit: there are a few more places you can update the name as well if you want to be consistent - let threshold = GovernanceThreshold::new(...) to let governance_threshold = GovernanceThreshold::new(...) at 169, 191, 218 and 462.
6a8590d
|
Thanks @barakeinav1 for the note |
6a8590d to
e89b463
Compare
e89b463 to
1467af0
Compare
Enforces strong typing of threshold in test function.
Part of #3903