chore: Format code
This commit is contained in:
parent
c46dfd4457
commit
27e5aaa777
2 changed files with 11 additions and 11 deletions
|
@ -53,7 +53,7 @@ pub struct GetProofByHashResponse {
|
|||
}
|
||||
|
||||
/// A response given when fetching CT log entries within a range
|
||||
///
|
||||
///
|
||||
/// See: [`super::endpoints::GET_ENTRIES`]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct GetEntriesResponse {
|
||||
|
@ -65,4 +65,4 @@ pub struct GetEntriesResponse {
|
|||
pub struct GetEntriesResponseEntry {
|
||||
pub leaf_input: String,
|
||||
pub extra_data: String
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,26 +2,26 @@ use std::sync::Arc;
|
|||
|
||||
use base64ct::Encoding;
|
||||
use ct::{
|
||||
api::{responses::GetEntriesResponseEntry, CtApiClient}, merkle::{
|
||||
api::{responses::GetEntriesResponseEntry, CtApiClient},
|
||||
merkle::{
|
||||
consts::EXTRA_DATA_BASE64_BUFFER_SIZE,
|
||||
types::{MerkleLeafType, Version}
|
||||
}, parsing::entry::{parse_entry_extra_data_precert, parse_entry_extra_data_x509}
|
||||
},
|
||||
parsing::entry::{parse_entry_extra_data_precert, parse_entry_extra_data_x509}
|
||||
};
|
||||
use tokio::task::JoinSet;
|
||||
|
||||
async fn fetch_entries() -> impl Iterator<Item = GetEntriesResponseEntry> {
|
||||
let client = Arc::new(
|
||||
CtApiClient::new_with_client(
|
||||
"https://oak.ct.letsencrypt.org/2024h2/ct/v1/get-entries",
|
||||
Arc::new(reqwest::Client::new())
|
||||
)
|
||||
);
|
||||
let client = Arc::new(CtApiClient::new_with_client(
|
||||
"https://oak.ct.letsencrypt.org/2024h2/ct/v1/get-entries",
|
||||
Arc::new(reqwest::Client::new())
|
||||
));
|
||||
let mut join_set: JoinSet<_> = JoinSet::new();
|
||||
for i in 0..12u64 {
|
||||
let client = client.clone();
|
||||
join_set.spawn(async move {
|
||||
client
|
||||
.get_log_entries(i * 256, (i+1) * 256 - 1)
|
||||
.get_log_entries(i * 256, (i + 1) * 256 - 1)
|
||||
.await
|
||||
.expect("Request should succeed")
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue