mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add markdown comments
This commit is contained in:
parent
06c1046943
commit
431808777c
@ -153,6 +153,7 @@ describe('Marketplace flow tests', async () => {
|
|||||||
}
|
}
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
|
/// We load the configuration:
|
||||||
/// ```Typescript
|
/// ```Typescript
|
||||||
before(async () => {
|
before(async () => {
|
||||||
config = await getTestConfig(web3)
|
config = await getTestConfig(web3)
|
||||||
@ -162,8 +163,10 @@ describe('Marketplace flow tests', async () => {
|
|||||||
console.log(`Aquarius URL: ${config.metadataCacheUri}`)
|
console.log(`Aquarius URL: ${config.metadataCacheUri}`)
|
||||||
console.log(`Provider URL: ${providerUrl}`)
|
console.log(`Provider URL: ${providerUrl}`)
|
||||||
})
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
it('initialize accounts', async () => {
|
it('Initialize accounts', async () => {
|
||||||
|
/// ```Typescript
|
||||||
const accounts = await web3.eth.getAccounts()
|
const accounts = await web3.eth.getAccounts()
|
||||||
publisherAccount = accounts[0]
|
publisherAccount = accounts[0]
|
||||||
consumerAccount = accounts[1]
|
consumerAccount = accounts[1]
|
||||||
@ -171,12 +174,16 @@ describe('Marketplace flow tests', async () => {
|
|||||||
console.log(`Publisher account address: ${publisherAccount}`)
|
console.log(`Publisher account address: ${publisherAccount}`)
|
||||||
console.log(`Consumer account address: ${consumerAccount}`)
|
console.log(`Consumer account address: ${consumerAccount}`)
|
||||||
})
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
it('deploy contracts', async () => {
|
it('Deploy contracts', async () => {
|
||||||
|
/// ```Typescript
|
||||||
contracts = await deployContracts(web3, publisherAccount)
|
contracts = await deployContracts(web3, publisherAccount)
|
||||||
})
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
it('publish a dataset (create NFT + ERC20) with a liquidity pool', async () => {
|
it('Publish a dataset (create NFT + ERC20) with a liquidity pool', async () => {
|
||||||
|
/// ```Typescript
|
||||||
const factory = new NftFactory(contracts.erc721FactoryAddress, web3)
|
const factory = new NftFactory(contracts.erc721FactoryAddress, web3)
|
||||||
|
|
||||||
const nftParams: NftCreateData = {
|
const nftParams: NftCreateData = {
|
||||||
@ -236,6 +243,12 @@ describe('Marketplace flow tests', async () => {
|
|||||||
console.log(`NFT address: ${erc721Address}`)
|
console.log(`NFT address: ${erc721Address}`)
|
||||||
console.log(`Datatoken address: ${datatokenAddress}`)
|
console.log(`Datatoken address: ${datatokenAddress}`)
|
||||||
console.log(`Pool address: ${poolAddress}`)
|
console.log(`Pool address: ${poolAddress}`)
|
||||||
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
|
it('Set metadata in the NFT', async () => {
|
||||||
|
/// ```Typescript
|
||||||
|
const nft = new Nft(web3)
|
||||||
|
|
||||||
// update ddo and set the right did
|
// update ddo and set the right did
|
||||||
DDO.chainId = await web3.eth.getChainId()
|
DDO.chainId = await web3.eth.getChainId()
|
||||||
@ -249,10 +262,7 @@ describe('Marketplace flow tests', async () => {
|
|||||||
DDO.services[0].datatokenAddress = datatokenAddress
|
DDO.services[0].datatokenAddress = datatokenAddress
|
||||||
|
|
||||||
console.log(`DID: ${DDO.id}`)
|
console.log(`DID: ${DDO.id}`)
|
||||||
})
|
|
||||||
|
|
||||||
it('set metadata in the NFT', async () => {
|
|
||||||
const nft = new Nft(web3)
|
|
||||||
const providerResponse = await ProviderInstance.encrypt(DDO, providerUrl)
|
const providerResponse = await ProviderInstance.encrypt(DDO, providerUrl)
|
||||||
const encryptedDDO = await providerResponse
|
const encryptedDDO = await providerResponse
|
||||||
const metadataHash = getHash(JSON.stringify(DDO))
|
const metadataHash = getHash(JSON.stringify(DDO))
|
||||||
@ -267,8 +277,10 @@ describe('Marketplace flow tests', async () => {
|
|||||||
'0x' + metadataHash
|
'0x' + metadataHash
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
it('marketplace displays asset for sale', async () => {
|
it('Marketplace displays asset for sale', async () => {
|
||||||
|
/// ```Typescript
|
||||||
const pool = new Pool(web3)
|
const pool = new Pool(web3)
|
||||||
const prices = await pool.getAmountInExactOut(
|
const prices = await pool.getAmountInExactOut(
|
||||||
poolAddress,
|
poolAddress,
|
||||||
@ -279,8 +291,10 @@ describe('Marketplace flow tests', async () => {
|
|||||||
)
|
)
|
||||||
console.log(`Price of 1 ${NFT_SYMBOL} is ${prices.tokenAmount} OCEAN`)
|
console.log(`Price of 1 ${NFT_SYMBOL} is ${prices.tokenAmount} OCEAN`)
|
||||||
})
|
})
|
||||||
|
/// ```
|
||||||
|
|
||||||
it('consumer buys data asset, and downloads it', async () => {
|
it('Consumer buys data asset, and downloads it', async () => {
|
||||||
|
/// ```Typescript
|
||||||
const datatoken = new Datatoken(web3)
|
const datatoken = new Datatoken(web3)
|
||||||
|
|
||||||
const consumerETHBalance = await web3.eth.getBalance(consumerAccount)
|
const consumerETHBalance = await web3.eth.getBalance(consumerAccount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user