pub struct BatchSigner<'a> { /* private fields */ }Expand description
Batch session manager. Wraps a Coordinator to provide batch creation and aggregation.
Implementations§
Source§impl<'a> BatchSigner<'a>
impl<'a> BatchSigner<'a>
Sourcepub fn new(coordinator: &'a mut Coordinator) -> Self
pub fn new(coordinator: &'a mut Coordinator) -> Self
Create a new batch signer wrapping a coordinator.
Sourcepub fn create_batch(
&mut self,
request: BatchSessionRequest,
) -> Result<String, BatchError>
pub fn create_batch( &mut self, request: BatchSessionRequest, ) -> Result<String, BatchError>
Create a batch of sessions — one per message. Returns the batch ID and the list of session IDs.
Sourcepub fn aggregate_batch(
&mut self,
batch_id: &str,
) -> Result<Vec<AggregatedSignature>, BatchError>
pub fn aggregate_batch( &mut self, batch_id: &str, ) -> Result<Vec<AggregatedSignature>, BatchError>
Aggregate all sessions in a batch. All sessions must have received T shares. Returns one signature per message.
Sourcepub fn batch_session_ids(&self, batch_id: &str) -> Option<&[SessionId]>
pub fn batch_session_ids(&self, batch_id: &str) -> Option<&[SessionId]>
Get the session IDs for a batch.
Sourcepub fn batch_count(&self) -> usize
pub fn batch_count(&self) -> usize
Number of batches managed.
Sourcepub fn is_batch_ready(&self, batch_id: &str) -> bool
pub fn is_batch_ready(&self, batch_id: &str) -> bool
Check if all sessions in a batch have reached the threshold share count (ready for aggregation).
Sourcepub fn batch_states(&self, batch_id: &str) -> Option<Vec<SessionState>>
pub fn batch_states(&self, batch_id: &str) -> Option<Vec<SessionState>>
Get batch states as a summary.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BatchSigner<'a>
impl<'a> !UnwindSafe for BatchSigner<'a>
impl<'a> Freeze for BatchSigner<'a>
impl<'a> Send for BatchSigner<'a>
impl<'a> Sync for BatchSigner<'a>
impl<'a> Unpin for BatchSigner<'a>
impl<'a> UnsafeUnpin for BatchSigner<'a>
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