mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Adding the key-value store steps to CodeExamples.test.ts
This commit is contained in:
parent
aef17e96d4
commit
3919bf7b2d
@ -31,6 +31,7 @@
|
|||||||
"test:unit": "npm run mocha -- 'test/unit/**/*.test.ts'",
|
"test:unit": "npm run mocha -- 'test/unit/**/*.test.ts'",
|
||||||
"test:unit:cover": "nyc --report-dir coverage/unit --exclude 'src/@types/**/*' npm run test:unit",
|
"test:unit:cover": "nyc --report-dir coverage/unit --exclude 'src/@types/**/*' npm run test:unit",
|
||||||
"test:integration": "npm run mocha -- 'test/integration/**/*.test.ts'",
|
"test:integration": "npm run mocha -- 'test/integration/**/*.test.ts'",
|
||||||
|
"test:guide": "npm run mocha -- 'test/integration/CodeExamples.test.ts'",
|
||||||
"test:integration:cover": "nyc --report-dir coverage/integration --no-clean npm run test:integration",
|
"test:integration:cover": "nyc --report-dir coverage/integration --no-clean npm run test:integration",
|
||||||
"create:guide": "./scripts/createCodeExamples.sh test/integration/CodeExamples.test.ts",
|
"create:guide": "./scripts/createCodeExamples.sh test/integration/CodeExamples.test.ts",
|
||||||
"create:guidec2d": "./scripts/createCodeExamples.sh test/integration/ComputeExamples.test.ts",
|
"create:guidec2d": "./scripts/createCodeExamples.sh test/integration/ComputeExamples.test.ts",
|
||||||
|
@ -676,6 +676,35 @@ describe('Marketplace flow tests', async () => {
|
|||||||
}
|
}
|
||||||
}) ///
|
}) ///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
|
it('8.1 Add key-value pair to data NFT', async () => {
|
||||||
|
/// ```Typescript
|
||||||
|
const nft = new Nft(web3)
|
||||||
|
const data = 'SomeData'
|
||||||
|
try {
|
||||||
|
/// Use the `setData` method to update the nft key value store with some data
|
||||||
|
await nft.setData(freNftAddress, publisherAccount, '1', data)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
assert.fail('Download failed')
|
||||||
|
}
|
||||||
|
/// ```
|
||||||
|
}) ///
|
||||||
|
|
||||||
|
it('8.2 Add key-value pair to data NFT', async () => {
|
||||||
|
/// ```Typescript
|
||||||
|
const nft = new Nft(web3)
|
||||||
|
try {
|
||||||
|
/// Use the `getData` method to get the data stored in the nft key value store
|
||||||
|
const data = await nft.getData(freNftAddress, '1')
|
||||||
|
console.log('Data: ', data)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
assert.fail('Download failed')
|
||||||
|
}
|
||||||
|
/// ```
|
||||||
|
}) ///
|
||||||
|
/// ```
|
||||||
}) ///
|
}) ///
|
||||||
|
|
||||||
/// ## Editing this file
|
/// ## Editing this file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user