Skip to content

Commit 17fe97e

Browse files
authored
Merge pull request #2829 from input-output-hk/jpraynaud/2826-update-signed-entity-type-timeout
chore: update signed entity type timeouts
2 parents 8f12c05 + a5c22a0 commit 17fe97e

File tree

4 files changed

+38
-10
lines changed

4 files changed

+38
-10
lines changed

Cargo.lock

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

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.6.29"
3+
version = "0.6.30"
44
description = "Common types, interfaces, and utilities for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-common/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ CARGO = cargo
55
all: test build
66

77
build:
8-
${CARGO} build --release --features full
8+
${CARGO} build --release
99

1010
test:
11-
${CARGO} test --features full
11+
${CARGO} test
1212

1313
check:
1414
${CARGO} check --release --all-features --all-targets
1515
${CARGO} clippy --release --all-features --all-targets
1616
${CARGO} fmt --check
1717

1818
doc:
19-
${CARGO} doc --no-deps --open --features full
19+
${CARGO} doc --no-deps --open
2020

2121
bench:
22-
${CARGO} bench --features full --verbose
22+
${CARGO} bench --verbose

mithril-common/src/entities/signed_entity_type.rs

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ impl SignedEntityType {
127127
/// Return the associated open message timeout
128128
pub fn get_open_message_timeout(&self) -> Option<Duration> {
129129
match self {
130-
Self::MithrilStakeDistribution(_) | Self::CardanoImmutableFilesFull(_) => None,
131-
Self::CardanoStakeDistribution(_) => Some(Duration::from_secs(600)),
132-
Self::CardanoTransactions(_, _) => Some(Duration::from_secs(1800)),
133-
Self::CardanoDatabase(_) => Some(Duration::from_secs(1800)),
130+
Self::MithrilStakeDistribution(_) => Some(Duration::from_secs(3600)),
131+
Self::CardanoImmutableFilesFull(_) => Some(Duration::from_secs(600)),
132+
Self::CardanoStakeDistribution(_) => Some(Duration::from_secs(1800)),
133+
Self::CardanoTransactions(_, _) => Some(Duration::from_secs(600)),
134+
Self::CardanoDatabase(_) => Some(Duration::from_secs(600)),
134135
}
135136
}
136137

@@ -377,6 +378,33 @@ mod tests {
377378
);
378379
}
379380

381+
#[test]
382+
fn get_open_message_timeout() {
383+
assert_eq!(
384+
SignedEntityType::MithrilStakeDistribution(Epoch(1)).get_open_message_timeout(),
385+
Some(Duration::from_secs(3600))
386+
);
387+
assert_eq!(
388+
SignedEntityType::CardanoImmutableFilesFull(CardanoDbBeacon::new(1, 1))
389+
.get_open_message_timeout(),
390+
Some(Duration::from_secs(600))
391+
);
392+
assert_eq!(
393+
SignedEntityType::CardanoStakeDistribution(Epoch(1)).get_open_message_timeout(),
394+
Some(Duration::from_secs(1800))
395+
);
396+
assert_eq!(
397+
SignedEntityType::CardanoTransactions(Epoch(1), BlockNumber(1))
398+
.get_open_message_timeout(),
399+
Some(Duration::from_secs(600))
400+
);
401+
assert_eq!(
402+
SignedEntityType::CardanoDatabase(CardanoDbBeacon::new(1, 1))
403+
.get_open_message_timeout(),
404+
Some(Duration::from_secs(600))
405+
);
406+
}
407+
380408
#[test]
381409
fn serialize_beacon_to_json() {
382410
let cardano_stake_distribution_json = SignedEntityType::CardanoStakeDistribution(Epoch(25))

0 commit comments

Comments
 (0)