From 8eb9673316f018878b09a1a716632712701d3001 Mon Sep 17 00:00:00 2001 From: Marcin Date: Fri, 1 Mar 2024 14:33:19 +0100 Subject: [PATCH] A0-4125: [staking-dashboard] When unbonding, leaving pool or unbonding in pool, time to withdraw is incorrect --- src/library/Hooks/useErasToTimeLeft/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/Hooks/useErasToTimeLeft/index.tsx b/src/library/Hooks/useErasToTimeLeft/index.tsx index bd27343776..36ad664e69 100644 --- a/src/library/Hooks/useErasToTimeLeft/index.tsx +++ b/src/library/Hooks/useErasToTimeLeft/index.tsx @@ -7,7 +7,7 @@ import { useApi } from 'contexts/Api'; export const useErasToTimeLeft = () => { const { consts } = useApi(); - const { epochDuration, expectedBlockTime, sessionsPerEra } = consts; + const { expectedEraTime, expectedBlockTime } = consts; // converts a number of eras to timeleft in seconds. const erasToSeconds = (eras: BigNumber) => { @@ -15,7 +15,7 @@ export const useErasToTimeLeft = () => { return 0; } // store the duration of an era in number of blocks. - const eraDurationBlocks = epochDuration.multipliedBy(sessionsPerEra); + const eraDurationBlocks = expectedEraTime.dividedBy(1000); // estimate the duration of the era in seconds. const eraDuration = eraDurationBlocks .multipliedBy(expectedBlockTime)