From b90f80f7a40ba69621e1a5cf09b3811b002e9d62 Mon Sep 17 00:00:00 2001 From: guru-web3 <105355858+guru-web3@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:18:42 +0530 Subject: [PATCH] fix: test cases --- karmaBaseConfig.js | 6 +++--- packages/core/src/core.ts | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/karmaBaseConfig.js b/karmaBaseConfig.js index 1512ec4c3..183518fed 100644 --- a/karmaBaseConfig.js +++ b/karmaBaseConfig.js @@ -24,9 +24,9 @@ const localBrowserConfig = (webpackConfig, karmaConfig, packageConfig) => { frameworks: ["mocha", "webpack"], webpack: { - module: webpackConfig[1].module, - resolve: webpackConfig[1].resolve, - plugins: webpackConfig[1].plugins, + module: webpackConfig[0].module, + resolve: webpackConfig[0].resolve, + plugins: webpackConfig[0].plugins, }, plugins: ["karma-mocha-reporter", "karma-webkit-launcher", "karma-chrome-launcher", "karma-firefox-launcher", "karma-mocha", "karma-webpack"], diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 20a852219..e0db96544 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -54,7 +54,6 @@ import { import { generatePrivate } from "@toruslabs/eccrypto"; import { keccak256 } from "@toruslabs/torus.js"; import BN from "bn.js"; -import crypto from "crypto"; import stringify from "json-stable-stringify"; import AuthMetadata from "./authMetadata"; @@ -236,8 +235,8 @@ class ThresholdKey implements ITKey { return index && index > 0 ? new BN(keccak256(Buffer.from(`${index}${chainCode}`)).slice(2), "hex").umod(ecCurve.curve.n) : new BN(0); } - generateSalt(length = 32) { - return crypto.randomBytes(length).toString("hex"); + generateSalt() { + return generatePrivate().toString("hex"); } async initialize(params?: {