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 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> {
if (!blsGlobal) {
await bls.init(bls.BLS12_381);
// Patch to fix multiVerify() calls on a browser with polyfilled NodeJS crypto
// @ts-ignore
if (typeof window === "object") {
// @ts-ignore
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);
}

View File

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