Skip to content

Commit 8b829ff

Browse files
committed
update Cargo version
1 parent b4275b3 commit 8b829ff

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
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-aggregator/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-aggregator"
3-
version = "0.2.49"
3+
version = "0.2.50"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-aggregator/src/ticker_service.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct MithrilTickerService {
4444
}
4545

4646
impl MithrilTickerService {
47-
/// Instanciate a new service
47+
/// Instantiate a new service
4848
pub fn new(
4949
chain_observer: Arc<dyn ChainObserver>,
5050
immutable_observer: Arc<dyn ImmutableFileObserver>,
@@ -127,4 +127,28 @@ mod tests {
127127
beacon
128128
)
129129
}
130+
131+
#[tokio::test]
132+
async fn no_beacon_error() {
133+
let mut chain_observer = MockChainObserver::new();
134+
chain_observer
135+
.expect_get_current_epoch()
136+
.returning(|| Ok(None))
137+
.times(1);
138+
let immutable_observer = DumbImmutableFileObserver::new();
139+
immutable_observer.shall_return(Some(99)).await;
140+
let network = CardanoNetwork::DevNet(42);
141+
142+
let ticker_service = MithrilTickerService::new(
143+
Arc::new(chain_observer),
144+
Arc::new(immutable_observer),
145+
network,
146+
);
147+
let error = ticker_service.get_current_epoch().await.unwrap_err();
148+
let error = error
149+
.downcast_ref::<MithrilTickerError>()
150+
.expect("Expected error was a `MithrilTickerError`.");
151+
152+
assert!(matches!(error, MithrilTickerError::NoEpoch));
153+
}
130154
}

0 commit comments

Comments
 (0)