Skip to content

Commit d8bce5f

Browse files
committed
feature(protocol-config): switch to hashmap for signed_entity_types_config
1 parent e4e8b82 commit d8bce5f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

internal/mithril-protocol-config/src/http_client/http_impl.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
use anyhow::anyhow;
2-
use std::{collections::BTreeSet, sync::Arc, time::Duration};
2+
use std::{
3+
collections::{BTreeSet, HashMap},
4+
sync::Arc,
5+
time::Duration,
6+
};
37

48
use crate::{
59
HTTP_REQUEST_TIMEOUT_DURATION,
@@ -46,7 +50,7 @@ impl MithrilNetworkConfigurationProvider for HttpMithrilNetworkConfigurationProv
4650
};
4751

4852
let available_signed_entity_types = BTreeSet::new(); // To be implemented to be retrieve from /aggreagator-features from aggregator_client.rs
49-
let signed_entity_types_config = vec![]; // To be implemented
53+
let signed_entity_types_config = HashMap::new(); // To be implemented
5054

5155
Ok(MithrilNetworkConfiguration {
5256
epoch: epoch_settings.epoch,

internal/mithril-protocol-config/src/model.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::BTreeSet;
1+
use std::collections::{BTreeSet, HashMap};
22

33
use mithril_common::entities::{
44
CardanoTransactionsSigningConfig, Epoch, ProtocolParameters, SignedEntityTypeDiscriminants,
@@ -21,5 +21,6 @@ pub struct MithrilNetworkConfiguration {
2121
pub available_signed_entity_types: BTreeSet<SignedEntityTypeDiscriminants>,
2222

2323
/// Custom configurations for signed entity types (e.g. `cardano_transactions_signing_config` for `CardanoTransactions`)
24-
pub signed_entity_types_config: Vec<SignedEntityTypeConfiguration>, //or HashMap<SignedEntityTypeDiscriminant, SignedEntityTypeConfiguration>
24+
pub signed_entity_types_config:
25+
HashMap<SignedEntityTypeDiscriminants, SignedEntityTypeConfiguration>,
2526
}

0 commit comments

Comments
 (0)