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 {