You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let header_resp_opt = self.beacon_client.get_beacon_headers_block_id(block_id).await?;
17
+
ifletSome(header) = header_resp_opt {
18
+
let beacon_client = self.beacon_client.clone();
19
+
let blobs_resp_opt = beacon_client.get_blobs::<MainnetEthSpec>(BlockId::Root(header.data.root),None).await?;
20
+
ifletSome(blob_sidecars) = blobs_resp_opt {
21
+
let blob_sidecar_list = blob_sidecars.data;
22
+
let blob_data = BlobData::new(Header{beacon_block_hash: header.data.root},BlobSidecars{data: blob_sidecar_list });
23
+
trace!("Persisting blobs for block: {:?}", blob_data);
24
+
returnOk(());
25
+
}
26
+
returnOk(());
27
+
}
28
+
29
+
Ok(())
30
+
}
31
+
}
32
+
33
+
#[cfg(test)]
34
+
mod tests {
35
+
use std::str::FromStr;
36
+
use std::time::Duration;
37
+
38
+
use eth2::{SensitiveUrl,Timeouts};
39
+
40
+
usesuper::*;
41
+
42
+
#[tokio::test]
43
+
asyncfntest_persist_blobs_for_block(){
44
+
let beacon_client = BeaconNodeHttpClient::new(SensitiveUrl::from_str("https://ethereum-beacon-api.publicnode.com").unwrap(),Timeouts::set_all(Duration::from_secs(30)));
use eth2::{BeaconNodeHttpClient,SensitiveUrl,Timeouts};
5
+
use eth2::types::BlockId;
6
+
7
+
usecrate::archiver::Archiver;
8
+
9
+
mod archiver;
10
+
11
+
#[tokio::main]
12
+
asyncfnmain(){
13
+
let beacon_client = BeaconNodeHttpClient::new(SensitiveUrl::from_str("https://ethereum-beacon-api.publicnode.com").unwrap(),Timeouts::set_all(Duration::from_secs(30)));
0 commit comments