Skip to content

Commit

Permalink
fix: fix frame in the past for validatorBalances case
Browse files Browse the repository at this point in the history
  • Loading branch information
DiRaiks committed Apr 15, 2024
1 parent f892dc6 commit d555798
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ export const calculateFrameByValidatorBalances = (args: calculateFrameByValidato
const sweepingMean = calculateSweepingMean(totalValidators).toNumber();
const framesOfSweepingMean = Math.ceil(sweepingMean / epochPerFrame);

return result.add(framesOfSweepingMean).toNumber();
const resultFrame = result.add(framesOfSweepingMean).toNumber();

// If withdrawable_epoch is less than current frame, should return next frame
return resultFrame < currentFrame ? currentFrame + 1 : resultFrame;
};

0 comments on commit d555798

Please sign in to comment.