1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

fix error in NftFactory.disableTokenTemplate() and NftFactory.reactivateTokenTemplate()

This commit is contained in:
Miquel A. Cabot 2022-03-24 09:55:27 +01:00
parent 46f7a7e280
commit 0e876edadf

View File

@ -492,14 +492,14 @@ export class NftFactory {
if ((await this.getOwner()) !== address) {
throw new Error(`Caller is not Factory Owner`)
}
if (templateIndex > (await this.getCurrentNFTTemplateCount())) {
if (templateIndex > (await this.getCurrentTokenTemplateCount())) {
throw new Error(`Template index doesnt exist`)
}
if (templateIndex === 0) {
throw new Error(`Template index cannot be ZERO`)
}
if ((await this.getNFTTemplate(templateIndex)).isActive === false) {
if ((await this.getTokenTemplate(templateIndex)).isActive === false) {
throw new Error(`Template is already disabled`)
}
const estGas = await this.estGasDisableTokenTemplate(address, templateIndex)
@ -551,7 +551,7 @@ export class NftFactory {
if ((await this.getOwner()) !== address) {
throw new Error(`Caller is not Factory Owner`)
}
if (templateIndex > (await this.getCurrentNFTTemplateCount())) {
if (templateIndex > (await this.getCurrentTokenTemplateCount())) {
throw new Error(`Template index doesnt exist`)
}