mithril_signer/dependency_injection/
containers.rs1use std::sync::Arc;
2
3use mithril_common::api_version::APIVersionProvider;
4use mithril_common::chain_observer::ChainObserver;
5use mithril_common::digesters::ImmutableDigester;
6use mithril_common::era::{EraChecker, EraReader};
7use mithril_common::signable_builder::SignableBuilderService;
8use mithril_common::TickerService;
9use mithril_signed_entity_lock::SignedEntityTypeLock;
10use mithril_signed_entity_preloader::CardanoTransactionsPreloader;
11
12use mithril_persistence::store::StakeStorer;
13use tokio::sync::RwLock;
14
15use crate::services::{
16 AggregatorClient, CertifierService, EpochService, SingleSigner, UpkeepService,
17};
18use crate::store::ProtocolInitializerStorer;
19use crate::MetricsService;
20
21type StakeStoreService = Arc<dyn StakeStorer>;
22type CertificateHandlerService = Arc<dyn AggregatorClient>;
23type ChainObserverService = Arc<dyn ChainObserver>;
24type DigesterService = Arc<dyn ImmutableDigester>;
25type SingleSignerService = Arc<dyn SingleSigner>;
26type TimePointProviderService = Arc<dyn TickerService>;
27type ProtocolInitializerStoreService = Arc<dyn ProtocolInitializerStorer>;
28
29pub type EpochServiceWrapper = Arc<RwLock<dyn EpochService>>;
31
32pub struct SignerDependencyContainer {
34 pub ticker_service: TimePointProviderService,
36
37 pub stake_store: StakeStoreService,
39
40 pub certificate_handler: CertificateHandlerService,
42
43 pub chain_observer: ChainObserverService,
45
46 pub digester: DigesterService,
48
49 pub single_signer: SingleSignerService,
51
52 pub protocol_initializer_store: ProtocolInitializerStoreService,
54
55 pub era_checker: Arc<EraChecker>,
57
58 pub era_reader: Arc<EraReader>,
60
61 pub api_version_provider: Arc<APIVersionProvider>,
63
64 pub signable_builder_service: Arc<dyn SignableBuilderService>,
66
67 pub metrics_service: Arc<MetricsService>,
69
70 pub signed_entity_type_lock: Arc<SignedEntityTypeLock>,
72
73 pub cardano_transactions_preloader: Arc<CardanoTransactionsPreloader>,
75
76 pub upkeep_service: Arc<dyn UpkeepService>,
78
79 pub epoch_service: EpochServiceWrapper,
81
82 pub certifier: Arc<dyn CertifierService>,
84}