mithril_aggregator/tools/
mod.rs

1mod certificates_hash_migrator;
2mod digest_helpers;
3mod era;
4pub mod file_archiver;
5pub mod file_size;
6mod genesis;
7mod signer_importer;
8mod single_signature_authenticator;
9pub mod url_sanitizer;
10mod vacuum_tracker;
11
12pub use certificates_hash_migrator::CertificatesHashMigrator;
13pub use digest_helpers::extract_digest_from_path;
14pub use era::EraTools;
15pub use genesis::GenesisTools;
16pub use signer_importer::{
17    CExplorerSignerRetriever, SignersImporter, SignersImporterPersister, SignersImporterRetriever,
18};
19pub use single_signature_authenticator::*;
20pub use vacuum_tracker::VacuumTracker;
21
22/// Default environment variable name where the GCP credentials JSON is stored.
23pub(crate) const DEFAULT_GCP_CREDENTIALS_JSON_ENV_VAR: &str = "GOOGLE_APPLICATION_CREDENTIALS_JSON";
24
25/// Downcast the error to the specified error type and check if the error satisfies the condition.
26pub(crate) fn downcast_check<E>(
27    error: &mithril_common::StdError,
28    check: impl Fn(&E) -> bool,
29) -> bool
30where
31    E: std::fmt::Display + std::fmt::Debug + Send + Sync + 'static,
32{
33    if let Some(inner_error) = error.downcast_ref::<E>() {
34        return check(inner_error);
35    }
36    false
37}