diff --git a/gradle.properties b/gradle.properties index 78bd22c19..d9abc155c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # x-release-please-start-version version=9.2.1 # x-release-please-end -iexecCommonsPocoVersion=5.4.0 +iexecCommonsPocoVersion=5.4.1 iexecCommonVersion=9.2.0 iexecBlockchainAdapterVersion=9.0.4 iexecResultVersion=9.1.0 diff --git a/src/main/java/com/iexec/core/chain/IexecHubService.java b/src/main/java/com/iexec/core/chain/IexecHubService.java index e8c90d5b3..e6684ec6a 100644 --- a/src/main/java/com/iexec/core/chain/IexecHubService.java +++ b/src/main/java/com/iexec/core/chain/IexecHubService.java @@ -39,7 +39,6 @@ @Service public class IexecHubService extends IexecHubAbstractService implements Purgeable { - private final SignerService signerService; private final Web3jService web3jService; public IexecHubService(final SignerService signerService, @@ -49,7 +48,6 @@ public IexecHubService(final SignerService signerService, signerService.getCredentials(), web3jService, chainConfig.getHubAddress()); - this.signerService = signerService; this.web3jService = web3jService; if (!hasEnoughGas()) { System.exit(0); @@ -118,12 +116,6 @@ public Date getChainDealFinalDeadline(ChainDeal chainDeal) { return new Date(startTime + maxTime * 10); } - public boolean hasEnoughGas() { - final boolean hasEnoughGas = hasEnoughGas(signerService.getAddress()); - log.debug("Gas status [hasEnoughGas:{}]", hasEnoughGas); - return hasEnoughGas; - } - // region check contribution status public boolean repeatIsContributedTrue(String chainTaskId, String walletAddress) { return web3jService.repeatCheck(NB_BLOCKS_TO_WAIT_PER_RETRY, MAX_RETRIES, diff --git a/src/main/java/com/iexec/core/workflow/ReplicateWorkflow.java b/src/main/java/com/iexec/core/workflow/ReplicateWorkflow.java index ae746f02e..08c886f38 100644 --- a/src/main/java/com/iexec/core/workflow/ReplicateWorkflow.java +++ b/src/main/java/com/iexec/core/workflow/ReplicateWorkflow.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -195,7 +195,6 @@ TaskNotificationType getNextActionWhenStatusAndCause(ReplicateStatus whenStatus, log.error("TaskDescription is null with a COMPUTED status, this case shouldn't happen"); return PLEASE_ABORT; } - // We must check CallBack is empty because there is an issue in poco (transaction is revert) if (taskDescription.isEligibleToContributeAndFinalize()) { return PLEASE_CONTRIBUTE_AND_FINALIZE; } diff --git a/src/test/java/com/iexec/core/chain/IexecHubServiceTests.java b/src/test/java/com/iexec/core/chain/IexecHubServiceTests.java index 6a0155f53..db48caa80 100644 --- a/src/test/java/com/iexec/core/chain/IexecHubServiceTests.java +++ b/src/test/java/com/iexec/core/chain/IexecHubServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ void init() throws Exception { final Credentials credentials = Credentials.create(Keys.createEcKeyPair()); when(signerService.getCredentials()).thenReturn(credentials); - when(web3jService.hasEnoughGas(any())).thenReturn(true); + when(web3jService.isSidechain()).thenReturn(true); when(chainConfig.getHubAddress()).thenReturn("0x748e091bf16048cb5103E0E10F9D5a8b7fBDd860"); iexecHubService = spy(new IexecHubService(signerService, web3jService, chainConfig)); diff --git a/src/test/java/com/iexec/core/detector/replicate/ContributionAndFinalizationUnnotifiedDetectorTests.java b/src/test/java/com/iexec/core/detector/replicate/ContributionAndFinalizationUnnotifiedDetectorTests.java index 7bbbd807b..1e20a3609 100644 --- a/src/test/java/com/iexec/core/detector/replicate/ContributionAndFinalizationUnnotifiedDetectorTests.java +++ b/src/test/java/com/iexec/core/detector/replicate/ContributionAndFinalizationUnnotifiedDetectorTests.java @@ -89,13 +89,12 @@ private Replicate getReplicateWithStatus(final ReplicateStatus replicateStatus) } // Helper method to avoid redundancy - private void mockTaskAndTaskDecription(final String callback) { + private void mockTaskAndTaskDescription(final String callback) { final Task task = Task.builder().chainTaskId(CHAIN_TASK_ID).build(); when(iexecHubService.getTaskDescription(anyString())).thenReturn( TaskDescription.builder() .trust(BigInteger.ONE) - .isTeeTask(true) - .teeFramework(TeeFramework.SCONE) + .teeFramework(TeeFramework.TDX) .callback(callback) .build() ); @@ -115,7 +114,7 @@ private void mockTaskAndTaskDecription(final String callback) { @ParameterizedTest @ValueSource(strings = {"", CALLBACK}) void shouldDetectBothChangesOnChain(final String callback) { - mockTaskAndTaskDecription(callback); + mockTaskAndTaskDescription(callback); final Replicate replicate = getReplicateWithStatus(CONTRIBUTE_AND_FINALIZE_ONGOING); when(replicatesService.getReplicates(CHAIN_TASK_ID)).thenReturn(Collections.singletonList(replicate)); @@ -140,7 +139,7 @@ void shouldDetectBothChangesOnChain(final String callback) { @ParameterizedTest @ValueSource(strings = {"", CALLBACK}) void shouldDetectMissedUpdateSinceOffChainOngoing(final String callback) { - mockTaskAndTaskDecription(callback); + mockTaskAndTaskDescription(callback); final Replicate replicate = getReplicateWithStatus(CONTRIBUTE_AND_FINALIZE_ONGOING); when(replicatesService.getReplicates(CHAIN_TASK_ID)).thenReturn(Collections.singletonList(replicate)); @@ -168,7 +167,7 @@ void shouldNotDetectMissedUpdateSinceNotOffChainOngoing(final String callback) { @ParameterizedTest @ValueSource(strings = {"", CALLBACK}) void shouldNotDetectMissedUpdateSinceNotOnChainDone(final String callback) { - mockTaskAndTaskDecription(callback); + mockTaskAndTaskDescription(callback); final Replicate replicate = getReplicateWithStatus(CONTRIBUTE_AND_FINALIZE_ONGOING); when(replicatesService.getReplicates(CHAIN_TASK_ID)).thenReturn(Collections.singletonList(replicate)); @@ -195,7 +194,7 @@ static Stream provideReplicateStatusAndCallback() { @ParameterizedTest @MethodSource("provideReplicateStatusAndCallback") void shouldDetectMissedUpdateSinceOnChainDoneNotOffChainDone(final ReplicateStatus replicateStatus, final String callback) { - mockTaskAndTaskDecription(callback); + mockTaskAndTaskDescription(callback); final Replicate replicate = getReplicateWithStatus(replicateStatus); when(replicatesService.getReplicates(CHAIN_TASK_ID)).thenReturn(Collections.singletonList(replicate)); @@ -226,22 +225,6 @@ void shouldNotDetectMissedUpdateSinceOnChainDoneAndOffChainDone() { .updateReplicateStatus(any(), any(), any(ReplicateStatusUpdate.class)); } - @Test - void shouldNotDetectMissedUpdateSinceOnChainDoneAndNotEligibleToContributeAndFinalize() { - when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)).thenReturn( - TaskDescription.builder().trust(BigInteger.ONE).isTeeTask(true).callback("0x2").build()); - final Task task = Task.builder().chainTaskId(CHAIN_TASK_ID).build(); - when(taskService.findByCurrentStatus(TaskStatus.getWaitingContributionStatuses())).thenReturn(Collections.singletonList(task)); - - final Replicate replicate = getReplicateWithStatus(CONTRIBUTING); - when(replicatesService.getReplicates(any())).thenReturn(Collections.singletonList(replicate)); - - detector.detectOnchainDone(); - - Mockito.verify(replicatesService, never()) - .updateReplicateStatus(any(), any(), any(ReplicateStatusUpdate.class)); - } - // endregion } diff --git a/src/test/java/com/iexec/core/detector/replicate/ContributionUnnotifiedDetectorTests.java b/src/test/java/com/iexec/core/detector/replicate/ContributionUnnotifiedDetectorTests.java index c00df9d47..0649848f0 100644 --- a/src/test/java/com/iexec/core/detector/replicate/ContributionUnnotifiedDetectorTests.java +++ b/src/test/java/com/iexec/core/detector/replicate/ContributionUnnotifiedDetectorTests.java @@ -20,6 +20,7 @@ import com.iexec.common.replicate.ReplicateStatusUpdate; import com.iexec.commons.poco.chain.ChainReceipt; import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.commons.poco.utils.BytesUtils; import com.iexec.core.chain.IexecHubService; import com.iexec.core.configuration.CronConfiguration; @@ -88,7 +89,6 @@ private void mockTaskAndTaskDescription() { Task task = Task.builder().chainTaskId(CHAIN_TASK_ID).build(); when(iexecHubService.getTaskDescription(anyString())).thenReturn(TaskDescription.builder() .trust(BigInteger.ONE) - .isTeeTask(false) .build()); when(taskService.findByCurrentStatus(TaskStatus.getWaitingContributionStatuses())).thenReturn(Collections.singletonList(task)); } @@ -208,10 +208,11 @@ void shouldNotDetectMissedUpdateSinceOnChainDoneAndOffChainDone() { .updateReplicateStatus(any(), any(), any(ReplicateStatusUpdate.class)); } - @Test - void shouldNotDetectMissedUpdateSinceOnChainDoneAndEligibleToContributeAndFinalize() { + @ParameterizedTest + @EnumSource(value = TeeFramework.class) + void shouldNotDetectMissedUpdateSinceOnChainDoneAndEligibleToContributeAndFinalize(final TeeFramework teeFramework) { when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)).thenReturn( - TaskDescription.builder().trust(BigInteger.ONE).isTeeTask(true).callback(BytesUtils.EMPTY_ADDRESS).build()); + TaskDescription.builder().trust(BigInteger.ONE).teeFramework(teeFramework).callback(BytesUtils.EMPTY_ADDRESS).build()); Task task = Task.builder().chainTaskId(CHAIN_TASK_ID).build(); when(taskService.findByCurrentStatus(TaskStatus.getWaitingContributionStatuses())).thenReturn(Collections.singletonList(task)); diff --git a/src/test/java/com/iexec/core/detector/task/FinalizedTaskDetectorTests.java b/src/test/java/com/iexec/core/detector/task/FinalizedTaskDetectorTests.java index ae8792f7c..1f372b64b 100644 --- a/src/test/java/com/iexec/core/detector/task/FinalizedTaskDetectorTests.java +++ b/src/test/java/com/iexec/core/detector/task/FinalizedTaskDetectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2023-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -296,7 +296,6 @@ private Task.TaskBuilder mockOnchainTask(final String chainTaskId, final ChainTa private void mockTaskDescriptionFromTask(final Task task) { final TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(task.getChainTaskId()) - .isTeeTask(task.isTeeTask()) .teeFramework(TeeUtils.getTeeFramework(task.getTag())) .trust(BigInteger.valueOf(task.getTrust())) .callback("") diff --git a/src/test/java/com/iexec/core/replicate/ReplicateServiceTests.java b/src/test/java/com/iexec/core/replicate/ReplicateServiceTests.java index 044f7b704..e595a29d5 100644 --- a/src/test/java/com/iexec/core/replicate/ReplicateServiceTests.java +++ b/src/test/java/com/iexec/core/replicate/ReplicateServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import com.iexec.commons.poco.chain.ChainTask; import com.iexec.commons.poco.chain.DealParams; import com.iexec.commons.poco.task.TaskDescription; +import com.iexec.commons.poco.tee.TeeFramework; import com.iexec.commons.poco.utils.BytesUtils; import com.iexec.core.chain.IexecHubService; import com.iexec.core.chain.Web3jService; @@ -33,7 +34,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.NullSource; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; @@ -382,8 +384,7 @@ void shouldUpdateReplicateStatusWithoutStdout() { .build(); replicatesService.updateReplicateStatus(CHAIN_TASK_ID, WALLET_WORKER_1, statusUpdate); - Mockito.verify(applicationEventPublisher, Mockito.times(1)) - .publishEvent(argumentCaptor.capture()); + verify(applicationEventPublisher).publishEvent(argumentCaptor.capture()); ReplicateUpdatedEvent capturedEvent = argumentCaptor.getAllValues().get(0); assertThat(capturedEvent.getChainTaskId()).isEqualTo(replicate.getChainTaskId()); @@ -397,8 +398,10 @@ void shouldUpdateReplicateStatusWithoutStdout() { assertThat(capturedEvent.getReplicateStatusUpdate().getDetails().getComputeLogs()).isNull(); } - @Test - void shouldUpdateReplicateStatusWithStdoutIfComputed() { + @ParameterizedTest + @NullSource + @EnumSource(value = TeeFramework.class) + void shouldUpdateReplicateStatusWithStdoutIfComputed(final TeeFramework teeFramework) { String stdout = "This is an stdout message !"; Replicate replicate = new Replicate(WALLET_WORKER_1, CHAIN_TASK_ID); replicate.updateStatus(COMPUTING, ReplicateStatusModifier.WORKER); @@ -413,11 +416,10 @@ void shouldUpdateReplicateStatusWithStdoutIfComputed() { .build(); ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(ReplicateUpdatedEvent.class); when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)) - .thenReturn(TaskDescription.builder().isTeeTask(true).build()); + .thenReturn(TaskDescription.builder().teeFramework(teeFramework).build()); replicatesService.updateReplicateStatus(CHAIN_TASK_ID, WALLET_WORKER_1, statusUpdate); - Mockito.verify(applicationEventPublisher, Mockito.times(1)) - .publishEvent(argumentCaptor.capture()); + verify(applicationEventPublisher).publishEvent(argumentCaptor.capture()); ReplicateUpdatedEvent capturedEvent = argumentCaptor.getAllValues().get(0); assertThat(capturedEvent.getChainTaskId()).isEqualTo(replicate.getChainTaskId()); assertThat(capturedEvent.getWalletAddress()).isEqualTo(WALLET_WORKER_1); @@ -750,15 +752,16 @@ void shouldGetReplicateWithResultUploadedStatus() { // region isResultUploaded @ParameterizedTest - @ValueSource(booleans = {true, false}) - void shouldCheckResultServiceAndReturnTrue(final boolean isTeeTask) { + @NullSource + @EnumSource(value = TeeFramework.class) + void shouldCheckResultServiceAndReturnTrue(final TeeFramework teeFramework) { final DealParams dealParams = DealParams.builder() .iexecResultStorageProvider(IPFS_RESULT_STORAGE_PROVIDER) .build(); TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(CHAIN_TASK_ID) .callback(BytesUtils.EMPTY_ADDRESS) - .isTeeTask(isTeeTask) + .teeFramework(teeFramework) .dealParams(dealParams) .build(); when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)) @@ -771,15 +774,16 @@ void shouldCheckResultServiceAndReturnTrue(final boolean isTeeTask) { } @ParameterizedTest - @ValueSource(booleans = {true, false}) - void shouldCheckResultServiceAndReturnFalse(final boolean isTeeTask) { + @NullSource + @EnumSource(value = TeeFramework.class) + void shouldCheckResultServiceAndReturnFalse(final TeeFramework teeFramework) { final DealParams dealParams = DealParams.builder() .iexecResultStorageProvider(IPFS_RESULT_STORAGE_PROVIDER) .build(); final TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(CHAIN_TASK_ID) .callback(BytesUtils.EMPTY_ADDRESS) - .isTeeTask(isTeeTask) + .teeFramework(teeFramework) .dealParams(dealParams) .build(); when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)) @@ -802,12 +806,13 @@ void shouldReturnFalseSinceTaskNotFound() { } @ParameterizedTest - @ValueSource(booleans = {true, false}) - void shouldReturnTrueForCallbackTask(boolean isTeeTask) { + @NullSource + @EnumSource(value = TeeFramework.class) + void shouldReturnTrueForCallbackTask(final TeeFramework teeFramework) { TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(CHAIN_TASK_ID) .callback("callback") - .isTeeTask(isTeeTask) + .teeFramework(teeFramework) .build(); when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)) .thenReturn(taskDescription); @@ -817,15 +822,17 @@ void shouldReturnTrueForCallbackTask(boolean isTeeTask) { verifyNoInteractions(resultService); } - @Test - void shouldReturnTrueIfPrivateStorageForTeeTask() { + @ParameterizedTest + @NullSource + @EnumSource(value = TeeFramework.class) + void shouldReturnTrueIfPrivateStorage(final TeeFramework teeFramework) { final DealParams dealParams = DealParams.builder() .iexecResultStorageProvider(DROPBOX_RESULT_STORAGE_PROVIDER) .build(); final TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(CHAIN_TASK_ID) .callback(BytesUtils.EMPTY_ADDRESS) - .isTeeTask(true) + .teeFramework(teeFramework) .dealParams(dealParams) .build(); when(iexecHubService.getTaskDescription(CHAIN_TASK_ID)) @@ -1120,7 +1127,6 @@ void shouldNotAuthorizeUpdateOnResultUploadedSinceNoResultLink() { .taskDescription(TaskDescription.builder().chainTaskId(CHAIN_TASK_ID).build()) .build(); - assertThat(replicatesService.canUpdateReplicateStatus(replicate, statusUpdate, updateArgs)) .isEqualTo(ReplicateStatusUpdateError.GENERIC_CANT_UPDATE); } @@ -1166,8 +1172,9 @@ void shouldAuthorizeUpdateOnContributeAndFinalizeOnGoing() { .isEqualTo(ReplicateStatusUpdateError.NO_ERROR); } - @Test - void shouldAuthorizeUpdateOnContributeAndFinalizeDone() { + @ParameterizedTest + @EnumSource(value = TeeFramework.class) + void shouldAuthorizeUpdateOnContributeAndFinalizeDone(final TeeFramework teeFramework) { final Replicate replicate = new Replicate(WALLET_WORKER_1, CHAIN_TASK_ID); replicate.updateStatus(CONTRIBUTE_AND_FINALIZE_ONGOING, ReplicateStatusModifier.WORKER); @@ -1178,7 +1185,7 @@ void shouldAuthorizeUpdateOnContributeAndFinalizeDone() { final TaskDescription task = TaskDescription .builder() .chainTaskId(CHAIN_TASK_ID) - .isTeeTask(true) + .teeFramework(teeFramework) .build(); when(iexecHubService.repeatIsRevealedTrue(CHAIN_TASK_ID, WALLET_WORKER_1)) diff --git a/src/test/java/com/iexec/core/task/TaskControllerTests.java b/src/test/java/com/iexec/core/task/TaskControllerTests.java index 2cf1e0cb2..499ac7b70 100644 --- a/src/test/java/com/iexec/core/task/TaskControllerTests.java +++ b/src/test/java/com/iexec/core/task/TaskControllerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2022-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ package com.iexec.core.task; import com.iexec.common.replicate.ComputeLogs; +import com.iexec.commons.poco.chain.SignerService; import com.iexec.commons.poco.eip712.EIP712Domain; import com.iexec.commons.poco.eip712.entity.Challenge; import com.iexec.commons.poco.eip712.entity.EIP712Challenge; @@ -57,6 +58,8 @@ class TaskControllerTests { private ECKeyPair ecKeyPair; private EIP712Challenge challenge; private EIP712Challenge badChallenge; + private EIP712Domain domain = new EIP712Domain(); + private SignerService signerService; private String requesterAddress; private String signature; @@ -76,12 +79,12 @@ class TaskControllerTests { @BeforeEach @SneakyThrows void setUp() { - EIP712Domain domain = new EIP712Domain(); + ecKeyPair = Keys.createEcKeyPair(); + signerService = new SignerService(null, 0L, Credentials.create(ecKeyPair)); + requesterAddress = signerService.getAddress(); challenge = new EIP712Challenge(domain, Challenge.builder().challenge("challenge").build()); badChallenge = new EIP712Challenge(domain, Challenge.builder().challenge("bad-challenge").build()); - ecKeyPair = Keys.createEcKeyPair(); - requesterAddress = Credentials.create(ecKeyPair).getAddress(); - signature = challenge.signMessage(ecKeyPair); + signature = signerService.signTypedDataForDomain(challenge.getMessage(), domain); } //region utilities @@ -230,8 +233,9 @@ void shouldFailToGetTaskLogsWithNotFoundStatus() { @Test void shouldFailToGetTaskLogsWhenBadChallenge() { - String authorization = String.join("_", badChallenge.getHash(), badChallenge.signMessage(ecKeyPair), requesterAddress); - TaskDescription description = TaskDescription.builder() + final String badSignature = signerService.signTypedDataForDomain(badChallenge.getMessage(), domain); + final String authorization = String.join("_", badChallenge.getHash(), badSignature, requesterAddress); + final TaskDescription description = TaskDescription.builder() .requester(requesterAddress) .build(); when(iexecHubService.getTaskDescription(TASK_ID)).thenReturn(description); @@ -294,8 +298,9 @@ void shouldFailToGetComputeLogsWithNotFoundStatus() { @Test void shouldFailToGetComputeLogsWhenBadChallenge() { - String authorization = String.join("_", badChallenge.getHash(), badChallenge.signMessage(ecKeyPair), requesterAddress); - TaskDescription description = TaskDescription.builder() + final String badSignature = signerService.signTypedDataForDomain(badChallenge.getMessage(), domain); + final String authorization = String.join("_", badChallenge.getHash(), badSignature, requesterAddress); + final TaskDescription description = TaskDescription.builder() .requester(requesterAddress) .build(); when(iexecHubService.getTaskDescription(TASK_ID)).thenReturn(description); diff --git a/src/test/java/com/iexec/core/task/update/TaskUpdateManagerTests.java b/src/test/java/com/iexec/core/task/update/TaskUpdateManagerTests.java index 28bb6f872..04e479481 100644 --- a/src/test/java/com/iexec/core/task/update/TaskUpdateManagerTests.java +++ b/src/test/java/com/iexec/core/task/update/TaskUpdateManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2021-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1616,10 +1616,9 @@ private void mockChainTask() { when(iexecHubService.getChainTask(CHAIN_TASK_ID)).thenReturn(Optional.of(chainTask)); } - private void mockTaskDescriptionFromTask(Task task) { + private void mockTaskDescriptionFromTask(final Task task) { final TaskDescription taskDescription = TaskDescription.builder() .chainTaskId(task.getChainTaskId()) - .isTeeTask(task.isTeeTask()) .teeFramework(TeeUtils.getTeeFramework(task.getTag())) .trust(BigInteger.valueOf(task.getTrust())) .callback("") diff --git a/src/test/java/com/iexec/core/workflow/ReplicateWorkflowTests.java b/src/test/java/com/iexec/core/workflow/ReplicateWorkflowTests.java index d26c8b0e5..d57339059 100644 --- a/src/test/java/com/iexec/core/workflow/ReplicateWorkflowTests.java +++ b/src/test/java/com/iexec/core/workflow/ReplicateWorkflowTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 IEXEC BLOCKCHAIN TECH + * Copyright 2020-2026 IEXEC BLOCKCHAIN TECH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -168,7 +168,7 @@ void shouldGetNextActionOnComputedWithTeeTaskShouldBePleaseContributeAndFinalize assertThat(replicateWorkflow .getNextAction(COMPUTED, null, - TaskDescription.builder().isTeeTask(true).teeFramework(TeeFramework.SCONE).trust(BigInteger.ONE).callback(BytesUtils.EMPTY_ADDRESS).build())) + TaskDescription.builder().teeFramework(TeeFramework.SCONE).trust(BigInteger.ONE).callback(BytesUtils.EMPTY_ADDRESS).build())) .isEqualTo(PLEASE_CONTRIBUTE_AND_FINALIZE); } @@ -177,7 +177,7 @@ void shouldGetNextActionOnComputedWithStandardTaskShouldBePleaseContribute() { assertThat(replicateWorkflow .getNextAction(COMPUTED, null, - TaskDescription.builder().isTeeTask(false).build())) + TaskDescription.builder().build())) .isEqualTo(PLEASE_CONTRIBUTE); } @@ -190,15 +190,6 @@ void shouldGetNextActionOnComputedWithoutTaskDescriptionShouldBePleaseAbort() { .isEqualTo(PLEASE_ABORT); } - @Test - void shouldGetNextActionOnComputedWithTeeTaskAndCallBackShouldBePlease() { - assertThat(replicateWorkflow - .getNextAction(COMPUTED, - null, - TaskDescription.builder().isTeeTask(true).callback("callback").build())) - .isEqualTo(PLEASE_CONTRIBUTE); - } - // endregion /*