Skip to content

Commit 4fa3e67

Browse files
committed
Use improved traits of Slot data structure
1 parent 1fa0e6c commit 4fa3e67

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

crates/sc-consensus-subspace/src/slot_worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ where
417417
// Ensure proof of time is valid according to parent block
418418
if !self.pot_verifier.is_output_valid(
419419
pot_input,
420-
Slot::from(u64::from(slot) - u64::from(parent_slot)),
420+
slot - parent_slot,
421421
proof_of_time,
422422
parent_pot_parameters.next_parameters_change(),
423423
) {

crates/sc-proof-of-time/src/source/gossip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ where
580580
match GossipProof::decode(&mut data) {
581581
Ok(proof) => {
582582
let next_slot_input = self.state.next_slot_input(atomic::Ordering::Relaxed);
583-
let current_slot = Slot::from(u64::from(next_slot_input.slot) - 1);
583+
let current_slot = next_slot_input.slot - Slot::from(1);
584584

585585
if proof.slot < current_slot {
586586
trace!(

crates/subspace-service/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ where
341341
if quick_verification {
342342
pot_verifier.try_is_output_valid(
343343
pot_input,
344-
Slot::from(slot - u64::from(parent_slot)),
344+
Slot::from(slot) - parent_slot,
345345
proof_of_time,
346346
pot_parameters.next_parameters_change(),
347347
)
348348
} else {
349349
pot_verifier.is_output_valid(
350350
pot_input,
351-
Slot::from(slot - u64::from(parent_slot)),
351+
Slot::from(slot) - parent_slot,
352352
proof_of_time,
353353
pot_parameters.next_parameters_change(),
354354
)

0 commit comments

Comments
 (0)