Move internal decoding to top-level-functions (#1818)

* Move internal decoding to top-level-functions

* Cleanup imports
This commit is contained in:
Jaco Greeff
2020-02-07 14:12:30 +01:00
committed by GitHub
parent f6490217ec
commit faa12a68f7
23 changed files with 170 additions and 181 deletions
@@ -5,7 +5,7 @@
import { MetadataLatest } from '@polkadot/types/interfaces/metadata';
import { AnyJsonObject, Registry } from '@polkadot/types/types';
import { createType } from '@polkadot/types';
import { createType } from '@polkadot/types/codec';
/** @internal */
export default function toCallsOnly (registry: Registry, { extrinsic, modules }: MetadataLatest): AnyJsonObject | string {
+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';
import { createType } from '@polkadot/types/codec';
/** @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';
import { createType } from '@polkadot/types/codec';
/** @internal */
export default function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 {
@@ -7,7 +7,8 @@ import { FunctionMetadataV11, FunctionMetadataLatest, MetadataV11, MetadataLates
import { Registry } from '@polkadot/types/types';
import { getModuleTypes } from '@polkadot/types/known';
import { Type, createType } from '@polkadot/types';
import { createType } from '@polkadot/types/codec';
import { Type } from '@polkadot/types/primitive';
import { stringCamelCase } from '@polkadot/util';
// TODO Handle consts as well
+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';
import { createType } from '@polkadot/types/codec';
/** @internal */
export default function toV3 (registry: Registry, metadataV2: MetadataV2): MetadataV3 {
+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';
import { createType } from '@polkadot/types/codec';
/** @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';
import { createType } from '@polkadot/types/codec';
/** @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';
import { createType } from '@polkadot/types/codec';
/** @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';
import { createType } from '@polkadot/types/codec';
/** @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';
import { createType } from '@polkadot/types/codec';
// migrate a storage hasher type
// see https://github.com/paritytech/substrate/pull/4462