hbbft
hbbft copied to clipboard
Refactor `Step`.
The fact that Step
depends on DistAlgorithm
is pretty inconvenient in some places. Also, any user who isn't concerned with writing something like a generalized wrapper or test framework that is supposed to work for several algorithms shouldn't have to deal with DistAlgorithm
at all. For the many algorithms that can only output once, the current Step
implementation also makes the API less intuitive, since it always contains a Vec
of outputs. Finally, Step
could be adapted to the fault kind hierarchy (#285) once that's done.
- [x] Make
Step
generic in the message and output types instead of the algorithm. - [ ] Find a way to make
Step
statically aware of whether it can potentially have multiple outputs. (E.g. another type parameter, and a methodStep::single_output
that only exists in the correspondingimpl
. Or make the output type itself eitherOption
orVec
.) - [x] Make
Step
generic in the fault kind? (Requires #285 and makingFault
andFaultLog
generic. See #343)