Skip to content

Commit

Permalink
feat: update calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
euharrison committed Aug 29, 2024
1 parent 7e3a95b commit e7ddecc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/namadillo/src/atoms/chain/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ export const calculateUnbondingPeriod = (parameters: Parameters): string => {
// + 1 because we unbonding period starts from the next epoch
1;
const minEpochDuration = Number(parameters.minDuration);
const minNumOfBlocks = Number(parameters.minNumOfBlocks);
const maxBlockTime = Number(parameters.maxBlockTime);
const epochSwitchBlocksDelay = Number(parameters.epochSwitchBlocksDelay);

// Because epoch duration is in reality longer by epochSwitchBlocksDelay we have to account for that
const timePerBlock = minEpochDuration / minNumOfBlocks;
const realMinEpochDuration =
minEpochDuration + timePerBlock * epochSwitchBlocksDelay;
minEpochDuration + maxBlockTime * epochSwitchBlocksDelay;

return singleUnitDurationFromInterval(
0,
Expand Down

0 comments on commit e7ddecc

Please sign in to comment.