Skip to content

Commit 5e110f0

Browse files
committed
fix(cardano-chain-follower): slot
Signed-off-by: bkioshn <[email protected]>
1 parent 81bc839 commit 5e110f0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async fn process_rollback(
194194
let slot_rollback_size = if head_slot > rollback_slot {
195195
head_slot - rollback_slot
196196
} else {
197-
0
197+
0.into()
198198
};
199199

200200
// We actually do the work here...
@@ -203,7 +203,7 @@ async fn process_rollback(
203203
// We never really know how many blocks are rolled back when advised by the peer, but we
204204
// can work out how many slots. This function wraps the real work, so we can properly
205205
// record the stats when the rollback is complete. Even if it errors.
206-
stats::rollback(chain, stats::RollbackType::Peer, slot_rollback_size);
206+
stats::rollback(chain, stats::RollbackType::Peer, slot_rollback_size.into());
207207

208208
Ok(response)
209209
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{
66
sync::{Arc, Mutex},
77
};
88

9-
use cardano_blockchain_types::{MultiEraBlock, Network, Point, Slot};
9+
use cardano_blockchain_types::{MultiEraBlock, Network, Point};
1010
use logcall::logcall;
1111
use tokio::task;
1212
use tracing::{debug, error};
@@ -54,7 +54,7 @@ pub(crate) struct MithrilSnapshotIterator {
5454
pub(crate) fn probe_point(point: &Point, distance: u64) -> Point {
5555
// Now that we have the tip, step back about 4 block intervals from tip, and do a fuzzy
5656
// iteration to find the exact two blocks at the end of the immutable chain.
57-
let step_back_search = Slot::from_saturating(point.slot_or_default().into() - distance);
57+
let step_back_search = point.slot_or_default() - distance.into();
5858

5959
// We stepped back to the origin, so just return Origin
6060
if step_back_search == 0.into() {

0 commit comments

Comments
 (0)