Drop Metadata V0-V8 (#2634)
* Drop MetadatV0 * Apply suggestions from code review * Restore asV1 * Remove V0 comment * Handle DoNotConstruct in enum * No imports from DoNotConstruct * Merge & re-generate * Attempt empty construction * Drop Metadata from 0-4 * CHANGELOG * assert(5) * BE vs LE * Metadataall to no-construction * Empty U8a create * Remove old comment * Santize handling * Update CHANGELOG.md * Drop support for Metadata < 9 * Remove old pre-9 definitions * Update CHANGELOG.md * CHANGELOG * Remove v8-era tests * v8 tests
This commit is contained in:
@@ -9,7 +9,6 @@ import { Text } from '@polkadot/types';
|
||||
import { bnToBn, isUndefined } from '@polkadot/util';
|
||||
|
||||
import typesChain from './chain';
|
||||
import typesMeta from './metadata';
|
||||
import typesModules from './modules';
|
||||
import typesSpec from './spec';
|
||||
import upgrades from './upgrades';
|
||||
@@ -29,13 +28,6 @@ function filterVersions (versions: OverrideVersionedType[] = [], specVersion: nu
|
||||
}), {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Based on the metadata version, return the registry types
|
||||
*/
|
||||
export function getMetadataTypes (_registry: Registry, specVersion: number): RegistryTypes {
|
||||
return filterVersions(typesMeta, specVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Get types for specific modules (metadata override)
|
||||
*/
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
// Copyright 2017-2020 @polkadot/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { OverrideVersionedType } from '@polkadot/types/types';
|
||||
|
||||
// Type overrides based on metadata versions
|
||||
const typesMeta: OverrideVersionedType[] = [
|
||||
{
|
||||
// NOTE this is for support of old, e.g. Alex, old metadata and BlockNumber/Index
|
||||
// This is detected based on metadata version, since this is what we have up-front
|
||||
// v3 = Alex
|
||||
// v4 = v1.0 branch
|
||||
minmax: [0, 4],
|
||||
types: {
|
||||
Address: 'GenericAddress',
|
||||
BlockNumber: 'u64',
|
||||
EventRecord: 'EventRecordTo76',
|
||||
Index: 'u64',
|
||||
StakingLedger: 'StakingLedgerTo223',
|
||||
ValidatorPrefs: 'ValidatorPrefsTo145'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
export default typesMeta;
|
||||
@@ -11,10 +11,6 @@ const typesModules: Record<string, OverrideModuleType> = {
|
||||
balances: {
|
||||
Status: 'BalanceStatus'
|
||||
},
|
||||
contract: { // old metadata & naming
|
||||
// v2 & v3
|
||||
AccountInfo: 'ContractAccountInfo'
|
||||
},
|
||||
contracts: {
|
||||
StorageKey: 'ContractStorageKey'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user