mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: local engine (#10803)
This commit is contained in:
@ -20,6 +20,7 @@ reth-errors.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-payload-primitives.workspace = true
|
||||
reth-ethereum-engine-primitives.workspace = true
|
||||
reth-chain-state = { workspace = true, optional = true }
|
||||
|
||||
# alloy
|
||||
alloy-primitives.workspace = true
|
||||
@ -42,4 +43,4 @@ tracing.workspace = true
|
||||
revm.workspace = true
|
||||
|
||||
[features]
|
||||
test-utils = []
|
||||
test-utils = ["reth-chain-state"]
|
||||
|
||||
@ -6,6 +6,7 @@ use crate::{
|
||||
PayloadJobGenerator,
|
||||
};
|
||||
use alloy_primitives::U256;
|
||||
use reth_chain_state::ExecutedBlock;
|
||||
use reth_payload_primitives::PayloadTypes;
|
||||
use reth_primitives::Block;
|
||||
use reth_provider::CanonStateNotification;
|
||||
@ -87,7 +88,7 @@ impl PayloadJob for TestPayloadJob {
|
||||
self.attr.payload_id(),
|
||||
Block::default().seal_slow(),
|
||||
U256::ZERO,
|
||||
None,
|
||||
Some(ExecutedBlock::default()),
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,9 @@ pub use error::{EngineObjectValidationError, PayloadBuilderError, VersionSpecifi
|
||||
/// Contains traits to abstract over payload attributes types and default implementations of the
|
||||
/// [`PayloadAttributes`] trait for ethereum mainnet and optimism types.
|
||||
mod traits;
|
||||
pub use traits::{BuiltPayload, PayloadAttributes, PayloadBuilderAttributes};
|
||||
pub use traits::{
|
||||
BuiltPayload, PayloadAttributes, PayloadAttributesBuilder, PayloadBuilderAttributes,
|
||||
};
|
||||
|
||||
mod payload;
|
||||
pub use payload::PayloadOrAttributes;
|
||||
|
||||
@ -145,3 +145,14 @@ impl PayloadAttributes for OptimismPayloadAttributes {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A builder that can return the current payload attribute.
|
||||
pub trait PayloadAttributesBuilder: std::fmt::Debug + Send + Sync + 'static {
|
||||
/// The payload attributes type returned by the builder.
|
||||
type PayloadAttributes: PayloadAttributes;
|
||||
/// The error type returned by [`PayloadAttributesBuilder::build`].
|
||||
type Error: std::error::Error + Send + Sync;
|
||||
|
||||
/// Return a new payload attribute from the builder.
|
||||
fn build(&self) -> Result<Self::PayloadAttributes, Self::Error>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user