Group setup_with_timeouts timeout parameters into a struct
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Start by locating state_machine::coordinator::test::setup_with_timeouts and its call sites, then inspect the test harness API and its #[allow(clippy::too_many_arguments)] comment. Group the timeout options into a Timeouts struct with named fields and a Default, updating callers to specify the phases they use. Done when the harness and callers compile without the allow and timeout arguments are unambiguous.
Written by the indexing model from the issue text.
Description
state_machine::coordinator::test::setup_with_timeouts takes eight positional parameters, five of them bare Option<Duration>:
setup_with_timeouts::<C, S>(num_signers, keys_per_signer,
dkg_public_timeout, dkg_private_timeout, dkg_end_timeout,
nonce_timeout, sign_timeout, verify_packet_sigs)
Call sites read like this, which is effectively unreviewable:
setup_with_timeouts::<FireCoordinator<Aggregator>, SignerType>(
num_signers, keys_per_signer,
Some(timeout), Some(timeout), Some(timeout), Some(timeout), Some(timeout),
false,
)
Five same-typed adjacent arguments means a transposition is invisible at the call site and silently changes which phase times out.
The eighth parameter (added in #234, replacing a mutable config accessor) tripped clippy::too_many_arguments, so the function currently carries an #[allow] with a comment pointing here.
Suggested fix
Group the timeouts into a Timeouts struct with named fields and a Default, so callers write Timeouts { nonce: Some(t), ..Default::default() } and only name what they mean. That also removes the clippy allow.
This is exported test-harness API, so it is a breaking change for anyone calling it with features = ["testing"] — fine inside a major, and worth batching with other breaking harness changes.
- Dominant language
- Rust
- Stars
- 34
- Forks
- 19
- Avg merge
- 9h 19m
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xoloki/wsts
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
xoloki/wsts#256 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
difficulty: easy docs help wanted tooling
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
bug help wanted ui
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
userFRM/egui-charts#4386 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eliasstravik/herdr-projects#1605 · 1 comment ·