Check metadata.version instead of isIndexed (#3002)

* Check metadata.version instead of isIndexed

* Bump
This commit is contained in:
Jaco Greeff
2020-12-29 21:42:06 +01:00
committed by GitHub
parent e685923102
commit 83f36e466f
8 changed files with 170 additions and 168 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ export class MetadataVersioned extends Struct {
return this.version === version;
}
private _getVersion<T extends MetaMapped, F extends MetaMapped> (version: MetaVersions, fromPrev: (registry: Registry, input: F) => T): T {
private _getVersion<T extends MetaMapped, F extends MetaMapped> (version: MetaVersions, fromPrev: (registry: Registry, input: F, metaVersion: number) => T): T {
const asCurr = `asV${version}` as MetaAsX;
const asPrev = `asV${version - 1}` as MetaAsX;
@@ -48,7 +48,7 @@ export class MetadataVersioned extends Struct {
}
if (!this.#converted.has(version)) {
this.#converted.set(version, fromPrev(this.registry, this[asPrev] as F));
this.#converted.set(version, fromPrev(this.registry, this[asPrev] as F, this.version));
}
return this.#converted.get(version) as T;