pallas_upstream/
framework.rs

1use pallas_crypto::hash::Hash;
2use pallas_network::miniprotocols::Point;
3
4pub type BlockSlot = u64;
5pub type BlockHash = Hash<32>;
6pub type RawBlock = Vec<u8>;
7
8#[derive(Clone)]
9pub enum Intersection {
10    Tip,
11    Origin,
12    Breadcrumbs(Vec<Point>),
13}
14
15pub trait Cursor: Send + Sync {
16    fn intersection(&self) -> Intersection;
17}
18
19#[derive(Debug, Clone)]
20pub enum UpstreamEvent {
21    RollForward(BlockSlot, BlockHash, RawBlock),
22    Rollback(Point),
23}
24
25// final output port
26pub type DownstreamPort<A> = gasket::messaging::OutputPort<A, UpstreamEvent>;