Kusama 1057 known types (#2168)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user