This commit is contained in:
Jaco Greeff
2019-08-29 16:21:26 +02:00
committed by GitHub
parent 14100d319d
commit 417a9ffceb
5 changed files with 108 additions and 84 deletions
@@ -7,7 +7,7 @@ import { Global } from './../mock/types';
declare const global: Global;
describe('http/polyfill', (): void => {
let origFetch: GlobalFetch;
let origFetch: any;
beforeEach((): void => {
origFetch = global.fetch;
+1 -1
View File
@@ -7,7 +7,7 @@ import { Constructor } from '@polkadot/types/types';
export interface Global extends NodeJS.Global {
WebSocket: Constructor<WebSocket>;
fetch: GlobalFetch;
fetch: any;
}
export interface Mock {
+2 -2
View File
@@ -37,9 +37,9 @@ export default class Struct<
public constructor (Types: S, value: V | Map<any, any> | any[] | string = {} as unknown as V, jsonMap: Map<keyof S, string> = new Map()) {
const Clazzes = mapToTypeMap(Types);
const decoded = Struct.decodeStruct(Clazzes, value, jsonMap);
const decoded: T = Struct.decodeStruct(Clazzes, value, jsonMap);
super(Object.entries(decoded as any));
super(Object.entries(decoded));
this._jsonMap = jsonMap;
this._Types = Clazzes;