Skip to content

Commit 20445d6

Browse files
committed
Add header response structs
1 parent 230d1b7 commit 20445d6

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

relay-api-types/src/lib.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,45 @@ pub struct BidTraceV2WithTimestamp {
233233
pub timestamp_ms: i64,
234234
}
235235

236+
#[superstruct(
237+
variants(Bellatrix, Capella, Deneb, Electra),
238+
variant_attributes(
239+
derive(Debug, Clone, Serialize, Deserialize, Encode, Decode),
240+
serde(bound = "E: EthSpec", deny_unknown_fields),
241+
),
242+
map_into(ExecutionPayloadHeader),
243+
map_ref_into(ExecutionPayloadHeader)
244+
)]
245+
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
246+
#[serde(bound = "E: EthSpec", untagged)]
247+
#[ssz(enum_behaviour = "transparent")]
248+
pub struct SignedHeaderResponse<E: EthSpec> {
249+
#[superstruct(flatten)]
250+
pub message: HeaderSubmission<E>,
251+
pub signature: Signature,
252+
}
253+
254+
#[superstruct(
255+
variants(Bellatrix, Capella, Deneb, Electra),
256+
variant_attributes(
257+
derive(Debug, Clone, Serialize, Deserialize, Encode, Decode),
258+
serde(bound = "E: EthSpec", deny_unknown_fields),
259+
),
260+
map_into(ExecutionPayloadHeader),
261+
map_ref_into(ExecutionPayloadHeader)
262+
)]
263+
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
264+
#[serde(bound = "E: EthSpec", untagged)]
265+
#[ssz(enum_behaviour = "transparent")]
266+
pub struct HeaderResponse<E: EthSpec> {
267+
#[superstruct(flatten)]
268+
pub execution_payload_header: ExecutionPayloadHeader<E>,
269+
#[superstruct(only(Deneb))]
270+
pub blobs_bundle: BlobsBundle<E>,
271+
pub value: Uint256,
272+
pub pubkey: PublicKeyBytes,
273+
}
274+
236275
// Builder API response types
237276
pub type GetValidatorsResponse = Vec<ValidatorsResponse>;
238277

0 commit comments

Comments
 (0)