Skip to content

Commit 4aface8

Browse files
authored
feat: add tag field to TaskDescription (#150)
1 parent 003563f commit 4aface8

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/main/java/com/iexec/commons/poco/task/TaskDescription.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public class TaskDescription {
4646
String datasetUri;
4747
String datasetChecksum;
4848

49-
// deal
50-
String chainDealId;
49+
// Deal in IexecLibCore_v5.sol
5150
String appAddress;
5251
String appOwner;
5352
BigInteger appPrice;
@@ -59,20 +58,24 @@ public class TaskDescription {
5958
BigInteger workerpoolPrice;
6059
BigInteger trust;
6160
BigInteger category;
62-
boolean isTeeTask;
63-
TeeFramework teeFramework;
61+
String tag;
6462
String requester;
6563
String beneficiary;
6664
String callback;
6765
@Builder.Default
6866
DealParams dealParams = DealParams.builder().build();
6967
long startTime;
70-
int botSize;
7168
int botFirstIndex;
69+
int botSize;
7270

73-
// task
74-
int botIndex;
75-
long maxExecutionTime; // timeref ?
71+
// TEE from tag
72+
boolean isTeeTask;
73+
TeeFramework teeFramework;
74+
75+
// Task in IexecLibCore_v5.sol
76+
String chainDealId;
77+
int botIndex; // idx
78+
long maxExecutionTime; // timeref in PoCo
7679
long contributionDeadline;
7780
long finalDeadline;
7881

@@ -178,7 +181,6 @@ public static TaskDescription toTaskDescription(final ChainDeal chainDeal, final
178181
.datasetUri(datasetUri)
179182
.datasetChecksum(datasetChecksum)
180183
// deal
181-
.chainDealId(chainDeal.getChainDealId())
182184
.appAddress(chainDeal.getDappPointer())
183185
.appOwner(chainDeal.getDappOwner())
184186
.appPrice(chainDeal.getDappPrice())
@@ -190,16 +192,19 @@ public static TaskDescription toTaskDescription(final ChainDeal chainDeal, final
190192
.workerpoolPrice(chainDeal.getPoolPrice())
191193
.trust(chainDeal.getTrust())
192194
.category(chainDeal.getCategory())
193-
.isTeeTask(TeeUtils.isTeeTag(tag))
194-
.teeFramework(TeeUtils.getTeeFramework(tag))
195+
.tag(tag)
195196
.requester(chainDeal.getRequester())
196197
.beneficiary(chainDeal.getBeneficiary())
197198
.callback(chainDeal.getCallback())
198199
.dealParams(chainDeal.getParams())
199200
.startTime(chainDeal.getStartTime().longValue())
200-
.botSize(chainDeal.getBotSize().intValue())
201201
.botFirstIndex(chainDeal.getBotFirst().intValue())
202+
.botSize(chainDeal.getBotSize().intValue())
203+
// tee
204+
.isTeeTask(TeeUtils.isTeeTag(tag))
205+
.teeFramework(TeeUtils.getTeeFramework(tag))
202206
// task
207+
.chainDealId(chainDeal.getChainDealId())
203208
.botIndex(chainTask.getIdx())
204209
.maxExecutionTime(chainDeal.getChainCategory().getMaxExecutionTime()) // https://github.com/iExecBlockchainComputing/PoCo/blob/v5/contracts/modules/delegates/IexecPoco2Delegate.sol#L111
205210
.contributionDeadline(chainTask.getContributionDeadline())

src/test/java/com/iexec/commons/poco/task/TaskDescriptionTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ void toTaskDescription() {
156156
.workerpoolPrice(WORKERPOOL_PRICE)
157157
.trust(TRUST)
158158
.category(CATEGORY)
159+
.tag(TeeUtils.TEE_SCONE_ONLY_TAG)
159160
.isTeeTask(IS_TEE_TASK)
160161
.teeFramework(TEE_FRAMEWORK)
161162
.requester(REQUESTER)

0 commit comments

Comments
 (0)