Skip to content

Commit

Permalink
🚧 cannon provider mock
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Jan 15, 2024
1 parent 9a8e130 commit 56995f1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions crates/fault/src/providers/cannon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//! This module contains the implementation of the [crate::TraceProvider] trait for calling out to `cannon` to fetch
//! state witnesses and proof values.

use crate::{Gindex, Position, TraceProvider};
use alloy_primitives::keccak256;
use anyhow::Result;
use durin_primitives::Claim;
use std::{marker::PhantomData, sync::Arc};

/// The [CannonTraceProvider] is a [TraceProvider] that runs `cannon` to retrieve state witnesses and proof values.
pub struct CannonTraceProvider {
pub split_depth: u8,
}

#[async_trait::async_trait]
impl TraceProvider<[u8; 32]> for CannonTraceProvider {
async fn absolute_prestate(&self) -> Result<Arc<[u8; 32]>> {
todo!()
}

async fn absolute_prestate_hash(&self) -> Result<Claim> {
todo!()
}

async fn state_at(&self, position: Position) -> Result<Arc<[u8; 32]>> {
todo!()
}

async fn state_hash(&self, position: Position) -> Result<Claim> {
todo!()
}

async fn proof_at(&self, _: Position) -> Result<Arc<[u8]>> {
todo!()
}
}
3 changes: 3 additions & 0 deletions crates/fault/src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ pub use self::output::OutputTraceProvider;

mod split;
pub use self::split::SplitTraceProvider;

mod cannon;
pub use self::cannon::CannonTraceProvider;

0 comments on commit 56995f1

Please sign in to comment.