Skip to content

Commit e7f22e8

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

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ pub use execution_payload::{
1717
ExecutionPayload, ExecutionPayloadHeader, Transaction, Transactions, Withdrawal,
1818
EMPTY_TX_ROOT_HASH,
1919
};
20+
pub use execution_requests::{
21+
ConsolidationRequest, DepositRequest, ExecutionRequests, WithdrawalRequest,
22+
};
2023
pub use get_header::{
21-
ExecutionPayloadHeaderMessageDeneb, GetHeaderParams, GetHeaderResponse,
22-
SignedExecutionPayloadHeader,
24+
ExecutionPayloadHeaderMessageDeneb, ExecutionPayloadHeaderMessageElectra, GetHeaderParams,
25+
GetHeaderResponse, SignedExecutionPayloadHeader,
2326
};
2427
pub use kzg::{
2528
KzgCommitment, KzgCommitments, KzgProof, KzgProofs, BYTES_PER_COMMITMENT, BYTES_PER_PROOF,
2629
};
27-
pub use spec::{DenebSpec, EthSpec};
30+
pub use spec::{DenebSpec, ElectraSpec, EthSpec};
2831
pub use utils::VersionedResponse;

0 commit comments

Comments
 (0)