diff --git a/Cargo.lock b/Cargo.lock index e41d565b5fa..b2081f83513 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3996,7 +3996,7 @@ dependencies = [ [[package]] name = "mithril-common" -version = "0.6.29" +version = "0.6.30" dependencies = [ "anyhow", "async-trait", diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml index 8bb419fbd87..0691f3113ef 100644 --- a/mithril-common/Cargo.toml +++ b/mithril-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-common" -version = "0.6.29" +version = "0.6.30" description = "Common types, interfaces, and utilities for Mithril nodes." authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-common/Makefile b/mithril-common/Makefile index c3e68deb9a6..39a2e49a7b6 100644 --- a/mithril-common/Makefile +++ b/mithril-common/Makefile @@ -5,10 +5,10 @@ CARGO = cargo all: test build build: - ${CARGO} build --release --features full + ${CARGO} build --release test: - ${CARGO} test --features full + ${CARGO} test check: ${CARGO} check --release --all-features --all-targets @@ -16,7 +16,7 @@ check: ${CARGO} fmt --check doc: - ${CARGO} doc --no-deps --open --features full + ${CARGO} doc --no-deps --open bench: - ${CARGO} bench --features full --verbose + ${CARGO} bench --verbose diff --git a/mithril-common/src/entities/signed_entity_type.rs b/mithril-common/src/entities/signed_entity_type.rs index 397c8c0057e..5ec27a6e4ec 100644 --- a/mithril-common/src/entities/signed_entity_type.rs +++ b/mithril-common/src/entities/signed_entity_type.rs @@ -127,10 +127,11 @@ impl SignedEntityType { /// Return the associated open message timeout pub fn get_open_message_timeout(&self) -> Option { match self { - Self::MithrilStakeDistribution(_) | Self::CardanoImmutableFilesFull(_) => None, - Self::CardanoStakeDistribution(_) => Some(Duration::from_secs(600)), - Self::CardanoTransactions(_, _) => Some(Duration::from_secs(1800)), - Self::CardanoDatabase(_) => Some(Duration::from_secs(1800)), + Self::MithrilStakeDistribution(_) => Some(Duration::from_secs(3600)), + Self::CardanoImmutableFilesFull(_) => Some(Duration::from_secs(600)), + Self::CardanoStakeDistribution(_) => Some(Duration::from_secs(1800)), + Self::CardanoTransactions(_, _) => Some(Duration::from_secs(600)), + Self::CardanoDatabase(_) => Some(Duration::from_secs(600)), } } @@ -377,6 +378,33 @@ mod tests { ); } + #[test] + fn get_open_message_timeout() { + assert_eq!( + SignedEntityType::MithrilStakeDistribution(Epoch(1)).get_open_message_timeout(), + Some(Duration::from_secs(3600)) + ); + assert_eq!( + SignedEntityType::CardanoImmutableFilesFull(CardanoDbBeacon::new(1, 1)) + .get_open_message_timeout(), + Some(Duration::from_secs(600)) + ); + assert_eq!( + SignedEntityType::CardanoStakeDistribution(Epoch(1)).get_open_message_timeout(), + Some(Duration::from_secs(1800)) + ); + assert_eq!( + SignedEntityType::CardanoTransactions(Epoch(1), BlockNumber(1)) + .get_open_message_timeout(), + Some(Duration::from_secs(600)) + ); + assert_eq!( + SignedEntityType::CardanoDatabase(CardanoDbBeacon::new(1, 1)) + .get_open_message_timeout(), + Some(Duration::from_secs(600)) + ); + } + #[test] fn serialize_beacon_to_json() { let cardano_stake_distribution_json = SignedEntityType::CardanoStakeDistribution(Epoch(25))