Skip to content

Commit 31b258a

Browse files
authored
fix mithril snapshot validation (#258)
1 parent ed688fc commit 31b258a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rust/cardano-chain-follower/src/mithril_snapshot_config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,11 @@ impl MithrilSnapshotConfig {
359359
.map_err(|e| Error::MithrilClient(self.chain, url.clone(), e))?;
360360

361361
// Check we have a snapshot, and its for our network.
362-
match snapshots.first().and_then(|s| s.beacon.network.as_ref()) {
363-
Some(network) => {
364-
let _aggregator_network = Network::from_str(network.as_str()).map_err(|_err| {
365-
Error::MithrilClientNetworkMismatch(self.chain, network.clone())
362+
match snapshots.first() {
363+
Some(snapshot_info) => {
364+
let network = snapshot_info.network.as_str();
365+
let _aggregator_network = Network::from_str(network).map_err(|_err| {
366+
Error::MithrilClientNetworkMismatch(self.chain, network.to_string())
366367
})?;
367368
},
368369
None => return Err(Error::MithrilClientNoSnapshots(self.chain, url)),

0 commit comments

Comments
 (0)