mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add marketplace flow
This commit is contained in:
parent
968f5038e9
commit
c16e277fde
@ -15,7 +15,7 @@ describe('Marketplace flow', () => {
|
|||||||
let alice
|
let alice
|
||||||
let contracts
|
let contracts
|
||||||
let datatoken
|
let datatoken
|
||||||
let tokenAddress
|
// let tokenAddress
|
||||||
let transactionId
|
let transactionId
|
||||||
|
|
||||||
const tokenAmount = 100
|
const tokenAmount = 100
|
||||||
@ -45,28 +45,28 @@ describe('Marketplace flow', () => {
|
|||||||
datatokensTemplate.abi,
|
datatokensTemplate.abi,
|
||||||
web3
|
web3
|
||||||
)
|
)
|
||||||
// tokenAddress = await datatoken.create(blob, alice)
|
|
||||||
|
|
||||||
const config = new Config()
|
const config = new Config()
|
||||||
const ocean = await Ocean.getInstance(config)
|
const ocean = await Ocean.getInstance(config)
|
||||||
|
|
||||||
ddo = await ocean.assets.createSimpleAsset(datatoken, alice, blob)
|
ddo = await ocean.assets.createSimpleAsset(datatoken, alice, blob)
|
||||||
|
|
||||||
|
await console.log(ddo)
|
||||||
})
|
})
|
||||||
|
|
||||||
// it('Alice mints 100 tokens', async () => {
|
it('Alice mints 100 tokens', async () => {
|
||||||
// await datatoken.mint(tokenAddress, alice, tokenAmount)
|
await datatoken.mint(ddo, alice, tokenAmount)
|
||||||
// })
|
})
|
||||||
|
|
||||||
// it('Alice transfers 1 token to Bob', async () => {
|
it('Bob gets 1 datatoken', async () => {
|
||||||
// const ts = await datatoken.transfer(tokenAddress, bob, transferAmount, alice)
|
const ts = await datatoken.transfer(ddo, bob, transferAmount, alice)
|
||||||
// transactionId = ts.transactionHash
|
transactionId = ts.transactionHash
|
||||||
// })
|
})
|
||||||
|
|
||||||
// it('Bob consumes dataset', async () => {
|
it('Bob consumes dataset', async () => {
|
||||||
// const config = new Config()
|
const config = new Config()
|
||||||
// const ocean = await Ocean.getInstance(config)
|
const ocean = await Ocean.getInstance(config)
|
||||||
// await ocean.assets.download(tokenAddress, blob, transactionId, bob)
|
await ocean.assets.download(ddo, blob, transactionId, bob)
|
||||||
// })
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user