diff --git a/package.json b/package.json index eb73c34e7..167f06a8c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "type-check": "tsc --noEmit", "postinstall": "husky install && npm run copy:address", "copy:address": "node scripts/copy-addresses.js", - "codegen:apollo": "apollo client:codegen --endpoint=https://v4.subgraph.goerli.oceanprotocol.com/subgraphs/name/oceanprotocol/ocean-subgraph --target typescript --tsFileExtension=d.ts --outputFlat src/@types/subgraph/", + "codegen:apollo": "apollo client:codegen --endpoint=https://subgraph.v4.genx.minimal-gaia-x.eu/subgraphs/name/oceanprotocol/ocean-subgraph --target typescript --tsFileExtension=d.ts --outputFlat src/@types/subgraph/", "storybook": "cross-env NODE_ENV=test start-storybook -p 6006 --quiet", "storybook:build": "cross-env NODE_ENV=test build-storybook" }, diff --git a/src/@utils/dispenser.ts b/src/@utils/dispenser.ts index e4eec5056..577f6558c 100644 --- a/src/@utils/dispenser.ts +++ b/src/@utils/dispenser.ts @@ -9,17 +9,20 @@ export async function setMinterToPublisher( ): Promise { const datatokenInstance = new Datatoken(signer) - const response = await datatokenInstance.removeMinter( + const removeMinterTx = await datatokenInstance.removeMinter( datatokenAddress, accountId, accountId ) - if (!response) { + if (!removeMinterTx) { setError('Updating DDO failed.') LoggerInstance.error('Failed at cancelMinter') } - return response + + await removeMinterTx.wait() + + return removeMinterTx } export async function setMinterToDispenser( @@ -30,14 +33,16 @@ export async function setMinterToDispenser( ): Promise { const datatokenInstance = new Datatoken(signer) - const response = await datatokenInstance.addMinter( + const addMinterTx = await datatokenInstance.addMinter( datatokenAddress, accountId, accountId ) - if (!response) { + if (!addMinterTx) { setError('Updating DDO failed.') LoggerInstance.error('Failed at makeMinter') } - return response + await addMinterTx.wait() + + return addMinterTx } diff --git a/src/components/Asset/Edit/EditComputeDataset.tsx b/src/components/Asset/Edit/EditComputeDataset.tsx index 6ae662901..63debfd5a 100644 --- a/src/components/Asset/Edit/EditComputeDataset.tsx +++ b/src/components/Asset/Edit/EditComputeDataset.tsx @@ -109,6 +109,7 @@ export default function EditComputeDataset({ LoggerInstance.error(content.form.error) return } else { + await setMetadataTx.wait() if (asset.accessDetails.type === 'free') { const tx = await setMinterToDispenser( signer, diff --git a/src/components/Asset/Edit/EditMetadata.tsx b/src/components/Asset/Edit/EditMetadata.tsx index d5588cde2..22e860fbc 100644 --- a/src/components/Asset/Edit/EditMetadata.tsx +++ b/src/components/Asset/Edit/EditMetadata.tsx @@ -230,6 +230,7 @@ export default function Edit({ LoggerInstance.error(content.form.error) return } else { + await setMetadataTx.wait() if (asset.accessDetails.type === 'free') { const tx = await setMinterToDispenser( signer,