diff --git a/src/components/ManaCalculator/index.tsx b/src/components/ManaCalculator/index.tsx index 3c8c1d0fb2c..8ce38b7ecc0 100644 --- a/src/components/ManaCalculator/index.tsx +++ b/src/components/ManaCalculator/index.tsx @@ -20,6 +20,7 @@ import { ValidatorParameters, } from './types'; import { Details } from '@docusaurus/theme-common/Details'; +import { EPOCH } from './utils'; function ValidatorCard({ validator, @@ -92,7 +93,6 @@ function ValidatorCard({ export default function ManaCalculator() { const [state, setState] = useState({ - epoch: 1154 + 1, initialEpoch: 0, finalEpoch: 100, validators: [ @@ -242,13 +242,6 @@ export default function ManaCalculator() { }); } - function handleEpochChange(value: number) { - setState({ - ...state, - epoch: value, - }); - } - function handleInitialEpochChange(value: number) { setState({ ...state, @@ -280,14 +273,14 @@ export default function ManaCalculator() { state.delegator.validator, null, state.validators, - state.epoch, + EPOCH, null, 'Delegator', ); let passiveRewards = calculatePassiveRewards( state.stake, - state.epoch, - state.epoch + 1, + EPOCH, + EPOCH + 1, ); let grantedTPS = calculateTPS(manaGeneratedPerEpoch, state.congestion); @@ -312,7 +305,7 @@ export default function ManaCalculator() { state.validator.attractedDelegatedStakeFromOtherPools, } as ValidatorParameters, state.validators, - state.epoch, + EPOCH, null, 'Validator', ); @@ -387,14 +380,6 @@ export default function ManaCalculator() {
-
- - handleEpochChange(Number(e.target.value))} - > -
{state.validators.map((validator, i) => ( diff --git a/src/components/ManaCalculator/utils.ts b/src/components/ManaCalculator/utils.ts index 4906bd9f183..47b916629e0 100644 --- a/src/components/ManaCalculator/utils.ts +++ b/src/components/ManaCalculator/utils.ts @@ -12,6 +12,7 @@ const REWARDS_MANA_SHARE_COEFFICIENT = 2; export const RMC_LOW_CONGESTION = 100000; export const RMC_STABLE_CONGESTION = 9000000; export const RMC_EXTREME_CONGESTION = 500000000; +export const EPOCH = 1154 + 1; // given t in seconds, returns the slot that time t belongs to function time_to_slot(t: number): number {