From 5e8ae793c3735dfcc495fbaf0cc29da188981f99 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 31 Aug 2020 14:16:45 +0200 Subject: [PATCH] Westend known upgrades (#2547) --- packages/types-known/src/upgrades/index.ts | 4 +++- packages/types-known/src/upgrades/westend.ts | 23 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packages/types-known/src/upgrades/westend.ts diff --git a/packages/types-known/src/upgrades/index.ts b/packages/types-known/src/upgrades/index.ts index b70e55f81e..0d318e9f04 100644 --- a/packages/types-known/src/upgrades/index.ts +++ b/packages/types-known/src/upgrades/index.ts @@ -6,11 +6,13 @@ import { ChainUpgrades } from '@polkadot/types/types'; import kusama from './kusama'; import polkadot from './polkadot'; +import westend from './westend'; // Type overrides for specific spec types & versions as given in runtimeVersion const upgrades: ChainUpgrades[] = [ kusama, - polkadot + polkadot, + westend ]; export default upgrades; diff --git a/packages/types-known/src/upgrades/westend.ts b/packages/types-known/src/upgrades/westend.ts new file mode 100644 index 0000000000..7357a71692 --- /dev/null +++ b/packages/types-known/src/upgrades/westend.ts @@ -0,0 +1,23 @@ +// Copyright 2017-2020 @polkadot/types-known authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ChainUpgrades } from '@polkadot/types/types'; + +import BN from 'bn.js'; +import { hexToU8a } from '@polkadot/util'; + +const upgrades: ChainUpgrades = { + genesisHash: hexToU8a('0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e'), + versions: [ + [214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24], + [879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29], + [1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35], + [1431703, 36], [1433369, 37], [1490972, 41] + ].map(([blockNumber, specVersion]) => ({ + blockNumber: new BN(blockNumber), + specVersion: new BN(specVersion) + })) +}; + +export default upgrades;