mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Merge pull request #163 from oceanprotocol/bug/fix_datatokens_abi
Fix default abi's are not initialized correctly when initializing oceanlib
This commit is contained in:
commit
7d0af48e81
@ -44,7 +44,7 @@ import { DataTokens } from '../../src/datatokens/Datatokens'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
// Alice's config
|
||||
@ -172,4 +172,4 @@ await ocean.assets.order(ddo.id, accessService.type, bob.getId()).then(async (re
|
||||
)
|
||||
})
|
||||
|
||||
```
|
||||
```
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -881,9 +881,9 @@
|
||||
}
|
||||
},
|
||||
"@oceanprotocol/contracts": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.2.2.tgz",
|
||||
"integrity": "sha512-wu5Ub5F50vCAON0GKyv4anPPLm+oWfHViksiAewVS/xvbbnSCt4gHws2Uc1ct25tiO/2AHAyJkqEiC0ep8SHeQ=="
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.2.3.tgz",
|
||||
"integrity": "sha512-5Oohzno3tnISMYG1jhtHxKMMkcIypTZAPlIoFjE5vDlAW51tyuxwYxBXHYQ2/FLRVFkmUmy5yASKg9zbnKKwQw=="
|
||||
},
|
||||
"@octokit/auth-token": {
|
||||
"version": "2.4.2",
|
||||
|
@ -38,7 +38,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethereum-navigator/navigator": "^0.5.0",
|
||||
"@oceanprotocol/contracts": "^0.2.2",
|
||||
"@oceanprotocol/contracts": "^0.2.3",
|
||||
"bignumber.js": "^9.0.0",
|
||||
"fs": "0.0.1-security",
|
||||
"node-fetch": "^2.6.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
const defaultFactoryABI = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const defaultFactoryABI = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const defaultDatatokensABI = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
/**
|
||||
@ -20,8 +20,8 @@ export class DataTokens {
|
||||
*/
|
||||
constructor(factoryAddress: string, factoryABI: any, datatokensABI: any, web3: any) {
|
||||
this.factoryAddress = factoryAddress
|
||||
this.factoryABI = factoryABI || defaultFactoryABI
|
||||
this.datatokensABI = datatokensABI || defaultDatatokensABI
|
||||
this.factoryABI = factoryABI || defaultFactoryABI.abi
|
||||
this.datatokensABI = datatokensABI || defaultDatatokensABI.abi
|
||||
this.web3 = web3
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import { assert } from 'console'
|
||||
import { ServiceComputePrivacy } from '../../src/ddo/interfaces/Service'
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
describe('Compute flow', () => {
|
||||
|
@ -6,7 +6,7 @@ import { assert } from 'console'
|
||||
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
describe('Marketplace flow', () => {
|
||||
|
@ -3,7 +3,7 @@ import { DataTokens } from '../../src/datatokens/Datatokens'
|
||||
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('wss://rinkeby.infura.io/ws/v3/357f2fe737db4304bd2f7285c5602d0d')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
describe('Rinkeby test', () => {
|
||||
|
@ -5,7 +5,7 @@ import { Config } from '../../src/models/Config'
|
||||
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
describe('Simple flow', () => {
|
||||
|
@ -3,7 +3,7 @@ import { TestContractHandler } from '../TestContractHandler'
|
||||
import { DataTokens } from '../../src/datatokens/Datatokens'
|
||||
|
||||
const Web3 = require('web3')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/development/DTFactory.json')
|
||||
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
|
Loading…
x
Reference in New Issue
Block a user