Adjust internal generic imports (#2838)

This commit is contained in:
Jaco Greeff
2020-11-11 09:40:35 +01:00
committed by GitHub
parent 3ec469bbaf
commit 5a1fd4a1bb
67 changed files with 204 additions and 215 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import { Codec, DefinitionRpcParam } from '@polkadot/types/types';
import fs from 'fs';
import { Metadata } from '@polkadot/metadata';
import rpcdata from '@polkadot/metadata/static';
import Call from '@polkadot/types/generic/Call';
import { GenericCall as Call } from '@polkadot/types/generic';
import { unwrapStorageType } from '@polkadot/types/primitive/StorageKey';
import { TypeRegistry } from '@polkadot/types/create';
import { Vec } from '@polkadot/types/codec';
+3 -4
View File
@@ -8,9 +8,8 @@ import { ClassOfUnsafe, getTypeDef } from '@polkadot/types/create';
import { Compact, Enum, Option, Struct, UInt, Vec, Tuple } from '@polkadot/types/codec';
import { AbstractInt } from '@polkadot/types/codec/AbstractInt';
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
import { GenericAccountId, GenericLookupSource } from '@polkadot/types/generic';
import Vote from '@polkadot/types/generic/Vote';
import Null from '@polkadot/types/primitive/Null';
import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
import { Null } from '@polkadot/types/primitive';
import * as primitiveClasses from '@polkadot/types/primitive';
import { isChildClass } from '@polkadot/util';
@@ -130,7 +129,7 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
} else if (isChildClass(Option, Clazz)) {
// TODO inspect container
possibleTypes.push('null', 'object', 'string', 'Uint8Array');
} else if (isChildClass(Vote, Clazz)) {
} else if (isChildClass(GenericVote, Clazz)) {
possibleTypes.push(`{ aye: boolean; conviction?: ${voteConvictions} | number }`, 'boolean', 'string', 'Uint8Array');
} else if (isChildClass(Uint8Array, Clazz)) {
possibleTypes.push('string', 'Uint8Array');