mithril_aggregator/tools/
mod.rs

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