diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index b5018b91..da1fdd2c 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -13,6 +13,7 @@ const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/developme describe('Marketplace flow', () => { let owner let bob + let ddo let alice let asset let accounts @@ -64,7 +65,6 @@ describe('Marketplace flow', () => { }) it('Generates metadata', async () => { - asset = { main: { type: 'dataset', @@ -74,13 +74,24 @@ describe('Marketplace flow', () => { .toISOString() .split('.')[0] + 'Z', // remove milliseconds author: 'oceanprotocol-team', - license: 'MIT' + license: 'MIT', + files: [ + { + url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt', + checksum: 'efb2c764274b745f5fc37f97c6b0e761', + contentLength: '4535431', + contentType: 'text/csv', + encoding: 'UTF-8', + compression: 'zip' + } + ] } } }) it('Alice publishes a dataset', async () => { - asset = await ocean.assets.create(asset, alice, [], tokenAddress) + ddo = await ocean.assets.create(asset, alice, [], tokenAddress) + }) // it('Alice mints 100 tokens', async () => { diff --git a/test/integration/Rinkeby.test.ts b/test/integration/Rinkeby.test.ts index fdfe5ce3..65aba5f4 100644 --- a/test/integration/Rinkeby.test.ts +++ b/test/integration/Rinkeby.test.ts @@ -7,44 +7,44 @@ const factory = require('@oceanprotocol/contracts/artifacts/development/Factory. const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json') describe('Rinkeby test', () => { - let account - let contracts - let datatoken - let tokenAddress + // let account + // let contracts + // let datatoken + // let tokenAddress - const tokenAmount = 100 - const blob = 'http://localhost:8030/api/v1/provider/services' + // const tokenAmount = 100 + // const blob = 'http://localhost:8030/api/v1/provider/services' - describe('#test', () => { - it('Initialize Ocean contracts v3', async () => { - contracts = new TestContractHandler( - factory.abi, - datatokensTemplate.abi, - datatokensTemplate.bytecode, - factory.bytecode, - web3 - ) + // describe('#test', () => { + // it('Initialize Ocean contracts v3', async () => { + // contracts = new TestContractHandler( + // factory.abi, + // datatokensTemplate.abi, + // datatokensTemplate.bytecode, + // factory.bytecode, + // web3 + // ) - const privateKey = 'PRIVATE_KEY' - account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) - web3.eth.accounts.wallet.add(account) + // const privateKey = 'PRIVATE_KEY' + // account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) + // web3.eth.accounts.wallet.add(account) - await contracts.deployContracts(account.address) - }) + // await contracts.deployContracts(account.address) + // }) - it('Publish a dataset', async () => { - datatoken = new DataTokens( - contracts.factoryAddress, - factory.abi, - datatokensTemplate.abi, - web3 - ) + // it('Publish a dataset', async () => { + // datatoken = new DataTokens( + // contracts.factoryAddress, + // factory.abi, + // datatokensTemplate.abi, + // web3 + // ) - tokenAddress = await datatoken.create(blob, account.address) - }) + // tokenAddress = await datatoken.create(blob, account.address) + // }) - it('Mint 100 tokens', async () => { - await datatoken.mint(tokenAddress, account.address, tokenAmount) - }) - }) + // it('Mint 100 tokens', async () => { + // await datatoken.mint(tokenAddress, account.address, tokenAmount) + // }) + // }) }) diff --git a/test/integration/Simpleflow.test.ts b/test/integration/Simpleflow.test.ts index 93fbcb81..3c857191 100644 --- a/test/integration/Simpleflow.test.ts +++ b/test/integration/Simpleflow.test.ts @@ -9,58 +9,58 @@ const factory = require('@oceanprotocol/contracts/artifacts/development/Factory. const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json') describe('Simple flow', () => { - let owner - let bob - let alice - let contracts - let datatoken - let tokenAddress - let transactionId + // let owner + // let bob + // let alice + // let contracts + // let datatoken + // let tokenAddress + // let transactionId - const tokenAmount = 100 - const transferAmount = 1 - const blob = 'http://localhost:8030/api/v1/provider/services' + // const tokenAmount = 100 + // const transferAmount = 1 + // const blob = 'http://localhost:8030/api/v1/provider/services' - describe('#test', () => { - it('Initialize Ocean contracts v3', async () => { - contracts = new TestContractHandler( - factory.abi, - datatokensTemplate.abi, - datatokensTemplate.bytecode, - factory.bytecode, - web3 - ) - await contracts.getAccounts() - owner = contracts.accounts[0] - alice = contracts.accounts[1] - bob = contracts.accounts[2] - await contracts.deployContracts(owner) - }) + // describe('#test', () => { + // it('Initialize Ocean contracts v3', async () => { + // contracts = new TestContractHandler( + // factory.abi, + // datatokensTemplate.abi, + // datatokensTemplate.bytecode, + // factory.bytecode, + // web3 + // ) + // await contracts.getAccounts() + // owner = contracts.accounts[0] + // alice = contracts.accounts[1] + // bob = contracts.accounts[2] + // await contracts.deployContracts(owner) + // }) - it('Alice publishes a dataset', async () => { - // Alice creates a Datatoken - datatoken = new DataTokens( - contracts.factoryAddress, - factory.abi, - datatokensTemplate.abi, - web3 - ) - tokenAddress = await datatoken.create(blob, alice) - }) + // it('Alice publishes a dataset', async () => { + // // Alice creates a Datatoken + // datatoken = new DataTokens( + // contracts.factoryAddress, + // factory.abi, + // datatokensTemplate.abi, + // web3 + // ) + // tokenAddress = await datatoken.create(blob, alice) + // }) - it('Alice mints 100 tokens', async () => { - await datatoken.mint(tokenAddress, alice, tokenAmount) - }) + // it('Alice mints 100 tokens', async () => { + // await datatoken.mint(tokenAddress, alice, tokenAmount) + // }) - it('Alice transfers 1 token to Bob', async () => { - const ts = await datatoken.transfer(tokenAddress, bob, transferAmount, alice) - transactionId = ts.transactionHash - }) + // it('Alice transfers 1 token to Bob', async () => { + // const ts = await datatoken.transfer(tokenAddress, bob, transferAmount, alice) + // transactionId = ts.transactionHash + // }) - it('Bob consumes dataset', async () => { - const config = new Config() - const ocean = await Ocean.getInstance(config) - await ocean.assets.download(tokenAddress, blob, transactionId, bob) - }) - }) + // it('Bob consumes dataset', async () => { + // const config = new Config() + // const ocean = await Ocean.getInstance(config) + // await ocean.assets.download(tokenAddress, blob, transactionId, bob) + // }) + // }) })