mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: add and fix more lints, improve docs (#4765)
This commit is contained in:
@ -1,21 +1,3 @@
|
||||
#![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_docs)]
|
||||
#![deny(
|
||||
unused_must_use,
|
||||
rust_2018_idioms,
|
||||
rustdoc::broken_intra_doc_links,
|
||||
unused_crate_dependencies
|
||||
)]
|
||||
#![doc(test(
|
||||
no_crate_inject,
|
||||
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
|
||||
))]
|
||||
|
||||
//! This crate defines abstractions to create and update payloads (blocks):
|
||||
//! - [`PayloadJobGenerator`]: a type that knows how to create new jobs for creating payloads based
|
||||
//! on [`PayloadAttributes`](reth_rpc_types::engine::PayloadAttributes).
|
||||
@ -110,6 +92,15 @@
|
||||
//!
|
||||
//! - `test-utils`: Export utilities for testing
|
||||
|
||||
#![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, rustdoc::all)]
|
||||
#![deny(unused_must_use, rust_2018_idioms)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
|
||||
pub mod database;
|
||||
pub mod error;
|
||||
mod metrics;
|
||||
|
||||
@ -10,6 +10,7 @@ use crate::{
|
||||
use futures_util::{future::FutureExt, StreamExt};
|
||||
use reth_rpc_types::engine::PayloadId;
|
||||
use std::{
|
||||
fmt,
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
@ -150,6 +151,7 @@ impl PayloadBuilderHandle {
|
||||
///
|
||||
/// By design, this type relies entirely on the [`PayloadJobGenerator`] to create new payloads and
|
||||
/// does know nothing about how to build them, it just drives their jobs to completion.
|
||||
#[derive(Debug)]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
pub struct PayloadBuilderService<Gen>
|
||||
where
|
||||
@ -331,3 +333,20 @@ enum PayloadServiceCommand {
|
||||
/// Resolve the payload and return the payload
|
||||
Resolve(PayloadId, oneshot::Sender<Option<PayloadFuture>>),
|
||||
}
|
||||
|
||||
impl fmt::Debug for PayloadServiceCommand {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
PayloadServiceCommand::BuildNewPayload(f0, f1) => {
|
||||
f.debug_tuple("BuildNewPayload").field(&f0).field(&f1).finish()
|
||||
}
|
||||
PayloadServiceCommand::BestPayload(f0, f1) => {
|
||||
f.debug_tuple("BestPayload").field(&f0).field(&f1).finish()
|
||||
}
|
||||
PayloadServiceCommand::PayloadAttributes(f0, f1) => {
|
||||
f.debug_tuple("PayloadAttributes").field(&f0).field(&f1).finish()
|
||||
}
|
||||
PayloadServiceCommand::Resolve(f0, _f1) => f.debug_tuple("Resolve").field(&f0).finish(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user