diff --git a/packages/react-hooks/src/useAvailableSlashes.ts b/packages/react-hooks/src/useAvailableSlashes.ts index 26e840e403..b7bf637700 100644 --- a/packages/react-hooks/src/useAvailableSlashes.ts +++ b/packages/react-hooks/src/useAvailableSlashes.ts @@ -8,7 +8,7 @@ import type { PalletStakingUnappliedSlash } from '@polkadot/types/lookup'; import { useEffect, useState } from 'react'; -import { BN, BN_ONE, BN_ZERO } from '@polkadot/util'; +import { BN, BN_HUNDRED, BN_ONE, BN_ZERO } from '@polkadot/util'; import { createNamedHook } from './createNamedHook'; import { useApi } from './useApi'; @@ -28,9 +28,10 @@ function useAvailableSlashesImpl (): [BN, PalletStakingUnappliedSlash[]][] { let unsub: Unsub | undefined; const [from, offset] = api.query.staking?.earliestUnappliedSlash ? [earliestSlash && earliestSlash.unwrapOr(null), BN_ZERO] - : [indexes?.activeEra, api.consts.staking?.slashDeferDuration]; + // future depth (one more than activeEra for delay) + : [indexes?.activeEra, BN_ONE.add(api.consts.staking?.slashDeferDuration || BN_HUNDRED)]; - if (mountedRef.current && indexes && from && offset) { + if (mountedRef.current && indexes && from) { const range: BN[] = []; const end = indexes.activeEra.add(offset); let start = new BN(from);