Skip to content

Commit

Permalink
Move signature_publisher module to services
Browse files Browse the repository at this point in the history
  • Loading branch information
Alenar committed Sep 2, 2024
1 parent 099d822 commit e95e2fb
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions mithril-signer/src/dependency_injection/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ use mithril_persistence::store::StakeStore;

use crate::dependency_injection::SignerDependencyContainer;
use crate::services::{
AggregatorHTTPClient, CardanoTransactionsImporter,
CardanoTransactionsPreloaderActivationSigner, MithrilSingleSigner, SignerUpkeepService,
TransactionsImporterByChunk, TransactionsImporterWithPruner, TransactionsImporterWithVacuum,
AggregatorHTTPClient, AggregatorHttpSignaturePublisher, CardanoTransactionsImporter,
CardanoTransactionsPreloaderActivationSigner, MithrilSingleSigner, SignaturePublisher,
SignerUpkeepService, TransactionsImporterByChunk, TransactionsImporterWithPruner,
TransactionsImporterWithVacuum, UnixSocketSignaturePublisher,
};
use crate::store::{MKTreeStoreSqlite, ProtocolInitializerStore};
use crate::{
AggregatorHttpSignaturePublisher, Configuration, MetricsService, SignaturePublisher,
UnixSocketSignaturePublisher, HTTP_REQUEST_TIMEOUT_DURATION, SQLITE_FILE,
Configuration, MetricsService, HTTP_REQUEST_TIMEOUT_DURATION, SQLITE_FILE,
SQLITE_FILE_CARDANO_TRANSACTION,
};

Expand Down
4 changes: 2 additions & 2 deletions mithril-signer/src/dependency_injection/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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::services::{AggregatorClient, SignaturePublisher, SingleSigner, UpkeepService};
use crate::store::ProtocolInitializerStorer;
use crate::{MetricsService, SignaturePublisher};
use crate::MetricsService;

type StakeStoreService = Arc<StakeStore>;
type CertificateHandlerService = Arc<dyn AggregatorClient>;
Expand Down
2 changes: 0 additions & 2 deletions mithril-signer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod message_adapters;
pub mod metrics;
mod runtime;
pub mod services;
mod signature_publisher;
pub mod store;

pub use configuration::{Configuration, DefaultConfiguration};
Expand All @@ -22,7 +21,6 @@ pub use message_adapters::{
};
pub use metrics::*;
pub use runtime::*;
pub use signature_publisher::*;

/// HTTP request timeout duration in milliseconds
const HTTP_REQUEST_TIMEOUT_DURATION: u64 = 30000;
Expand Down
6 changes: 3 additions & 3 deletions mithril-signer/src/runtime/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,11 @@ impl Runner for SignerRunner {
mod tests {
use crate::metrics::MetricsService;
use crate::services::{
AggregatorClient, CardanoTransactionsImporter, DumbAggregatorClient, MithrilSingleSigner,
MockTransactionStore, MockUpkeepService, SingleSigner,
AggregatorClient, AggregatorHttpSignaturePublisher, CardanoTransactionsImporter,
DumbAggregatorClient, MithrilSingleSigner, MockSignaturePublisher, MockTransactionStore,
MockUpkeepService, SingleSigner,
};
use crate::store::ProtocolInitializerStore;
use crate::{AggregatorHttpSignaturePublisher, MockSignaturePublisher};
use mithril_common::{
api_version::APIVersionProvider,
cardano_block_scanner::DumbBlockScanner,
Expand Down
2 changes: 2 additions & 0 deletions mithril-signer/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

mod aggregator_client;
mod cardano_transactions;
mod signature_publisher;
mod single_signer;
mod upkeep_service;

#[cfg(test)]
pub use aggregator_client::dumb::DumbAggregatorClient;
pub use aggregator_client::*;
pub use cardano_transactions::*;
pub use signature_publisher::*;
pub use single_signer::*;
pub use upkeep_service::*;
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use mithril_common::entities::{SignedEntityType, SingleSignatures};
use mithril_common::StdResult;
use std::sync::Arc;

use crate::services::AggregatorClient;
use crate::SignaturePublisher;
use crate::services::{AggregatorClient, SignaturePublisher};

/// Publishes computed single signatures to an Aggregator http api.
pub struct AggregatorHttpSignaturePublisher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use mithril_common::StdResult;
use std::path::{Path, PathBuf};

use crate::message_adapters::ToRegisterSignatureMessageAdapter;
use crate::SignaturePublisher;
use crate::services::SignaturePublisher;

/// Publishes computed single signatures to a third party using unix socket.
pub struct UnixSocketSignaturePublisher {
Expand Down
6 changes: 3 additions & 3 deletions mithril-signer/tests/test_extensions/state_machine_tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ use mithril_signer::{
dependency_injection::{DependenciesBuilder, SignerDependencyContainer},
metrics::*,
services::{
AggregatorClient, CardanoTransactionsImporter, MithrilSingleSigner, SignerUpkeepService,
AggregatorClient, AggregatorHttpSignaturePublisher, CardanoTransactionsImporter,
MithrilSingleSigner, SignerUpkeepService,
},
store::{MKTreeStoreSqlite, ProtocolInitializerStore, ProtocolInitializerStorer},
AggregatorHttpSignaturePublisher, Configuration, MetricsService, RuntimeError, SignerRunner,
SignerState, StateMachine,
Configuration, MetricsService, RuntimeError, SignerRunner, SignerState, StateMachine,
};

use super::FakeAggregator;
Expand Down

0 comments on commit e95e2fb

Please sign in to comment.