1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-11-16 02:04:54 +01:00

[Free Pricing] Check minterApproved before cancelMinter() (#836)

* Check `minterApproved` before cancelMinter

* Feedback change

* Update freePrice.ts

Co-authored-by: KRIS LIEW <iforte.intellege.liew@daimler.com>
Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
This commit is contained in:
Kris Liew 2021-10-14 17:20:36 +08:00 committed by GitHub
parent 0698c26440
commit d1206c291b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,9 @@ export async function setMinterToPublisher(
setError: (msg: string) => void
): Promise<TransactionReceipt> {
// free pricing v3 workaround part1
const status = await ocean.OceanDispenser.status(dataTokenAddress)
if (!status?.minterApproved) return
const response = await ocean.OceanDispenser.cancelMinter(
dataTokenAddress,
accountId