@@ -10,14 +10,14 @@ import {
1010 Interface ,
1111 TypedDataDomain ,
1212 ZeroAddress ,
13- ZeroHash ,
1413} from 'ethers' ;
1514import hre , { ethers } from 'hardhat' ;
1615import {
1716 AppRegistry ,
1817 AppRegistry__factory ,
1918 DatasetRegistry ,
2019 DatasetRegistry__factory ,
20+ IWorkerpool__factory ,
2121 IexecAccessors__factory ,
2222 IexecConfigurationFacet__factory ,
2323 IexecInterfaceNative__factory ,
@@ -29,7 +29,6 @@ import {
2929 Registry__factory ,
3030 WorkerpoolRegistry ,
3131 WorkerpoolRegistry__factory ,
32- Workerpool__factory ,
3332} from '../../typechain' ;
3433import { TransferEvent } from '../../typechain/contracts/registries/IRegistry' ;
3534import { IexecPoco1__factory } from '../../typechain/factories/contracts/interfaces/IexecPoco1.v8.sol/IexecPoco1__factory' ;
@@ -52,6 +51,12 @@ import {
5251 setNextBlockTimestamp ,
5352} from '../../utils/poco-tools' ;
5453
54+ export const APP_MULTIADDR = '0x68656c6c6f20776f726c64' ; // "hello world" in hex
55+ export const APP_CHECKSUM = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' ;
56+ export const APP_MR_ENCLAVE = '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890' ;
57+ export const DATASET_MULTIADDR = '0x646174617365742064617461' ; // "dataset data" in hex
58+ export const DATASET_CHECKSUM =
59+ '0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321' ;
5560export class IexecWrapper {
5661 proxyAddress : string ;
5762 accounts : IexecAccounts ;
@@ -129,8 +134,7 @@ export class IexecWrapper {
129134 * @returns value of worker stake
130135 */
131136 async computeWorkerTaskStake ( workerpoolAddress : string , workerpoolPrice : bigint ) {
132- // TODO make "m_workerStakeRatioPolicy()" as view function in IWorkerpool.v8 and use it.
133- const workerStakeRatio = await Workerpool__factory . connect (
137+ const workerStakeRatio = await IWorkerpool__factory . connect (
134138 workerpoolAddress ,
135139 this . accounts . anyone ,
136140 ) . m_workerStakeRatioPolicy ( ) ;
@@ -143,7 +147,7 @@ export class IexecWrapper {
143147 * @returns value of the reward
144148 */
145149 async getSchedulerRewardRatio ( workerpoolAddress : string ) {
146- return await Workerpool__factory . connect (
150+ return await IWorkerpool__factory . connect (
147151 workerpoolAddress ,
148152 this . accounts . anyone ,
149153 ) . m_schedulerRewardRatioPolicy ( ) ;
@@ -302,9 +306,9 @@ export class IexecWrapper {
302306 this . accounts . appProvider . address ,
303307 'my-app' ,
304308 'APP_TYPE_0' ,
305- ZeroHash ,
306- ZeroHash ,
307- ZeroHash ,
309+ APP_MULTIADDR ,
310+ APP_CHECKSUM ,
311+ APP_MR_ENCLAVE ,
308312 )
309313 . then ( ( tx ) => tx . wait ( ) ) ;
310314 return await extractRegistryEntryAddress ( appReceipt ) ;
@@ -317,7 +321,12 @@ export class IexecWrapper {
317321 this . accounts . datasetProvider ,
318322 ) ;
319323 const datasetReceipt = await datasetRegistry
320- . createDataset ( this . accounts . datasetProvider . address , 'my-dataset' , ZeroHash , ZeroHash )
324+ . createDataset (
325+ this . accounts . datasetProvider . address ,
326+ 'my-dataset' ,
327+ DATASET_MULTIADDR ,
328+ DATASET_CHECKSUM ,
329+ )
321330 . then ( ( tx ) => tx . wait ( ) ) ;
322331 return await extractRegistryEntryAddress ( datasetReceipt ) ;
323332 }
0 commit comments