From 8ef4ed18dd281adfef3ce9e8f0bede8a82e62ec9 Mon Sep 17 00:00:00 2001 From: fixxxedpoint Date: Wed, 1 Sep 2021 13:25:35 +0200 Subject: [PATCH] Changed THRESHOLD in useBlockTime so chains that uses values smaller than 1s for the MinimumPeriod (pallet_timestamp) parameter are displayed correctly (#6045) --- packages/react-hooks/src/useBlockTime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-hooks/src/useBlockTime.ts b/packages/react-hooks/src/useBlockTime.ts index 5a234ad978..9be6e75690 100644 --- a/packages/react-hooks/src/useBlockTime.ts +++ b/packages/react-hooks/src/useBlockTime.ts @@ -17,7 +17,7 @@ const DEFAULT_TIME = new BN(6_000); // Some chains incorrectly use these, i.e. it is se to values such as 0 or even 2 // Use a low minimum validity threshold to check these against -const THRESHOLD = BN_THOUSAND; +const THRESHOLD = BN_THOUSAND.div(BN_TWO); export function useBlockTime (blocks: number | BN = BN_ONE, apiOverride?: ApiPromise | null): Result { const { t } = useTranslation();