pub trait Coordinator:
Clone
+ Debug
+ PartialEq
+ StateMachine<State, Error> {
Show 14 methods
// Required methods
fn new(config: Config) -> Self;
fn load(state: &SavedState) -> Self;
fn save(&self) -> SavedState;
fn get_config(&self) -> Config;
fn set_coordinator_public_key(&mut self, key: Option<PublicKey>);
fn set_key_and_party_polynomials(
&mut self,
aggregate_key: Point,
party_polynomials: Vec<(u32, PolyCommitment)>,
) -> Result<(), Error>;
fn process(
&mut self,
packet: &Packet,
) -> Result<(Option<Packet>, Option<OperationResult>), Error>;
fn get_aggregate_public_key(&self) -> Option<Point>;
fn set_aggregate_public_key(&mut self, aggregate_public_key: Option<Point>);
fn get_message(&self) -> Vec<u8> ⓘ;
fn get_state(&self) -> State;
fn start_dkg_round(&mut self, dkg_id: Option<u64>) -> Result<Packet, Error>;
fn start_signing_round(
&mut self,
message: &[u8],
signature_type: SignatureType,
sign_id: Option<u64>,
) -> Result<Packet, Error>;
fn reset(&mut self);
}Expand description
Coordinator trait for handling the coordination of DKG and sign messages
Required Methods§
Sourcefn load(state: &SavedState) -> Self
fn load(state: &SavedState) -> Self
Load a coordinator from the previously saved state
Sourcefn save(&self) -> SavedState
fn save(&self) -> SavedState
Save the state required to reconstruct the coordinator
Sourcefn get_config(&self) -> Config
fn get_config(&self) -> Config
Retrieve the config
Sourcefn set_coordinator_public_key(&mut self, key: Option<PublicKey>)
fn set_coordinator_public_key(&mut self, key: Option<PublicKey>)
Set the coordinator public key
Sourcefn set_key_and_party_polynomials(
&mut self,
aggregate_key: Point,
party_polynomials: Vec<(u32, PolyCommitment)>,
) -> Result<(), Error>
fn set_key_and_party_polynomials( &mut self, aggregate_key: Point, party_polynomials: Vec<(u32, PolyCommitment)>, ) -> Result<(), Error>
Initialize Coordinator from partial saved state
Sourcefn process(
&mut self,
packet: &Packet,
) -> Result<(Option<Packet>, Option<OperationResult>), Error>
fn process( &mut self, packet: &Packet, ) -> Result<(Option<Packet>, Option<OperationResult>), Error>
Process any timeouts, and if none of them fire then process the passed packet If a timeout does fire, then the coordinator state has changed; this means the packet is now stale and must be dropped
Sourcefn get_aggregate_public_key(&self) -> Option<Point>
fn get_aggregate_public_key(&self) -> Option<Point>
Retrieve the aggregate public key
Sourcefn set_aggregate_public_key(&mut self, aggregate_public_key: Option<Point>)
fn set_aggregate_public_key(&mut self, aggregate_public_key: Option<Point>)
Set the aggregate public key
Sourcefn get_message(&self) -> Vec<u8> ⓘ
fn get_message(&self) -> Vec<u8> ⓘ
Retrieve the current message bytes being signed
Sourcefn start_dkg_round(&mut self, dkg_id: Option<u64>) -> Result<Packet, Error>
fn start_dkg_round(&mut self, dkg_id: Option<u64>) -> Result<Packet, Error>
Trigger a DKG round, with an optional dkg_id
Sourcefn start_signing_round(
&mut self,
message: &[u8],
signature_type: SignatureType,
sign_id: Option<u64>,
) -> Result<Packet, Error>
fn start_signing_round( &mut self, message: &[u8], signature_type: SignatureType, sign_id: Option<u64>, ) -> Result<Packet, Error>
Trigger a signing round
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.