Skip to content

Commit f7ad3de

Browse files
committed
feature(aggregator): WIP: add protocol-config dependency and start a local configuration implementation
1 parent 69e39ed commit f7ad3de

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ mithril-doc = { path = "../internal/mithril-doc" }
3535
mithril-era = { path = "../internal/mithril-era" }
3636
mithril-metric = { path = "../internal/mithril-metric" }
3737
mithril-persistence = { path = "../internal/mithril-persistence" }
38+
mithril-protocol-config = { path = "../internal/mithril-protocol-config" }
3839
mithril-resource-pool = { path = "../internal/mithril-resource-pool" }
3940
mithril-signed-entity-lock = { path = "../internal/signed-entity/mithril-signed-entity-lock" }
4041
mithril-signed-entity-preloader = { path = "../internal/signed-entity/mithril-signed-entity-preloader" }
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
use std::collections::BTreeSet;
2+
3+
use crate::entities::AggregatorEpochSettings;
4+
use async_trait::async_trait;
5+
use mithril_common::{StdResult, entities::SignedEntityTypeDiscriminants, test::double::Dummy};
6+
use mithril_protocol_config::{
7+
interface::MithrilNetworkConfigurationProvider, model::MithrilNetworkConfiguration,
8+
};
9+
10+
pub struct LocalMithrilNetworkConfigurationProvider {
11+
epoch_settings: AggregatorEpochSettings,
12+
allowed_discriminants: BTreeSet<SignedEntityTypeDiscriminants>,
13+
}
14+
15+
impl LocalMithrilNetworkConfigurationProvider {
16+
pub fn new(
17+
epoch_settings: AggregatorEpochSettings,
18+
allowed_discriminants: BTreeSet<SignedEntityTypeDiscriminants>,
19+
) -> Self {
20+
Self {
21+
epoch_settings,
22+
allowed_discriminants,
23+
}
24+
}
25+
}
26+
27+
#[async_trait]
28+
impl MithrilNetworkConfigurationProvider for LocalMithrilNetworkConfigurationProvider {
29+
async fn get(&self) -> StdResult<MithrilNetworkConfiguration> {
30+
Ok(MithrilNetworkConfiguration::dummy())
31+
}
32+
}

mithril-aggregator/src/dependency_injection/builder/enablers/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
mod cardano_node;
44
mod epoch;
55
mod misc;
6+
mod mithril_network_configuration;
67
mod ticker;

0 commit comments

Comments
 (0)