Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/pathfinder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub mod monitoring;
pub mod sierra;
pub mod state;
pub mod sync;

#[cfg(feature = "p2p")]
pub mod p2p_network;
50 changes: 50 additions & 0 deletions crates/pathfinder/src/sync.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#![allow(dead_code, unused_variables)]

mod tracking;

use std::ops::RangeBounds;

use anyhow::Result;
use pathfinder_common::{BlockHash, BlockNumber};

#[derive(Clone)]
pub struct BlockHeader {
parent: BlockHash,
hash: BlockHash,
number: BlockNumber,
// TODO
}

pub struct BlockBody {
// TODO
}

pub struct StateUpdate {
// TODO
}

/// Source of starknet block data.
#[allow(unused_variables)]
#[async_trait::async_trait]
pub trait Source: std::marker::Send + std::marker::Sync {
async fn block_headers(
&self,
range: impl RangeBounds<BlockNumber> + std::marker::Send,
) -> Result<Vec<BlockHeader>> {
unimplemented!();
}

async fn block_bodies(
&self,
range: impl RangeBounds<BlockNumber> + std::marker::Send,
) -> Result<Vec<BlockBody>> {
unimplemented!();
}

async fn state_updates(
&self,
range: impl RangeBounds<BlockNumber> + std::marker::Send,
) -> Result<Vec<StateUpdate>> {
unimplemented!();
}
}
Loading