Skip to content

Commit

Permalink
Merge pull request #61 from Cardinal-Cryptography/A0-4125
Browse files Browse the repository at this point in the history
A0-4125: [staking-dashboard] When unbonding, leaving pool or unbonding in pool, time to withdraw is incorrect
  • Loading branch information
Marcin-Radecki authored Mar 4, 2024
2 parents 9d6c047 + 8eb9673 commit 0f813cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/library/Hooks/useErasToTimeLeft/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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) => {
if (!greaterThanZero(eras)) {
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)
Expand Down

0 comments on commit 0f813cb

Please sign in to comment.