pub struct RoundCoordinator { /* private fields */ }Expand description
The multi-round coordinator. Tracks protocol progress across rounds and enforces the threshold requirement per round.
Implementations§
Source§impl RoundCoordinator
impl RoundCoordinator
Sourcepub fn new(threshold: u32, party_count: u32) -> Self
pub fn new(threshold: u32, party_count: u32) -> Self
Create a new coordinator for a T-of-N protocol.
Sourcepub fn current_round(&self) -> SigningRound
pub fn current_round(&self) -> SigningRound
Current round.
Sourcepub fn response_count(&self) -> usize
pub fn response_count(&self) -> usize
Number of signers who responded in the current round.
Sourcepub fn has_responded(&self, signer_id: &str) -> bool
pub fn has_responded(&self, signer_id: &str) -> bool
Has this signer responded in the current round?
Sourcepub fn submit(
&mut self,
signer_id: &str,
data: Vec<u8>,
) -> Result<Option<SigningRound>, RoundError>
pub fn submit( &mut self, signer_id: &str, data: Vec<u8>, ) -> Result<Option<SigningRound>, RoundError>
Submit a response for the current round. If the threshold is met, advances to the next round automatically.
Sourcepub fn round_data(&self, round: SigningRound) -> Vec<(String, Vec<u8>)>
pub fn round_data(&self, round: SigningRound) -> Vec<(String, Vec<u8>)>
Collect all round data from a completed round.
Sourcepub fn rounds_completed(&self) -> usize
pub fn rounds_completed(&self) -> usize
Number of rounds completed.
Sourcepub fn force_advance(&mut self) -> Option<SigningRound>
pub fn force_advance(&mut self) -> Option<SigningRound>
Force-advance to the next round (admin/debug only). Does not check threshold.
Auto Trait Implementations§
impl Freeze for RoundCoordinator
impl RefUnwindSafe for RoundCoordinator
impl Send for RoundCoordinator
impl Sync for RoundCoordinator
impl Unpin for RoundCoordinator
impl UnsafeUnpin for RoundCoordinator
impl UnwindSafe for RoundCoordinator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more