added a typedef for the Queueing HB propose result

This commit is contained in:
Vladimir Komendantskiy 2018-07-18 15:00:59 +01:00
parent ccd1a98c42
commit 17339c322c
1 changed files with 6 additions and 6 deletions

View File

@ -178,6 +178,11 @@ where
}
}
type ProposeResult<NodeUid> = Result<(
FaultLog<NodeUid>,
VecDeque<TargetedMessage<Message<NodeUid>, NodeUid>>,
)>;
impl<Tx, NodeUid> QueueingHoneyBadger<Tx, NodeUid>
where
Tx: Eq + Serialize + for<'r> Deserialize<'r> + Debug + Hash + Clone,
@ -210,12 +215,7 @@ where
}
/// Initiates the next epoch by proposing a batch from the queue.
fn propose(
&mut self,
) -> Result<(
FaultLog<NodeUid>,
VecDeque<TargetedMessage<Message<NodeUid>, NodeUid>>,
)> {
fn propose(&mut self) -> ProposeResult<NodeUid> {
let amount = cmp::max(1, self.batch_size / self.dyn_hb.netinfo().num_nodes());
// TODO: This will loop forever if we are the only validator.
let mut fault_log = FaultLog::new();