@polkadot/types-known 9.14.2 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +2 -5
- package/chain/index.js +0 -4
- package/cjs/bundle.js +8 -34
- package/cjs/chain/index.js +2 -11
- package/cjs/detectOther.js +3 -10
- package/cjs/detectPackage.js +6 -11
- package/cjs/index.js +3 -15
- package/cjs/packageInfo.js +2 -16
- package/cjs/spec/centrifuge-chain.js +99 -93
- package/cjs/spec/index.js +23 -32
- package/cjs/spec/kusama.js +201 -195
- package/cjs/spec/node-template.js +12 -20
- package/cjs/spec/node.js +12 -20
- package/cjs/spec/polkadot.js +77 -82
- package/cjs/spec/rococo.js +52 -59
- package/cjs/spec/shell.js +10 -18
- package/cjs/spec/statemint.js +49 -50
- package/cjs/spec/westend.js +95 -96
- package/cjs/upgrades/e2e/index.js +11 -26
- package/cjs/upgrades/e2e/kusama.js +4176 -14
- package/cjs/upgrades/e2e/polkadot.js +2626 -14
- package/cjs/upgrades/e2e/westend.js +4014 -14
- package/cjs/upgrades/index.js +23 -40
- package/cjs/upgrades/manual/index.js +11 -26
- package/cjs/upgrades/manual/kusama.js +20 -13
- package/cjs/upgrades/manual/polkadot.js +13 -11
- package/cjs/upgrades/manual/westend.js +18 -11
- package/cjs/upgrades/types.js +2 -1
- package/cjs/util.js +55 -105
- package/detectOther.js +0 -3
- package/detectPackage.js +2 -7
- package/index.js +2 -5
- package/package.json +11 -8
- package/packageInfo.js +1 -11
- package/spec/centrifuge-chain.js +95 -84
- package/spec/index.js +20 -25
- package/spec/kusama.js +197 -187
- package/spec/node-template.js +10 -13
- package/spec/node.js +10 -13
- package/spec/polkadot.js +74 -75
- package/spec/rococo.js +48 -52
- package/spec/shell.js +8 -11
- package/spec/statemint.js +45 -42
- package/spec/westend.js +91 -88
- package/upgrades/e2e/index.js +3 -6
- package/upgrades/e2e/kusama.js +4174 -7
- package/upgrades/e2e/polkadot.js +2624 -7
- package/upgrades/e2e/westend.js +4012 -7
- package/upgrades/index.js +17 -25
- package/upgrades/manual/index.js +3 -6
- package/upgrades/manual/kusama.js +18 -6
- package/upgrades/manual/polkadot.js +11 -4
- package/upgrades/manual/westend.js +16 -4
- package/util.js +42 -77
package/upgrades/index.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
// Copyright 2017-2023 @polkadot/types-known authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
1
|
import { selectableNetworks } from '@polkadot/networks';
|
|
5
2
|
import { BN, hexToU8a } from '@polkadot/util';
|
|
6
|
-
import * as allKnown from
|
|
7
|
-
|
|
8
|
-
// testnets are not available in the networks map
|
|
3
|
+
import * as allKnown from './e2e/index.js';
|
|
9
4
|
const NET_EXTRA = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
westend: {
|
|
6
|
+
genesisHash: ['0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e']
|
|
7
|
+
}
|
|
13
8
|
};
|
|
14
|
-
|
|
15
9
|
/** @internal */
|
|
16
10
|
function mapRaw([network, versions]) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
const chain = selectableNetworks.find((n) => n.network === network) || NET_EXTRA[network];
|
|
12
|
+
if (!chain) {
|
|
13
|
+
throw new Error(`Unable to find info for chain ${network}`);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
genesisHash: hexToU8a(chain.genesisHash[0]),
|
|
17
|
+
network,
|
|
18
|
+
versions: versions.map(([blockNumber, specVersion, apis]) => ({
|
|
19
|
+
apis,
|
|
20
|
+
blockNumber: new BN(blockNumber),
|
|
21
|
+
specVersion: new BN(specVersion)
|
|
22
|
+
}))
|
|
23
|
+
};
|
|
30
24
|
}
|
|
31
|
-
|
|
32
|
-
// Type overrides for specific spec types & versions as given in runtimeVersion
|
|
33
25
|
const upgrades = Object.entries(allKnown).map(mapRaw);
|
|
34
26
|
export default upgrades;
|
package/upgrades/manual/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { default as kusama } from "./kusama.js";
|
|
5
|
-
export { default as polkadot } from "./polkadot.js";
|
|
6
|
-
export { default as westend } from "./westend.js";
|
|
1
|
+
export { default as kusama } from './kusama.js';
|
|
2
|
+
export { default as polkadot } from './polkadot.js';
|
|
3
|
+
export { default as westend } from './westend.js';
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[
|
|
1
|
+
const upgrades = [
|
|
2
|
+
[0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
|
|
3
|
+
[67651, 1025], [82191, 1027], [83238, 1028], [101503, 1029], [203466, 1030],
|
|
4
|
+
[295787, 1031], [461692, 1032], [504329, 1033], [569327, 1038], [587687, 1039],
|
|
5
|
+
[653183, 1040], [693488, 1042], [901442, 1045], [1375086, 1050], [1445458, 1051],
|
|
6
|
+
[1472960, 1052], [1475648, 1053], [1491596, 1054], [1574408, 1055], [2064961, 1058],
|
|
7
|
+
[2201991, 1062], [2671528, 2005], [2704202, 2007], [2728002, 2008], [2832534, 2011],
|
|
8
|
+
[2962294, 2012], [3240000, 2013], [3274408, 2015], [3323565, 2019], [3534175, 2022],
|
|
9
|
+
[3860281, 2023], [4143129, 2024], [4401242, 2025], [4841367, 2026], [5961600, 2027],
|
|
10
|
+
[6137912, 2028], [6561855, 2029], [7100891, 2030], [7468792, 9010], [7668600, 9030],
|
|
11
|
+
[7812476, 9040], [8010981, 9050], [8073833, 9070], [8555825, 9080], [8945245, 9090],
|
|
12
|
+
[9611377, 9100], [9625129, 9111], [9866422, 9122], [10403784, 9130], [10960765, 9150],
|
|
13
|
+
[11006614, 9151], [11404482, 9160], [11601803, 9170], [12008022, 9180], [12405451, 9190],
|
|
14
|
+
[12665416, 9200], [12909508, 9220], [13109752, 9230], [13555777, 9250], [13727747, 9260],
|
|
15
|
+
[14248044, 9271], [14433840, 9280], [14645900, 9291], [15048375, 9300], [15426015, 9320],
|
|
16
|
+
// we have 9340 via system.setStorage (whitelist.WhitelistedCallDispatched event)
|
|
17
|
+
[15680713, 9340], [15756296, 9350]
|
|
18
|
+
];
|
|
7
19
|
export default upgrades;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const upgrades = [
|
|
2
|
+
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
|
|
3
|
+
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
|
4
|
+
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
|
5
|
+
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
|
6
|
+
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
|
|
7
|
+
[6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
|
|
8
|
+
[8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190],
|
|
9
|
+
[10458576, 9200], [10655116, 9220], [10879371, 9230], [11328884, 9250], [11532856, 9260],
|
|
10
|
+
[11933818, 9270], [12217535, 9280], [12245277, 9281], [12532644, 9291], [12876189, 9300]
|
|
11
|
+
];
|
|
5
12
|
export default upgrades;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const upgrades = [
|
|
2
|
+
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
|
|
3
|
+
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
|
|
4
|
+
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
|
|
5
|
+
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
|
|
6
|
+
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
|
7
|
+
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
|
|
8
|
+
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
|
|
9
|
+
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
|
|
10
|
+
[7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
|
|
11
|
+
[9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
|
|
12
|
+
[10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
|
|
13
|
+
[11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
|
|
14
|
+
[12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
|
|
15
|
+
[13649433, 9340], [13761100, 9350]
|
|
16
|
+
];
|
|
5
17
|
export default upgrades;
|
package/util.js
CHANGED
|
@@ -1,119 +1,84 @@
|
|
|
1
|
-
// Copyright 2017-2023 @polkadot/types-known authors & contributors
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
1
|
import { bnToBn, objectSpread } from '@polkadot/util';
|
|
5
|
-
import typesChain from
|
|
6
|
-
import typesSpec from
|
|
7
|
-
import upgrades from
|
|
8
|
-
|
|
2
|
+
import typesChain from './chain/index.js';
|
|
3
|
+
import typesSpec from './spec/index.js';
|
|
4
|
+
import upgrades from './upgrades/index.js';
|
|
9
5
|
/**
|
|
10
6
|
* @description Perform the callback function using the stringified spec/chain
|
|
11
7
|
* @internal
|
|
12
8
|
* */
|
|
13
9
|
function withNames(chainName, specName, fn) {
|
|
14
|
-
|
|
10
|
+
return fn(chainName.toString(), specName.toString());
|
|
15
11
|
}
|
|
16
|
-
|
|
17
12
|
/**
|
|
18
13
|
* @descriptionFflatten a VersionedType[] into a Record<string, string>
|
|
19
14
|
* @internal
|
|
20
15
|
* */
|
|
21
16
|
function filterVersions(versions = [], specVersion) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}) => objectSpread(result, types), {});
|
|
17
|
+
return versions
|
|
18
|
+
.filter(({ minmax: [min, max] }) => (min === undefined || min === null || specVersion >= min) &&
|
|
19
|
+
(max === undefined || max === null || specVersion <= max))
|
|
20
|
+
.reduce((result, { types }) => objectSpread(result, types), {});
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
/**
|
|
30
23
|
* @description Based on the chain and runtimeVersion, get the applicable signed extensions (ready for registration)
|
|
31
24
|
*/
|
|
32
|
-
export function getSpecExtensions({
|
|
33
|
-
|
|
34
|
-
}, chainName, specName) {
|
|
35
|
-
return withNames(chainName, specName, (c, s) => {
|
|
36
|
-
var _knownTypes$typesBund, _knownTypes$typesBund2, _knownTypes$typesBund3, _knownTypes$typesBund4, _knownTypes$typesBund5, _knownTypes$typesBund6;
|
|
37
|
-
return objectSpread({}, (_knownTypes$typesBund = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund2 = _knownTypes$typesBund.spec) == null ? void 0 : (_knownTypes$typesBund3 = _knownTypes$typesBund2[s]) == null ? void 0 : _knownTypes$typesBund3.signedExtensions, (_knownTypes$typesBund4 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund5 = _knownTypes$typesBund4.chain) == null ? void 0 : (_knownTypes$typesBund6 = _knownTypes$typesBund5[c]) == null ? void 0 : _knownTypes$typesBund6.signedExtensions);
|
|
38
|
-
});
|
|
25
|
+
export function getSpecExtensions({ knownTypes }, chainName, specName) {
|
|
26
|
+
return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.signedExtensions, knownTypes.typesBundle?.chain?.[c]?.signedExtensions));
|
|
39
27
|
}
|
|
40
|
-
|
|
41
28
|
/**
|
|
42
29
|
* @description Based on the chain and runtimeVersion, get the applicable types (ready for registration)
|
|
43
30
|
*/
|
|
44
|
-
export function getSpecTypes({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// - spec then chain
|
|
53
|
-
// - typesBundle takes higher precedence
|
|
54
|
-
// - types is the final catch-all override
|
|
55
|
-
objectSpread({}, filterVersions(typesSpec[s], _specVersion), filterVersions(typesChain[c], _specVersion), filterVersions((_knownTypes$typesBund7 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund8 = _knownTypes$typesBund7.spec) == null ? void 0 : (_knownTypes$typesBund9 = _knownTypes$typesBund8[s]) == null ? void 0 : _knownTypes$typesBund9.types, _specVersion), filterVersions((_knownTypes$typesBund10 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund11 = _knownTypes$typesBund10.chain) == null ? void 0 : (_knownTypes$typesBund12 = _knownTypes$typesBund11[c]) == null ? void 0 : _knownTypes$typesBund12.types, _specVersion), (_knownTypes$typesSpec = knownTypes.typesSpec) == null ? void 0 : _knownTypes$typesSpec[s], (_knownTypes$typesChai = knownTypes.typesChain) == null ? void 0 : _knownTypes$typesChai[c], knownTypes.types)
|
|
56
|
-
);
|
|
57
|
-
});
|
|
31
|
+
export function getSpecTypes({ knownTypes }, chainName, specName, specVersion) {
|
|
32
|
+
const _specVersion = bnToBn(specVersion).toNumber();
|
|
33
|
+
return withNames(chainName, specName, (c, s) =>
|
|
34
|
+
// The order here is always, based on -
|
|
35
|
+
// - spec then chain
|
|
36
|
+
// - typesBundle takes higher precedence
|
|
37
|
+
// - types is the final catch-all override
|
|
38
|
+
objectSpread({}, filterVersions(typesSpec[s], _specVersion), filterVersions(typesChain[c], _specVersion), filterVersions(knownTypes.typesBundle?.spec?.[s]?.types, _specVersion), filterVersions(knownTypes.typesBundle?.chain?.[c]?.types, _specVersion), knownTypes.typesSpec?.[s], knownTypes.typesChain?.[c], knownTypes.types));
|
|
58
39
|
}
|
|
59
|
-
|
|
60
40
|
/**
|
|
61
41
|
* @description Based on the chain or spec, return the hasher used
|
|
62
42
|
*/
|
|
63
|
-
export function getSpecHasher({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return knownTypes.hasher || ((_knownTypes$typesBund13 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund14 = _knownTypes$typesBund13.chain) == null ? void 0 : (_knownTypes$typesBund15 = _knownTypes$typesBund14[c]) == null ? void 0 : _knownTypes$typesBund15.hasher) || ((_knownTypes$typesBund16 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund17 = _knownTypes$typesBund16.spec) == null ? void 0 : (_knownTypes$typesBund18 = _knownTypes$typesBund17[s]) == null ? void 0 : _knownTypes$typesBund18.hasher) || null;
|
|
69
|
-
});
|
|
43
|
+
export function getSpecHasher({ knownTypes }, chainName, specName) {
|
|
44
|
+
return withNames(chainName, specName, (c, s) => knownTypes.hasher ||
|
|
45
|
+
knownTypes.typesBundle?.chain?.[c]?.hasher ||
|
|
46
|
+
knownTypes.typesBundle?.spec?.[s]?.hasher ||
|
|
47
|
+
null);
|
|
70
48
|
}
|
|
71
|
-
|
|
72
49
|
/**
|
|
73
50
|
* @description Based on the chain and runtimeVersion, get the applicable rpc definitions (ready for registration)
|
|
74
51
|
*/
|
|
75
|
-
export function getSpecRpc({
|
|
76
|
-
|
|
77
|
-
}, chainName, specName) {
|
|
78
|
-
return withNames(chainName, specName, (c, s) => {
|
|
79
|
-
var _knownTypes$typesBund19, _knownTypes$typesBund20, _knownTypes$typesBund21, _knownTypes$typesBund22, _knownTypes$typesBund23, _knownTypes$typesBund24;
|
|
80
|
-
return objectSpread({}, (_knownTypes$typesBund19 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund20 = _knownTypes$typesBund19.spec) == null ? void 0 : (_knownTypes$typesBund21 = _knownTypes$typesBund20[s]) == null ? void 0 : _knownTypes$typesBund21.rpc, (_knownTypes$typesBund22 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund23 = _knownTypes$typesBund22.chain) == null ? void 0 : (_knownTypes$typesBund24 = _knownTypes$typesBund23[c]) == null ? void 0 : _knownTypes$typesBund24.rpc);
|
|
81
|
-
});
|
|
52
|
+
export function getSpecRpc({ knownTypes }, chainName, specName) {
|
|
53
|
+
return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.rpc, knownTypes.typesBundle?.chain?.[c]?.rpc));
|
|
82
54
|
}
|
|
83
|
-
|
|
84
55
|
/**
|
|
85
56
|
* @description Based on the chain and runtimeVersion, get the applicable runtime definitions (ready for registration)
|
|
86
57
|
*/
|
|
87
|
-
export function getSpecRuntime({
|
|
88
|
-
|
|
89
|
-
}, chainName, specName) {
|
|
90
|
-
return withNames(chainName, specName, (c, s) => {
|
|
91
|
-
var _knownTypes$typesBund25, _knownTypes$typesBund26, _knownTypes$typesBund27, _knownTypes$typesBund28, _knownTypes$typesBund29, _knownTypes$typesBund30;
|
|
92
|
-
return objectSpread({}, (_knownTypes$typesBund25 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund26 = _knownTypes$typesBund25.spec) == null ? void 0 : (_knownTypes$typesBund27 = _knownTypes$typesBund26[s]) == null ? void 0 : _knownTypes$typesBund27.runtime, (_knownTypes$typesBund28 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund29 = _knownTypes$typesBund28.chain) == null ? void 0 : (_knownTypes$typesBund30 = _knownTypes$typesBund29[c]) == null ? void 0 : _knownTypes$typesBund30.runtime);
|
|
93
|
-
});
|
|
58
|
+
export function getSpecRuntime({ knownTypes }, chainName, specName) {
|
|
59
|
+
return withNames(chainName, specName, (c, s) => objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.runtime, knownTypes.typesBundle?.chain?.[c]?.runtime));
|
|
94
60
|
}
|
|
95
|
-
|
|
96
61
|
/**
|
|
97
62
|
* @description Based on the chain and runtimeVersion, get the applicable alias definitions (ready for registration)
|
|
98
63
|
*/
|
|
99
|
-
export function getSpecAlias({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var _knownTypes$typesBund31, _knownTypes$typesBund32, _knownTypes$typesBund33, _knownTypes$typesBund34, _knownTypes$typesBund35, _knownTypes$typesBund36;
|
|
104
|
-
return (
|
|
105
|
-
// as per versions, first spec, then chain then finally non-versioned
|
|
106
|
-
objectSpread({}, (_knownTypes$typesBund31 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund32 = _knownTypes$typesBund31.spec) == null ? void 0 : (_knownTypes$typesBund33 = _knownTypes$typesBund32[s]) == null ? void 0 : _knownTypes$typesBund33.alias, (_knownTypes$typesBund34 = knownTypes.typesBundle) == null ? void 0 : (_knownTypes$typesBund35 = _knownTypes$typesBund34.chain) == null ? void 0 : (_knownTypes$typesBund36 = _knownTypes$typesBund35[c]) == null ? void 0 : _knownTypes$typesBund36.alias, knownTypes.typesAlias)
|
|
107
|
-
);
|
|
108
|
-
});
|
|
64
|
+
export function getSpecAlias({ knownTypes }, chainName, specName) {
|
|
65
|
+
return withNames(chainName, specName, (c, s) =>
|
|
66
|
+
// as per versions, first spec, then chain then finally non-versioned
|
|
67
|
+
objectSpread({}, knownTypes.typesBundle?.spec?.[s]?.alias, knownTypes.typesBundle?.chain?.[c]?.alias, knownTypes.typesAlias));
|
|
109
68
|
}
|
|
110
|
-
|
|
111
69
|
/**
|
|
112
70
|
* @description Returns a version record for known chains where upgrades are being tracked
|
|
113
71
|
*/
|
|
114
72
|
export function getUpgradeVersion(genesisHash, blockNumber) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
73
|
+
const known = upgrades.find((u) => genesisHash.eq(u.genesisHash));
|
|
74
|
+
return known
|
|
75
|
+
? [
|
|
76
|
+
known.versions.reduce((last, version) => {
|
|
77
|
+
return blockNumber.gt(version.blockNumber)
|
|
78
|
+
? version
|
|
79
|
+
: last;
|
|
80
|
+
}, undefined),
|
|
81
|
+
known.versions.find((version) => blockNumber.lte(version.blockNumber))
|
|
82
|
+
]
|
|
83
|
+
: [undefined, undefined];
|
|
119
84
|
}
|