Remove 2 tsconfig-ignore

This commit is contained in:
dapplion 2020-12-03 19:09:15 +00:00
parent 0b10c2cb4e
commit c8798707d9
2 changed files with 9 additions and 3 deletions

View File

@ -6,15 +6,21 @@ type Bls = typeof bls;
let blsGlobal: Bls | null = null; let blsGlobal: Bls | null = null;
let blsGlobalPromise: Promise<void> | null = null; let blsGlobalPromise: Promise<void> | null = null;
// Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto
declare global {
interface Window {
msCrypto: typeof window["crypto"];
}
}
export async function setupBls(): Promise<void> { export async function setupBls(): Promise<void> {
if (!blsGlobal) { if (!blsGlobal) {
await bls.init(bls.BLS12_381); await bls.init(bls.BLS12_381);
// Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto // Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto
// @ts-ignore
if (typeof window === "object") { if (typeof window === "object") {
// @ts-ignore
const crypto = window.crypto || window.msCrypto; const crypto = window.crypto || window.msCrypto;
// getRandomValues is not typed in `bls-eth-wasm` because it's not meant to be exposed
// @ts-ignore // @ts-ignore
bls.getRandomValues = (x) => crypto.getRandomValues(x); bls.getRandomValues = (x) => crypto.getRandomValues(x);
} }

View File

@ -4,7 +4,7 @@
"target": "esnext", "target": "esnext",
"module": "commonjs", "module": "commonjs",
"pretty": true, "pretty": true,
"lib": ["esnext.bigint"], "lib": ["esnext.bigint", "DOM"],
"typeRoots": ["./node_modules/@types"], "typeRoots": ["./node_modules/@types"],
"declaration": true, "declaration": true,
"strict": true, "strict": true,