File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -1350,19 +1350,21 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
13501350 }
13511351
13521352 private async deleteMetadataShareBackup ( factorKey : BN ) : Promise < void > {
1353- await this . tKey . addLocalMetadataTransitions ( { input : [ { message : SHARE_DELETED , dateAdded : Date . now ( ) } ] , privKey : [ factorKey ] } ) ;
1354- if ( ! this . tkey ?. manualSync ) await this . tkey ?. syncLocalMetadataTransitions ( ) ;
1353+ await this . atomicSync ( async ( ) => {
1354+ await this . tKey . addLocalMetadataTransitions ( { input : [ { message : SHARE_DELETED , dateAdded : Date . now ( ) } ] , privKey : [ factorKey ] } ) ;
1355+ } ) ;
13551356 }
13561357
13571358 private async backupMetadataShare ( factorKey : BN ) {
13581359 const metadataShare = await this . getMetadataShare ( ) ;
13591360
1360- // Set metadata for factor key backup
1361- await this . tKey ?. addLocalMetadataTransitions ( {
1362- input : [ metadataShare ] ,
1363- privKey : [ factorKey ] ,
1361+ await this . atomicSync ( async ( ) => {
1362+ // Set metadata for factor key backup
1363+ await this . tKey ?. addLocalMetadataTransitions ( {
1364+ input : [ metadataShare ] ,
1365+ privKey : [ factorKey ] ,
1366+ } ) ;
13641367 } ) ;
1365- if ( ! this . tkey ?. manualSync ) await this . tkey ?. syncLocalMetadataTransitions ( ) ;
13661368 }
13671369
13681370 private async addFactorDescription ( args : {
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ variable.forEach((testVariable) => {
171171 }
172172 const exportedSeed = await coreKitInstance . _UNSAFE_exportTssEd25519Seed ( ) ;
173173
174+ // import tss key into mpc corekit
174175 const coreKitInstance2 = newCoreKitInstance ( ) ;
175176 await coreKitInstance2 . init ( { handleRedirectResult : false , rehydrate : false } ) ;
176177 const localToken2 = await mockLogin2 ( importedEmail ) ;
@@ -180,13 +181,13 @@ variable.forEach((testVariable) => {
180181 idToken : localToken2 . idToken ,
181182 importTssKey : exportedSeed . toString ( "hex" ) ,
182183 } ) ;
184+ if ( manualSync ) {
185+ await coreKitInstance2 . commitChanges ( ) ;
186+ }
183187
184188 const exportedSeed2 = await coreKitInstance2 . _UNSAFE_exportTssEd25519Seed ( ) ;
185189
186190 assert ( exportedSeed . toString ( "hex" ) === ( exportedSeed2 . toString ( "hex" ) ) ) ;
187191 } ) ;
188-
189-
190-
191192 } ) ;
192193} ) ;
You can’t perform that action at this time.
0 commit comments