* 2.10

* Use system.blockHashCount
This commit is contained in:
Jaco Greeff
2020-12-07 11:11:39 +01:00
committed by GitHub
parent 37f49b30de
commit 70f1fa5514
14 changed files with 96 additions and 76 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-derive",
"version": "2.9.2-13",
"version": "2.10.0",
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
"main": "index.js",
"sideEffects": false,
@@ -18,9 +18,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "2.9.2-13",
"@polkadot/rpc-core": "2.9.2-13",
"@polkadot/types": "2.9.2-13",
"@polkadot/api": "2.10.0",
"@polkadot/rpc-core": "2.10.0",
"@polkadot/types": "2.10.0",
"@polkadot/util": "^4.2.1",
"@polkadot/util-crypto": "^4.2.1",
"bn.js": "^4.11.9",
@@ -29,6 +29,6 @@
},
"devDependencies": {
"@polkadot/keyring": "^4.2.1",
"@polkadot/rpc-provider": "2.9.2-13"
"@polkadot/rpc-provider": "2.10.0"
}
}
+1 -1
View File
@@ -64,7 +64,7 @@ export function signingInfo (_instanceId: string, api: ApiInterfaceRx): (address
map(([nonce, header]) => ({
header,
mortalLength: Math.min(
FALLBACK_MAX_HASH_COUNT,
api.consts.system?.blockHashCount?.toNumber() || FALLBACK_MAX_HASH_COUNT,
MORTAL_PERIOD
.div(api.consts.babe?.expectedBlockTime || api.consts.timestamp?.minimumPeriod.muln(2) || FALLBACK_PERIOD)
.iadd(MAX_FINALITY_LAG)