From 195e3d8b76526b03bd4e0825c269d53c340eafe5 Mon Sep 17 00:00:00 2001 From: truemiller <31908788+truemiller@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:57:09 +0100 Subject: [PATCH] chore: Refactor Autonolas.ts to use Math.floor instead of Math.round for calculating nowInSeconds --- frontend/service/Autonolas.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/service/Autonolas.ts b/frontend/service/Autonolas.ts index cd7d79070..550ad8978 100644 --- a/frontend/service/Autonolas.ts +++ b/frontend/service/Autonolas.ts @@ -99,7 +99,7 @@ const getAgentStakingRewardsInfo = async ({ uint256 inactivity;} */ - const nowInSeconds = Math.round(Date.now() / 1000); + const nowInSeconds = Math.floor(Date.now() / 1000); const requiredMechRequests = (Math.ceil(Math.max(livenessPeriod, nowInSeconds - lastTsCheckpoint)) * @@ -147,7 +147,7 @@ const getAvailableRewardsForEpoch = async (): Promise => { const [rewardsPerSecond, epochLength, tsCheckpoint] = multicallResponse; - const nowInSeconds = Math.round(Date.now() / 1000); + const nowInSeconds = Math.floor(Date.now() / 1000); return Math.max( rewardsPerSecond * epochLength,