Skip to content

Commit ccff02e

Browse files
committed
fix: undo critical delete changes
1 parent b3beb44 commit ccff02e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/setup.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ export const criticalResetAccount = async (coreKitInstance: Web3AuthMPCCoreKit):
3030
throw new Error("coreKitInstance is not set");
3131
}
3232

33-
await coreKitInstance.tKey.storageLayer.setMetadata({
34-
privKey: new BN(coreKitInstance.state.postBoxKey!, "hex"),
35-
input: { message: "KEY_NOT_FOUND" },
36-
});
33+
if (coreKitInstance.tKey.secp256k1Key) {
34+
await coreKitInstance.tKey.CRITICAL_deleteTkey();
35+
} else {
36+
await coreKitInstance.tKey.storageLayer.setMetadata({
37+
privKey: new BN(coreKitInstance.state.postBoxKey!, "hex"),
38+
input: { message: "KEY_NOT_FOUND" },
39+
});
40+
}
3741
};
3842

3943
const privateKey = "MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCCD7oLrcKae+jVZPGx52Cb/lKhdKxpXjl9eGNa1MlY57A==";

0 commit comments

Comments
 (0)