Skip to content

Commit 0565876

Browse files
committed
rename to signed entity service
1 parent 88d4e46 commit 0565876

File tree

10 files changed

+11
-31
lines changed

10 files changed

+11
-31
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
//! The module used for building artifact
2-
3-
mod artifact_builder_service;
42
mod cardano_immutable_files_full;
53
mod interface;
64
mod mithril_stake_distribution;
75

8-
pub use artifact_builder_service::*;
96
pub use cardano_immutable_files_full::*;
107
pub use interface::*;
118
pub use mithril_stake_distribution::*;

mithril-aggregator/src/database/provider/signed_entity.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use async_trait::async_trait;
77

88
use mithril_common::{
99
entities::{SignedEntity, SignedEntityType, SignedEntityTypeDiscriminants, Snapshot},
10-
signable_builder::Artifact,
1110
sqlite::{
1211
EntityCursor, HydrationError, Projection, Provider, SourceAlias, SqLiteEntity,
1312
WhereCondition,
@@ -63,7 +62,7 @@ impl From<SignedEntityRecord> for Snapshot {
6362

6463
impl<T> TryFrom<SignedEntityRecord> for SignedEntity<T>
6564
where
66-
T: Serialize + Deserialize,
65+
for<'a> T: Serialize + Deserialize<'a>,
6766
{
6867
type Error = serde_json::error::Error;
6968

mithril-aggregator/src/dependency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use std::{collections::HashMap, sync::Arc};
1717
use tokio::sync::{Mutex, RwLock};
1818

1919
use crate::event_store::EventMessage;
20+
use crate::signed_entity_service::SignedEntityService;
2021
use crate::{
21-
artifact_builder::SignedEntityService,
2222
certifier_service::CertifierService,
2323
configuration::*,
2424
database::provider::{SignedEntityStorer, StakePoolStore},

mithril-aggregator/src/dependency_injection/builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ use warp::Filter;
3737

3838
use crate::{
3939
artifact_builder::{
40-
CardanoImmutableFilesFullArtifactBuilder, MithrilSignedEntityService,
41-
MithrilStakeDistributionArtifactBuilder, SignedEntityService,
40+
CardanoImmutableFilesFullArtifactBuilder, MithrilStakeDistributionArtifactBuilder,
4241
},
4342
certifier_service::{CertifierService, MithrilCertifierService},
4443
configuration::ExecutionEnvironment,
@@ -49,6 +48,7 @@ use crate::{
4948
},
5049
event_store::{EventMessage, EventStore, TransmitterService},
5150
http_server::routes::router,
51+
signed_entity_service::{MithrilSignedEntityService, SignedEntityService},
5252
signer_registerer::SignerRecorder,
5353
stake_distribution_service::{MithrilStakeDistributionService, StakeDistributionService},
5454
ticker_service::{MithrilTickerService, TickerService},
@@ -894,13 +894,13 @@ impl DependenciesBuilder {
894894
let cardano_immutable_files_full_artifact_builder = Arc::new(
895895
CardanoImmutableFilesFullArtifactBuilder::new(snapshotter, snapshot_uploader),
896896
);
897-
let artifact_builder_service = Arc::new(MithrilSignedEntityService::new(
897+
let signed_entity_service = Arc::new(MithrilSignedEntityService::new(
898898
signed_entity_storer,
899899
mithril_stake_distribution_artifact_builder,
900900
cardano_immutable_files_full_artifact_builder,
901901
));
902902

903-
Ok(artifact_builder_service)
903+
Ok(signed_entity_service)
904904
}
905905

906906
/// [ArtifactBuilderService] service

mithril-aggregator/src/http_server/routes/artifact_routes/mithril_stake_distribution.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod handlers {
3636
use crate::message_adapters::{
3737
ToMithrilStakeDistributionListMessageAdapter, ToMithrilStakeDistributionMessageAdapter,
3838
};
39-
use crate::SignedEntityService;
39+
use crate::signed_entity_service::SignedEntityService;
4040
use mithril_common::messages::MessageAdapter;
4141
use slog_scope::{debug, warn};
4242
use std::convert::Infallible;
@@ -96,6 +96,7 @@ pub mod handlers {
9696
#[cfg(test)]
9797
pub mod tests {
9898
use crate::http_server::SERVER_BASE_PATH;
99+
use mithril_common::entities::SignedEntityType;
99100
use mithril_common::sqlite::HydrationError;
100101
use mithril_common::test_utils::apispec::APISpec;
101102
use mithril_common::test_utils::fake_data;

mithril-aggregator/src/http_server/routes/artifact_routes/snapshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ mod handlers {
9393
use crate::http_server::SERVER_BASE_PATH;
9494
use crate::message_adapters::ToSnapshotListMessageAdapter;
9595
use crate::message_adapters::ToSnapshotMessageAdapter;
96-
use crate::{Configuration, SignedEntityService};
96+
use crate::{signed_entity_service::SignedEntityService, Configuration};
9797
use mithril_common::messages::MessageAdapter;
9898
use slog_scope::{debug, warn};
9999
use std::convert::Infallible;

mithril-aggregator/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mod http_server;
2424
mod message_adapters;
2525
mod multi_signer;
2626
mod runtime;
27+
pub mod signed_entity_service;
2728
mod signer_registerer;
2829
mod snapshot_uploaders;
2930
mod snapshotter;
@@ -32,7 +33,7 @@ mod store;
3233
pub mod ticker_service;
3334
mod tools;
3435

35-
pub use crate::artifact_builder::{ArtifactBuilder, SignedEntityService};
36+
pub use crate::artifact_builder::ArtifactBuilder;
3637
pub use crate::configuration::{
3738
Configuration, DefaultConfiguration, ExecutionEnvironment, SnapshotUploaderType,
3839
};
File renamed without changes.

mithril-common/src/entities/mithril_stake_distribution.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use crate::{
66
signable_builder::Artifact,
77
};
88

9-
use super::SignedEntityTypeDiscriminants;
10-
119
/// Mithril Stake Distribution
1210
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
1311
pub struct MithrilStakeDistribution {
@@ -59,11 +57,4 @@ impl Artifact for MithrilStakeDistribution {
5957
fn get_id(&self) -> String {
6058
self.hash.clone()
6159
}
62-
63-
fn get_entity_type_id() -> SignedEntityTypeDiscriminants
64-
where
65-
Self: Sized,
66-
{
67-
SignedEntityTypeDiscriminants::MithrilStakeDistribution
68-
}
6960
}

mithril-common/src/entities/snapshot.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use crate::{entities::Beacon, signable_builder::Artifact};
22
use serde::{Deserialize, Serialize};
33

4-
use super::SignedEntityTypeDiscriminants;
5-
64
/// Snapshot represents a snapshot file and its metadata
75
#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
86
pub struct Snapshot {
@@ -51,11 +49,4 @@ impl Artifact for Snapshot {
5149
fn get_id(&self) -> String {
5250
self.digest.clone()
5351
}
54-
55-
fn get_entity_type_id() -> SignedEntityTypeDiscriminants
56-
where
57-
Self: Sized,
58-
{
59-
SignedEntityTypeDiscriminants::CardanoImmutableFilesFull
60-
}
6152
}

0 commit comments

Comments
 (0)