@@ -33,10 +33,12 @@ import { IExecConsumer } from '../types/internalTypes.js';
3333import { getWhitelistContract } from './smartContract/getWhitelistContract.js' ;
3434import { isAddressInWhitelist } from './smartContract/whitelistContract.read.js' ;
3535
36+ export type ProcessProtectedData = typeof processProtectedData ;
37+
3638export const processProtectedData = async ( {
3739 iexec = throwIfMissing ( ) ,
38- protectedData = throwIfMissing ( ) ,
39- app = throwIfMissing ( ) ,
40+ protectedData,
41+ app,
4042 userWhitelist,
4143 maxPrice = DEFAULT_MAX_PRICE ,
4244 args,
@@ -46,14 +48,14 @@ export const processProtectedData = async ({
4648 onStatusUpdate = ( ) => { } ,
4749} : IExecConsumer &
4850 ProcessProtectedDataParams ) : Promise < ProcessProtectedDataResponse > => {
49- const vApp = addressOrEnsSchema ( )
50- . required ( )
51- . label ( 'authorizedApp' )
52- . validateSync ( app ) ;
5351 const vProtectedData = addressOrEnsSchema ( )
5452 . required ( )
5553 . label ( 'protectedData' )
5654 . validateSync ( protectedData ) ;
55+ const vApp = addressOrEnsSchema ( )
56+ . required ( )
57+ . label ( 'authorizedApp' )
58+ . validateSync ( app ) ;
5759 const vUserWhitelist = addressSchema ( )
5860 . label ( 'userWhitelist' )
5961 . validateSync ( userWhitelist ) ;
@@ -96,7 +98,7 @@ export const processProtectedData = async ({
9698
9799 if ( ! isRequesterInWhitelist ) {
98100 throw new Error (
99- ` As a user, you are not in the whitelist. So you can't access to the protectedData in order process it`
101+ " As a user, you are not in the whitelist. You can't access the protectedData so you can't process it."
100102 ) ;
101103 }
102104 requester = vUserWhitelist ;
@@ -244,6 +246,7 @@ export const processProtectedData = async ({
244246 result,
245247 } ;
246248 } catch ( error ) {
249+ console . error ( '[processProtectedData] ERROR' , error ) ;
247250 handleIfProtocolError ( error ) ;
248251 throw new WorkflowError ( {
249252 message : processProtectedDataErrorMessage ,
0 commit comments