mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Update ocean-lib with 2.7.0 version. (#633)
This commit is contained in:
parent
ec9d7e733f
commit
6a9b342c52
14
package-lock.json
generated
14
package-lock.json
generated
@ -10,7 +10,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^1.1.12",
|
||||
"@oceanprotocol/lib": "^2.6.3",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -968,9 +968,9 @@
|
||||
"integrity": "sha512-kvMLH4nOKvkqsNmob00yqVi2kD9xiYLoobw2ioezOA1p6wRPDFLzZd+w8+NZP2hMDFVITUY4YCdO/dRGKTihOA=="
|
||||
},
|
||||
"node_modules/@oceanprotocol/lib": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-2.6.3.tgz",
|
||||
"integrity": "sha512-Xzmc/1wogOa7AJnFvqmFMJaS1IV5OzoY2HXH4wGi6wOPL3hrWKPUiY4L+/PXmuIMaLEUm5bCZnpLHBidYrb2vg==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-2.7.0.tgz",
|
||||
"integrity": "sha512-mSisB8mOVQLg6CJ4Fjp2oa6NAr/zc+yh/2x8fdjSzzZPN23WlmpPkluHeCIKN5rQDqDIGHXCntfyCaVp5hGMnw==",
|
||||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^1.1.8",
|
||||
"bignumber.js": "^9.1.0",
|
||||
@ -15102,9 +15102,9 @@
|
||||
"integrity": "sha512-kvMLH4nOKvkqsNmob00yqVi2kD9xiYLoobw2ioezOA1p6wRPDFLzZd+w8+NZP2hMDFVITUY4YCdO/dRGKTihOA=="
|
||||
},
|
||||
"@oceanprotocol/lib": {
|
||||
"version": "2.6.3",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-2.6.3.tgz",
|
||||
"integrity": "sha512-Xzmc/1wogOa7AJnFvqmFMJaS1IV5OzoY2HXH4wGi6wOPL3hrWKPUiY4L+/PXmuIMaLEUm5bCZnpLHBidYrb2vg==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-2.7.0.tgz",
|
||||
"integrity": "sha512-mSisB8mOVQLg6CJ4Fjp2oa6NAr/zc+yh/2x8fdjSzzZPN23WlmpPkluHeCIKN5rQDqDIGHXCntfyCaVp5hGMnw==",
|
||||
"requires": {
|
||||
"@oceanprotocol/contracts": "^1.1.8",
|
||||
"bignumber.js": "^9.1.0",
|
||||
|
@ -71,7 +71,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/contracts": "^1.1.12",
|
||||
"@oceanprotocol/lib": "^2.6.3",
|
||||
"@oceanprotocol/lib": "^2.7.0",
|
||||
"cross-fetch": "^3.1.4"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -218,17 +218,21 @@ describe('Datatoken tests', async () => {
|
||||
|
||||
it('Correct Datatoken fields after updating metadata', async () => {
|
||||
// create the files encrypted string
|
||||
let providerResponse = await ProviderInstance.encrypt(assetUrl, providerUrl)
|
||||
const chain = await web3.eth.getChainId()
|
||||
let providerResponse = await ProviderInstance.encrypt(
|
||||
assetUrl,
|
||||
chain,
|
||||
providerUrl
|
||||
)
|
||||
ddo.services[0].files = await providerResponse
|
||||
ddo.services[0].datatokenAddress = datatokenAddress
|
||||
// update ddo and set the right did
|
||||
ddo.nftAddress = erc721Address
|
||||
const chain = await web3.eth.getChainId()
|
||||
ddo.id =
|
||||
'did:op:' +
|
||||
SHA256(web3.utils.toChecksumAddress(erc721Address) + chain.toString(10))
|
||||
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, providerUrl)
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, chain, providerUrl)
|
||||
const encryptedResponse = await providerResponse
|
||||
const metadataHash = getHash(JSON.stringify(ddo))
|
||||
await nft.setMetadata(
|
||||
|
@ -185,18 +185,22 @@ describe('NFT tests', async () => {
|
||||
})
|
||||
|
||||
it('Update metadata', async () => {
|
||||
const chain = await web3.eth.getChainId()
|
||||
// create the files encrypted string
|
||||
let providerResponse = await ProviderInstance.encrypt(assetUrl, providerUrl)
|
||||
let providerResponse = await ProviderInstance.encrypt(
|
||||
assetUrl,
|
||||
chain,
|
||||
providerUrl
|
||||
)
|
||||
ddo.services[0].files = await providerResponse
|
||||
ddo.services[0].datatokenAddress = datatokenAddress
|
||||
// update ddo and set the right did
|
||||
ddo.nftAddress = erc721Address
|
||||
const chain = await web3.eth.getChainId()
|
||||
ddo.id =
|
||||
'did:op:' +
|
||||
SHA256(web3.utils.toChecksumAddress(erc721Address) + chain.toString(10))
|
||||
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, providerUrl)
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, chain, providerUrl)
|
||||
const encryptedResponse = await providerResponse
|
||||
const metadataHash = getHash(JSON.stringify(ddo))
|
||||
await nft.setMetadata(
|
||||
|
@ -122,18 +122,22 @@ describe('Simple Publish & consume test', async () => {
|
||||
const erc721Address = result.events.NFTCreated.returnValues[0]
|
||||
datatokenAddress = result.events.TokenCreated.returnValues[0]
|
||||
|
||||
const chain = await web3.eth.getChainId()
|
||||
// create the files encrypted string
|
||||
let providerResponse = await ProviderInstance.encrypt(assetUrl, providerUrl)
|
||||
let providerResponse = await ProviderInstance.encrypt(
|
||||
assetUrl,
|
||||
chain,
|
||||
providerUrl
|
||||
)
|
||||
ddo.services[0].files = await providerResponse
|
||||
ddo.services[0].datatokenAddress = datatokenAddress
|
||||
// update ddo and set the right did
|
||||
ddo.nftAddress = erc721Address
|
||||
const chain = await web3.eth.getChainId()
|
||||
ddo.id =
|
||||
'did:op:' +
|
||||
SHA256(web3.utils.toChecksumAddress(erc721Address) + chain.toString(10))
|
||||
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, providerUrl)
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, chain, providerUrl)
|
||||
const encryptedResponse = await providerResponse
|
||||
const metadataHash = getHash(JSON.stringify(ddo))
|
||||
await nft.setMetadata(
|
||||
@ -203,19 +207,22 @@ describe('Simple Publish & consume test', async () => {
|
||||
initialResult.data.nft.owner.id.toLowerCase() ===
|
||||
publisherAccount.toLowerCase()
|
||||
)
|
||||
|
||||
const chain = await web3.eth.getChainId()
|
||||
// create the files encrypted string
|
||||
let providerResponse = await ProviderInstance.encrypt(assetUrl, providerUrl)
|
||||
let providerResponse = await ProviderInstance.encrypt(
|
||||
assetUrl,
|
||||
chain,
|
||||
providerUrl
|
||||
)
|
||||
ddo.services[0].files = await providerResponse
|
||||
ddo.services[0].datatokenAddress = datatokenAddress
|
||||
// update ddo and set the right did
|
||||
ddo.nftAddress = erc721Address
|
||||
const chain = await web3.eth.getChainId()
|
||||
ddo.id =
|
||||
'did:op:' +
|
||||
SHA256(web3.utils.toChecksumAddress(erc721Address) + chain.toString(10))
|
||||
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, providerUrl)
|
||||
providerResponse = await ProviderInstance.encrypt(ddo, chain, providerUrl)
|
||||
const encryptedResponse = await providerResponse
|
||||
const metadataHash = getHash(JSON.stringify(ddo))
|
||||
await nft.setMetadata(
|
||||
|
Loading…
Reference in New Issue
Block a user