Skip to content

Commit 35b629c

Browse files
authored
Merge pull request #87 from iExecBlockchainComputing/release/4.0.0
Release/4.0.0
2 parents d077907 + 31f33ce commit 35b629c

24 files changed

+2004
-841
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [[4.0.0]](https://github.com/iExecBlockchainComputing/iexec-commons-poco/releases/tag/v4.0.0) 2024-04-12
6+
7+
### New features
8+
9+
- Add `SignerService` class. (#72)
10+
- Add encoders to allow sending transactions with `SignerService`. (#73 #74 #75)
11+
- Add `getAssetAddressFromReceipt` method to `AssetDataEncoder`. (#78)
12+
- Use `eth_call` Ethereum JSON-RPC API to predict assets on-chain address. (#79)
13+
- Add `PoCoDataEncoder` with `initialize`, `contribute`, `reveal`, `finalize` and `contributeAndFinalize` support. (#80 #81)
14+
- Add `eth_estimateGas` Ethereum JSON-RPC API support. (#82)
15+
- Add transaction data encoder to support `isRegistered` method call. (#83)
16+
- Add decoder to display log topics with human readable names. (#84)
17+
18+
### Bug Fixes
19+
20+
- Log a message if a transaction could not be verified on-chain, always return its hash. (#85)
21+
22+
### Quality
23+
24+
- Remove unused `IexecLibOrders_v5` generated class. (#68)
25+
- Use `@SneakyThrows` lombok annotation in `EIP-712` related tests. (#69)
26+
- Migrate `EthAddress` utility class from `iexec-common`. (#71)
27+
- Replace `OrderSigner` with `SignerService` in `MatchOrdersTests`. (#76)
28+
- Add methods to `IexecHubTestService` and add `OrdersService` for tests. (#77)
29+
530
## [[3.2.0]](https://github.com/iExecBlockchainComputing/iexec-commons-poco/releases/tag/v3.2.0) 2023-12-19
631

732
### New Features

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=3.2.0
1+
version=4.0.0
22
nexusUser
33
nexusPassword

src/main/java/com/iexec/commons/poco/chain/IexecHubAbstractService.java

Lines changed: 36 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import java.util.concurrent.TimeUnit;
4848
import java.util.function.BiFunction;
4949

50+
import static com.iexec.commons.poco.encoding.AssetDataEncoder.getAssetAddressFromReceipt;
5051
import static com.iexec.commons.poco.tee.TeeEnclaveConfiguration.buildEnclaveConfigurationFromJsonString;
5152
import static com.iexec.commons.poco.utils.BytesUtils.isNonZeroedBytes32;
5253
import static org.web3j.tx.TransactionManager.DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH;
@@ -212,8 +213,8 @@ public WorkerpoolRegistry getWorkerpoolRegistryContract(ContractGasProvider cont
212213
* ERC721 mint method to retrieve workerpool address
213214
* tokenId is the generic form of workerpoolAddress
214215
*
215-
* @param name workerpool name
216-
* @param secondsTimeout await workerpool deployment for couple seconds
216+
* @param name workerpool name
217+
* @param secondsTimeout await workerpool deployment for couple seconds
217218
* @param secondsPollingInterval check if workerpool is deployed every couple seconds
218219
* @return workerpool address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
219220
*/
@@ -251,13 +252,7 @@ public String createWorkerpool(String name, int secondsTimeout, int secondsPolli
251252
return "";
252253
}
253254

254-
String workerpoolAddress = WorkerpoolRegistry.getTransferEvents(createWorkerpoolReceipt)
255-
.stream()
256-
.findFirst()
257-
.map(event -> event.tokenId) // workerpool is an ERC721
258-
.map(Address::new)
259-
.map(Address::toString)
260-
.orElse("");
255+
String workerpoolAddress = getAssetAddressFromReceipt(createWorkerpoolReceipt);
261256

262257
if (StringUtils.isEmpty(workerpoolAddress)) {
263258
log.error("Failed to extract workerpool address" + paramsPrinter,
@@ -299,7 +294,7 @@ public String createWorkerpool(String name) {
299294
* This method to predict workerpool address without deploying it
300295
*
301296
* @param owner workerpool owner
302-
* @param name workerpool name
297+
* @param name workerpool name
303298
* @return workerpool address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
304299
*/
305300
public String predictWorkerpool(String owner, String name) {
@@ -379,12 +374,12 @@ public AppRegistry getAppRegistryContract(ContractGasProvider contractGasProvide
379374
* ERC721 mint method to retrieve app address
380375
* tokenId is the generic form of appAddress
381376
*
382-
* @param name app name
383-
* @param multiAddress app url
384-
* @param type app type
385-
* @param checksum app sha256 checksum
386-
* @param mrEnclave app mrEnclave
387-
* @param secondsTimeout await app deployment for couple seconds
377+
* @param name app name
378+
* @param multiAddress app url
379+
* @param type app type
380+
* @param checksum app sha256 checksum
381+
* @param mrEnclave app mrEnclave
382+
* @param secondsTimeout await app deployment for couple seconds
388383
* @param secondsPollingInterval check if app is deployed every couple seconds
389384
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
390385
*/
@@ -426,13 +421,7 @@ public String createApp(String name, String multiAddress, String type,
426421
return "";
427422
}
428423

429-
String appAddress = AppRegistry.getTransferEvents(createAppReceipt)
430-
.stream()
431-
.findFirst()
432-
.map(event -> event.tokenId) // app is an ERC721
433-
.map(Address::new)
434-
.map(Address::toString)
435-
.orElse("");
424+
String appAddress = getAssetAddressFromReceipt(createAppReceipt);
436425

437426
if (StringUtils.isEmpty(appAddress)) {
438427
log.error("Failed to extract app address" + paramsPrinter,
@@ -463,11 +452,11 @@ public String createApp(String name, String multiAddress, String type,
463452
/**
464453
* Default method for creating app
465454
*
466-
* @param name app name
455+
* @param name app name
467456
* @param multiAddress app url
468-
* @param type app type
469-
* @param checksum app sha256 checksum
470-
* @param mrEnclave app mrEnclave
457+
* @param type app type
458+
* @param checksum app sha256 checksum
459+
* @param mrEnclave app mrEnclave
471460
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
472461
*/
473462
public String createApp(String name, String multiAddress, String type,
@@ -478,10 +467,10 @@ public String createApp(String name, String multiAddress, String type,
478467
/**
479468
* This method to predict app address without deploying it
480469
*
481-
* @param owner app owner
482-
* @param name app name
470+
* @param owner app owner
471+
* @param name app name
483472
* @param multiAddress app url
484-
* @param checksum app sha256 checksum
473+
* @param checksum app sha256 checksum
485474
* @return app address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
486475
*/
487476
public String predictApp(String owner, String name, String multiAddress, String type,
@@ -569,10 +558,10 @@ public DatasetRegistry getDatasetRegistryContract(ContractGasProvider contractGa
569558
* ERC721 mint method to retrieve dataset address
570559
* tokenId is the generic form of datasetAddress
571560
*
572-
* @param name dataset name
573-
* @param multiAddress dataset url
574-
* @param checksum dataset sha256 checksum
575-
* @param secondsTimeout await dataset deployment for couple seconds
561+
* @param name dataset name
562+
* @param multiAddress dataset url
563+
* @param checksum dataset sha256 checksum
564+
* @param secondsTimeout await dataset deployment for couple seconds
576565
* @param secondsPollingInterval check if dataset is deployed every couple seconds
577566
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
578567
*/
@@ -618,13 +607,7 @@ public String createDataset(String name, String multiAddress, String checksum,
618607
return "";
619608
}
620609

621-
String datasetAddress = DatasetRegistry.getTransferEvents(createDatasetReceipt)
622-
.stream()
623-
.findFirst()
624-
.map(event -> event.tokenId) // dataset is an ERC721
625-
.map(Address::new)
626-
.map(Address::toString)
627-
.orElse("");
610+
String datasetAddress = getAssetAddressFromReceipt(createDatasetReceipt);
628611

629612
if (StringUtils.isEmpty(datasetAddress)) {
630613
log.error("Failed to extract dataset address" + paramsPrinter,
@@ -655,9 +638,9 @@ public String createDataset(String name, String multiAddress, String checksum,
655638
/**
656639
* Default method for creating dataset
657640
*
658-
* @param name dataset name
641+
* @param name dataset name
659642
* @param multiAddress dataset url
660-
* @param checksum dataset sha256 checksum
643+
* @param checksum dataset sha256 checksum
661644
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
662645
*/
663646
public String createDataset(String name, String multiAddress, String checksum) {
@@ -667,10 +650,10 @@ public String createDataset(String name, String multiAddress, String checksum) {
667650
/**
668651
* This method to predict dataset address without deploying it
669652
*
670-
* @param owner dataset owner
671-
* @param name dataset name
653+
* @param owner dataset owner
654+
* @param name dataset name
672655
* @param multiAddress dataset url
673-
* @param checksum dataset sha256 checksum
656+
* @param checksum dataset sha256 checksum
674657
* @return dataset address (e.g.: 0x95ba540ca3c2dfd52a7e487a03e1358dfe9441ce)
675658
*/
676659
public String predictDataset(String owner, String name, String multiAddress,
@@ -713,8 +696,8 @@ public String predictDataset(String owner, String name, String multiAddress,
713696
* Retrieves on-chain deal with a retryer
714697
*
715698
* @param chainDealId deal ID
716-
* @param retryDelay delay between retries in ms
717-
* @param maxRetry number of maximum retry
699+
* @param retryDelay delay between retries in ms
700+
* @param maxRetry number of maximum retry
718701
* @return optional ChainDeal
719702
*/
720703
public Optional<ChainDeal> repeatGetChainDeal(String chainDealId,
@@ -730,7 +713,7 @@ public Optional<ChainDeal> repeatGetChainDeal(String chainDealId,
730713

731714
/**
732715
* Retrieves on-chain deal with its blockchain ID
733-
*
716+
* <p>
734717
* Note:
735718
* If `start time` is invalid, it is likely a blockchain issue. In this case,
736719
* in order to protect workflows based on top of it, the deal won't be
@@ -782,8 +765,8 @@ public Optional<ChainDeal> getChainDeal(String chainDealId) {
782765
* Retrieve on-chain task with a retryer
783766
*
784767
* @param chainTaskId task ID
785-
* @param retryDelay delay between retries in ms
786-
* @param maxRetry number of maximum retry
768+
* @param retryDelay delay between retries in ms
769+
* @param maxRetry number of maximum retry
787770
* @return optional ChainTask
788771
*/
789772
public Optional<ChainTask> repeatGetChainTask(String chainTaskId,
@@ -839,7 +822,7 @@ public Optional<ChainContribution> getChainContribution(String chainTaskId,
839822

840823
/**
841824
* Retrieves on-chain category with its blockchain ID
842-
*
825+
* <p>
843826
* Note:
844827
* If `max execution time` is invalid, it is likely a blockchain issue.
845828
* In this case,in order to protect workflows based on top of it, the category
@@ -859,7 +842,7 @@ public Optional<ChainCategory> getChainCategory(long id) {
859842
);
860843
if (chainCategory.getMaxExecutionTime() <= 0) {
861844
log.error("Category max execution time should be greater than zero " +
862-
"(likely a blockchain issue) [categoryId:{}, maxExecutionTime:{}]",
845+
"(likely a blockchain issue) [categoryId:{}, maxExecutionTime:{}]",
863846
id, chainCategory.getMaxExecutionTime());
864847
return Optional.empty();
865848
}

0 commit comments

Comments
 (0)