Skip to content

Commit bc907dd

Browse files
committed
fix: import recovery test
1 parent 7e699d2 commit bc907dd

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/importRecovery.spec.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { bufferToElliptic, criticalResetAccount, newCoreKitLogInInstance } from
99
import { getKeyCurve } from "@toruslabs/torus.js";
1010
import { KeyType, Point } from "@tkey/common-types";
1111
import { MockStorageLayer } from "@tkey/storage-layer-torus";
12-
import { BN } from "bn.js";
1312

1413
type ImportKeyTestVariable = {
1514
manualSync?: boolean;
@@ -22,8 +21,8 @@ type ImportKeyTestVariable = {
2221
const storageInstance = new MemoryStorage();
2322

2423
// use mockStorageLayer, hence resetAccount is not required.
25-
const mockStorageLayer = new MockStorageLayer();
2624
export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
25+
const mockStorageLayer = new MockStorageLayer();
2726
async function newCoreKitInstance(email: string, importTssKey?: string) {
2827
return newCoreKitLogInInstance({
2928
network: WEB3AUTH_NETWORK.DEVNET,
@@ -37,7 +36,7 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
3736
});
3837
}
3938

40-
describe(`import recover tss key : ${testVariable.manualSync}, testVariable: ${testVariable}`, async function (t) {
39+
describe(`import recover tss key manual sync: ${testVariable.manualSync}, testVariable: ${JSON.stringify(testVariable)}`, async function (t) {
4140
it("#recover Tss key using 2 factors key, import tss key to new oauth login", async function () {
4241
const coreKitInstance = await newCoreKitInstance(testVariable.email);
4342

@@ -88,8 +87,6 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
8887
const exportedTssKey3 = await coreKitInstance3._UNSAFE_exportTssKey(keyType);
8988
const tssCurve = getKeyCurve(keyType);
9089
const exportedPub = tssCurve.keyFromPrivate(exportedTssKey3).getPublic();
91-
console.log(exportedPub.encodeCompressed("hex"))
92-
console.log(tssPubkey.encodeCompressed("hex"))
9390
assert(tssPubkey.eq(exportedPub));
9491

9592
// Check exported key corresponds to pub key for account index > 0.
@@ -105,9 +102,9 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
105102
};
106103

107104
const variable: ImportKeyTestVariable[] = [
108-
// { manualSync: false, email: "emailexport", importKeyEmail: "emailimport", tssLib: tssLibDKLS },
109-
// { manualSync: true, email: "emailexport", importKeyEmail: "emailimport", tssLib: tssLibDKLS },
110-
{ manualSync: false, email: "emailexport_ed25519", importKeyEmail: "emailimport_ed25519", tssLib: tssLibFROST },
105+
{ manualSync: false, email: "emailexport", importKeyEmail: "emailimport", tssLib: tssLibDKLS },
106+
{ manualSync: true, email: "emailexport", importKeyEmail: "emailimport", tssLib: tssLibDKLS },
107+
// { manualSync: false, email: "emailexport_ed25519--1", importKeyEmail: "emailimport_ed25519--1", tssLib: tssLibFROST },
111108
];
112109

113110
variable.forEach(async (testVariable) => {

0 commit comments

Comments
 (0)