Skip to content

Commit cbddd5c

Browse files
Merge pull request #312 from iExecBlockchainComputing/release/v8.14.0
## [8.14.0] ### Added - added `voucherAddress` option for using a non-owned voucher contract in `matchOrders`
2 parents 48ae860 + 1d9e6d3 commit cbddd5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5605
-3934
lines changed

.eslintrc

Lines changed: 0 additions & 67 deletions
This file was deleted.

CHANGELOG.md

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

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

5+
## [8.14.0] 2025-03-25
6+
7+
### Added
8+
9+
- added `voucherAddress` option for using a non-owned voucher contract in `matchOrders`
10+
511
## [8.13.1] 2025-02-24
612

713
### Changed

CLI.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ Options:
10791079
| --params \<json\> | specify the params of the request<br/>\* usage: --params '{"iexec\_args":"do stuff","iexec\_input\_files":\["https://example.com/file.zip"\]}' |
10801080
| --skip-preflight-check | skip preflight check, this may result in task execution fail |
10811081
| --use-voucher | use the voucher to cover the costs of matching orders |
1082+
| --voucher-address \<voucherAddress\> | specify the voucher contract to use other than the owned voucher |
10821083

10831084
#### iexec app request-execution
10841085

@@ -1794,6 +1795,7 @@ Options:
17941795
| --params \<json\> | specify the params of the request, existing request order will be ignored<br/>\* usage: --params '{"iexec\_args":"do stuff","iexec\_input\_files":\["https://example.com/file.zip"\]}' |
17951796
| --skip-preflight-check | skip preflight check, this may result in task execution fail |
17961797
| --use-voucher | use the voucher to cover the costs of matching orders |
1798+
| --voucher-address \<voucherAddress\> | specify the voucher contract to use other than the owned voucher |
17971799

17981800
#### iexec order publish
17991801

docs/classes/IExecDatasetModule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const checksum = await computeEncryptedFileChecksum(
150150

151151
| Name | Type |
152152
| :------ | :------ |
153-
| `encryptedFile` | `Buffer` \| `ArrayBuffer` \| `Uint8Array` |
153+
| `encryptedFile` | `Buffer` \| `Uint8Array` \| `ArrayBuffer` |
154154

155155
#### Returns
156156

@@ -242,7 +242,7 @@ const binary = new Blob([encryptedDataset]);
242242

243243
| Name | Type |
244244
| :------ | :------ |
245-
| `datasetFile` | `Buffer` \| `ArrayBuffer` \| `Uint8Array` |
245+
| `datasetFile` | `Buffer` \| `Uint8Array` \| `ArrayBuffer` |
246246
| `encyptionKey` | `string` |
247247

248248
#### Returns

docs/classes/IExecOrderModule.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ ___
334334

335335
### estimateMatchOrders
336336

337-
**estimateMatchOrders**(`orders`, `options?`): `Promise`<{ `sponsored`: `NRlcAmount` ; `total`: `NRlcAmount` }\>
337+
**estimateMatchOrders**(`orders`, `options?`): `Promise`<{ `sponsored`: [`BN`](utils.BN.md) ; `total`: [`BN`](utils.BN.md) }\>
338338

339339
estimates the cost of matching the provided orders
340340

@@ -353,19 +353,20 @@ console.log(`sponsored cost covered by voucher: ${result.sponsored} nRLC`);
353353

354354
#### Parameters
355355

356-
| Name | Type |
357-
| :------ | :------ |
358-
| `orders` | `Object` |
359-
| `orders.apporder` | [`ConsumableApporder`](../interfaces/internal_.ConsumableApporder.md) |
360-
| `orders.datasetorder?` | [`ConsumableDatasetorder`](../interfaces/internal_.ConsumableDatasetorder.md) |
361-
| `orders.requestorder` | [`ConsumableRequestorder`](../interfaces/internal_.ConsumableRequestorder.md) |
362-
| `orders.workerpoolorder` | [`ConsumableWorkerpoolorder`](../interfaces/internal_.ConsumableWorkerpoolorder.md) |
363-
| `options?` | `Object` |
364-
| `options.useVoucher?` | `boolean` |
356+
| Name | Type | Description |
357+
| :------ | :------ | :------ |
358+
| `orders` | `Object` | - |
359+
| `orders.apporder` | [`ConsumableApporder`](../interfaces/internal_.ConsumableApporder.md) | - |
360+
| `orders.datasetorder?` | [`ConsumableDatasetorder`](../interfaces/internal_.ConsumableDatasetorder.md) | - |
361+
| `orders.requestorder` | [`ConsumableRequestorder`](../interfaces/internal_.ConsumableRequestorder.md) | - |
362+
| `orders.workerpoolorder` | [`ConsumableWorkerpoolorder`](../interfaces/internal_.ConsumableWorkerpoolorder.md) | - |
363+
| `options?` | `Object` | - |
364+
| `options.useVoucher?` | `boolean` | use a voucher contract to sponsor the deal |
365+
| `options.voucherAddress?` | `string` | override the voucher contract to use, must be combined with `useVoucher: true` the user must be authorized by the voucher's owner to use it |
365366

366367
#### Returns
367368

368-
`Promise`<{ `sponsored`: `NRlcAmount` ; `total`: `NRlcAmount` }\>
369+
`Promise`<{ `sponsored`: [`BN`](utils.BN.md) ; `total`: [`BN`](utils.BN.md) }\>
369370

370371
___
371372

@@ -486,16 +487,17 @@ console.log(`created deal ${dealid} in tx ${txHash}`);
486487

487488
#### Parameters
488489

489-
| Name | Type |
490-
| :------ | :------ |
491-
| `orders` | `Object` |
492-
| `orders.apporder` | [`ConsumableApporder`](../interfaces/internal_.ConsumableApporder.md) |
493-
| `orders.datasetorder?` | [`ConsumableDatasetorder`](../interfaces/internal_.ConsumableDatasetorder.md) |
494-
| `orders.requestorder` | [`ConsumableRequestorder`](../interfaces/internal_.ConsumableRequestorder.md) |
495-
| `orders.workerpoolorder` | [`ConsumableWorkerpoolorder`](../interfaces/internal_.ConsumableWorkerpoolorder.md) |
496-
| `options?` | `Object` |
497-
| `options.preflightCheck?` | `boolean` |
498-
| `options.useVoucher?` | `boolean` |
490+
| Name | Type | Description |
491+
| :------ | :------ | :------ |
492+
| `orders` | `Object` | - |
493+
| `orders.apporder` | [`ConsumableApporder`](../interfaces/internal_.ConsumableApporder.md) | - |
494+
| `orders.datasetorder?` | [`ConsumableDatasetorder`](../interfaces/internal_.ConsumableDatasetorder.md) | - |
495+
| `orders.requestorder` | [`ConsumableRequestorder`](../interfaces/internal_.ConsumableRequestorder.md) | - |
496+
| `orders.workerpoolorder` | [`ConsumableWorkerpoolorder`](../interfaces/internal_.ConsumableWorkerpoolorder.md) | - |
497+
| `options?` | `Object` | - |
498+
| `options.preflightCheck?` | `boolean` | - |
499+
| `options.useVoucher?` | `boolean` | use a voucher contract to sponsor the deal |
500+
| `options.voucherAddress?` | `string` | override the voucher contract to use, must be combined with `useVoucher: true` the user must be authorized by the voucher's owner to use it |
499501

500502
#### Returns
501503

docs/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ ___
164164

165165
Ƭ **HumanSingleTag**: `string`
166166

167-
human redable task tag
167+
human readable task tag
168168

169169
example:
170170
```js

docs/modules/utils.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ const binary = new Blob([decryptedFileBuffer]);
8686

8787
| Name | Type |
8888
| :------ | :------ |
89-
| `encrypted` | `string` \| `Buffer` \| `ArrayBuffer` \| `Uint8Array` |
90-
| `beneficiaryKey` | `string` \| `Buffer` \| `ArrayBuffer` \| `Uint8Array` \| `CryptoKey` |
89+
| `encrypted` | `string` \| `Buffer` \| `Uint8Array` \| `ArrayBuffer` |
90+
| `beneficiaryKey` | `string` \| `Buffer` \| `Uint8Array` \| `ArrayBuffer` \| `CryptoKey` |
9191

9292
#### Returns
9393

eslint.config.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import importPlugin from 'eslint-plugin-import';
2+
import sonarjsPlugin from 'eslint-plugin-sonarjs';
3+
import prettierConfig from 'eslint-config-prettier/flat';
4+
import globals from 'globals';
5+
import js from '@eslint/js';
6+
7+
export default [
8+
js.configs.recommended,
9+
importPlugin.flatConfigs.recommended,
10+
sonarjsPlugin.configs.recommended,
11+
prettierConfig,
12+
{
13+
// default config
14+
files: ['src/**/*', 'test/**/*'],
15+
languageOptions: {
16+
globals: {
17+
...globals['shared-node-browser'],
18+
},
19+
ecmaVersion: 2022,
20+
sourceType: 'module',
21+
},
22+
rules: {
23+
'default-param-last': 'off',
24+
'new-cap': 'off',
25+
'no-console': 'error',
26+
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
27+
'no-underscore-dangle': [
28+
'error',
29+
{
30+
allow: [
31+
'_args',
32+
'_data',
33+
'_ethersType',
34+
'_eventName',
35+
'_execs',
36+
'_hex',
37+
'_name',
38+
'_options',
39+
'_signTypedData',
40+
'_subscribe',
41+
'_chainId',
42+
'_contracts',
43+
'_bridgedContracts',
44+
'_chainConfDefaults',
45+
'_bridgedConf',
46+
],
47+
},
48+
],
49+
'no-template-curly-in-string': 'off',
50+
'max-classes-per-file': 'off',
51+
'max-len': 'off',
52+
'import/prefer-default-export': 'off',
53+
'import/extensions': ['error', 'ignorePackages'],
54+
'sonarjs/cognitive-complexity': ['warn', 15],
55+
'sonarjs/no-duplicate-string': 'off',
56+
'sonarjs/no-nested-functions': 'warn', // todo refactor to enforce error on this rule
57+
'sonarjs/todo-tag': 'warn',
58+
},
59+
settings: {
60+
'import/ignore': ['ethers', 'graphql-request'],
61+
},
62+
},
63+
{
64+
// cli specific files using nodejs globals
65+
files: ['src/cli/**/*'],
66+
languageOptions: {
67+
globals: {
68+
...globals.node,
69+
},
70+
},
71+
},
72+
{
73+
files: ['src/cli/utils/cli-helper.js', 'src/lib/IExecConfig.js'],
74+
rules: {
75+
'no-console': 'off',
76+
},
77+
},
78+
{
79+
// test specific files using jest globals
80+
files: ['test/**/*'],
81+
languageOptions: {
82+
globals: {
83+
...globals.jest,
84+
},
85+
},
86+
rules: {
87+
'no-console': 'off',
88+
'no-await-in-loop': 'off',
89+
},
90+
},
91+
{
92+
files: ['*.cjs'],
93+
languageOptions: {
94+
globals: {
95+
...globals.node,
96+
},
97+
ecmaVersion: 2022,
98+
sourceType: 'script',
99+
},
100+
},
101+
];

generateCliDoc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const MAIN_HEADER_LEVEL = 1;
1010

1111
const execPromise = (command) =>
1212
new Promise((res, rej) => {
13+
// eslint-disable-next-line sonarjs/os-command
1314
exec(command, (error, stdout, stderr) => {
1415
if (error) {
1516
rej(Error(stdout + stderr));

generateEsModulesFromJson.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ const sources = [
101101
];
102102

103103
const createEsModule = (jsonObj) => {
104-
let module =
105-
'// this file is auto generated do not edit it\n/* eslint-disable */\n';
104+
let module = '// this file is auto generated do not edit it\n';
106105
Object.entries(jsonObj).forEach(([key, value]) => {
107106
module += `export const ${key} = ${JSON.stringify(value)};\n`;
108107
});

0 commit comments

Comments
 (0)