Skip to content

Commit 22323bb

Browse files
committed
chore: expose electra struct
1 parent d3244bb commit 22323bb

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

crates/common/src/pbs/types/get_header.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ impl GetHeaderResponse {
6666
VersionedResponse::Electra(data) => data.message.value,
6767
}
6868
}
69+
70+
pub fn transactions_root(&self) -> B256 {
71+
match self {
72+
GetHeaderResponse::Deneb(data) => data.message.header.transactions_root,
73+
GetHeaderResponse::Electra(data) => data.message.header.transactions_root,
74+
}
75+
}
76+
77+
pub fn parent_hash(&self) -> B256 {
78+
match self {
79+
GetHeaderResponse::Deneb(data) => data.message.header.parent_hash,
80+
GetHeaderResponse::Electra(data) => data.message.header.parent_hash,
81+
}
82+
}
83+
84+
pub fn signautre(&self) -> BlsSignature {
85+
match self {
86+
GetHeaderResponse::Deneb(data) => data.signature,
87+
GetHeaderResponse::Electra(data) => data.signature,
88+
}
89+
}
6990
}
7091

7192
#[derive(Debug, Default, Clone, Serialize, Deserialize, Encode, Decode)]

crates/common/src/pbs/types/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ pub use execution_payload::{
1818
EMPTY_TX_ROOT_HASH,
1919
};
2020
pub use get_header::{
21-
ExecutionPayloadHeaderMessageDeneb, GetHeaderParams, GetHeaderResponse,
22-
SignedExecutionPayloadHeader,
21+
ExecutionPayloadHeaderMessageDeneb, ExecutionPayloadHeaderMessageElectra, GetHeaderParams,
22+
GetHeaderResponse, SignedExecutionPayloadHeader,
2323
};
24+
pub use execution_requests::{ConsolidationRequest, DepositRequest, ExecutionRequests, WithdrawalRequest};
2425
pub use kzg::{
2526
KzgCommitment, KzgCommitments, KzgProof, KzgProofs, BYTES_PER_COMMITMENT, BYTES_PER_PROOF,
2627
};
27-
pub use spec::{DenebSpec, EthSpec};
28+
pub use spec::{DenebSpec, ElectraSpec, EthSpec};
2829
pub use utils::VersionedResponse;

0 commit comments

Comments
 (0)