Skip to content

Commit

Permalink
Fix era end check
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Sep 20, 2024
1 parent 7b1770c commit 9aa5372
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export function epochProgress(epochInfo: Network.EpochInfo) {
absoluteSlot += Math.floor((date.getTime() - era.start.getTime()) / 1e3 / era.slotInSeconds)
break
}
absoluteSlot += Math.floor((era.end.getTime() - era.start.getTime()) / 1e3 / era.slotInSeconds)
absoluteSlot += Math.floor(
((era.end?.getTime() ?? new Date().getTime()) - era.start.getTime()) / 1e3 / era.slotInSeconds,
)
}

if (date > epochEnd || date < epochStart) {
Expand Down

0 comments on commit 9aa5372

Please sign in to comment.