diff --git a/src/components/organisms/AssetActions/Compute/index.tsx b/src/components/organisms/AssetActions/Compute/index.tsx index ec1375ee3..e055e9233 100644 --- a/src/components/organisms/AssetActions/Compute/index.tsx +++ b/src/components/organisms/AssetActions/Compute/index.tsx @@ -195,7 +195,9 @@ export default function Compute({ source.token ) setDdoAlgorithmList(gueryResults.results) + const datasetComputeService = ddo.findServiceByType('compute') algorithmSelectionList = await transformDDOToAssetSelection( + datasetComputeService.serviceEndpoint, gueryResults.results, config.metadataCacheUri, [] diff --git a/src/utils/aquarius.ts b/src/utils/aquarius.ts index a642be1df..025c1aa17 100644 --- a/src/utils/aquarius.ts +++ b/src/utils/aquarius.ts @@ -107,6 +107,7 @@ export async function getAssetsNames( } export async function transformDDOToAssetSelection( + datasetProviderEndpoint: string, ddoList: DDO[], metadataCacheUri: string, selectedAlgorithms?: PublisherTrustedAlgorithm[] @@ -115,14 +116,22 @@ export async function transformDDOToAssetSelection( const didList: string[] = [] const priceList: PriceList = await getAssetPrices(ddoList) const symbolList: any = {} + const didProviderEndpointMap: any = {} for (const ddo of ddoList) { didList.push(ddo.id) symbolList[ddo.id] = ddo.dataTokenInfo.symbol + const algoComputeService = ddo.findServiceByType('compute') + algoComputeService?.serviceEndpoint && + (didProviderEndpointMap[ddo.id] = algoComputeService?.serviceEndpoint) } const ddoNames = await getAssetsNames(didList, metadataCacheUri, source.token) const algorithmList: AssetSelectionAsset[] = [] didList?.forEach((did: string) => { - if (priceList[did]) { + if ( + priceList[did] && + (!didProviderEndpointMap[did] || + didProviderEndpointMap[did] === datasetProviderEndpoint) + ) { let selected = false selectedAlgorithms?.forEach((algorithm: PublisherTrustedAlgorithm) => { if (algorithm.did === did) {