From 894f07e3c9202f9b3fca1a9206cee749ac341e37 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 26 Jul 2019 15:54:50 +0200 Subject: [PATCH] Fix moment is compact again (#1201) --- packages/types/src/interfaceRegistry.ts | 2 ++ packages/types/src/scripts/interfacesTs.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/types/src/interfaceRegistry.ts b/packages/types/src/interfaceRegistry.ts index 7c63502cf6..7ce033911d 100644 --- a/packages/types/src/interfaceRegistry.ts +++ b/packages/types/src/interfaceRegistry.ts @@ -99,6 +99,7 @@ export interface InterfaceRegistry { 'Option': Option; 'Vec': Vec; Moment: Moment; + 'Compact': Compact; 'Option': Option; 'Vec': Vec; Null: Null; @@ -564,6 +565,7 @@ export interface InterfaceRegistry { 'Option': Option; 'Vec': Vec; MomentOf: MomentOf; + 'Compact': Compact; 'Option': Option; 'Vec': Vec; RewardDestination: RewardDestination; diff --git a/packages/types/src/scripts/interfacesTs.ts b/packages/types/src/scripts/interfacesTs.ts index 2338140d39..4dca38828c 100644 --- a/packages/types/src/scripts/interfacesTs.ts +++ b/packages/types/src/scripts/interfacesTs.ts @@ -60,7 +60,7 @@ function setImports ({ codecTypes, localTypes, ownTypes, primitiveTypes }: TypeI function isChildClass (Parent: Constructor, Child: Constructor): boolean { // https://stackoverflow.com/questions/30993434/check-if-a-constructor-inherits-another-in-es6/30993664 // eslint-disable-next-line no-prototype-builtins - return Parent.isPrototypeOf(Child); + return Parent === Child || Parent.isPrototypeOf(Child); } function isCompactEncodable (Child: Constructor): boolean {