33import com .iexec .common .chain .ChainContribution ;
44import com .iexec .common .chain .ChainContributionStatus ;
55import com .iexec .common .chain .ChainTask ;
6- import com .iexec .common .chain .ChainTaskStatus ;
76import com .iexec .common .contract .generated .IexecHubABILegacy ;
87import com .iexec .common .utils .HashUtils ;
98import com .iexec .worker .result .ResultService ;
@@ -71,9 +70,9 @@ public void canRevealAllValid() {
7170 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
7271 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
7372 when (credentialsService .getCredentials ()).thenReturn (credentials );
74- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
73+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
7574
76- assertThat (revealService .canReveal (chainTaskId , 1 )).isTrue ();
75+ assertThat (revealService .canReveal (chainTaskId )).isTrue ();
7776 }
7877
7978 @ Test
@@ -102,9 +101,9 @@ public void cannotRevealSinceChainTaskStatusWrong() {
102101 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
103102 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
104103 when (credentialsService .getCredentials ()).thenReturn (credentials );
105- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (false );
104+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (false );
106105
107- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
106+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
108107 }
109108
110109 @ Test
@@ -133,9 +132,9 @@ public void cannotRevealSinceRevealDeadlineReached() {
133132 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
134133 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
135134 when (credentialsService .getCredentials ()).thenReturn (credentials );
136- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
135+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
137136
138- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
137+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
139138 }
140139
141140 @ Test
@@ -164,9 +163,9 @@ public void cannotRevealSinceChainContributionStatusWrong() {
164163 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
165164 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
166165 when (credentialsService .getCredentials ()).thenReturn (credentials );
167- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
166+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
168167
169- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
168+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
170169 }
171170
172171 @ Test
@@ -195,9 +194,9 @@ public void cannotRevealSinceHashDoesntMatchConsensus() {
195194 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
196195 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
197196 when (credentialsService .getCredentials ()).thenReturn (credentials );
198- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
197+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
199198
200- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
199+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
201200 }
202201
203202 @ Test
@@ -226,9 +225,9 @@ public void cannotRevealSinceContributionResultHashWrong() {
226225 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
227226 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
228227 when (credentialsService .getCredentials ()).thenReturn (credentials );
229- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
228+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
230229
231- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
230+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
232231 }
233232
234233 @ Test
@@ -255,17 +254,17 @@ public void cannotRevealSinceContributionResultSealWrong() {
255254 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
256255 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn (deterministHash );
257256 when (credentialsService .getCredentials ()).thenReturn (credentials );
258- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
257+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
259258
260- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
259+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
261260 }
262261
263262 @ Test
264263 public void cannotRevealSinceCannotFindChainTask () {
265264 String chainTaskId = "0xd94b63fc2d3ec4b96daf84b403bbafdc8c8517e8e2addd51fec0fa4e67801be8" ;
266265 when (iexecHubService .getChainTask (chainTaskId )).thenReturn (Optional .empty ());
267266
268- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
267+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
269268 }
270269
271270 @ Test
@@ -281,10 +280,10 @@ public void cannotRevealSinceCannotFindChainContribution() {
281280 .build ());
282281 when (iexecHubService .getChainTask (chainTaskId )).thenReturn (optionalChainTask );
283282 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (Optional .empty ());
284- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
283+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
285284
286285
287- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
286+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
288287 }
289288
290289 @ Test
@@ -313,9 +312,9 @@ public void cannotRevealSinceDeterministHashIsEmpty() {
313312 when (iexecHubService .getChainContribution (chainTaskId )).thenReturn (optionalChainContribution );
314313 when (resultService .getDeterministHashForTask (chainTaskId )).thenReturn ("" );
315314 when (credentialsService .getCredentials ()).thenReturn (credentials );
316- when (iexecHubService .isChainTaskRevealingWhenNodeNotSync (chainTaskId , 1 )).thenReturn (true );
315+ when (iexecHubService .isChainTaskRevealing (chainTaskId )).thenReturn (true );
317316
318- assertThat (revealService .canReveal (chainTaskId , 1 )).isFalse ();
317+ assertThat (revealService .canReveal (chainTaskId )).isFalse ();
319318 }
320319
321320 @ Test
0 commit comments