Skip to content

Commit

Permalink
feat(papyrus_base_layer): automock the base layer
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-starkware committed Feb 13, 2025
1 parent 7eab8a9 commit ad5d208
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/papyrus_base_layer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ alloy-transport-http.workspace = true
async-trait.workspace = true
colored = { workspace = true, optional = true }
ethers.workspace = true
mockall.workspace = true
papyrus_config.workspace = true
serde.workspace = true
starknet-types-core.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions crates/papyrus_base_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ use std::fmt::{Debug, Display};
use std::ops::RangeInclusive;

use async_trait::async_trait;
use mockall::automock;
use serde::{Deserialize, Serialize};
use starknet_api::block::BlockHashAndNumber;
use starknet_api::core::{ContractAddress, EntryPointSelector, EthAddress, Nonce};
use starknet_api::transaction::fields::{Calldata, Fee};
use starknet_api::transaction::L1HandlerTransaction;
use thiserror::Error;

pub mod constants;
pub mod ethereum_base_layer_contract;
Expand All @@ -22,8 +24,12 @@ mod base_layer_test;

pub type L1BlockNumber = u64;

#[derive(Debug, Error)]
pub enum MockError {}

/// Interface for getting data from the Starknet base contract.
#[async_trait]
#[automock(type Error = MockError;)]
pub trait BaseLayerContract {
type Error: Error + Display + Debug;

Expand Down

0 comments on commit ad5d208

Please sign in to comment.