alloy_rpc_types_engine/
testing.rs

1//! Testing namespace types for building a block in a single call.
2//!
3//! This follows the `testing_buildBlockV1` specification.
4
5use crate::PayloadAttributes;
6use alloc::vec::Vec;
7use alloy_primitives::{Bytes, B256};
8
9/// Capability string for `testing_buildBlockV1`.
10pub const TESTING_BUILD_BLOCK_V1: &str = "testing_buildBlockV1";
11
12/// Request payload for `testing_buildBlockV1`.
13#[derive(Clone, Debug, PartialEq, Eq)]
14#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
15#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
16pub struct TestingBuildBlockRequestV1 {
17    /// Parent block hash of the block to build.
18    pub parent_block_hash: B256,
19    /// Payload attributes.
20    pub payload_attributes: PayloadAttributes,
21    /// Raw signed transactions to force-include in order.
22    pub transactions: Vec<Bytes>,
23    /// Optional extra data for the block header.
24    #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))]
25    pub extra_data: Option<Bytes>,
26}