Skip to content

Commit

Permalink
fix: add wait to txs
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrom8 committed Mar 21, 2024
1 parent 069b9ac commit 6b1abe7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/@utils/dispenser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ export async function setMinterToPublisher(
): Promise<ethers.providers.TransactionResponse> {
const datatokenInstance = new Datatoken(signer)

const response = await datatokenInstance.removeMinter(
const removeMinterTx = await datatokenInstance.removeMinter(
datatokenAddress,
accountId,
accountId
)
await removeMinterTx.wait()

if (!response) {
if (!removeMinterTx) {
setError('Updating DDO failed.')
LoggerInstance.error('Failed at cancelMinter')
}
return response
return removeMinterTx
}

export async function setMinterToDispenser(
Expand All @@ -30,14 +31,14 @@ export async function setMinterToDispenser(
): Promise<ethers.providers.TransactionResponse> {
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
return addMinterTx
}
1 change: 1 addition & 0 deletions src/@utils/nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export async function setNFTMetadataAndTokenURI(
accountId,
metadataAndTokenURI
)
await setMetadataAndTokenURITx.wait()

return setMetadataAndTokenURITx
}

0 comments on commit 6b1abe7

Please sign in to comment.