mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
publishing services prior creating asset
This commit is contained in:
parent
06933aa2fa
commit
5535305c5f
@ -353,7 +353,7 @@ export class Assets extends Instantiable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async createAccessServiceAttributes(
|
public async createAccessServiceAttributes(
|
||||||
consumerAccount: Account,
|
creator: Account,
|
||||||
dtCost: number,
|
dtCost: number,
|
||||||
datePublished: string,
|
datePublished: string,
|
||||||
timeout: number = 0
|
timeout: number = 0
|
||||||
@ -364,7 +364,7 @@ export class Assets extends Instantiable {
|
|||||||
serviceEndpoint: this.ocean.provider.getConsumeEndpoint(),
|
serviceEndpoint: this.ocean.provider.getConsumeEndpoint(),
|
||||||
attributes: {
|
attributes: {
|
||||||
main: {
|
main: {
|
||||||
creator: consumerAccount.getId(),
|
creator: creator.getId(),
|
||||||
datePublished,
|
datePublished,
|
||||||
dtCost,
|
dtCost,
|
||||||
timeout: timeout,
|
timeout: timeout,
|
||||||
|
@ -26,7 +26,7 @@ describe('Marketplace flow', () => {
|
|||||||
let transactionId
|
let transactionId
|
||||||
let service1
|
let service1
|
||||||
let service2
|
let service2
|
||||||
|
let price
|
||||||
let ocean
|
let ocean
|
||||||
|
|
||||||
const marketplaceAllowance = 20
|
const marketplaceAllowance = 20
|
||||||
@ -86,10 +86,21 @@ describe('Marketplace flow', () => {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Alice publishes a dataset', async () => {
|
it('Alice publishes a dataset', async () => {
|
||||||
ddo = await ocean.assets.create(asset, alice, [], tokenAddress)
|
price = 10 // in datatoken
|
||||||
|
const publishedDate = new Date(Date.now()).toISOString().split('.')[0] + 'Z'
|
||||||
|
const timeout = 0
|
||||||
|
service1 = await ocean.assets.createAccessServiceAttributes(
|
||||||
|
alice,
|
||||||
|
price,
|
||||||
|
publishedDate,
|
||||||
|
timeout
|
||||||
|
)
|
||||||
|
ddo = await ocean.assets.create(asset, alice, [service1], tokenAddress)
|
||||||
assert(ddo.dataToken === tokenAddress)
|
assert(ddo.dataToken === tokenAddress)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -137,8 +148,12 @@ describe('Marketplace flow', () => {
|
|||||||
assert(ddo, await ocean.assets.resolve(ddo.id))
|
assert(ddo, await ocean.assets.resolve(ddo.id))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('Marketplace creates access service', async () => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
it('Marketplace posts asset for sale', async () => {
|
it('Marketplace posts asset for sale', async () => {
|
||||||
// const downloadService = await ocean.assets.getService(ddo.id, 'download')
|
//const downloadService = await ocean.assets.getService(ddo.id, 'download')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Bob gets datatokens', async () => {
|
it('Bob gets datatokens', async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user