pub struct Dkg {
id: Identifier,
members: BTreeSet<Identifier>,
threshold: u16,
secret_package: Option<SecretPackage>,
commitment: Option<VerifiableSecretSharingCommitment>,
sent_round2_packages: bool,
round2_packages: HashMap<Identifier, Package>,
}
Expand description
Distributed key generation state machine.
Fields§
§id: Identifier
§members: BTreeSet<Identifier>
§threshold: u16
§secret_package: Option<SecretPackage>
§commitment: Option<VerifiableSecretSharingCommitment>
§sent_round2_packages: bool
§round2_packages: HashMap<Identifier, Package>
Implementations§
Source§impl Dkg
impl Dkg
Sourcepub fn new(
id: Identifier,
members: BTreeSet<Identifier>,
threshold: u16,
) -> Self
pub fn new( id: Identifier, members: BTreeSet<Identifier>, threshold: u16, ) -> Self
Sourcepub fn on_commit(&mut self, commitment: VerifiableSecretSharingCommitment)
pub fn on_commit(&mut self, commitment: VerifiableSecretSharingCommitment)
Handles the receipt of a commitment from another participant.
§Arguments
commitment
- The commitment received from another participant.
Sourcepub fn on_message(&mut self, peer: Identifier, msg: DkgMessage)
pub fn on_message(&mut self, peer: Identifier, msg: DkgMessage)
Handles the receipt of a message from another participant.
§Arguments
peer
- The identifier of the peer who sent the message.msg
- The message received from the peer.
Sourcepub fn next_action(&mut self) -> Option<DkgAction>
pub fn next_action(&mut self) -> Option<DkgAction>
Determines the next action to be taken in the DKG process.
§Returns
An optional DkgAction
representing the next action to be taken.
Auto Trait Implementations§
impl Freeze for Dkg
impl RefUnwindSafe for Dkg
impl Send for Dkg
impl Sync for Dkg
impl Unpin for Dkg
impl UnwindSafe for Dkg
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