File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //! Combined inputs and actions of all state machines.
2+
3+ use crate :: {
4+ evaluator:: { ActionContainer as EvaluatorActionContainer , input:: Input as EvaluatorInput } ,
5+ garbler:: { ActionContainer as GarblerActionContainer , input:: Input as GarblerInput } ,
6+ } ;
7+
8+ /// All possible state machine inputs
9+ #[ derive( Debug ) ]
10+ pub enum Input {
11+ /// Garbler SM inputs
12+ Garbler ( GarblerInput ) ,
13+ /// Evaluator SM inputs
14+ Evaluator ( EvaluatorInput ) ,
15+ }
16+
17+ /// All possible action container outputs
18+ #[ derive( Debug ) ]
19+ pub enum ActionContainer {
20+ /// Garbler action container
21+ Garbler ( GarblerActionContainer ) ,
22+ /// Evaluator action container
23+ Evaluator ( EvaluatorActionContainer ) ,
24+ }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl<S: EvaluatorArtifactStore> StateMachine for EvaluatorSM<S> {
3434
3535 type UntrackedAction = EvaluatorUntrackedAction ;
3636
37- type Actions = Vec < Action < EvaluatorUntrackedAction , EvaluatorTrackedActionTypes > > ;
37+ type Actions = ActionContainer ;
3838
3939 type TransitionError = SMError ;
4040
@@ -89,3 +89,5 @@ impl TrackedActionTypes for EvaluatorTrackedActionTypes {
8989
9090 type Result = ( ) ;
9191}
92+
93+ pub type ActionContainer = Vec < Action < EvaluatorUntrackedAction , EvaluatorTrackedActionTypes > > ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl<S: GarblerArtifactStore> StateMachine for GarblerSM<S> {
3434
3535 type UntrackedAction = GarblerUntrackedAction ;
3636
37- type Actions = Vec < Action < GarblerUntrackedAction , GarblerTrackedActionTypes > > ;
37+ type Actions = ActionContainer ;
3838
3939 type TransitionError = SMError ;
4040
@@ -89,3 +89,5 @@ impl TrackedActionTypes for GarblerTrackedActionTypes {
8989
9090 type Result = ( ) ;
9191}
92+
93+ pub type ActionContainer = Vec < Action < GarblerUntrackedAction , GarblerTrackedActionTypes > > ;
Original file line number Diff line number Diff line change 11//! protocol state machines
22
3+ pub mod composite;
34pub mod deposit;
45mod error;
56pub mod evaluator;
You can’t perform that action at this time.
0 commit comments