@@ -23,23 +23,6 @@ pub enum SignerState {
2323 epoch : Epoch ,
2424 } ,
2525
26- /// `Registered` state. The signer has successfully registered against the
27- /// aggregator for this Epoch, it is now able to sign.
28- Registered {
29- /// Epoch when Signer may sign.
30- epoch : Epoch ,
31- } ,
32-
33- /// `Signed` state. The signer has signed the message for the
34- /// current pending certificate.
35- Signed {
36- /// Epoch when signer signed.
37- epoch : Epoch ,
38-
39- /// Entity type that is signed
40- signed_entity_type : SignedEntityType ,
41- } ,
42-
4326 /// `ReadyToSign` state. The signer is registered and ready to sign new messages.
4427 ReadyToSign {
4528 /// Time point when signer transited to the state.
@@ -67,11 +50,6 @@ impl SignerState {
6750 matches ! ( * self , SignerState :: Unregistered { epoch: _ } )
6851 }
6952
70- /// Returns `true` if the state in `Registered`
71- pub fn is_registered ( & self ) -> bool {
72- matches ! ( * self , SignerState :: Registered { epoch: _ } )
73- }
74-
7553 /// Returns `true` if the state in `ReadyToSign`
7654 pub fn is_ready_to_sign ( & self ) -> bool {
7755 matches ! (
@@ -87,29 +65,13 @@ impl SignerState {
8765 pub fn is_registered_not_able_to_sign ( & self ) -> bool {
8866 matches ! ( * self , SignerState :: RegisteredNotAbleToSign { epoch: _ } )
8967 }
90-
91- /// Returns `true` if the state in `Signed`
92- pub fn is_signed ( & self ) -> bool {
93- matches ! (
94- * self ,
95- SignerState :: Signed {
96- epoch: _,
97- signed_entity_type: _
98- }
99- )
100- }
10168}
10269
10370impl Display for SignerState {
10471 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
10572 match self {
10673 Self :: Init => write ! ( f, "Init" ) ,
10774 Self :: Unregistered { epoch } => write ! ( f, "Unregistered - {epoch:?}" ) ,
108- Self :: Registered { epoch } => write ! ( f, "Registered - {epoch}" ) ,
109- Self :: Signed {
110- epoch,
111- signed_entity_type,
112- } => write ! ( f, "Signed - {epoch} - {signed_entity_type:?}" ) ,
11375 Self :: RegisteredNotAbleToSign { epoch } => {
11476 write ! ( f, "RegisteredNotAbleToSign - {epoch}" )
11577 }
@@ -224,15 +186,6 @@ impl StateMachine {
224186 info ! ( "→ No epoch settings found yet, waiting…" ) ;
225187 }
226188 }
227- SignerState :: Registered { epoch : _epoch } => {
228- todo ! ( "Will be removed" )
229- }
230- SignerState :: Signed {
231- epoch : _epoch,
232- signed_entity_type : _signed_entity_type,
233- } => {
234- todo ! ( "Will be removed" )
235- }
236189 SignerState :: RegisteredNotAbleToSign { epoch } => {
237190 if let Some ( new_epoch) = self . has_epoch_changed ( * epoch) . await ? {
238191 info ! ( " → new Epoch detected, transiting to UNREGISTERED" ) ;
0 commit comments