Move types/codec/create -> types/create (#1871)

* Move types/codec/create -> types/create

* Update imports after move

* Cleanups

* Cleanup code circular deps

* Re-add dropped interfaces

* Drop duplicated code

* Fix imports

* Remove whacky comment
This commit is contained in:
Jaco Greeff
2020-02-16 13:51:37 +01:00
committed by GitHub
parent fde076152a
commit 921e55a82e
141 changed files with 204 additions and 225 deletions
@@ -5,7 +5,7 @@
import { MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, MetadataV10, MetadataV11 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec/create/createType';
import { createType } from '@polkadot/types/create/createType';
import Struct from '@polkadot/types/codec/Struct';
import { assert } from '@polkadot/util';
@@ -5,7 +5,7 @@
import { Codec, Registry } from '@polkadot/types/types';
import { MetadataInterface } from '../types';
import { createTypeUnsafe } from '@polkadot/types/codec/create';
import { createTypeUnsafe } from '@polkadot/types/create';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import getUniqTypes from './getUniqTypes';
@@ -5,7 +5,7 @@
import { MetadataLatest } from '@polkadot/types/interfaces/metadata';
import { AnyJsonObject, Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toCallsOnly (registry: Registry, { extrinsic, modules }: MetadataLatest): AnyJsonObject | string {
@@ -2,10 +2,9 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { Registry } from '@polkadot/types/types';
import { TypeDef, TypeDefInfo, TypeDefExtVecFixed } from '@polkadot/types/codec/types';
import { Registry, TypeDef, TypeDefInfo, TypeDefExtVecFixed } from '@polkadot/types/types';
import { getTypeDef } from '@polkadot/types/codec/create';
import { getTypeDef } from '@polkadot/types/create';
import flattenUniq from './flattenUniq';
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { TypeRegistry } from '@polkadot/types/codec';
import { TypeRegistry } from '@polkadot/types/create';
import Metadata from '../';
import latestSubstrateV0 from './static-substrate.json';
+2 -1
View File
@@ -8,7 +8,8 @@ import { Registry } from '@polkadot/types/types';
import { stringUpperFirst } from '@polkadot/util';
import { createType, Option, Vec } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
import { Option, Vec } from '@polkadot/types/codec';
import { Text } from '@polkadot/types/primitive';
/** @internal */
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV1, MetadataV2 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV2 (registry: Registry, metadataV1: MetadataV1): MetadataV2 {
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV10, MetadataV11 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 {
@@ -7,7 +7,7 @@ import { FunctionMetadataV11, FunctionMetadataLatest, MetadataV11, MetadataLates
import { Registry } from '@polkadot/types/types';
import { getModuleTypes } from '@polkadot/types/known';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
import { Type } from '@polkadot/types/primitive';
import { stringCamelCase } from '@polkadot/util';
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV2, MetadataV3 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV3 (registry: Registry, metadataV2: MetadataV2): MetadataV3 {
+2 -1
View File
@@ -5,7 +5,8 @@
import { MetadataV3, MetadataV4, ModuleMetadataV4, StorageFunctionMetadataV3, StorageFunctionMetadataV4 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType, Option } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
import { Option } from '@polkadot/types/codec';
/** @internal */
function toV4StorageFunction (registry: Registry, storageFn: StorageFunctionMetadataV3): StorageFunctionMetadataV4 {
+2 -1
View File
@@ -7,7 +7,8 @@ import { Registry } from '@polkadot/types/types';
import { assert } from '@polkadot/util';
import { createType, Option } from '@polkadot/types/codec';
import { Option } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
import Text from '@polkadot/types/primitive/Text';
const hasherMap: Map<string, string> = new Map([
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV5, MetadataV6, ModuleMetadataV6 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV6 (registry: Registry, { modules }: MetadataV5): MetadataV6 {
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV6, MetadataV7, ModuleMetadataV7 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV7 (registry: Registry, { modules }: MetadataV6): MetadataV7 {
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV7, MetadataV8, ModuleMetadataV8 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV8 (registry: Registry, { modules }: MetadataV7): MetadataV8 {
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV8, MetadataV9 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
/** @internal */
export default function toV9 (registry: Registry, { modules }: MetadataV8): MetadataV9 {
+1 -1
View File
@@ -5,7 +5,7 @@
import { MetadataV9, MetadataV10, ModuleMetadataV9, ModuleMetadataV10, StorageEntryMetadataV9, StorageEntryTypeV9, StorageHasherV9, StorageHasherV10 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types/codec';
import { createType } from '@polkadot/types/create';
// migrate a storage hasher type
// see https://github.com/paritytech/substrate/pull/4462