Skeleton primitives and interface crate (#13)

* wip interface primitives

* wip

* Integrate it inside rpc- crates

* fmt

* move tx to mod.rs

* Add interfaces, executor to toml

* Added nits, comments fix
This commit is contained in:
rakita
2022-10-06 14:48:57 +02:00
committed by GitHub
parent 849e8ae518
commit bc30cbce61
28 changed files with 323 additions and 18 deletions

View File

@ -0,0 +1,12 @@
[package]
name = "reth-interfaces"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/foundry-rs/reth"
readme = "README.md"
[dependencies]
reth-primitives = { path = "../primitives" }
async-trait = "0.1.57"
thiserror = "1.0.37"

View File

@ -0,0 +1,20 @@
use async_trait::async_trait;
use reth_primitives::Block;
use thiserror::Error;
/// Takes block and executes it, returns error
#[async_trait]
pub trait BlockExecutor {
/// Execute block
async fn execute(&self, _block: Block) -> Error {
Error::VerificationFailed
}
}
/// BlockExecutor Errors
#[derive(Error, Debug, Clone)]
pub enum Error {
/// Example of error
#[error("Example of error.")]
VerificationFailed,
}

View File

@ -0,0 +1,11 @@
#![warn(missing_debug_implementations, missing_docs, unreachable_pub)]
#![deny(unused_must_use, rust_2018_idioms)]
#![doc(test(
no_crate_inject,
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Reth interface bindings
/// Block Execution traits.
pub mod executor;