struct RoastCoordinator {
threshold: u16,
session_id: u16,
commitments: BTreeMap<Identifier, SigningCommitments>,
sessions: BTreeMap<u16, RoastSession>,
committed: BTreeSet<Identifier>,
}
Expand description
Coordinates the signing process, ensuring that enough participants have committed to generate a signature.
Fields§
§threshold: u16
§session_id: u16
§commitments: BTreeMap<Identifier, SigningCommitments>
§sessions: BTreeMap<u16, RoastSession>
§committed: BTreeSet<Identifier>
Implementations§
Source§impl RoastCoordinator
impl RoastCoordinator
Sourcefn new(threshold: u16) -> Self
fn new(threshold: u16) -> Self
Creates a new RoastCoordinator
instance with the given threshold.
Sourcefn on_commit(&mut self, peer: Identifier, commitment: SigningCommitments)
fn on_commit(&mut self, peer: Identifier, commitment: SigningCommitments)
Handles a commitment from a peer.
Sourcefn on_response(
&mut self,
peer: Identifier,
message: RoastSignerResponse,
span: &Span,
)
fn on_response( &mut self, peer: Identifier, message: RoastSignerResponse, span: &Span, )
Handles a response from a peer.
Sourcefn start_session(&mut self, span: &Span) -> Option<RoastSignerRequest>
fn start_session(&mut self, span: &Span) -> Option<RoastSignerRequest>
Starts a new signing session if enough commitments have been received.
Sourcefn aggregate_signature(&mut self, span: &Span) -> Option<RoastSession>
fn aggregate_signature(&mut self, span: &Span) -> Option<RoastSession>
Aggregates the signature shares from a complete session.
Auto Trait Implementations§
impl Freeze for RoastCoordinator
impl RefUnwindSafe for RoastCoordinator
impl Send for RoastCoordinator
impl Sync for RoastCoordinator
impl Unpin for RoastCoordinator
impl UnwindSafe for RoastCoordinator
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