diff --git a/packages/api/src/nodeCompat.ts b/packages/api/src/nodeCompat.ts index f124a8c709..0eff2f113d 100644 --- a/packages/api/src/nodeCompat.ts +++ b/packages/api/src/nodeCompat.ts @@ -4,9 +4,12 @@ import { Constructor } from '@polkadot/types/types'; -import { EventRecord77, RuntimeVersion, getTypeRegistry } from '@polkadot/types'; +import { EventRecord_0_76, RuntimeVersion, getTypeRegistry } from '@polkadot/types'; type Compat = { + // an array of the spec-name and spec_version that denotes the first version that + // does not support this feature. i.e. for EventRecord between 0-76, the new version + // went live at 77 - hence the version here denotes 77 nodeSpecs: Array<[string, number]>, types: { [index: string]: Constructor @@ -19,12 +22,12 @@ const types: Array = [ { nodeSpecs: [ ['node', 77], + ['polkadot', 1000], ['node-template', ANY_VERSION], - ['polkadot', ANY_VERSION], ['edgeware', ANY_VERSION] ], types: { - 'EventRecord': EventRecord77 + 'EventRecord': EventRecord_0_76 } } ]; diff --git a/packages/types/src/primitive/EventRecord.ts b/packages/types/src/primitive/EventRecord.ts index b049e5acc2..7eac29f40b 100644 --- a/packages/types/src/primitive/EventRecord.ts +++ b/packages/types/src/primitive/EventRecord.ts @@ -75,12 +75,13 @@ export class Phase extends Enum { } /** - * @name EventRecord77 + * @name EventRecord_0_76 * @description * A record for an [[Event]] (as specified by [[Metadata]]) with the specific [[Phase]] of * application. */ -export class EventRecord77 extends Struct { +// tslint:disable-next-line +export class EventRecord_0_76 extends Struct { constructor (value: any) { super({ phase: Phase, @@ -125,7 +126,7 @@ export default class EventRecord extends Struct { }, value); } - static Fallback = EventRecord77; + static Fallback = EventRecord_0_76; /** * @description The [[Event]] this record refers to diff --git a/packages/types/src/primitive/index.ts b/packages/types/src/primitive/index.ts index 8c18a7172c..98968b35b6 100644 --- a/packages/types/src/primitive/index.ts +++ b/packages/types/src/primitive/index.ts @@ -15,7 +15,7 @@ export { default as AccountIndex } from './AccountIndex'; export { default as AccountInfo } from './AccountInfo'; export { default as Address } from './Address'; export { default as Event, EventIndex } from './Event'; -export { default as EventRecord, EventRecord77 } from './EventRecord'; +export { default as EventRecord, EventRecord_0_76 } from './EventRecord'; export { default as Bool, default as bool } from './Bool'; export { default as Bytes } from './Bytes'; export { default as Data } from './Data';