mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
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:
12
crates/interfaces/Cargo.toml
Normal file
12
crates/interfaces/Cargo.toml
Normal 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"
|
||||
20
crates/interfaces/src/executor.rs
Normal file
20
crates/interfaces/src/executor.rs
Normal 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,
|
||||
}
|
||||
11
crates/interfaces/src/lib.rs
Normal file
11
crates/interfaces/src/lib.rs
Normal 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;
|
||||
Reference in New Issue
Block a user