diff --git a/.travis.yml b/.travis.yml index 5ec16e88..b13f3d88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,11 +18,17 @@ before_install: before_script: - ganache-cli > ganache-cli.log & + - git clone https://github.com/oceanprotocol/barge + - cd barge + - git checkout origin/v3 + - bash -x start_ocean.sh --no-commons --no-dashboard 2>&1 > start_ocean.log & + - cd .. script: - npm run lint - npm run build - - npm run test:cover + - npm run test:cover + - npm run test:integration notifications: email: false \ No newline at end of file diff --git a/src/ddo/DDO.ts b/src/ddo/DDO.ts index 64c94e5f..a64d5029 100644 --- a/src/ddo/DDO.ts +++ b/src/ddo/DDO.ts @@ -3,7 +3,7 @@ import { Authentication } from './interfaces/Authentication' import { Proof } from './interfaces/Proof' import { PublicKey } from './interfaces/PublicKey' import { Service, ServiceType } from './interfaces/Service' -import Web3Provider from '../datatokens/Web3Provider' +import Web3Provider from '../datatokens/Web3Provider' /** * DID Descriptor Object. * Contains all the data related to an asset. @@ -106,8 +106,7 @@ export class DDO { this.id ] - return Web3Provider - .getWeb3() + return Web3Provider.getWeb3() .utils.sha3(values.join('')) .replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1') } diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index da1fdd2c..4c49199a 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -3,7 +3,7 @@ import { DataTokens } from '../../src/datatokens/Datatokens' import { Ocean } from '../../src/ocean/Ocean' import config from './config' -// import Accounts from "../../src/ocean/Account" +// import Accounts from "../../src/ocean/Account" const Web3 = require('web3') const web3 = new Web3('http://127.0.0.1:8545') @@ -50,11 +50,10 @@ describe('Marketplace flow', () => { marketplace = (await ocean.accounts.list())[3] await contracts.deployContracts(owner.getId()) - }) it('Alice publishes a datatoken contract', async () => { - datatoken = new DataTokens( + datatoken = new DataTokens( contracts.factoryAddress, factory.abi, datatokensTemplate.abi, @@ -69,29 +68,26 @@ describe('Marketplace flow', () => { main: { type: 'dataset', name: 'test-dataset', - dateCreated: - new Date(Date.now()) - .toISOString() - .split('.')[0] + 'Z', // remove milliseconds + dateCreated: new Date(Date.now()).toISOString().split('.')[0] + 'Z', // remove milliseconds author: 'oceanprotocol-team', license: 'MIT', files: [ { - url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt', + 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 () => { 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 65aba5f4..4e828f32 100644 --- a/test/integration/Rinkeby.test.ts +++ b/test/integration/Rinkeby.test.ts @@ -11,10 +11,8 @@ describe('Rinkeby test', () => { // let contracts // let datatoken // let tokenAddress - // const tokenAmount = 100 // const blob = 'http://localhost:8030/api/v1/provider/services' - // describe('#test', () => { // it('Initialize Ocean contracts v3', async () => { // contracts = new TestContractHandler( @@ -24,14 +22,11 @@ describe('Rinkeby test', () => { // factory.bytecode, // web3 // ) - // const privateKey = 'PRIVATE_KEY' // account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey) // web3.eth.accounts.wallet.add(account) - // await contracts.deployContracts(account.address) // }) - // it('Publish a dataset', async () => { // datatoken = new DataTokens( // contracts.factoryAddress, @@ -39,10 +34,8 @@ describe('Rinkeby test', () => { // datatokensTemplate.abi, // web3 // ) - // tokenAddress = await datatoken.create(blob, account.address) // }) - // 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 3c857191..81052dd0 100644 --- a/test/integration/Simpleflow.test.ts +++ b/test/integration/Simpleflow.test.ts @@ -16,11 +16,9 @@ describe('Simple flow', () => { // let datatoken // let tokenAddress // let transactionId - // 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( @@ -36,7 +34,6 @@ describe('Simple flow', () => { // bob = contracts.accounts[2] // await contracts.deployContracts(owner) // }) - // it('Alice publishes a dataset', async () => { // // Alice creates a Datatoken // datatoken = new DataTokens( @@ -47,16 +44,13 @@ describe('Simple flow', () => { // ) // tokenAddress = await datatoken.create(blob, alice) // }) - // 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('Bob consumes dataset', async () => { // const config = new Config() // const ocean = await Ocean.getInstance(config) diff --git a/test/integration/config.ts b/test/integration/config.ts index 6be4a5d9..59d0a6e5 100644 --- a/test/integration/config.ts +++ b/test/integration/config.ts @@ -15,4 +15,4 @@ export default { secretStoreUri: 'http://localhost:12001', verbose: LogLevel.Error, web3Provider: web3 -} as Config \ No newline at end of file +} as Config