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:
@ -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