Kusama 1057 known types (#2168)

This commit is contained in:
Jaco Greeff
2020-04-14 16:24:19 +02:00
committed by GitHub
parent 5acce98346
commit 7a0efaf58c
3 changed files with 24 additions and 8 deletions
+6 -6
View File
@@ -15,11 +15,11 @@ import typesSpec from './spec';
// flatten a VersionedType[] into a Record<string, string>
/** @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);
}
/**
+9 -1
View File
@@ -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'
}
}
];
+9 -1
View File
@@ -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'
}
}
];