pub struct RefreshSession {
pub session_id: String,
pub threshold: u32,
pub party_count: u32,
pub contributions: HashMap<u32, RefreshContribution>,
}Expand description
A refresh session.
Fields§
§session_id: String§threshold: u32§party_count: u32§contributions: HashMap<u32, RefreshContribution>Implementations§
Source§impl RefreshSession
impl RefreshSession
pub fn new(session_id: &str, threshold: u32, party_count: u32) -> Self
Sourcepub fn submit_contribution(
&mut self,
contrib: RefreshContribution,
) -> Result<(), String>
pub fn submit_contribution( &mut self, contrib: RefreshContribution, ) -> Result<(), String>
Submit a refresh contribution from a party.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all parties have contributed.
Sourcepub fn aggregate_for_party(&self, party_idx: u32) -> Option<Vec<u8>>
pub fn aggregate_for_party(&self, party_idx: u32) -> Option<Vec<u8>>
Get the aggregate refresh for a specific party. Returns the XOR of all refresh shares addressed to that party.
Sourcepub fn contribution_count(&self) -> usize
pub fn contribution_count(&self) -> usize
Number of contributions received.
Sourcepub fn missing_parties(&self) -> Vec<u32>
pub fn missing_parties(&self) -> Vec<u32>
List parties that haven’t contributed yet.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RefreshSession
impl RefUnwindSafe for RefreshSession
impl Send for RefreshSession
impl Sync for RefreshSession
impl Unpin for RefreshSession
impl UnsafeUnpin for RefreshSession
impl UnwindSafe for RefreshSession
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