-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1908 from input-output-hk/djo/1906/reorganize_sig…
…ner_dependencies Reorganize signer dependencies
- Loading branch information
Showing
27 changed files
with
225 additions
and
166 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
use std::sync::Arc; | ||
|
||
use mithril_common::api_version::APIVersionProvider; | ||
use mithril_common::cardano_transactions_preloader::CardanoTransactionsPreloader; | ||
use mithril_common::chain_observer::ChainObserver; | ||
use mithril_common::digesters::ImmutableDigester; | ||
use mithril_common::era::{EraChecker, EraReader}; | ||
use mithril_common::signable_builder::SignableBuilderService; | ||
use mithril_common::signed_entity_type_lock::SignedEntityTypeLock; | ||
use mithril_common::TickerService; | ||
use mithril_persistence::store::StakeStore; | ||
|
||
use crate::services::{AggregatorClient, SingleSigner, UpkeepService}; | ||
use crate::store::ProtocolInitializerStorer; | ||
use crate::MetricsService; | ||
|
||
type StakeStoreService = Arc<StakeStore>; | ||
type CertificateHandlerService = Arc<dyn AggregatorClient>; | ||
type ChainObserverService = Arc<dyn ChainObserver>; | ||
type DigesterService = Arc<dyn ImmutableDigester>; | ||
type SingleSignerService = Arc<dyn SingleSigner>; | ||
type TimePointProviderService = Arc<dyn TickerService>; | ||
type ProtocolInitializerStoreService = Arc<dyn ProtocolInitializerStorer>; | ||
|
||
/// This structure groups all the dependencies required by the state machine. | ||
pub struct SignerDependencyContainer { | ||
/// Time point provider service | ||
pub ticker_service: TimePointProviderService, | ||
|
||
/// Stake store service | ||
pub stake_store: StakeStoreService, | ||
|
||
/// Certificate handler service | ||
pub certificate_handler: CertificateHandlerService, | ||
|
||
/// Chain Observer service | ||
pub chain_observer: ChainObserverService, | ||
|
||
/// Digester service | ||
pub digester: DigesterService, | ||
|
||
/// SingleSigner service | ||
pub single_signer: SingleSignerService, | ||
|
||
/// ProtocolInitializer store | ||
pub protocol_initializer_store: ProtocolInitializerStoreService, | ||
|
||
/// Era checker service | ||
pub era_checker: Arc<EraChecker>, | ||
|
||
/// Era reader service | ||
pub era_reader: Arc<EraReader>, | ||
|
||
/// API version provider | ||
pub api_version_provider: Arc<APIVersionProvider>, | ||
|
||
/// Signable Builder Service | ||
pub signable_builder_service: Arc<dyn SignableBuilderService>, | ||
|
||
/// Metrics service | ||
pub metrics_service: Arc<MetricsService>, | ||
|
||
/// Signed entity type lock | ||
pub signed_entity_type_lock: Arc<SignedEntityTypeLock>, | ||
|
||
/// Cardano transactions preloader | ||
pub cardano_transactions_preloader: Arc<CardanoTransactionsPreloader>, | ||
|
||
/// Upkeep service | ||
pub upkeep_service: Arc<dyn UpkeepService>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Dependency injection module. | ||
//! | ||
//! This module provides tools to initialize and share resources and services | ||
//! amongst different threads. | ||
//! | ||
//! It takes all its inputs from the configuration which should combine inputs from: | ||
//! | ||
//! * environment | ||
//! * command line | ||
//! * configuration files | ||
//! * default values | ||
//! | ||
//! The Builder ensure every service has required dependencies to build and | ||
//! provide services containers for each sub process. | ||
mod builder; | ||
mod containers; | ||
|
||
pub use builder::*; | ||
pub use containers::*; |
Oops, something went wrong.