diff --git a/src/provider/Provider.ts b/src/provider/Provider.ts index b6ee7f95..ea7fe992 100644 --- a/src/provider/Provider.ts +++ b/src/provider/Provider.ts @@ -231,7 +231,8 @@ export class Provider { providerUri: string, getMethod: any, userCustomParameters?: UserCustomParameters, - computeEnv?: string + computeEnv?: string, + validUntil?: string ): Promise { const providerEndpoints = await this.getEndpoints(providerUri) const serviceEndpoints = await this.getServiceEndpoints( @@ -250,6 +251,7 @@ export class Provider { if (userCustomParameters) initializeUrl += '&userdata=' + encodeURI(JSON.stringify(userCustomParameters)) if (computeEnv) initializeUrl += '&computeEnv=' + encodeURI(computeEnv) + if (validUntil) initializeUrl += '&validUntil=' + validUntil try { const response = await getMethod('GET', initializeUrl) const results: ProviderInitialize = await response.json() diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index 45d5a361..bd79d481 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -279,6 +279,10 @@ describe('Simple compute tests', async () => { providerAlgoFees ) assert(txidAlgo, 'Failed to order algo') + + const providerValidUntil = new Date() + providerValidUntil.setHours(providerValidUntil.getHours() + 1) + // initialize provider orders for asset const initializeData = await ProviderInstance.initialize( resolvedDDOAsset.id, @@ -288,7 +292,8 @@ describe('Simple compute tests', async () => { providerUrl, crossFetchGeneric, null, - 'env1' + 'env1', + providerValidUntil.toString() ) const providerDatasetFees: ProviderFees = { providerFeeAddress: initializeData.providerFee.providerFeeAddress,