diff --git a/packages/types-known/src/index.ts b/packages/types-known/src/index.ts index 41675d0a9c..d244be35ee 100644 --- a/packages/types-known/src/index.ts +++ b/packages/types-known/src/index.ts @@ -15,11 +15,11 @@ import typesSpec from './spec'; // flatten a VersionedType[] into a Record /** @internal */ -function filterVersions (versions: OverrideVersionedType[] = [], version: number): RegistryTypes { +function filterVersions (versions: OverrideVersionedType[] = [], specVersion: number): RegistryTypes { return versions - .filter(({ minmax: [min, max] }): boolean => - (isUndefined(min) || version >= min) && - (isUndefined(max) || version <= max) + .filter(({ minmax: [min, max] }) => + (isUndefined(min) || specVersion >= min) && + (isUndefined(max) || specVersion <= max) ) .reduce((result: RegistryTypes, { types }): RegistryTypes => ({ ...result, @@ -30,8 +30,8 @@ function filterVersions (versions: OverrideVersionedType[] = [], version: number /** * @description Based on the metadata version, return the registry types */ -export function getMetadataTypes (_registry: Registry, version: number): RegistryTypes { - return filterVersions(typesMeta, version); +export function getMetadataTypes (_registry: Registry, specVersion: number): RegistryTypes { + return filterVersions(typesMeta, specVersion); } /** diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index 2a6c20f1e6..4018ce8ff3 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -59,13 +59,21 @@ const versioned: OverrideVersionedType[] = [ } }, { - minmax: [1055, undefined], + minmax: [1055, 1056], types: { Address: 'AccountId', Keys: 'SessionKeys5', LookupSource: 'AccountId', StakingLedger: 'StakingLedgerTo240' } + }, + { + minmax: [1057, undefined], + types: { + Address: 'AccountId', + Keys: 'SessionKeys5', + LookupSource: 'AccountId' + } } ]; diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index 175ab90765..965a9a9475 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -32,13 +32,21 @@ const versioned: OverrideVersionedType[] = [ } }, { - minmax: [1005, undefined], + minmax: [1005, 1005], types: { Address: 'AccountId', Keys: 'SessionKeys5', LookupSource: 'AccountId', StakingLedger: 'StakingLedgerTo240' } + }, + { + minmax: [1006, undefined], + types: { + Address: 'AccountId', + Keys: 'SessionKeys5', + LookupSource: 'AccountId' + } } ];