From 76af7447266fd58bf62bc7c575cb533f6671aec1 Mon Sep 17 00:00:00 2001 From: Ahmed Ali Date: Fri, 10 Jul 2020 09:51:32 +0200 Subject: [PATCH] initialize compute flow --- .DS_Store | Bin 6148 -> 6148 bytes test/integration/ComputeFlow.test.ts | 79 +++++++++++++++++++++++ test/integration/Marketplaceflow.test.ts | 2 +- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 test/integration/ComputeFlow.test.ts diff --git a/.DS_Store b/.DS_Store index 2c1f1f84227b580ca493984a20824f015bb54118..46ffce9cf491541a77e535ee58272a5e9e966c9d 100644 GIT binary patch delta 153 zcmZoMXfc@JFUrrrz`)4BAi%)j&fv=6!{863^)?G~EN8X^N%1f^Gk7pKGWa1&GvqR) zc;@6MC*|ZP0o4HYGFSt##(ywiVA#yV!pz7hJ^37qk_LkwgE@mK5F0ZXGFUR0Fjz1c Wpz3A(40Hj { + let owner + let bob + let ddo + let alice + let asset + let marketplace + let contracts + let datatoken + let tokenAddress + let service1 + let price + let ocean + let accessService + let data + let blob + + const marketplaceAllowance = 20 + const tokenAmount = 100 + + describe('#MarketplaceComputeFlow-Test', () => { + it('Initialize Ocean contracts v3', async () => { + contracts = new TestContractHandler( + factory.abi, + datatokensTemplate.abi, + datatokensTemplate.bytecode, + factory.bytecode, + web3 + ) + + ocean = await Ocean.getInstance(config) + owner = (await ocean.accounts.list())[0] + alice = (await ocean.accounts.list())[1] + bob = (await ocean.accounts.list())[2] + marketplace = (await ocean.accounts.list())[3] + data = { t: 1, url: ocean.config.metadataStoreUri } + blob = JSON.stringify(data) + await contracts.deployContracts(owner.getId()) + }) + + it('Alice deploys datatoken contract', async () => { + datatoken = new DataTokens( + contracts.factoryAddress, + factory.abi, + datatokensTemplate.abi, + web3 + ) + tokenAddress = await datatoken.create(blob, alice.getId()) + assert(tokenAddress != null) + }) + + // it('Alice publishes dataset with a compute service', async () => {}) + + // it('Alice mints 100 DTs and tranfers them to the compute marketplace', async () => {}) + + // it('Markeplace post compute service for sale', async () => {}) + + // it('Bob buys datatokens from open market and order a compute service', async () => {}) + + // it('Bob starts compute job', async () => {}) + + // it('Bob gets the compute job status', async () => {}) + + // it('Bob restarts compute job', async () => {}) + + // it('Bob gets outputs', async () => {}) + }) +}) diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index 1964f251..3ff1e2d6 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -29,7 +29,7 @@ describe('Marketplace flow', () => { const marketplaceAllowance = 20 const tokenAmount = 100 - describe('#test', () => { + describe('#MarketplaceDownloadFlow-Test', () => { it('Initialize Ocean contracts v3', async () => { contracts = new TestContractHandler( factory.abi,