Skip to content

Code deduplication in the threshold signatures repo #3460

@SimonRastikian

Description

@SimonRastikian

Background

Duplication exists for the first four checks in presign (presign.rs:58-80) and in assert_sign_inputs of sign.rs:

  1. participants.len() < 2 → NotEnoughParticipants
  2. ParticipantList::new(...) → DuplicateParticipants
  3. contains(me) → MissingParticipant { role: "self" }
  4. threshold.value() > participants.len() → ThresholdTooLarge

Goal: reduce the code redundancy.

User Story

No response

Acceptance Criteria

Make a shared function assert_participant_inputs that would be called as a helper in presigning and signing

Resources & Additional Notes

That was spotted by Barak #3343 (comment)

Metadata

Metadata

Labels

refactorImprovements to code structure, readability, or performance that don't add new features or fix bugs.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions