From 332bd3cfe56381a67b88ed42f62f6d27778facf1 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 9 Aug 2023 10:58:11 +0200 Subject: [PATCH] add docs --- Cargo.lock | 1 - crates/rpc/rpc-types-compat/Cargo.toml | 5 +++-- crates/rpc/rpc-types-compat/src/block.rs | 2 ++ crates/rpc/rpc-types-compat/src/lib.rs | 19 ++++++++++++++++++- .../rpc-types-compat/src/transaction/mod.rs | 2 ++ 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 721996e13465..a11dd46e99a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6096,7 +6096,6 @@ dependencies = [ "reth-primitives", "reth-rlp", "reth-rpc-types", - "serde", ] [[package]] diff --git a/crates/rpc/rpc-types-compat/Cargo.toml b/crates/rpc/rpc-types-compat/Cargo.toml index 83b410172791..a7997e34102e 100644 --- a/crates/rpc/rpc-types-compat/Cargo.toml +++ b/crates/rpc/rpc-types-compat/Cargo.toml @@ -6,10 +6,11 @@ rust-version.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true - +description = """ +Compatibility layer for reth-primitives and ethereum RPC types +""" [dependencies] reth-primitives.workspace = true reth-rpc-types.workspace = true -serde = { workspace = true, features = ["derive"] } reth-rlp.workspace = true diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index 7169d1c6a9a4..e80938be307f 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -1,3 +1,5 @@ +//! Compatibility functions for rpc `Block` type. + use crate::transaction::from_recovered_with_block_context; use reth_primitives::{Block as PrimitiveBlock, Header as PrimitiveHeader, H256, U256}; use reth_rlp::Encodable; diff --git a/crates/rpc/rpc-types-compat/src/lib.rs b/crates/rpc/rpc-types-compat/src/lib.rs index 70557cd5923a..b4628cfcbab1 100644 --- a/crates/rpc/rpc-types-compat/src/lib.rs +++ b/crates/rpc/rpc-types-compat/src/lib.rs @@ -1,4 +1,21 @@ +#![cfg_attr(docsrs, feature(doc_cfg))] +#![doc( + html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png", + html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", + issue_tracker_base_url = "https://github.com/paradigmxzy/reth/issues/" +)] +#![warn(missing_debug_implementations, missing_docs, unreachable_pub, unused_crate_dependencies)] +#![deny(unused_must_use, rust_2018_idioms)] +#![doc(test( + no_crate_inject, + attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) +))] + +//! Reth compatibility and utils for RPC types +//! +//! This crate various helper functions to convert between reth primitive types and rpc types. + pub mod block; -pub mod transaction; pub use block::*; +pub mod transaction; pub use transaction::*; diff --git a/crates/rpc/rpc-types-compat/src/transaction/mod.rs b/crates/rpc/rpc-types-compat/src/transaction/mod.rs index 6fc75d61b827..02026b04fbec 100644 --- a/crates/rpc/rpc-types-compat/src/transaction/mod.rs +++ b/crates/rpc/rpc-types-compat/src/transaction/mod.rs @@ -1,3 +1,5 @@ +//! Compatibility functions for rpc `Transaction` type. + use reth_primitives::{ AccessListItem, BlockNumber, Transaction as PrimitiveTransaction, TransactionKind as PrimitiveTransactionKind, TransactionSignedEcRecovered, TxType, H256, U128,