mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat(no_std): Add no_std support for reth-ethereum-engine-primitives (#13931)
This commit is contained in:
@ -18,13 +18,13 @@ reth-engine-primitives.workspace = true
|
||||
reth-payload-primitives.workspace = true
|
||||
reth-payload-validator.workspace = true
|
||||
reth-rpc-types-compat.workspace = true
|
||||
alloy-rlp.workspace = true
|
||||
reth-chain-state.workspace = true
|
||||
|
||||
# alloy
|
||||
alloy-primitives.workspace = true
|
||||
alloy-eips.workspace = true
|
||||
alloy-rpc-types-engine.workspace = true
|
||||
alloy-rlp.workspace = true
|
||||
|
||||
# misc
|
||||
serde.workspace = true
|
||||
@ -32,3 +32,17 @@ sha2.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json.workspace = true
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"reth-chainspec/std",
|
||||
"reth-primitives/std",
|
||||
"alloy-primitives/std",
|
||||
"alloy-eips/std",
|
||||
"alloy-rpc-types-engine/std",
|
||||
"alloy-rlp/std",
|
||||
"serde/std",
|
||||
"sha2/std",
|
||||
"serde_json/std",
|
||||
]
|
||||
|
||||
@ -7,8 +7,12 @@
|
||||
)]
|
||||
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
mod payload;
|
||||
use alloc::sync::Arc;
|
||||
use alloy_rpc_types_engine::{ExecutionPayload, ExecutionPayloadSidecar, PayloadError};
|
||||
pub use alloy_rpc_types_engine::{
|
||||
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4,
|
||||
@ -24,13 +28,12 @@ use reth_payload_primitives::{
|
||||
use reth_payload_validator::ExecutionPayloadValidator;
|
||||
use reth_primitives::{Block, NodePrimitives, SealedBlock};
|
||||
use reth_rpc_types_compat::engine::payload::block_to_payload;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// The types used in the default mainnet ethereum beacon consensus engine.
|
||||
#[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)]
|
||||
#[non_exhaustive]
|
||||
pub struct EthEngineTypes<T: PayloadTypes = EthPayloadTypes> {
|
||||
_marker: std::marker::PhantomData<T>,
|
||||
_marker: core::marker::PhantomData<T>,
|
||||
}
|
||||
|
||||
impl<T: PayloadTypes> PayloadTypes for EthEngineTypes<T> {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
//! Contains types required for building a payload.
|
||||
|
||||
use alloc::{sync::Arc, vec::Vec};
|
||||
use alloy_eips::{eip4844::BlobTransactionSidecar, eip4895::Withdrawals, eip7685::Requests};
|
||||
use alloy_primitives::{Address, B256, U256};
|
||||
use alloy_rlp::Encodable;
|
||||
@ -7,13 +8,13 @@ use alloy_rpc_types_engine::{
|
||||
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4,
|
||||
ExecutionPayloadV1, PayloadAttributes, PayloadId,
|
||||
};
|
||||
use core::convert::Infallible;
|
||||
use reth_chain_state::ExecutedBlock;
|
||||
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
|
||||
use reth_primitives::{EthPrimitives, SealedBlock};
|
||||
use reth_rpc_types_compat::engine::payload::{
|
||||
block_to_payload_v1, block_to_payload_v3, convert_block_to_payload_field_v2,
|
||||
};
|
||||
use std::{convert::Infallible, sync::Arc};
|
||||
|
||||
/// Contains the built payload.
|
||||
///
|
||||
@ -297,7 +298,7 @@ mod tests {
|
||||
use super::*;
|
||||
use alloy_eips::eip4895::Withdrawal;
|
||||
use alloy_primitives::B64;
|
||||
use std::str::FromStr;
|
||||
use core::str::FromStr;
|
||||
|
||||
#[test]
|
||||
fn attributes_serde() {
|
||||
|
||||
Reference in New Issue
Block a user