From f544c289da18a1f966691313893360b853ae7e88 Mon Sep 17 00:00:00 2001 From: dapplion Date: Sun, 6 Dec 2020 11:35:17 +0000 Subject: [PATCH] Remove browser specific code --- src/herumi/context.ts | 17 ----------------- tsconfig.json | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/herumi/context.ts b/src/herumi/context.ts index 9527630..7780283 100644 --- a/src/herumi/context.ts +++ b/src/herumi/context.ts @@ -6,26 +6,9 @@ type Bls = typeof bls; let blsGlobal: Bls | null = null; let blsGlobalPromise: Promise | null = null; -// Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto -declare global { - // eslint-disable-next-line @typescript-eslint/interface-name-prefix - interface Window { - msCrypto: typeof window["crypto"]; - } -} - export async function setupBls(): Promise { if (!blsGlobal) { await bls.init(bls.BLS12_381); - - // Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto - if (typeof window === "object") { - const crypto = window.crypto || window.msCrypto; - // getRandomValues is not typed in `bls-eth-wasm` because it's not meant to be exposed - // @ts-ignore - bls.getRandomValues = (x) => crypto.getRandomValues(x); - } - blsGlobal = bls; } } diff --git a/tsconfig.json b/tsconfig.json index 5b70769..a15932d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "target": "esnext", "module": "commonjs", "pretty": true, - "lib": ["esnext.bigint", "DOM"], + "lib": ["esnext.bigint"], "typeRoots": ["./node_modules/@types"], "declaration": true, "strict": true,