@@ -18,6 +18,7 @@ import {
1818} from '@selfxyz/common/utils' ;
1919import { getPublicKey , verifyAttestation } from '@selfxyz/common/utils/attest' ;
2020import {
21+ generateTEEInputsDiscloseStateless ,
2122 generateTEEInputsDSC ,
2223 generateTEEInputsRegister ,
2324} from '@selfxyz/common/utils/circuits/registerInputs' ;
@@ -38,7 +39,6 @@ import {
3839} from '@selfxyz/common/utils/proving' ;
3940import {
4041 clearPassportData ,
41- generateTEEInputsDisclose ,
4242 hasAnyValidRegisteredDocument ,
4343 loadSelectedDocument ,
4444 markCurrentDocumentAsRegistered ,
@@ -459,7 +459,7 @@ export const useProvingStore = create<ProvingState>((set, get) => {
459459 selfClient . emit ( SdkEvents . PROVING_REGISTER_ERROR_OR_FAILURE , {
460460 hasValidDocument : hasValid ,
461461 } ) ;
462- } catch ( error ) {
462+ } catch {
463463 selfClient . emit ( SdkEvents . PROVING_REGISTER_ERROR_OR_FAILURE , {
464464 hasValidDocument : false ,
465465 } ) ;
@@ -1015,7 +1015,7 @@ export const useProvingStore = create<ProvingState>((set, get) => {
10151015 }
10161016 } ,
10171017
1018- _closeConnections : ( selfClient : SelfClient ) => {
1018+ _closeConnections : ( _selfClient : SelfClient ) => {
10191019 const { wsConnection : ws , wsHandlers } = get ( ) ;
10201020 if ( ws && wsHandlers ) {
10211021 try {
@@ -1088,10 +1088,27 @@ export const useProvingStore = create<ProvingState>((set, get) => {
10881088 break ;
10891089 case 'disclose' :
10901090 ( { inputs, circuitName, endpointType, endpoint } =
1091- generateTEEInputsDisclose (
1091+ generateTEEInputsDiscloseStateless (
10921092 secret as string ,
10931093 passportData ,
10941094 selfApp as SelfApp ,
1095+ ( doc : DocumentCategory , tree ) => {
1096+ const docStore =
1097+ doc === 'passport'
1098+ ? protocolStore . passport
1099+ : protocolStore . id_card ;
1100+ switch ( tree ) {
1101+ case 'ofac' :
1102+ return docStore . ofac_trees ;
1103+ case 'commitment' :
1104+ if ( ! docStore . commitment_tree ) {
1105+ throw new Error ( 'Commitment tree not loaded' ) ;
1106+ }
1107+ return docStore . commitment_tree ;
1108+ default :
1109+ throw new Error ( 'Unknown tree type' ) ;
1110+ }
1111+ } ,
10951112 ) ) ;
10961113 circuitTypeWithDocumentExtension = `disclose` ;
10971114 break ;
0 commit comments