mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix tests
This commit is contained in:
parent
f8ca995f7f
commit
07449ed18d
@ -17,7 +17,7 @@
|
|||||||
"changelog": "auto-changelog -p",
|
"changelog": "auto-changelog -p",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"test:unit": "mocha --config=test/unit/.mocharc.json --node-env=test --exit test/unit/**/*.ts",
|
"test:unit": "mocha --config=test/unit/.mocharc.json --node-env=test --exit test/unit/**/*.ts",
|
||||||
"test:integration": "mocha --opts test/integration/mocha.opts"
|
"test:integration": "mocha --config=test/integration/.mocharc.json --node-env=test --exit test/integration/**/*.ts"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -6,9 +6,8 @@ import { Config } from '../../src/models/Config'
|
|||||||
|
|
||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
const web3 = new Web3('http://127.0.0.1:8545')
|
const web3 = new Web3('http://127.0.0.1:8545')
|
||||||
|
const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json')
|
||||||
const factoryABI = require('../../src/datatokens/FactoryABI.json')
|
const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json')
|
||||||
const datatokensABI = require('../../src/datatokens/DatatokensABI.json')
|
|
||||||
|
|
||||||
describe('Simple flow', () => {
|
describe('Simple flow', () => {
|
||||||
let owner
|
let owner
|
||||||
@ -26,7 +25,12 @@ describe('Simple flow', () => {
|
|||||||
|
|
||||||
describe('#test', () => {
|
describe('#test', () => {
|
||||||
it('Initialize Ocean contracts v3', async () => {
|
it('Initialize Ocean contracts v3', async () => {
|
||||||
contracts = new TestContractHandler(factoryABI, datatokensABI)
|
contracts = new TestContractHandler(
|
||||||
|
factory.abi,
|
||||||
|
datatokensTemplate.abi,
|
||||||
|
datatokensTemplate.bytecode,
|
||||||
|
factory.bytecode
|
||||||
|
)
|
||||||
await contracts.getAccounts()
|
await contracts.getAccounts()
|
||||||
owner = contracts.accounts[0]
|
owner = contracts.accounts[0]
|
||||||
alice = contracts.accounts[1]
|
alice = contracts.accounts[1]
|
||||||
@ -38,8 +42,8 @@ describe('Simple flow', () => {
|
|||||||
// Alice creates a Datatoken
|
// Alice creates a Datatoken
|
||||||
datatoken = new DataTokens(
|
datatoken = new DataTokens(
|
||||||
contracts.factoryAddress,
|
contracts.factoryAddress,
|
||||||
factoryABI,
|
factory.abi,
|
||||||
datatokensABI,
|
datatokensTemplate.abi,
|
||||||
web3
|
web3
|
||||||
)
|
)
|
||||||
tokenAddress = await datatoken.create(blob, alice)
|
tokenAddress = await datatoken.create(blob, alice)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user