Add explicit support for Call typegen (inclusive of non-defaults) (#4803)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import type { Constructor, Registry } from '@polkadot/types/types';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
|
||||
import { GenericAccountId, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
|
||||
import { GenericAccountId, GenericCall, GenericLookupSource, GenericVote } from '@polkadot/types/generic';
|
||||
import { AllConvictions } from '@polkadot/types/interfaces/democracy/definitions';
|
||||
import { AbstractInt, bool, Compact, Enum, Null, Option, Struct, Tuple, UInt, Vec, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
|
||||
import { getTypeDef, TypeDefInfo } from '@polkadot/types-create';
|
||||
@@ -84,6 +84,8 @@ export function getSimilarTypes (registry: Registry, definitions: Record<string,
|
||||
possibleTypes.push('Address', 'AccountId', 'AccountIndex', 'LookupSource', 'string', 'Uint8Array');
|
||||
} else if (isChildClass(GenericAccountId, Clazz)) {
|
||||
possibleTypes.push('string', 'Uint8Array');
|
||||
} else if (isChildClass(GenericCall, Clazz)) {
|
||||
possibleTypes.push('IMethod', 'string', 'Uint8Array');
|
||||
} else if (isChildClass(bool, Clazz)) {
|
||||
possibleTypes.push('boolean', 'Uint8Array');
|
||||
} else if (isChildClass(Null, Clazz)) {
|
||||
|
||||
@@ -42,7 +42,7 @@ export function setImports (allDefs: Record<string, ModuleTypes>, imports: TypeI
|
||||
types.filter((t): t is string => !!t).forEach((type): void => {
|
||||
if (ignoredTypes.includes(type)) {
|
||||
// do nothing
|
||||
} else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'ITuple'].includes(type)) {
|
||||
} else if (['AnyNumber', 'CallFunction', 'Codec', 'IExtrinsic', 'IMethod', 'ITuple'].includes(type)) {
|
||||
typesTypes[type] = true;
|
||||
} else if (['Metadata', 'PortableRegistry'].includes(type)) {
|
||||
metadataTypes[type] = true;
|
||||
|
||||
Reference in New Issue
Block a user