Add Subspace expected block time (#6665)

* extract expectedBlockTime for non babe chains

* Apply suggested changes on block time
This commit is contained in:
1devNdogs 2021-12-11 07:11:05 -03:00 committed by GitHub
parent 974a85b991
commit b7baf1b47f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,9 @@ function useBlockTimeImpl (blocks: number | BN = BN_ONE, apiOverride?: ApiPromis
// Babe
a.consts.babe?.expectedBlockTime ||
// POW, eg. Kulupu
a.consts.difficulty?.targetBlockTime || (
a.consts.difficulty?.targetBlockTime ||
// Subspace
a.consts.subspace?.expectedBlockTime || (
// Check against threshold to determine value validity
a.consts.timestamp?.minimumPeriod.gte(THRESHOLD)
// Default minimum period config