2023-06-26 09:37:35 +00:00
|
|
|
use std::collections::HashSet;
|
|
|
|
|
|
|
|
use consensus_engine::{Block, NewView, TimeoutQc};
|
2023-06-22 06:15:38 +00:00
|
|
|
|
|
|
|
// State transtitions that will be picked randomly
|
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
pub enum Transition {
|
|
|
|
Nop,
|
|
|
|
ReceiveSafeBlock(Block),
|
|
|
|
ReceiveUnsafeBlock(Block),
|
|
|
|
ApproveBlock(Block),
|
|
|
|
ApprovePastBlock(Block),
|
|
|
|
LocalTimeout,
|
2023-06-26 23:34:16 +00:00
|
|
|
ReceiveTimeoutQcForRecentView(TimeoutQc),
|
2023-06-22 06:15:38 +00:00
|
|
|
ReceiveTimeoutQcForOldView(TimeoutQc),
|
2023-06-26 09:37:35 +00:00
|
|
|
ApproveNewViewWithLatestTimeoutQc(TimeoutQc, HashSet<NewView>),
|
|
|
|
//TODO: add more corner transitions
|
2023-06-22 06:15:38 +00:00
|
|
|
}
|