@@ -9,7 +9,6 @@ import { bufferToElliptic, criticalResetAccount, newCoreKitLogInInstance } from
9
9
import { getKeyCurve } from "@toruslabs/torus.js" ;
10
10
import { KeyType , Point } from "@tkey/common-types" ;
11
11
import { MockStorageLayer } from "@tkey/storage-layer-torus" ;
12
- import { BN } from "bn.js" ;
13
12
14
13
type ImportKeyTestVariable = {
15
14
manualSync ?: boolean ;
@@ -22,8 +21,8 @@ type ImportKeyTestVariable = {
22
21
const storageInstance = new MemoryStorage ( ) ;
23
22
24
23
// use mockStorageLayer, hence resetAccount is not required.
25
- const mockStorageLayer = new MockStorageLayer ( ) ;
26
24
export const ImportTest = async ( testVariable : ImportKeyTestVariable ) => {
25
+ const mockStorageLayer = new MockStorageLayer ( ) ;
27
26
async function newCoreKitInstance ( email : string , importTssKey ?: string ) {
28
27
return newCoreKitLogInInstance ( {
29
28
network : WEB3AUTH_NETWORK . DEVNET ,
@@ -37,7 +36,7 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
37
36
} ) ;
38
37
}
39
38
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 ) {
41
40
it ( "#recover Tss key using 2 factors key, import tss key to new oauth login" , async function ( ) {
42
41
const coreKitInstance = await newCoreKitInstance ( testVariable . email ) ;
43
42
@@ -88,8 +87,6 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
88
87
const exportedTssKey3 = await coreKitInstance3 . _UNSAFE_exportTssKey ( keyType ) ;
89
88
const tssCurve = getKeyCurve ( keyType ) ;
90
89
const exportedPub = tssCurve . keyFromPrivate ( exportedTssKey3 ) . getPublic ( ) ;
91
- console . log ( exportedPub . encodeCompressed ( "hex" ) )
92
- console . log ( tssPubkey . encodeCompressed ( "hex" ) )
93
90
assert ( tssPubkey . eq ( exportedPub ) ) ;
94
91
95
92
// Check exported key corresponds to pub key for account index > 0.
@@ -105,9 +102,9 @@ export const ImportTest = async (testVariable: ImportKeyTestVariable) => {
105
102
} ;
106
103
107
104
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 },
111
108
] ;
112
109
113
110
variable . forEach ( async ( testVariable ) => {
0 commit comments